oficina / equipo Public

hostedwire: bootstrap v2, services, admission and proxy feed types

Slice 2 Task 1: BootstrapV2 (ASCII, at most 4096 bytes), LaunchRequest's
person, purpose and launch_by_unix_ms with Validate, admission, proxy
feed, redeem and certificate report types. wire: ProtocolHostedRunners
(39, now current; ProtocolHostedChecks stays 5), hosted placements,
hosted_pack and deps transfer kinds with per-kind MaxBytes/MaxChunks
(deps 256 MiB), Encode refusing hosted transfers below 39, and the
hosted enrolment and renewal types. Raises the internal/wire budget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 9d35ff5aab48a07bcf34c8e60efffe79c0bfb44d parent c5c15e9
28 files changed, +820 −29
  • .rastrillo/budgets.txt +1 −1
  • docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md +18 −0
  • internal/hostedwire/api.go +27 −2
  • internal/hostedwire/api_test.go +38 −2
  • internal/hostedwire/hosted.go +247 −0
  • internal/hostedwire/hosted_test.go +213 −0
  • internal/wire/assistant_files_test.go +1 −1
  • internal/wire/assistant_test.go +1 −1
  • internal/wire/change_diffs_test.go +1 −1
  • internal/wire/change_files_test.go +1 −1
  • internal/wire/design_test.go +1 −1
  • internal/wire/hosted.go +111 −0
  • internal/wire/hosted_test.go +130 −0
  • internal/wire/injection_test.go +2 −2
  • internal/wire/lookup_test.go +1 −1
  • internal/wire/mac_engineering_test.go +2 −2
  • internal/wire/mixed_protocol_test.go +1 −1
  • internal/wire/models_test.go +1 −1
  • internal/wire/opencode_test.go +1 −1
  • internal/wire/pinned_release_test.go +1 −1
  • internal/wire/places_test.go +1 −1
  • internal/wire/publish_test.go +1 −1
  • internal/wire/runners.go +14 −3
  • internal/wire/runners_test.go +1 −1
  • internal/wire/schedule_test.go +1 −1
  • internal/wire/stuck_test.go +1 −1
  • internal/wire/usage_test.go +1 −1
  • internal/wire/warm_test.go +1 −1

CI failed — run details

CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/hosted-runners-2: Type  Size Avail | ext4   96G   85G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   85G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.9s
ci-box: codex: fetched and verified in 3.4s
ci-box: codex-code-mode-host: fetched and verified in 1.3s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.9s
ci-box: pi: installed and verified in 7.4s
ci-box: opencode: installed and verified in 2.3s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.6s
ci-box: clone deepened in 7.2s
ci-box: file times set from content: 3758 files, 244 directories
ci-box: ready in 20.7s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipotest	0.237s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  5.7s
+ go list -export -test -tags testbuild -f  ./...
  6.9s
+ go list -export -test -tags browser,testbuild -f  ./internal/equipo ./internal/equipotest ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
  4.2s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-24 15:56:00 +0000 UTC

go run github.com/zricethezav/gitleaks/v8@v8.30.1 version
version is set by build process
=== check ===
--- shard 0 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-work: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$' ./internal/headless

receipt: test step 1m24.823s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m22.076s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m22.08s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 78.91, cpu waiting 47.22%, memory waiting 0.00%, io waiting 0.41%
--- shard 1 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-review: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$' ./internal/headless

receipt: test step 1m21.779s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m19.153s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m19.15s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 79.08, cpu waiting 46.27%, memory waiting 0.00%, io waiting 0.43%
--- shard 2 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-connections: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$' ./internal/headless

receipt: test step 1m25.249s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m22.775s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m11.91s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.91s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.95s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 78.91, cpu waiting 47.22%, memory waiting 0.00%, io waiting 0.41%
--- shard 3 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-mac: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$' ./internal/headless

receipt: test step 2m48.796s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m46.079s amadan.net/oficina/equipo/internal/headless
receipt: slow test 2m11.59s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 15.79s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.52s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.18s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 40.01, cpu waiting 19.41%, memory waiting 0.00%, io waiting 0.09%
--- shard 4 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-guards: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless

receipt: test step 1m43.718s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m40.671s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m9.99s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.62s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.4s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7.62s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 5.04s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 73.19, cpu waiting 46.65%, memory waiting 0.00%, io waiting 0.30%
--- shard 5 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-rest: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$|^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$|^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$|^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$|^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless

receipt: test step 3m34.548s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m31.804s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m46.81s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 23.66s amadan.net/oficina/equipo/internal/headless TestMacMixedVersions
receipt: slow test 20.99s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.5s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 7.26s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistantAttachments
machine: 32 CPUs, load 21.71, cpu waiting 9.04%, memory waiting 0.00%, io waiting 0.04%
--- shard 6 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest

receipt: test step 3m31.414s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m28.405s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 15.65s amadan.net/oficina/equipo/internal/thintest TestTasklessHoldResumes
receipt: slow test 10.99s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.68s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 5.46s amadan.net/oficina/equipo/internal/thintest TestAbilityHoldResumes
receipt: slow test 5.46s amadan.net/oficina/equipo/internal/thintest TestNudgeResumesHeldJob
machine: 32 CPUs, load 23.26, cpu waiting 9.66%, memory waiting 0.00%, io waiting 0.04%
--- shard 7 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest-contract: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest

receipt: test step 2m27.053s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m24.064s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.56s amadan.net/oficina/equipo/internal/thintest TestContractRetryPreviewUnverifiedMerge
receipt: slow test 9.1s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 4.96s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 4.93s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 3.07s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
machine: 32 CPUs, load 52.10, cpu waiting 27.01%, memory waiting 0.00%, io waiting 0.14%
--- shard 8 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-thin: ./internal/runner/thin
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/runner/thin
budget note: internal/runner/thin took 7m36.94s, over the 45s its record on line 45 allows; reported only, timing fails on CI

receipt: test step 7m44.171s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 7m36.94s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 37.11s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.99s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.89s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 33.26s amadan.net/oficina/equipo/internal/runner/thin TestWorkerHelloConnections
receipt: slow test 18.53s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
machine: 32 CPUs, load 1.04, cpu waiting 0.13%, memory waiting 0.00%, io waiting 0.00%
--- shard 9 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-bug: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$' ./internal/runner

receipt: test step 52.019s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 50.914s amadan.net/oficina/equipo/internal/runner
receipt: slow test 30.87s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 59.14, cpu waiting 33.99%, memory waiting 0.00%, io waiting 0.72%
--- shard 10 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-plans: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner

receipt: test step 1m2.065s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m0.677s amadan.net/oficina/equipo/internal/runner
receipt: slow test 50.79s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 44.2s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.41s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.46s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 72.07, cpu waiting 41.06%, memory waiting 0.00%, io waiting 0.61%
--- shard 11 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-rest: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$|^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner

receipt: test step 41.77s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 40.854s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.13s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 5.01s amadan.net/oficina/equipo/internal/runner TestEnrolCommitsTheCredentialLast
receipt: slow test 3.36s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.13s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 3.13s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
machine: 32 CPUs, load 43.97, cpu waiting 26.40%, memory waiting 0.00%, io waiting 0.86%
--- shard 12 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-a started 30s late; cpu waiting 41.6%, load 29.69
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/equipotest TestDirectDeadReferencesRepository
=== RUN   TestDirectDeadReferencesRepository
    direct_cutover_test.go:221: repository reference inventory: exit status 1
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:9:210: unclassified equipo-runner
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:234:744: unclassified equipo-runner
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:234:783: unclassified equipo-runner
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:285:60: unclassified equipo-runner
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:294:119: unclassified equipo-runner
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:316:225: unclassified equipo-runner
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:380:97: unclassified equipo-runner
        reference scan: 3470 text files, 3991 matches, 7 failures
--- FAIL: TestDirectDeadReferencesRepository (2.84s)

--- FAIL amadan.net/oficina/equipo/internal/equipotest (package output)
FAIL
rastrillo-budget/v1 ran 1m14.793s
FAIL	amadan.net/oficina/equipo/internal/equipotest	75.223s


receipt: test step 1m17.169s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 1m14.793s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 34.34s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 34.24s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 31.4s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 27.68s amadan.net/oficina/equipo/internal/equipotest TestAuthorityGrantReferences
receipt: slow test 27.63s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
exit status 1
+ go test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' -v -run '^TestDirectDeadReferencesRepository$' -count=1 ./internal/equipotest   (retry, once)
FAILED TWICE ./internal/equipotest:TestDirectDeadReferencesRepository equipotest-a
=== RUN   TestDirectDeadReferencesRepository
    direct_cutover_test.go:221: repository reference inventory: exit status 1
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:9:210: unclassified equipo-runner
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:234:744: unclassified equipo-runner
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:234:783: unclassified equipo-runner
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:285:60: unclassified equipo-runner
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:294:119: unclassified equipo-runner
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:316:225: unclassified equipo-runner
        docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:380:97: unclassified equipo-runner
        reference scan: 3470 text files, 3991 matches, 7 failures
--- FAIL: TestDirectDeadReferencesRepository (2.68s)
FAIL
rastrillo-budget/v1 ran 2.684s
FAIL	amadan.net/oficina/equipo/internal/equipotest	2.872s
FAIL
machine: 32 CPUs, load 73.18, cpu waiting 45.72%, memory waiting 0.00%, io waiting 0.26%
make: *** [Makefile:113: ci-shard] Error 1

amadan: step check shard 12 of 29 failed: exit status 2
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-e started 30s late; cpu waiting 38.5%, load 29.69
test lane equipotest-e: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[E-P]' ./internal/equipotest

receipt: test step 2m25.446s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m23.075s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 24.52s amadan.net/oficina/equipo/internal/equipotest TestProjectBindingUniqueness
receipt: slow test 24.51s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 24.51s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
receipt: slow test 24.5s amadan.net/oficina/equipo/internal/equipotest TestProjectKindsAndDefaultBranch
receipt: slow test 24.48s amadan.net/oficina/equipo/internal/equipotest TestProjectRetryAndRevision
machine: 32 CPUs, load 37.53, cpu waiting 17.60%, memory waiting 0.00%, io waiting 0.08%
--- shard 14 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-r started 30s late; cpu waiting 38.5%, load 29.69
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest
budget note: internal/equipotest took 5m41.23s, over the 5m0s its record on line 15 allows; reported only, timing fails on CI

receipt: test step 5m47.624s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 5m41.23s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 4m45.31s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 14.22s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 11.17s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 11.12s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 8.06s amadan.net/oficina/equipo/internal/equipotest TestRosterProtectsLastOwner
machine: 32 CPUs, load 2.97, cpu waiting 0.60%, memory waiting 0.00%, io waiting 0.00%
--- shard 15 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-rest started 30s late; cpu waiting 38.5%, load 29.69
test lane equipotest-rest: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test[A-D]|^TestQ|^Test[E-P]|^TestR' ./internal/equipotest

receipt: test step 1m14.487s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m12.235s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 30.52s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 30.43s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 30.38s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 27.81s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsRollbackAndUnavailable
receipt: slow test 27.64s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
machine: 32 CPUs, load 73.19, cpu waiting 47.08%, memory waiting 0.00%, io waiting 0.29%
--- shard 16 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: plan3test started 30s late; cpu waiting 41.6%, load 29.69
test lane plan3test: ./internal/plan3test
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/plan3test

receipt: test step 1m0.315s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 57.889s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 4.39s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.55s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.86s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.66s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.53s amadan.net/oficina/equipo/internal/plan3test TestOnboardingAccountMigration
machine: 32 CPUs, load 75.95, cpu waiting 47.38%, memory waiting 0.00%, io waiting 0.37%
--- shard 17 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: rest started 30s late; cpu waiting 38.5%, load 29.69
test lane rest: ./cmd/equipo ./cmd/equipo-hosted-controller ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/hostedclient ./internal/hostedctl ./internal/hostedwire ./internal/idtest ./internal/isolatedjob ./internal/isolatedjob/awsjob ./internal/isolatedjob/guardfixture ./internal/isolatedjob/isolatedjobtest ./internal/ownermodetest ./internal/release ./internal/release/renderertest ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/designstep ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mac/creds ./internal/runner/mac/denylist ./internal/runner/mac/fprobe ./internal/runner/mac/proc ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/pause ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/render ./internal/runner/renderpage ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/teamprobe ./internal/testci ./internal/toolproxy ./internal/websearch ./internal/websearch/websearchtest ./internal/websource ./internal/websource/guard ./internal/websource/hostaddrs ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-hosted-controller ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/hostedclient ./internal/hostedctl ./internal/hostedwire ./internal/idtest ./internal/isolatedjob ./internal/isolatedjob/awsjob ./internal/isolatedjob/guardfixture ./internal/isolatedjob/isolatedjobtest ./internal/ownermodetest ./internal/release ./internal/release/renderertest ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/designstep ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mac/creds ./internal/runner/mac/denylist ./internal/runner/mac/fprobe ./internal/runner/mac/proc ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/pause ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/render ./internal/runner/renderpage ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/teamprobe ./internal/testci ./internal/toolproxy ./internal/websearch ./internal/websearch/websearchtest ./internal/websource ./internal/websource/guard ./internal/websource/hostaddrs ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/isolatedjob: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude/realcli: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
--- FAIL amadan.net/oficina/equipo/internal/runner/metered TestMeteredRaceAdmitsExactlyOne
=== RUN   TestMeteredRaceAdmitsExactlyOne
    meter_test.go:205: round 7: ran map[], held map[ask:busy review:busy]
--- FAIL: TestMeteredRaceAdmitsExactlyOne (0.08s)

--- FAIL amadan.net/oficina/equipo/internal/runner/metered (package output)
FAIL
rastrillo-budget/v1 ran 1.589s
FAIL	amadan.net/oficina/equipo/internal/runner/metered	1.600s

--- FAIL amadan.net/oficina/equipo/internal/runner/webread TestTimeouts
=== RUN   TestTimeouts
    fetch_test.go:537: s1: {Source:s1 Origin:paul Parent: URL:https://shop.example.com/slow-body Hops:[{URL:https://shop.example.com/slow-body Address:151.101.1.1 Status:200}] Address:151.101.1.1 Status:200 Type:text/plain Bytes:5 SHA256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 Millis:304 Reason: File:s001.txt}
--- FAIL: TestTimeouts (0.62s)

--- FAIL amadan.net/oficina/equipo/internal/runner/webread (package output)
FAIL
rastrillo-budget/v1 ran 1.408s
FAIL	amadan.net/oficina/equipo/internal/runner/webread	1.420s

--- FAIL amadan.net/oficina/equipo/internal/testci TestBudgetRecordsAreShort
=== RUN   TestBudgetRecordsAreShort
    budgets_file_test.go:37: .rastrillo/budgets.txt:18: reason is 268 bytes, over 200
--- FAIL: TestBudgetRecordsAreShort (0.00s)

--- FAIL amadan.net/oficina/equipo/internal/testci (package output)
FAIL
rastrillo-budget/v1 ran 2.292s
FAIL	amadan.net/oficina/equipo/internal/testci	2.303s

budget note: cmd/equipo-runner took 1m26.611s, over the 1m0s its record on line 74 allows; reported only, timing fails on CI
budget note: internal/equipo took 3m3.264s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 48.525s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/github took 40.217s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/equipo/setup took 13.384s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/hostedctl took 29.36s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 2m16.678s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 1m8.184s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/containment took 1m14.538s, over the 15s its record on line 41 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 30.719s, over the 20s its record on line 36 allows; reported only, timing fails on CI
budget note: internal/runner/mac took 46.766s, over the 45s its record on line 44 allows; reported only, timing fails on CI
budget note: internal/runner/mac/fprobe took 13.461s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 16.609s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/provider/pi took 1m25.824s, over the 1m0s its record on line 28 allows; reported only, timing fails on CI
budget note: internal/runner/render took 1m9.183s, over the 10s the default allows; reported only, timing fails on CI

receipt: test step 3m8.664s against a 60s target (the gate's other steps are not in this figure)
receipt: 48 packages ran, 34 cached, 22 without tests, 3 failed
receipt: slow package 3m3.264s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 2m16.678s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m26.611s amadan.net/oficina/equipo/cmd/equipo-runner
receipt: slow package 1m25.824s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 1m16.004s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow test 1m18.87s amadan.net/oficina/equipo/cmd/equipo-runner TestReleaseRunnerHasNoFakeWorker
receipt: slow test 1m6.24s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 58.24s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
receipt: slow test 58.13s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 57.26s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestMeteredRaceAdmitsExactlyOne$' -count=1 ./internal/runner/metered   (retry, once)
##############################################################################
FLAKE ./internal/runner/metered:TestMeteredRaceAdmitsExactlyOne rest 9d35ff5aab48a07bcf34c8e60efffe79c0bfb44d 0.08s 20.14
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
+ go test -tags testbuild -timeout 15m -v -run '^TestTimeouts$' -count=1 ./internal/runner/webread   (retry, once)
##############################################################################
FLAKE ./internal/runner/webread:TestTimeouts rest 9d35ff5aab48a07bcf34c8e60efffe79c0bfb44d 0.62s 20.14
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
+ go test -tags testbuild -timeout 15m -v -run '^TestBudgetRecordsAreShort$' -count=1 ./internal/testci   (retry, once)
FAILED TWICE ./internal/testci:TestBudgetRecordsAreShort rest
=== RUN   TestBudgetRecordsAreShort
    budgets_file_test.go:37: .rastrillo/budgets.txt:18: reason is 268 bytes, over 200
--- FAIL: TestBudgetRecordsAreShort (0.00s)
FAIL
rastrillo-budget/v1 ran 0s
FAIL	amadan.net/oficina/equipo/internal/testci	0.004s
FAIL
machine: 32 CPUs, load 20.14, cpu waiting 8.18%, memory waiting 0.00%, io waiting 0.03%
make: *** [Makefile:113: ci-shard] Error 1

amadan: step check shard 17 of 29 failed: exit status 2
--- shard 18 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-chat: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' ./internal/headless

receipt: test step 1m26.47s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m24.42s amadan.net/oficina/equipo/internal/headless
receipt: slow test 39s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.79s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.54s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.56s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.7s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 78.91, cpu waiting 47.58%, memory waiting 0.00%, io waiting 0.39%
--- shard 19 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-work: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
=== RUN   TestBrowserRailFollowsWork
time=2026-11-30T19:23:00.659Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-30T19:23:00.659Z level=INFO msg="startup phase done" phase=state_lock took=67µs
time=2026-11-30T19:23:00.659Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-30T19:23:00.659Z level=INFO msg="startup phase done" phase=claim_roots took=82µs
time=2026-11-30T19:23:00.659Z level=INFO msg="startup phase" phase=sweep
time=2026-11-30T19:23:00.699Z level=INFO msg="startup phase done" phase=sweep took=40.24ms
time=2026-11-30T19:23:00.699Z level=INFO msg="startup phase" phase=credentials
time=2026-11-30T19:23:00.699Z level=INFO msg="startup phase done" phase=credentials took=110µs
time=2026-11-30T19:23:00.699Z level=INFO msg="startup phase" phase=open_state
time=2026-11-30T19:23:00.750Z level=INFO msg="startup phase done" phase=open_state took=50.628ms
time=2026-11-30T19:23:00.750Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-30T19:23:00.751Z level=INFO msg=connecting host=127.0.0.1:43215 protocol=39
time=2026-11-30T19:23:00.752Z level=INFO msg=connected host=127.0.0.1:43215 took=1.024ms
time=2026-11-30T19:23:00.753Z level=INFO msg="capabilities gathering"
time=2026-11-30T19:23:00.753Z level=INFO msg="capabilities gathered" took=441µs tags=linux,claude,go
time=2026-11-30T19:23:00.754Z level=INFO msg="hello sent" protocol=39
time=2026-11-30T19:23:00.761Z level=INFO msg=welcome protocol=39 role=primary generation=1
time=2026-11-30T19:23:01.719Z level=INFO msg="connection checked" connection=claude-1 state=healthy
time=2026-11-30T19:23:09.195Z level=INFO msg="kept sessions" kept=1 bytes=2885 expired=0
time=2026-11-30T19:23:13.229Z level=INFO msg="kept sessions" kept=2 bytes=5037 expired=0
time=2026-11-30T19:23:14.124Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-30T19:23:14.124Z level=INFO msg="startup phase done" phase=state_lock took=234µs
time=2026-11-30T19:23:14.124Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-30T19:23:14.124Z level=INFO msg="startup phase done" phase=claim_roots took=143µs
time=2026-11-30T19:23:14.124Z level=INFO msg="startup phase" phase=sweep
time=2026-11-30T19:23:14.222Z level=INFO msg="startup phase done" phase=sweep took=97.916ms
time=2026-11-30T19:23:14.224Z level=INFO msg="startup phase" phase=credentials
time=2026-11-30T19:23:14.225Z level=INFO msg="startup phase done" phase=credentials took=320µs
time=2026-11-30T19:23:14.225Z level=INFO msg="startup phase" phase=open_state
time=2026-11-30T19:23:14.321Z level=INFO msg="startup phase done" phase=open_state took=96.506ms
time=2026-11-30T19:23:14.324Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-30T19:23:14.326Z level=INFO msg=connecting host=127.0.0.1:38391 protocol=39
time=2026-11-30T19:23:14.329Z level=INFO msg=connected host=127.0.0.1:38391 took=1.309ms
time=2026-11-30T19:23:14.329Z level=INFO msg="capabilities gathering"
time=2026-11-30T19:23:14.329Z level=INFO msg="capabilities gathered" took=581µs tags=linux,claude,go
time=2026-11-30T19:23:14.337Z level=INFO msg="hello sent" protocol=39
time=2026-11-30T19:23:14.356Z level=INFO msg=welcome protocol=39 role=primary generation=1
time=2026-11-30T19:23:16.200Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_review_test.go:57: waiting for document.querySelector('#rail [data-specialist="engineering"]')?.dataset.state==='working' && document.querySelector('#rail [data-specialist="engineering"]').querySelector('[equipo-nav-task]')?.textContent==='Slow sidebar change' && document.querySelector('#nav-tasks [data-count]')?.textContent==='1': context deadline exceeded (last evaluation: context deadline exceeded)
time=2026-11-30T19:23:20.377Z level=WARN msg="step account" err=cancelled
--- FAIL: TestBrowserRailFollowsWork (20.39s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m32.817s
FAIL	amadan.net/oficina/equipo/internal/headless	93.042s


receipt: test step 1m34.829s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 1m32.817s amadan.net/oficina/equipo/internal/headless
receipt: slow test 27.14s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 20.39s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 13.74s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 11.75s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
receipt: slow test 10.84s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' -v -run '^TestBrowserRailFollowsWork$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserRailFollowsWork browser-headless-work 9d35ff5aab48a07bcf34c8e60efffe79c0bfb44d 20.39s 73.95
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 66.40, cpu waiting 41.54%, memory waiting 0.00%, io waiting 0.23%
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless

receipt: test step 1m57.958s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m55.711s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.38s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.57s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 13.48s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.52s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
receipt: slow test 11.32s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
machine: 32 CPUs, load 66.40, cpu waiting 41.54%, memory waiting 0.00%, io waiting 0.23%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN   TestBrowserCopyContinue
rastrillo: budget test: go test failed
time=2026-11-30T19:23:26.250Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-30T19:23:26.250Z level=INFO msg="startup phase done" phase=state_lock took=82µs
time=2026-11-30T19:23:26.250Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-30T19:23:26.250Z level=INFO msg="startup phase done" phase=claim_roots took=85µs
time=2026-11-30T19:23:26.250Z level=INFO msg="startup phase" phase=sweep
time=2026-11-30T19:23:26.297Z level=INFO msg="startup phase done" phase=sweep took=46.922ms
time=2026-11-30T19:23:26.297Z level=INFO msg="startup phase" phase=credentials
time=2026-11-30T19:23:26.297Z level=INFO msg="startup phase done" phase=credentials took=129µs
time=2026-11-30T19:23:26.297Z level=INFO msg="startup phase" phase=open_state
time=2026-11-30T19:23:26.358Z level=INFO msg="startup phase done" phase=open_state took=61.186ms
time=2026-11-30T19:23:26.359Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-30T19:23:26.360Z level=INFO msg=connecting host=127.0.0.1:33677 protocol=39
time=2026-11-30T19:23:26.363Z level=INFO msg=connected host=127.0.0.1:33677 took=2.97ms
time=2026-11-30T19:23:26.363Z level=INFO msg="capabilities gathering"
time=2026-11-30T19:23:26.366Z level=INFO msg="capabilities gathered" took=2.838ms tags=linux,claude,go
time=2026-11-30T19:23:26.369Z level=INFO msg="hello sent" protocol=39
time=2026-11-30T19:23:26.376Z level=INFO msg=welcome protocol=39 role=primary generation=1
    browser_copy_test.go:90: waiting for !document.querySelector('[data-copy-continue]'): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserCopyContinue (6.36s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m45.941s
FAIL	amadan.net/oficina/equipo/internal/headless	106.145s


receipt: test step 1m47.789s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 0 cached, 0 without tests, 1 failed
receipt: slow package 1m45.941s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.48s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 13.28s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.71s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 10.34s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.85s amadan.net/oficina/equipo/internal/headless TestBrowserCardAnswerSettlesAtBottom
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' -v -run '^TestBrowserCopyContinue$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest 9d35ff5aab48a07bcf34c8e60efffe79c0bfb44d 6.36s 73.18
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 70.44, cpu waiting 44.58%, memory waiting 0.00%, io waiting 0.25%
--- shard 22 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-rest: ./internal/equipo
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserPreviewBlocksNavigation|TestBrowserPreviewPassExchange)$' ./internal/equipo

receipt: test step 4.668s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.633s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 2.03s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 610ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/equipotest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserGitHubManifestCSP)$' ./internal/equipotest

receipt: test step 8.18s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 6.53s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 6.53s amadan.net/oficina/equipo/internal/equipotest TestBrowserGitHubManifestCSP
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor|TestBrowserSmartDoor)$' ./internal/idtest
budget note: internal/idtest took 11.785s, over the 10s the default allows; reported only, timing fails on CI

receipt: test step 13.54s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 11.785s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 9.52s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.26s amadan.net/oficina/equipo/internal/idtest TestBrowserOficinaIDDoor
browser lane browser-rest: ./internal/plan3test
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestTeamsHierarchyBrowser)$' ./internal/plan3test

receipt: test step 4.618s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.732s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.73s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAskMacOffline|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPausedWork|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRhythm|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingSteady|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackPulse|TestBrowserTrackStarCentre|TestBrowserTryAgain)$' ./internal/thintest

receipt: test step 3m43.937s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3m41.226s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 26.22s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.39s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.08s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.78s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.29s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 11.84, cpu waiting 4.49%, memory waiting 0.00%, io waiting 0.01%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless   (56s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.84s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.30s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.97s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.22s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 27.85s
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^C5_review_auth$|^TestHeadlessConnections$/^C5_review_failover$|^TestHeadlessConnections$/^C5_review_on_codex$|^TestHeadlessConnections$/^C5_review_other_family_first$' ./internal/headless   (61s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 15.23s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 12.00s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 10.93s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 19.79s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (23s)
ok ./internal/headless TestMixedVersions 19.77s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.84s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (2s)
first attempt failed: TestRunnerCancelAndSupersede; output tail:
=== RUN   TestRunnerCancelAndSupersede
time=2026-11-30T19:22:37.365Z level=INFO msg=connecting host=127.0.0.1:44247 protocol=39
time=2026-11-30T19:22:37.366Z level=INFO msg=connected host=127.0.0.1:44247 took=796µs
time=2026-11-30T19:22:37.366Z level=INFO msg="hello sent" protocol=39
time=2026-11-30T19:22:37.367Z level=INFO msg=welcome protocol=1 role=primary generation=3
    contract_test.go:298: waiting for ack, got {"id":"rdirriyoqjp-1","type":"turn","data":{"turn_id":"t_wait","attempt":1,"state":"cancelled","reason":"cancelled"}}
--- FAIL: TestRunnerCancelAndSupersede (0.06s)
FAIL
rastrillo-budget/v1 ran 63ms
FAIL	amadan.net/oficina/equipo/internal/runner/thin	0.090s
FAIL
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' -count=1 ./internal/runner/thin   (retry, once)
##############################################################################
FLAKE ./internal/runner/thin:TestRunnerCancelAndSupersede quarantine 9d35ff5aab48a07bcf34c8e60efffe79c0bfb44d 0.06s 9.38
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
quarantine: 1 flaked (passed on the retry), 0 failed
quarantine flake: TestRunnerCancelAndSupersede
machine: 32 CPUs, load 72.07, cpu waiting 41.06%, memory waiting 0.00%, io waiting 0.61%
--- shard 24 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 24: make runner-host
python3 scripts/runner-prerequisites.py
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run 'TestDirect|TestProvider|TestCheckSandbox' -count=1 ./internal/runner/provider/... ./internal/runner/checks

receipt: test step 14.184s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 4 without tests, 0 failed
receipt: slow package 7.671s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 216ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 74ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 2ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow test 5.37s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.76s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 400ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 220ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxToolchain
CGO_ENABLED=0 EQUIPO_REQUIRE_USER_SESSION=1 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment

receipt: test step 4.504s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3.258s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 290ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 200ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReapsOrphans
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
machine: 32 CPUs, load 17.93, cpu waiting 12.22%, memory waiting 0.00%, io waiting 1.24%
--- shard 25 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: runner-dead-references started 30s late; cpu waiting 38.5%, load 29.69
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:9:210: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:234:744: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:234:783: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:285:60: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:294:119: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:316:225: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:380:97: unclassified equipo-runner
reference scan: 3470 text files, 3991 matches, 7 failures
make[1]: *** [Makefile:238: runner-dead-references] Error 1
machine: 32 CPUs, load 29.69, cpu waiting 19.52%, memory waiting 0.00%, io waiting 0.98%
make: *** [Makefile:113: ci-shard] Error 2

amadan: step check shard 25 of 29 failed: exit status 2
--- shard 26 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: staticcheck started 30s late; cpu waiting 38.5%, load 29.69
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 72.07, cpu waiting 41.06%, memory waiting 0.00%, io waiting 0.61%
--- shard 27 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: govulncheck started 30s late; cpu waiting 38.5%, load 29.69
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===

No vulnerabilities found.

Your code is affected by 0 vulnerabilities.
This scan also found 1 vulnerability in packages you import and 10
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
machine: 32 CPUs, load 81.88, cpu waiting 45.25%, memory waiting 0.00%, io waiting 0.52%
--- shard 28 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: gitleaks started 30s late; cpu waiting 38.5%, load 29.69
shard 28: make gitleaks
7:23PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
7:23PM INF 1336 commits scanned.
7:23PM INF scanned ~75208561 bytes (75.21 MB) in 26s
7:23PM INF no leaks found
machine: 32 CPUs, load 63.45, cpu waiting 36.59%, memory waiting 0.00%, io waiting 0.68%

amadan: job failed at step check shards 12, 17, 25 of 29 — its output is above, not at the tail of this log
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index df5f6f81..2436ecfa 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -15,7 +15,7 @@ time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial re
time internal/equipotest 300s Final fix package rerun measured 187.035s (review 172.4s); 300s gives 60 percent headroom for HTTP, sandbox, authority and final regression coverage.
size internal/equipo 24735 - Preview, retry, merges, kept work, check-db, notifications, places, GitHub routes, installer, abilities, lookups, Mac waits, slice F codes, D1, probe details, Design's copy, /api/team; measured 24735.
-size internal/wire 9726 - Protocols 31 to 35 (facts, diffs, evidence, CI units, files, places), abilities, 36 lookups, 37 Mac Engineering, 38 Design, unproven and probe detail codes; measured 9726.
+size internal/wire 9848 - Protocols 31 to 35 (facts, diffs, evidence, CI units, files, places), abilities, 36 lookups, 37 Mac Engineering, 38 Design, unproven and probe detail codes, 39 hosted runners (hosted.go: placement, hosted_pack and deps transfer limits, enrolment types); measured 9848.
size internal/equipotest - 12693 GitHub connect value search, lifecycle and sweep-log contracts; Task 21 migration fixtures, Rastrillo asset contract, renderer archive link; measured 0/12693 source/test lines.
time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded);
time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s).
diff --git a/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md b/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md
new file mode 100644
index 00000000..1992b7fa
--- /dev/null
+++ b/docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md
@@ -0,0 +1,18 @@
+# Hosted runners slice 2: progress
+
+## Task 1
+
+Wire contracts for hosted checks. Protocol ruling (coordinator, c5c15e9c): `wire.ProtocolHostedRunners = Protocol39`, now `ProtocolCurrent`; `ProtocolHostedChecks` stays `Protocol5` (release slice 1's hub checks).
+
+RED: `go test ./internal/hostedwire ./internal/wire -run 'TestBootstrapV2|TestLaunchRequestV2|TestDepsTransfer|TestHostedKinds' -count=1` failed to build: `undefined: BootstrapV2`, `unknown field Person in struct literal of type LaunchRequest`, `undefined: ErrLaunchRequest`, `undefined: wire.Protocol39`, `undefined: wire.ProtocolHostedRunners`, `undefined: wire.TransferKindDeps`, `undefined: wire.DepsTransferMax`.
+
+GREEN: the same command: `ok internal/hostedwire`, `ok internal/wire` (TestLaunchRequestV2Strict, TestBootstrapV2Limit, TestBootstrapV2Valid, TestDepsTransferLimit, TestHostedKindsNeedProtocol pass).
+
+Mutation checks (each restored, then the GREEN command passed again):
+
+1. Drop the bootstrap size check: `if len(raw) > MaxBootstrapBytes` became `if false && ...` in `internal/hostedwire/hosted.go`. `go test ./internal/hostedwire -run TestBootstrapV2Limit -count=1`: FAIL, `hosted_test.go:104: bootstrap of 4097 bytes = (4097 bytes, <nil>), want ErrBootstrapTooLarge`. Restored.
+2. Let `deps` use the 64 MiB limit: `MaxBytes` returned `MaxTransferBytes` for `deps` in `internal/wire/hosted.go`. `go test ./internal/wire -run TestDepsTransferLimit -count=1`: FAIL, `hosted_test.go:48: MaxBytes("deps") = 67108864, want 268435456` and `hosted_test.go:52: "deps" header: fits 268435456 false`. Restored.
+3. (extra) Skip `downgradeHostedRunners` in `Encode` (`internal/wire/runners.go`). `go test ./internal/wire -run TestHostedKindsNeedProtocol -count=1`: FAIL, `hosted_test.go:76: hosted_pack blob at 38 = ({...}, <nil>), want ErrProtocol` (also at 37, and for send_pack and deps). Restored.
+4. (extra) Drop the person rule for checks in `LaunchRequest.Validate` (`internal/hostedwire/api.go`). `go test ./internal/hostedwire -run TestLaunchRequestV2Strict -count=1`: FAIL, `api_test.go:163: empty person for checks: decode and Validate = <nil>, want hostedwire: launch request is not valid`. Restored.
+
+Also run: `go test ./internal/wire/... ./internal/hostedwire ./internal/hostedctl/... ./internal/hostedclient -count=1` ok (after moving the existing tests' current-protocol pins from 38 to 39); `go test ./internal/runner/thin ./internal/equipo/chat ./internal/thintest -run 'Protocol|Hello|Welcome|Spoken|Downgrade|Mixed|Older' -count=1` ok; `make budget` ok after raising the `internal/wire` record to 9848; `make build vet` ok.
diff --git a/internal/hostedwire/api.go b/internal/hostedwire/api.go
index f42bce65..04f5af08 100644
--- a/internal/hostedwire/api.go
+++ b/internal/hostedwire/api.go
@@ -15,8 +15,8 @@ import (
// Wire types for the controller's routes. Every body is one JSON object with
// lower-case snake_case keys, read with DecodeStrict. Durations are whole
// milliseconds in fields ending _ms; controller time is whole nanoseconds
-// since the controller's epoch in fields ending _ns. No field holds wall
-// time.
+// since the controller's epoch in fields ending _ns. The one wall time is
+// LaunchRequest's launch_by_unix_ms, Unix milliseconds.
//
// POST /v1/jobs LaunchRequest -> JobView
// GET /v1/jobs/{attempt} (empty body) -> JobView
@@ -44,6 +44,31 @@ type LaunchRequest struct {
Size isolatedjob.Size `json:"size"`
MaxLifetimeMS int64 `json:"max_lifetime_ms"`
InstanceCode string `json:"instance_code"`
+ // Slice 2: the person the checks run for ("" for certification),
+ // PurposeChecks or PurposeCertification, and the wall clock (Unix
+ // milliseconds) after which the controller must not launch: the
+ // instance's admitted_at plus HostedLaunchWindow. Services are not
+ // requested; the controller derives them from its manifest.
+ Person string `json:"person"`
+ Purpose string `json:"purpose"`
+ LaunchByUnixMS int64 `json:"launch_by_unix_ms"`
+}
+
+// ErrLaunchRequest is a launch request that decodes but breaks a rule.
+var ErrLaunchRequest = errors.New("hostedwire: launch request is not valid")
+
+// Validate checks the slice 2 fields: a known purpose, a person for
+// checks, and a launch-by time above zero.
+func (q LaunchRequest) Validate() error {
+ switch {
+ case !knownPurpose(q.Purpose):
+ return fmt.Errorf("%w: purpose must be %q or %q", ErrLaunchRequest, PurposeChecks, PurposeCertification)
+ case q.Purpose == PurposeChecks && q.Person == "":
+ return fmt.Errorf("%w: checks need a person", ErrLaunchRequest)
+ case q.LaunchByUnixMS <= 0:
+ return fmt.Errorf("%w: launch_by_unix_ms must be above zero", ErrLaunchRequest)
+ }
+ return nil
}
// MaxLifetime is MaxLifetimeMS as a duration. A negative value, or one too
diff --git a/internal/hostedwire/api_test.go b/internal/hostedwire/api_test.go
index 386d2a93..92f2324c 100644
--- a/internal/hostedwire/api_test.go
+++ b/internal/hostedwire/api_test.go
@@ -82,9 +82,9 @@ func TestWireNames(t *testing.T) {
into func() any
want string
}{
- {LaunchRequest{AttemptID: "a1", TaskID: "t1", Account: "acct", Replaces: "a0", Image: "sha256:ab", Size: isolatedjob.SizeSmall, MaxLifetimeMS: 1000, InstanceCode: "code"},
+ {LaunchRequest{AttemptID: "a1", TaskID: "t1", Account: "acct", Replaces: "a0", Image: "sha256:ab", Size: isolatedjob.SizeSmall, MaxLifetimeMS: 1000, InstanceCode: "code", Person: "p1", Purpose: PurposeChecks, LaunchByUnixMS: 1764460800000},
func() any { return &LaunchRequest{} },
- `{"attempt_id":"a1","task_id":"t1","account":"acct","replaces":"a0","image":"sha256:ab","size":"small","max_lifetime_ms":1000,"instance_code":"code"}`},
+ `{"attempt_id":"a1","task_id":"t1","account":"acct","replaces":"a0","image":"sha256:ab","size":"small","max_lifetime_ms":1000,"instance_code":"code","person":"p1","purpose":"checks","launch_by_unix_ms":1764460800000}`},
{JobView{AttemptID: "a1", LaunchID: "l1", State: "running", VMRef: "vm-1", Epoch: 2, DeadlineInMS: 3, DrainInMS: 4, StopInMS: 5},
func() any { return &JobView{} },
`{"attempt_id":"a1","launch_id":"l1","state":"running","vm_ref":"vm-1","epoch":2,"deadline_in_ms":3,"drain_in_ms":4,"stop_in_ms":5}`},
@@ -129,6 +129,42 @@ func TestWireNames(t *testing.T) {
}
}
+func TestLaunchRequestV2Strict(t *testing.T) {
+ const valid = `{"attempt_id":"a1","task_id":"t1","account":"acct","replaces":"","image":"sha256:ab","size":"small","max_lifetime_ms":1000,"instance_code":"code","person":"p1","purpose":"checks","launch_by_unix_ms":1764460800000}`
+ with := func(old, new string) string {
+ if !strings.Contains(valid, old) {
+ t.Fatalf("fixture has no %s", old)
+ }
+ return strings.Replace(valid, old, new, 1)
+ }
+ cases := []struct {
+ name string
+ in string
+ want error // nil: decoded and valid
+ }{
+ {"checks", valid, nil},
+ {"certification without person", with(`"person":"p1","purpose":"checks"`, `"person":"","purpose":"certification"`), nil},
+ {"unknown field", with(`"person"`, `"services":[],"person"`), ErrBadJSON},
+ {"unknown purpose", with(`"purpose":"checks"`, `"purpose":"build"`), ErrLaunchRequest},
+ {"no purpose", with(`"purpose":"checks",`, ``), ErrLaunchRequest},
+ {"purpose in another case", with(`"purpose":"checks"`, `"purpose":"Checks"`), ErrLaunchRequest},
+ {"empty person for checks", with(`"person":"p1"`, `"person":""`), ErrLaunchRequest},
+ {"no launch by", with(`,"launch_by_unix_ms":1764460800000`, ``), ErrLaunchRequest},
+ {"negative launch by", with(`1764460800000`, `-1`), ErrLaunchRequest},
+ {"certification without launch by", with(`"purpose":"checks","launch_by_unix_ms":1764460800000`, `"purpose":"certification","launch_by_unix_ms":0`), ErrLaunchRequest},
+ }
+ for _, c := range cases {
+ var q LaunchRequest
+ err := DecodeStrict(strings.NewReader(c.in), &q)
+ if err == nil {
+ err = q.Validate()
+ }
+ if c.want == nil && err != nil || c.want != nil && !errors.Is(err, c.want) {
+ t.Errorf("%s: decode and Validate = %v, want %v", c.name, err, c.want)
+ }
+ }
+}
+
func TestLaunchLifetimeBounds(t *testing.T) {
const most = math.MaxInt64 / int64(time.Millisecond)
cases := []struct {
diff --git a/internal/hostedwire/hosted.go b/internal/hostedwire/hosted.go
new file mode 100644
index 00000000..2084c6d9
--- /dev/null
+++ b/internal/hostedwire/hosted.go
@@ -0,0 +1,247 @@
+package hostedwire
+
+import (
+ "crypto/sha256"
+ "encoding/base64"
+ "encoding/hex"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net/netip"
+
+ "amadan.net/oficina/equipo/internal/isolatedjob"
+)
+
+// Hosted checks (slice 2) wire types: the VM's bootstrap, the instance's
+// admission record, and the proxy's feed, redemption and certificate
+// routes. Keys are lower snake_case and read with DecodeStrict, like the
+// rest of this package.
+
+// RoleProxy is an egress proxy's key: it may use the proxy routes only.
+const RoleProxy Role = "proxy"
+
+// Launch purposes. A checks VM runs one hosted checks step for an
+// instance; a certification VM proves an image (no instance involved).
+const (
+ PurposeChecks = "checks"
+ PurposeCertification = "certification"
+)
+
+func knownPurpose(p string) bool { return p == PurposeChecks || p == PurposeCertification }
+
+// ServiceInstance is the class of an Equipo instance a VM may reach
+// through the proxy. Slice 4 adds a gateway class.
+const ServiceInstance = "instance"
+
+// Service is one exact host and port a VM may reach through the proxy.
+type Service struct {
+ Host string `json:"host"`
+ Port uint16 `json:"port"`
+ Class string `json:"class"`
+}
+
+// Bootstrap v2 bounds. MaxBootstrapBytes is the provider's run hook
+// payload limit as measured live (Task 17).
+const (
+ BootstrapV2Version = 2
+ MaxBootstrapBytes = 4096
+ // MaxLaunchIDLen bounds a bootstrap's launch and attempt IDs.
+ MaxLaunchIDLen = 64
+ // MaxHostLen is the longest DNS name.
+ MaxHostLen = 253
+ // maxProxies: one egress proxy, or two for redundancy.
+ maxProxies = 2
+)
+
+// ErrBootstrap is a bootstrap Encode will not write: a field out of its
+// rules, or text that is not printable ASCII.
+var ErrBootstrap = errors.New("hostedwire: bootstrap is not valid")
+
+// ErrBootstrapTooLarge is a valid bootstrap whose JSON passes
+// MaxBootstrapBytes.
+var ErrBootstrapTooLarge = errors.New("hostedwire: bootstrap is too large")
+
+// BootstrapV2 is the one-time payload a slice 2 VM's run hook receives.
+type BootstrapV2 struct {
+ Version int `json:"v"`
+ Purpose string `json:"purpose"`
+ LaunchID string `json:"launch_id"`
+ AttemptID string `json:"attempt_id"`
+ InstanceCode string `json:"instance_code"` // 32 bytes base64url; "" for certification
+ ProxyCode string `json:"proxy_code"` // 32 bytes base64url
+ Proxies []netip.AddrPort `json:"proxies"` // egress listeners, 1 or 2
+ ProxyBoot []netip.AddrPort `json:"proxy_boot"` // bootstrap listeners, same hosts, same order
+ ProxyCAPin string `json:"proxy_ca_pin"` // hex SHA-256 of the intercept CA's SPKI
+ Services []Service `json:"services"` // the launch's snapshot
+}
+
+// Encode checks b and returns its JSON: printable ASCII and at most
+// MaxBootstrapBytes bytes.
+func (b BootstrapV2) Encode() ([]byte, error) {
+ if err := b.valid(); err != nil {
+ return nil, err
+ }
+ raw, err := json.Marshal(b)
+ if err != nil {
+ return nil, fmt.Errorf("%w: %v", ErrBootstrap, err)
+ }
+ if !printableASCII(string(raw)) {
+ return nil, fmt.Errorf("%w: not printable ASCII", ErrBootstrap)
+ }
+ if len(raw) > MaxBootstrapBytes {
+ return nil, fmt.Errorf("%w: %d bytes, limit %d", ErrBootstrapTooLarge, len(raw), MaxBootstrapBytes)
+ }
+ return raw, nil
+}
+
+func (b BootstrapV2) valid() error {
+ bad := func(what string) error { return fmt.Errorf("%w: %s", ErrBootstrap, what) }
+ switch {
+ case b.Version != BootstrapV2Version:
+ return bad("version")
+ case !knownPurpose(b.Purpose):
+ return bad("purpose")
+ case !boundedText(b.LaunchID, MaxLaunchIDLen):
+ return bad("launch id")
+ case !boundedText(b.AttemptID, MaxLaunchIDLen):
+ return bad("attempt id")
+ case b.Purpose == PurposeChecks && !code32(b.InstanceCode),
+ b.Purpose == PurposeCertification && b.InstanceCode != "":
+ return bad("instance code")
+ case !code32(b.ProxyCode):
+ return bad("proxy code")
+ case len(b.Proxies) == 0 || len(b.Proxies) > maxProxies || len(b.ProxyBoot) != len(b.Proxies):
+ return bad("proxy count")
+ case !sha256Hex(b.ProxyCAPin):
+ return bad("proxy CA pin")
+ }
+ for i, p := range b.Proxies {
+ boot := b.ProxyBoot[i]
+ if !listener(p) || !listener(boot) || boot.Addr() != p.Addr() {
+ return bad("proxy listener")
+ }
+ }
+ for _, s := range b.Services {
+ if !boundedText(s.Host, MaxHostLen) || s.Port == 0 || s.Class != ServiceInstance {
+ return bad("service")
+ }
+ }
+ return nil
+}
+
+// boundedText is 1 to n bytes of printable ASCII.
+func boundedText(s string, n int) bool { return s != "" && len(s) <= n && printableASCII(s) }
+
+func printableASCII(s string) bool {
+ for i := 0; i < len(s); i++ {
+ if s[i] < 0x20 || s[i] > 0x7e {
+ return false
+ }
+ }
+ return true
+}
+
+// code32 is 32 bytes in unpadded base64url.
+func code32(s string) bool {
+ b, err := base64.RawURLEncoding.Strict().DecodeString(s)
+ return err == nil && len(b) == 32
+}
+
+// sha256Hex is 64 lower-case hex digits.
+func sha256Hex(s string) bool {
+ if len(s) != 64 {
+ return false
+ }
+ for i := 0; i < len(s); i++ {
+ if c := s[i]; !(c >= '0' && c <= '9' || c >= 'a' && c <= 'f') {
+ return false
+ }
+ }
+ return true
+}
+
+// listener is an address and a port, without a zone.
+func listener(p netip.AddrPort) bool {
+ return p.IsValid() && p.Port() != 0 && p.Addr().Zone() == ""
+}
+
+// AdmissionView is the controller's answer to the creating instance's
+// admission check for one attempt: the VM, its epoch and image, and
+// whether the image's certificate is valid now. CheckedNS is controller
+// time.
+type AdmissionView struct {
+ AttemptID string `json:"attempt_id"`
+ LaunchID string `json:"launch_id"`
+ State string `json:"state"`
+ VMRef isolatedjob.Ref `json:"vm_ref"`
+ Epoch int64 `json:"epoch"`
+ Image isolatedjob.ImageDigest `json:"image"`
+ CertDigest string `json:"cert_digest"`
+ CertValid bool `json:"cert_valid"`
+ CheckedNS int64 `json:"checked_ns"`
+}
+
+// ProxyFeed is the controller's signed list of live launches for the
+// egress proxies, valid TTLMS after IssuedNS (controller time).
+type ProxyFeed struct {
+ Version int `json:"version"`
+ Serial int64 `json:"serial"`
+ IssuedNS int64 `json:"issued_ns"`
+ TTLMS int64 `json:"ttl_ms"`
+ Launches []FeedLaunch `json:"launches"`
+ Revoked []string `json:"revoked"`
+}
+
+// FeedLaunch is one live launch in the feed: what its VM may reach, and
+// the hash of its single-use proxy code.
+type FeedLaunch struct {
+ LaunchID string `json:"launch_id"`
+ AttemptID string `json:"attempt_id"`
+ VMRef isolatedjob.Ref `json:"vm_ref"`
+ Epoch int64 `json:"epoch"`
+ Services []Service `json:"services"`
+ ProxyCodeHash string `json:"proxy_code_hash"`
+ DeadlineNS int64 `json:"deadline_ns"`
+}
+
+// RedeemRequest trades a VM's proxy code for its first client
+// certificate.
+type RedeemRequest struct {
+ LaunchID string `json:"launch_id"`
+ VMRef isolatedjob.Ref `json:"vm_ref"`
+ ProxyCode string `json:"proxy_code"`
+ CSR []byte `json:"csr"`
+}
+
+type RedeemResponse struct {
+ Cert []byte `json:"cert"`
+ NotAfterNS int64 `json:"not_after_ns"`
+}
+
+// RenewCertRequest renews a client certificate; it is sent over the
+// current one.
+type RenewCertRequest struct {
+ Serial string `json:"serial"`
+ CSR []byte `json:"csr"`
+}
+
+// CertReport is a certification VM's report, signed with its
+// certificate key (ECDSA P-256) over CertReportMessage, and sent through
+// the proxy's bootstrap listener.
+type CertReport struct {
+ Serial string `json:"serial"`
+ Report []byte `json:"report"`
+ Sig []byte `json:"sig"`
+}
+
+// CertReportMessage is what a CertReport's Sig signs.
+func CertReportMessage(serial string, report []byte) []byte {
+ sum := sha256.Sum256(report)
+ return []byte("equipo-hosted-cert-report-v1\n" + serial + "\n" + hex.EncodeToString(sum[:]))
+}
+
+// CertLaunchRequest asks for a certification VM for one image.
+type CertLaunchRequest struct {
+ Image isolatedjob.ImageDigest `json:"image"`
+ Size isolatedjob.Size `json:"size"`
+}
diff --git a/internal/hostedwire/hosted_test.go b/internal/hostedwire/hosted_test.go
new file mode 100644
index 00000000..8e5855e0
--- /dev/null
+++ b/internal/hostedwire/hosted_test.go
@@ -0,0 +1,213 @@
+package hostedwire
+
+import (
+ "bytes"
+ "crypto/sha256"
+ "encoding/hex"
+ "encoding/json"
+ "errors"
+ "net/netip"
+ "strings"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/isolatedjob"
+)
+
+// validCode is a valid 32-byte base64url code.
+var validCode = strings.Repeat("A", 43)
+
+func maximalBootstrap() BootstrapV2 {
+ host := func(c string) string {
+ // 253 characters: four 62-character labels and dots, then four more.
+ label := strings.Repeat(c, 62)
+ return label + "." + label + "." + label + "." + label + "." + strings.Repeat(c, 1)
+ }
+ v6 := func(port uint16) netip.AddrPort {
+ return netip.AddrPortFrom(netip.MustParseAddr("fd12:3456:789a:bcde:f012:3456:789a:bcde"), port)
+ }
+ v6b := func(port uint16) netip.AddrPort {
+ return netip.AddrPortFrom(netip.MustParseAddr("fd12:3456:789a:bcde:f012:3456:789a:bcdf"), port)
+ }
+ return BootstrapV2{
+ Version: BootstrapV2Version,
+ Purpose: PurposeChecks,
+ LaunchID: strings.Repeat("l", MaxLaunchIDLen),
+ AttemptID: strings.Repeat("a", MaxLaunchIDLen),
+ InstanceCode: validCode,
+ ProxyCode: validCode,
+ Proxies: []netip.AddrPort{v6(65535), v6b(65535)},
+ ProxyBoot: []netip.AddrPort{v6(65534), v6b(65534)},
+ ProxyCAPin: strings.Repeat("ab", 32),
+ Services: []Service{
+ {Host: host("x"), Port: 65535, Class: ServiceInstance},
+ {Host: host("y"), Port: 65535, Class: ServiceInstance},
+ },
+ }
+}
+
+// padTo lengthens hosts, adding a service as each fills, until b's JSON
+// is exactly n bytes.
+func padTo(t *testing.T, b BootstrapV2, n int) BootstrapV2 {
+ t.Helper()
+ b.Services = append([]Service(nil), b.Services...)
+ size := func() int {
+ raw, err := json.Marshal(b)
+ if err != nil {
+ t.Fatal(err)
+ }
+ return len(raw)
+ }
+ for size() < n {
+ last := &b.Services[len(b.Services)-1]
+ if len(last.Host) < MaxHostLen {
+ last.Host += strings.Repeat("h", min(n-size(), MaxHostLen-len(last.Host)))
+ continue
+ }
+ b.Services = append(b.Services, Service{Host: "h", Port: 443, Class: ServiceInstance})
+ if over := size() - n; over > 0 {
+ full := &b.Services[len(b.Services)-2]
+ full.Host = full.Host[:len(full.Host)-over]
+ }
+ }
+ if got := size(); got != n {
+ t.Fatalf("padded bootstrap is %d bytes, want %d", got, n)
+ }
+ return b
+}
+
+func TestBootstrapV2Limit(t *testing.T) {
+ max := maximalBootstrap()
+ raw, err := max.Encode()
+ if err != nil {
+ t.Fatalf("maximal bootstrap: %v", err)
+ }
+ if len(raw) >= MaxBootstrapBytes {
+ t.Fatalf("maximal bootstrap is %d bytes, want under %d", len(raw), MaxBootstrapBytes)
+ }
+ var back BootstrapV2
+ if err := DecodeStrict(bytes.NewReader(raw), &back); err != nil {
+ t.Fatalf("DecodeStrict(maximal) = %v", err)
+ }
+ if again, _ := back.Encode(); !bytes.Equal(again, raw) {
+ t.Fatalf("round trip = %s, want %s", again, raw)
+ }
+
+ small := maximalBootstrap()
+ small.Services = small.Services[:1]
+ small.Services[0].Host = "a.example.com"
+ at := padTo(t, small, MaxBootstrapBytes)
+ if raw, err := at.Encode(); err != nil || len(raw) != MaxBootstrapBytes {
+ t.Fatalf("bootstrap of exactly %d bytes = (%d bytes, %v), want accepted", MaxBootstrapBytes, len(raw), err)
+ }
+ over := padTo(t, small, MaxBootstrapBytes+1)
+ if raw, err := over.Encode(); !errors.Is(err, ErrBootstrapTooLarge) || raw != nil {
+ t.Fatalf("bootstrap of %d bytes = (%d bytes, %v), want ErrBootstrapTooLarge", MaxBootstrapBytes+1, len(raw), err)
+ }
+
+ accent := maximalBootstrap()
+ accent.Services[0].Host = "café.example.com"
+ if raw, err := accent.Encode(); !errors.Is(err, ErrBootstrap) || raw != nil {
+ t.Fatalf("non-ASCII bootstrap = (%s, %v), want ErrBootstrap", raw, err)
+ }
+}
+
+func TestBootstrapV2Valid(t *testing.T) {
+ cert := maximalBootstrap()
+ cert.Purpose, cert.InstanceCode = PurposeCertification, ""
+ if _, err := cert.Encode(); err != nil {
+ t.Fatalf("certification bootstrap: %v", err)
+ }
+ one := maximalBootstrap()
+ one.Proxies, one.ProxyBoot = one.Proxies[:1], one.ProxyBoot[:1]
+ if _, err := one.Encode(); err != nil {
+ t.Fatalf("one proxy: %v", err)
+ }
+ cases := map[string]func(*BootstrapV2){
+ "version 1": func(b *BootstrapV2) { b.Version = 1 },
+ "unknown purpose": func(b *BootstrapV2) { b.Purpose = "build" },
+ "no launch": func(b *BootstrapV2) { b.LaunchID = "" },
+ "long launch": func(b *BootstrapV2) { b.LaunchID = strings.Repeat("l", MaxLaunchIDLen+1) },
+ "no attempt": func(b *BootstrapV2) { b.AttemptID = "" },
+ "checks without instance code": func(b *BootstrapV2) { b.InstanceCode = "" },
+ "short instance code": func(b *BootstrapV2) { b.InstanceCode = validCode[:42] },
+ "padded proxy code": func(b *BootstrapV2) { b.ProxyCode = validCode[:42] + "=" },
+ "certification with code": func(b *BootstrapV2) { b.Purpose = PurposeCertification },
+ "no proxies": func(b *BootstrapV2) { b.Proxies, b.ProxyBoot = nil, nil },
+ "three proxies": func(b *BootstrapV2) {
+ b.Proxies = append(b.Proxies, b.Proxies[0])
+ b.ProxyBoot = append(b.ProxyBoot, b.ProxyBoot[0])
+ },
+ "boot count differs": func(b *BootstrapV2) { b.ProxyBoot = b.ProxyBoot[:1] },
+ "boot on another host": func(b *BootstrapV2) {
+ b.ProxyBoot[0] = netip.AddrPortFrom(netip.MustParseAddr("10.0.0.9"), 9)
+ },
+ "port zero": func(b *BootstrapV2) { b.Proxies[0] = netip.AddrPortFrom(b.Proxies[0].Addr(), 0) },
+ "zone": func(b *BootstrapV2) { b.Proxies[0] = netip.MustParseAddrPort("[fe80::1%eth0]:443") },
+ "pin upper case": func(b *BootstrapV2) { b.ProxyCAPin = strings.Repeat("AB", 32) },
+ "pin short": func(b *BootstrapV2) { b.ProxyCAPin = "ab" },
+ "empty host": func(b *BootstrapV2) { b.Services[0].Host = "" },
+ "long host": func(b *BootstrapV2) { b.Services[0].Host = strings.Repeat("h", MaxHostLen+1) },
+ "service port 0": func(b *BootstrapV2) { b.Services[0].Port = 0 },
+ "gateway class": func(b *BootstrapV2) { b.Services[0].Class = "gateway" },
+ "non-ASCII id": func(b *BootstrapV2) { b.LaunchID = "lé" },
+ "control in host": func(b *BootstrapV2) { b.Services[0].Host = "a\x01b" },
+ }
+ for name, change := range cases {
+ b := maximalBootstrap()
+ change(&b)
+ if raw, err := b.Encode(); !errors.Is(err, ErrBootstrap) || raw != nil {
+ t.Errorf("%s: Encode = (%s, %v), want ErrBootstrap", name, raw, err)
+ }
+ }
+}
+
+func TestHostedWireNames(t *testing.T) {
+ svc := []Service{{Host: "base.example.com", Port: 443, Class: ServiceInstance}}
+ img := isolatedjob.ImageDigest("sha256:ab")
+ cases := []struct {
+ v any
+ into func() any
+ want string
+ }{
+ {AdmissionView{AttemptID: "a1", LaunchID: "l1", State: "running", VMRef: "vm-1", Epoch: 2, Image: img, CertDigest: "cd", CertValid: true, CheckedNS: 7},
+ func() any { return &AdmissionView{} },
+ `{"attempt_id":"a1","launch_id":"l1","state":"running","vm_ref":"vm-1","epoch":2,"image":"sha256:ab","cert_digest":"cd","cert_valid":true,"checked_ns":7}`},
+ {ProxyFeed{Version: 1, Serial: 3, IssuedNS: 4, TTLMS: 5, Launches: []FeedLaunch{{LaunchID: "l1", AttemptID: "a1", VMRef: "vm-1", Epoch: 2, Services: svc, ProxyCodeHash: "ph", DeadlineNS: 6}}, Revoked: []string{"s1"}},
+ func() any { return &ProxyFeed{} },
+ `{"version":1,"serial":3,"issued_ns":4,"ttl_ms":5,"launches":[{"launch_id":"l1","attempt_id":"a1","vm_ref":"vm-1","epoch":2,"services":[{"host":"base.example.com","port":443,"class":"instance"}],"proxy_code_hash":"ph","deadline_ns":6}],"revoked":["s1"]}`},
+ {RedeemRequest{LaunchID: "l1", VMRef: "vm-1", ProxyCode: "pc", CSR: []byte{1, 2}},
+ func() any { return &RedeemRequest{} },
+ `{"launch_id":"l1","vm_ref":"vm-1","proxy_code":"pc","csr":"AQI="}`},
+ {RedeemResponse{Cert: []byte{3}, NotAfterNS: 9}, func() any { return &RedeemResponse{} }, `{"cert":"Aw==","not_after_ns":9}`},
+ {RenewCertRequest{Serial: "s1", CSR: []byte{1}}, func() any { return &RenewCertRequest{} }, `{"serial":"s1","csr":"AQ=="}`},
+ {CertReport{Serial: "s1", Report: []byte{1}, Sig: []byte{2}}, func() any { return &CertReport{} }, `{"serial":"s1","report":"AQ==","sig":"Ag=="}`},
+ {CertLaunchRequest{Image: img, Size: isolatedjob.SizeLarge}, func() any { return &CertLaunchRequest{} }, `{"image":"sha256:ab","size":"large"}`},
+ }
+ for _, c := range cases {
+ b, err := json.Marshal(c.v)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if string(b) != c.want {
+ t.Fatalf("json of %T = %s, want %s", c.v, b, c.want)
+ }
+ back := c.into()
+ if err := DecodeStrict(bytes.NewReader(b), back); err != nil {
+ t.Fatalf("DecodeStrict(%s) into %T = %v", b, back, err)
+ }
+ if again, _ := json.Marshal(back); string(again) != c.want {
+ t.Fatalf("round trip of %T = %s, want %s", c.v, again, c.want)
+ }
+ }
+ if RoleProxy != "proxy" {
+ t.Fatalf("RoleProxy = %q", RoleProxy)
+ }
+}
+
+func TestCertReportMessage(t *testing.T) {
+ sum := sha256.Sum256([]byte("report"))
+ want := "equipo-hosted-cert-report-v1\ns1\n" + hex.EncodeToString(sum[:])
+ if got := string(CertReportMessage("s1", []byte("report"))); got != want {
+ t.Fatalf("CertReportMessage = %q, want %q", got, want)
+ }
+}
diff --git a/internal/wire/assistant_files_test.go b/internal/wire/assistant_files_test.go
index ec9c4510..616e10bc 100644
--- a/internal/wire/assistant_files_test.go
+++ b/internal/wire/assistant_files_test.go
@@ -16,7 +16,7 @@ import (
// Assistant message with files is refused, earlier and earlier_more are
// dropped, and the Coordinator's and a job's frames go as they are.
func TestProtocol33AssistantFiles(t *testing.T) {
- if wire.Protocol33 != 33 || wire.ProtocolAssistantFiles != wire.Protocol33 || wire.ProtocolUnfinishedWork != wire.Protocol32 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.Spoken(99) != 38 {
+ if wire.Protocol33 != 33 || wire.ProtocolAssistantFiles != wire.Protocol33 || wire.ProtocolUnfinishedWork != wire.Protocol32 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 {
t.Fatalf("assistant files %d, current %d", wire.ProtocolAssistantFiles, wire.ProtocolCurrent)
}
if wire.RunnerKeepFiles != 14*24*time.Hour {
diff --git a/internal/wire/assistant_test.go b/internal/wire/assistant_test.go
index 62844d49..7057830c 100644
--- a/internal/wire/assistant_test.go
+++ b/internal/wire/assistant_test.go
@@ -81,7 +81,7 @@ func TestAssistantCardJSON(t *testing.T) {
// A runner that speaks 24 or more is spoken to at 24, the warm
// protocol; glances came at 23 and jobs at 22.
func TestSpokenIs24(t *testing.T) {
- if wire.Spoken(99) != 38 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.ProtocolWarm != wire.Protocol24 || wire.ProtocolGlance != wire.Protocol23 || wire.ProtocolJobs != wire.Protocol22 || wire.ProtocolCopy != wire.Protocol21 || wire.ProtocolUsageRefresh != wire.Protocol20 || wire.ProtocolAssistant != wire.Protocol19 {
+ if wire.Spoken(99) != 39 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.ProtocolWarm != wire.Protocol24 || wire.ProtocolGlance != wire.Protocol23 || wire.ProtocolJobs != wire.Protocol22 || wire.ProtocolCopy != wire.Protocol21 || wire.ProtocolUsageRefresh != wire.Protocol20 || wire.ProtocolAssistant != wire.Protocol19 {
t.Fatalf("spoken %d, current %d", wire.Spoken(99), wire.ProtocolCurrent)
}
}
diff --git a/internal/wire/change_diffs_test.go b/internal/wire/change_diffs_test.go
index 101aba0d..3eca1260 100644
--- a/internal/wire/change_diffs_test.go
+++ b/internal/wire/change_diffs_test.go
@@ -11,7 +11,7 @@ import (
)
func TestProtocol35ChangeDiffs(t *testing.T) {
- if wire.ProtocolChangeDiffs != 35 || wire.ProtocolCurrent != 38 {
+ if wire.ProtocolChangeDiffs != 35 || wire.ProtocolCurrent != 39 {
t.Fatal("protocol")
}
f, err := wire.NewFrame("diff", wire.FrameChangeDiff, wire.ChangeDiffUpload{})
diff --git a/internal/wire/change_files_test.go b/internal/wire/change_files_test.go
index 8567e9ef..f7240666 100644
--- a/internal/wire/change_files_test.go
+++ b/internal/wire/change_files_test.go
@@ -11,7 +11,7 @@ import (
)
func TestProtocol31ChangeFiles(t *testing.T) {
- if wire.ProtocolChangeFiles != 31 || wire.ProtocolCurrent != 38 {
+ if wire.ProtocolChangeFiles != 31 || wire.ProtocolCurrent != 39 {
t.Fatal("protocol not 31")
}
facts := &wire.ChangeFiles{Base: strings.Repeat("a", 40), SHA: strings.Repeat("b", 40), Files: 1, Additions: 1, Entries: []wire.ChangedFile{{Path: "a.txt", Status: "added", Additions: 1}}}
diff --git a/internal/wire/design_test.go b/internal/wire/design_test.go
index 711f4c18..9af068da 100644
--- a/internal/wire/design_test.go
+++ b/internal/wire/design_test.go
@@ -36,7 +36,7 @@ func renderFile() wire.RenderFile {
// TestProtocol38Design: protocol 38 is the Design specialist's and the
// current one.
func TestProtocol38Design(t *testing.T) {
- if wire.Protocol38 != 38 || wire.ProtocolDesign != wire.Protocol38 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.Spoken(99) != 38 || wire.ProtocolMacEngineering != 37 {
+ if wire.Protocol38 != 38 || wire.ProtocolDesign != wire.Protocol38 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 || wire.ProtocolMacEngineering != 37 {
t.Fatalf("design %d, current %d, spoken %d", wire.ProtocolDesign, wire.ProtocolCurrent, wire.Spoken(99))
}
}
diff --git a/internal/wire/hosted.go b/internal/wire/hosted.go
new file mode 100644
index 00000000..2cc78a67
--- /dev/null
+++ b/internal/wire/hosted.go
@@ -0,0 +1,111 @@
+package wire
+
+import (
+ "fmt"
+ "strconv"
+ "time"
+)
+
+// Hosted runners (slice 2, ProtocolHostedRunners): a checks step placed
+// on a hosted VM instead of the person's own runners.
+
+// Placement of a hosted step: waiting_hosted while it waits for its
+// primary, or for a hosted VM, as hosted work (it never falls back to
+// running on the primary); hosted_limit while the hosted limits leave no
+// room for it.
+const (
+ PlacementHosted = "waiting_hosted"
+ PlacementHostedLimit = "hosted_limit"
+)
+
+// Hosted transfer kinds. A hosted_pack carries the base and candidate
+// commits a hosted worker checks out into an empty store; deps carries
+// the primary's dependency bundle. Both are inbound and need
+// ProtocolHostedRunners.
+const (
+ TransferKindHostedPack = "hosted_pack"
+ TransferKindDeps = "deps"
+)
+
+// DepsTransferMax is a deps transfer's own byte limit. Every other kind
+// keeps MaxTransferBytes.
+const DepsTransferMax = 256 << 20
+
+// MaxBytes is the most bytes a transfer of kind may carry. The instance's
+// chunk check and the receiver's assembly check both use it.
+func MaxBytes(kind string) int64 {
+ if kind == TransferKindDeps {
+ return DepsTransferMax
+ }
+ return MaxTransferBytes
+}
+
+// MaxChunks is the most chunks a transfer of kind within MaxBytes has.
+func MaxChunks(kind string) int {
+ if kind == TransferKindDeps {
+ return (DepsTransferMax + MaxBlobChunk - 1) / MaxBlobChunk
+ }
+ return MaxTransferChunks
+}
+
+// Fits reports whether n bytes are within the header's kind's limit.
+func (h TransferHeader) Fits(n int64) bool { return n >= 0 && n <= MaxBytes(h.Kind) }
+
+// hostedTransfer: a header only a peer at ProtocolHostedRunners has words
+// for.
+func (h TransferHeader) hostedTransfer() bool {
+ return h.Kind == TransferKindHostedPack || h.Kind == TransferKindDeps
+}
+
+// downgradeHostedRunners refuses a hosted_pack or deps transfer's chunk or
+// pack request below ProtocolHostedRunners, rather than drop its kind and
+// send it as a checks transfer.
+func downgradeHostedRunners(body any, protocol int) error {
+ if protocol >= ProtocolHostedRunners {
+ return nil
+ }
+ var h TransferHeader
+ switch v := body.(type) {
+ case *Blob:
+ h = v.Transfer
+ case *SendPackCommand:
+ h = v.Transfer
+ default:
+ return nil
+ }
+ if h.hostedTransfer() {
+ return fmt.Errorf("%w: a %s transfer at protocol %d", ErrProtocol, h.Kind, protocol)
+ }
+ return nil
+}
+
+// HostedEnrolRequest is a hosted VM's runner enrolling with the instance:
+// its single-use code, its launch and VM, and its machine key (Ed25519).
+type HostedEnrolRequest struct {
+ Code string `json:"code"`
+ LaunchID string `json:"launch_id"`
+ VMRef string `json:"vm_ref"`
+ MachinePublicKey []byte `json:"machine_public_key"`
+}
+
+// HostedChallenge is a nonce a hosted runner signs to renew its
+// credential.
+type HostedChallenge struct {
+ Nonce []byte `json:"nonce"`
+ ExpiresAt time.Time `json:"expires_at"`
+}
+
+// HostedRenewRequest renews a hosted runner's credential: Signature is
+// the machine key's Ed25519 signature over HostedRenewMessage.
+type HostedRenewRequest struct {
+ RunnerID string `json:"runner_id"`
+ Epoch int64 `json:"epoch"`
+ Nonce []byte `json:"nonce"`
+ Signature []byte `json:"signature"`
+}
+
+// HostedRenewMessage is what a HostedRenewRequest's Signature signs.
+func HostedRenewMessage(runner string, epoch int64, nonce []byte) []byte {
+ msg := []byte("equipo-hosted-renew-v1\n" + runner + "\n" + strconv.FormatInt(epoch, 10) + "\n")
+ return append(msg, nonce...)
+}
diff --git a/internal/wire/hosted_test.go b/internal/wire/hosted_test.go
new file mode 100644
index 00000000..c95eb01c
--- /dev/null
+++ b/internal/wire/hosted_test.go
@@ -0,0 +1,130 @@
+package wire_test
+
+import (
+ "bytes"
+ "encoding/json"
+ "errors"
+ "strings"
+ "testing"
+ "time"
+
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+func TestHostedRunnersProtocol(t *testing.T) {
+ if wire.Protocol39 != 39 || wire.ProtocolHostedRunners != wire.Protocol39 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 || wire.Spoken(38) != 38 {
+ t.Fatalf("hosted runners %d, current %d, spoken %d", wire.ProtocolHostedRunners, wire.ProtocolCurrent, wire.Spoken(99))
+ }
+ // Release slice 1's hub checks keep their own, older number.
+ if wire.ProtocolHostedChecks != wire.Protocol5 {
+ t.Fatalf("hosted checks %d, want 5", wire.ProtocolHostedChecks)
+ }
+ names := map[string]string{
+ wire.PlacementHosted: "waiting_hosted",
+ wire.PlacementHostedLimit: "hosted_limit",
+ wire.TransferKindHostedPack: "hosted_pack",
+ wire.TransferKindDeps: "deps",
+ }
+ for got, want := range names {
+ if got != want {
+ t.Fatalf("constant %q, want %q", got, want)
+ }
+ }
+}
+
+func TestDepsTransferLimit(t *testing.T) {
+ if wire.DepsTransferMax != 256<<20 {
+ t.Fatalf("DepsTransferMax = %d", wire.DepsTransferMax)
+ }
+ limits := map[string]int64{
+ wire.TransferKindDeps: 256 << 20,
+ "": 64 << 20, // checks, or a worker's commit
+ wire.TransferKindEngineering: 64 << 20,
+ wire.TransferKindHostedPack: 64 << 20,
+ "unknown": 64 << 20,
+ }
+ for kind, limit := range limits {
+ if got := wire.MaxBytes(kind); got != limit {
+ t.Errorf("MaxBytes(%q) = %d, want %d", kind, got, limit)
+ }
+ h := wire.TransferHeader{Kind: kind}
+ if !h.Fits(limit) || h.Fits(limit+1) || h.Fits(-1) {
+ t.Errorf("%q header: fits %d %v, %d %v", kind, limit, h.Fits(limit), limit+1, h.Fits(limit+1))
+ }
+ // MaxChunks agrees with MaxBytes: the most chunks a transfer
+ // within the bound has, and no more.
+ chunks := wire.MaxChunks(kind)
+ if int64(chunks)*wire.MaxBlobChunk < limit || int64(chunks-1)*wire.MaxBlobChunk >= limit {
+ t.Errorf("MaxChunks(%q) = %d for %d bytes in %d-byte chunks", kind, chunks, limit, wire.MaxBlobChunk)
+ }
+ }
+ if wire.MaxBytes("") != wire.MaxTransferBytes || wire.MaxChunks("") != wire.MaxTransferChunks {
+ t.Fatalf("a checks transfer's limits moved: %d %d", wire.MaxBytes(""), wire.MaxChunks(""))
+ }
+}
+
+func TestHostedKindsNeedProtocol(t *testing.T) {
+ sha := strings.Repeat("c", 40)
+ for _, kind := range []string{wire.TransferKindHostedPack, wire.TransferKindDeps} {
+ header := wire.TransferHeader{ID: "tr_1", Direction: wire.TransferInbound, Repo: "amadan.net/oficina/sample", TaskID: "tk1", StepID: "s1", Attempt: 1, BaseSHA: sha, CandidateSHA: sha, Kind: kind}
+ blob, _ := wire.NewFrame("b", wire.FrameBlob, wire.Blob{Transfer: header, Index: 0, Total: 1, SHA256: strings.Repeat("0", 64), Data: ""})
+ send, _ := wire.NewFrame("sp", wire.FrameSendPack, wire.SendPackCommand{Transfer: header, Have: []string{}})
+ for _, f := range []wire.Frame{blob, send} {
+ for _, p := range []int{wire.Protocol2, 36, 37, 38} {
+ got, err := wire.Encode(f, p)
+ if !errors.Is(err, wire.ErrProtocol) || got.Data != nil {
+ t.Errorf("%s %s at %d = (%s, %v), want ErrProtocol", kind, f.Type, p, got.Data, err)
+ }
+ }
+ if same, err := wire.Encode(f, wire.ProtocolHostedRunners); err != nil || !bytes.Equal(same.Data, f.Data) {
+ t.Errorf("%s %s changed at %d: %v", kind, f.Type, wire.ProtocolHostedRunners, err)
+ }
+ }
+ }
+ // A checks transfer still reaches a peer at 38 unchanged.
+ checks, _ := wire.NewFrame("b", wire.FrameBlob, wire.Blob{Transfer: wire.TransferHeader{ID: "tr_2", Direction: wire.TransferInbound, CandidateSHA: sha}})
+ if same, err := wire.Encode(checks, 38); err != nil || !bytes.Equal(same.Data, checks.Data) {
+ t.Fatalf("checks blob at 38: %v %s", err, same.Data)
+ }
+}
+
+func TestHostedEnrolWireNames(t *testing.T) {
+ at := time.Date(2026, 11, 30, 12, 0, 0, 0, time.UTC)
+ cases := []struct {
+ v any
+ into func() any
+ want string
+ }{
+ {wire.HostedEnrolRequest{Code: "c", LaunchID: "l1", VMRef: "vm-1", MachinePublicKey: []byte{1}},
+ func() any { return &wire.HostedEnrolRequest{} },
+ `{"code":"c","launch_id":"l1","vm_ref":"vm-1","machine_public_key":"AQ=="}`},
+ {wire.HostedChallenge{Nonce: []byte{2}, ExpiresAt: at},
+ func() any { return &wire.HostedChallenge{} },
+ `{"nonce":"Ag==","expires_at":"2026-11-30T12:00:00Z"}`},
+ {wire.HostedRenewRequest{RunnerID: "r1", Epoch: 3, Nonce: []byte{2}, Signature: []byte{4}},
+ func() any { return &wire.HostedRenewRequest{} },
+ `{"runner_id":"r1","epoch":3,"nonce":"Ag==","signature":"BA=="}`},
+ }
+ for _, c := range cases {
+ b, err := json.Marshal(c.v)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if string(b) != c.want {
+ t.Fatalf("json of %T = %s, want %s", c.v, b, c.want)
+ }
+ back := c.into()
+ dec := json.NewDecoder(bytes.NewReader(b))
+ dec.DisallowUnknownFields()
+ if err := dec.Decode(back); err != nil {
+ t.Fatal(err)
+ }
+ if again, _ := json.Marshal(back); string(again) != c.want {
+ t.Fatalf("round trip of %T = %s", c.v, again)
+ }
+ }
+ got := string(wire.HostedRenewMessage("r1", 3, []byte("nonce")))
+ if want := "equipo-hosted-renew-v1\nr1\n3\nnonce"; got != want {
+ t.Fatalf("HostedRenewMessage = %q, want %q", got, want)
+ }
+}
diff --git a/internal/wire/injection_test.go b/internal/wire/injection_test.go
index 1597958f..292ec62a 100644
--- a/internal/wire/injection_test.go
+++ b/internal/wire/injection_test.go
@@ -7,10 +7,10 @@ import (
)
func TestInjectionProtocolDowngrade(t *testing.T) {
- if wire.ProtocolInjectionDefences != 28 || wire.ProtocolCurrent != 38 {
+ if wire.ProtocolInjectionDefences != 28 || wire.ProtocolCurrent != 39 {
t.Fatal("injection guarantees require protocol 28")
}
- for version, want := range map[int]int{26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, 36: 36, 37: 37, 38: 38, 99: 38} {
+ for version, want := range map[int]int{26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, 36: 36, 37: 37, 38: 38, 39: 39, 99: 39} {
if got := wire.Spoken(version); got != want {
t.Fatalf("negotiated %d as %d, want %d", version, got, want)
}
diff --git a/internal/wire/lookup_test.go b/internal/wire/lookup_test.go
index 824a2661..9edd7bca 100644
--- a/internal/wire/lookup_test.go
+++ b/internal/wire/lookup_test.go
@@ -13,7 +13,7 @@ import (
func TestProtocolLookupIs36(t *testing.T) {
// Lookups stay at 36; Mac Engineering is 37 and Design (38) is the
// current protocol.
- if wire.ProtocolLookup != 36 || wire.ProtocolMacEngineering != 37 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.Spoken(99) != 38 || wire.Spoken(36) != 36 {
+ if wire.ProtocolLookup != 36 || wire.ProtocolMacEngineering != 37 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 || wire.Spoken(36) != 36 {
t.Fatalf("lookup %d current %d", wire.ProtocolLookup, wire.ProtocolCurrent)
}
}
diff --git a/internal/wire/mac_engineering_test.go b/internal/wire/mac_engineering_test.go
index 7b9071d5..78247829 100644
--- a/internal/wire/mac_engineering_test.go
+++ b/internal/wire/mac_engineering_test.go
@@ -18,10 +18,10 @@ import (
// Engineering. The values are written out so that moving a constant
// fails here.
func TestProtocol37Constants(t *testing.T) {
- if wire.Protocol37 != 37 || wire.ProtocolMacEngineering != wire.Protocol37 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.ProtocolChangeDiffs != 35 || wire.ProtocolLookup != 36 {
+ if wire.Protocol37 != 37 || wire.ProtocolMacEngineering != wire.Protocol37 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.ProtocolChangeDiffs != 35 || wire.ProtocolLookup != 36 {
t.Fatalf("mac engineering %d, current %d", wire.ProtocolMacEngineering, wire.ProtocolCurrent)
}
- if wire.Spoken(99) != 38 || wire.Spoken(37) != 37 || wire.Spoken(36) != 36 || wire.Spoken(35) != 35 {
+ if wire.Spoken(99) != 39 || wire.Spoken(37) != 37 || wire.Spoken(36) != 36 || wire.Spoken(35) != 35 {
t.Fatal("spoken protocol")
}
for kind, want := range map[string]bool{wire.FramePrepareBase: true, wire.FrameBase: true} {
diff --git a/internal/wire/mixed_protocol_test.go b/internal/wire/mixed_protocol_test.go
index 6f9607e0..817cac6b 100644
--- a/internal/wire/mixed_protocol_test.go
+++ b/internal/wire/mixed_protocol_test.go
@@ -15,7 +15,7 @@ import (
// both go out whole; at 11 both are downgraded. The numbers are written
// out so that pointing ProtocolResearch back at 12 fails here.
func TestEncodeMixedMeteredAndResearch(t *testing.T) {
- if wire.ProtocolMetered != wire.Protocol12 || wire.ProtocolResearch != wire.Protocol13 || wire.ProtocolCurrent != wire.ProtocolDesign {
+ if wire.ProtocolMetered != wire.Protocol12 || wire.ProtocolResearch != wire.Protocol13 || wire.ProtocolCurrent != wire.ProtocolHostedRunners {
t.Fatalf("metered %d, research %d, current %d", wire.ProtocolMetered, wire.ProtocolResearch, wire.ProtocolCurrent)
}
metered := wire.HeldConnection{LocalID: "tensorx-1", Person: "p", Provider: wire.ProviderTensorX, Kind: wire.KindAPIKey, State: wire.ConnHealthy, Harness: wire.HarnessPi, Upstream: "https://api.tensorx.ai", Billing: wire.BillingMetered, Model: "z-ai/glm-5.3", Budget: &wire.Budget{Day: 1, Month: 2, Currency: "USD"}, Spend: &wire.Spend{Currency: "USD"}}
diff --git a/internal/wire/models_test.go b/internal/wire/models_test.go
index f0a780b5..42dc8f6a 100644
--- a/internal/wire/models_test.go
+++ b/internal/wire/models_test.go
@@ -94,7 +94,7 @@ func modelsFrames(t *testing.T) map[string]wire.Frame {
// protocol is checked because an older step in Encode's chain could
// undo a newer one (S5's bug).
func TestEncodeBelowProtocol18AgainstFrozenSchemas(t *testing.T) {
- if wire.ProtocolModels != wire.Protocol18 || wire.ProtocolCurrent != wire.ProtocolDesign {
+ if wire.ProtocolModels != wire.Protocol18 || wire.ProtocolCurrent != wire.ProtocolHostedRunners {
t.Fatalf("models %d, current %d", wire.ProtocolModels, wire.ProtocolCurrent)
}
fs := modelsFrames(t)
diff --git a/internal/wire/opencode_test.go b/internal/wire/opencode_test.go
index e3c79938..5df6a327 100644
--- a/internal/wire/opencode_test.go
+++ b/internal/wire/opencode_test.go
@@ -57,7 +57,7 @@ func providersIn(t *testing.T, raw []byte) (providers, harnesses []string) {
// leave hello and sync, its usage rows leave every report, and a connect
// or a report about one is refused. At 17 nothing changes.
func TestEncodeBelowProtocol17DropsOpenCode(t *testing.T) {
- if wire.ProtocolOpenCode != wire.Protocol17 || wire.ProtocolCurrent != wire.ProtocolDesign {
+ if wire.ProtocolOpenCode != wire.Protocol17 || wire.ProtocolCurrent != wire.ProtocolHostedRunners {
t.Fatalf("opencode %d, current %d", wire.ProtocolOpenCode, wire.ProtocolCurrent)
}
budget := &wire.Budget{Day: 1_000_000, Month: 10_000_000, Currency: "USD", Revision: 1}
diff --git a/internal/wire/pinned_release_test.go b/internal/wire/pinned_release_test.go
index ab745b47..ae2ba86e 100644
--- a/internal/wire/pinned_release_test.go
+++ b/internal/wire/pinned_release_test.go
@@ -13,7 +13,7 @@ import (
// carrying a pinned release loses the release and its pin; an unpinned
// release is unchanged from protocol 14.
func TestEncodePinnedReleaseBelow29(t *testing.T) {
- if wire.ProtocolPinnedRelease != wire.Protocol29 || wire.ProtocolCurrent != wire.ProtocolDesign {
+ if wire.ProtocolPinnedRelease != wire.Protocol29 || wire.ProtocolCurrent != wire.ProtocolHostedRunners {
t.Fatalf("pinned %d, current %d", wire.ProtocolPinnedRelease, wire.ProtocolCurrent)
}
pinned, err := wire.NewFrame("f1", wire.FrameRelease, wire.ReleaseCommand{ID: "rl_1", Person: "p", TaskID: "tk1", StepID: "s1", StepRevision: 1, Connection: "claude-1"})
diff --git a/internal/wire/places_test.go b/internal/wire/places_test.go
index 22d4d758..54e51ae9 100644
--- a/internal/wire/places_test.go
+++ b/internal/wire/places_test.go
@@ -22,7 +22,7 @@ func placesHello() wire.Hello {
// refused: an older runner would deploy to its own fixed account, an
// older instance would decide a check without the destination.
func TestEncodeBelowProtocol31DropsPlaces(t *testing.T) {
- if wire.ProtocolPlaces != wire.Protocol34 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.Spoken(99) != 38 {
+ if wire.ProtocolPlaces != wire.Protocol34 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 {
t.Fatalf("places %d, current %d", wire.ProtocolPlaces, wire.ProtocolCurrent)
}
hello := placesHello()
diff --git a/internal/wire/publish_test.go b/internal/wire/publish_test.go
index a7ceeea3..4a5e9c50 100644
--- a/internal/wire/publish_test.go
+++ b/internal/wire/publish_test.go
@@ -17,7 +17,7 @@ import (
// and a hello's sites capability are dropped, so nothing a protocol 15
// peer decodes strictly carries them.
func TestEncodeBelowProtocol16DropsPublish(t *testing.T) {
- if wire.ProtocolPublish != wire.Protocol16 || wire.ProtocolCurrent != wire.ProtocolDesign {
+ if wire.ProtocolPublish != wire.Protocol16 || wire.ProtocolCurrent != wire.ProtocolHostedRunners {
t.Fatalf("publish %d, current %d", wire.ProtocolPublish, wire.ProtocolCurrent)
}
publish := wire.DispatchCommand{Person: "p", TaskID: "tk", StepID: "s", Attempt: 1, Specialist: wire.SpecialistPublish, Findings: []wire.Finding{}, CandidateSHA: strings.Repeat("e", 40), Publish: &wire.PublishDispatch{App: "site-sample", Into: "main"}}
diff --git a/internal/wire/runners.go b/internal/wire/runners.go
index 7de374b5..206d92a5 100644
--- a/internal/wire/runners.go
+++ b/internal/wire/runners.go
@@ -64,6 +64,7 @@ const (
Protocol36 = 36
Protocol37 = 37
Protocol38 = 38
+ Protocol39 = 39
// ProtocolSpend is the first protocol with a fix round's Feedback and
// a usage row's Turns; Encode drops both below it.
ProtocolSpend = Protocol3
@@ -251,8 +252,14 @@ const (
// it Encode refuses a bound dispatch, a render check, a render_file
// chunk and a proposal for one project, and drops a report's options
// and render records and a proposal's empty project (downgradeDesign).
- ProtocolDesign = Protocol38
- ProtocolCurrent = ProtocolDesign
+ ProtocolDesign = Protocol38
+ // ProtocolHostedRunners adds hosted runners (hosted.go, slice 2):
+ // hosted placement, and the hosted_pack and deps transfers. Hosted
+ // placement needs it on the primary and on the hosted runner. Below
+ // it Encode refuses those transfers (downgradeHostedRunners). It is
+ // not ProtocolHostedChecks, release slice 1's hub checks at 5.
+ ProtocolHostedRunners = Protocol39
+ ProtocolCurrent = ProtocolHostedRunners
)
// Runner roles. A person's first runner is the primary: the coordinator,
@@ -766,7 +773,8 @@ var ErrProtocol = errors.New("wire: frame not in this protocol")
// slice F's fields dropped (downgradeMacEngineering). Below ProtocolDesign
// a bound dispatch, a render check, a render_file chunk and a proposal
// for one project are refused and a report's options and render records
-// dropped (downgradeDesign).
+// dropped (downgradeDesign). Below ProtocolHostedRunners a hosted_pack
+// or deps transfer is refused (downgradeHostedRunners).
func Encode(f Frame, protocol int) (Frame, error) {
if protocol >= ProtocolCurrent {
return f, nil
@@ -778,6 +786,9 @@ func Encode(f Frame, protocol int) (Frame, error) {
if err != nil {
return Frame{}, err
}
+ if err := downgradeHostedRunners(body, protocol); err != nil {
+ return Frame{}, err
+ }
if protocol < ProtocolGlance && f.Type == FrameGlance || protocol < ProtocolWarm && f.Type == FrameWarm {
return Frame{}, fmt.Errorf("%w: %s at protocol %d", ErrProtocol, f.Type, protocol)
}
diff --git a/internal/wire/runners_test.go b/internal/wire/runners_test.go
index a3f4ccb2..305fbdd4 100644
--- a/internal/wire/runners_test.go
+++ b/internal/wire/runners_test.go
@@ -413,7 +413,7 @@ func TestEncodeBelowProtocol9DropsPreviews(t *testing.T) {
if _, err := wire.Encode(d, wire.ProtocolPreview); err != nil {
t.Fatal(err)
}
- if wire.ProtocolCurrent != wire.ProtocolDesign || wire.ProtocolDesign != 38 || wire.ProtocolMacEngineering != 37 || wire.ProtocolLookup != 36 || wire.ProtocolChangeDiffs != 35 || wire.ProtocolPlaces != 34 || wire.ProtocolAssistantFiles != 33 || wire.ProtocolStuckTasks != 30 || wire.ProtocolPinnedRelease != 29 || wire.ProtocolInjectionDefences != 28 || wire.ProtocolWarm != 24 || wire.ProtocolGlance != 23 || wire.ProtocolJobs != 22 || wire.ProtocolCopy != 21 || wire.ProtocolUsageRefresh != 20 || wire.ProtocolAssistant != 19 || wire.ProtocolModels != 18 || wire.ProtocolOpenCode != 17 || wire.ProtocolPublish != 16 || wire.ProtocolReadings != 15 || wire.ProtocolScheduler != 14 || wire.ProtocolResearch != 13 || wire.ProtocolMetered != 12 || wire.ProtocolPreviewHost != 11 || wire.ProtocolExplore != 10 || wire.ProtocolPreview != 9 {
+ if wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.ProtocolDesign != 38 || wire.ProtocolMacEngineering != 37 || wire.ProtocolLookup != 36 || wire.ProtocolChangeDiffs != 35 || wire.ProtocolPlaces != 34 || wire.ProtocolAssistantFiles != 33 || wire.ProtocolStuckTasks != 30 || wire.ProtocolPinnedRelease != 29 || wire.ProtocolInjectionDefences != 28 || wire.ProtocolWarm != 24 || wire.ProtocolGlance != 23 || wire.ProtocolJobs != 22 || wire.ProtocolCopy != 21 || wire.ProtocolUsageRefresh != 20 || wire.ProtocolAssistant != 19 || wire.ProtocolModels != 18 || wire.ProtocolOpenCode != 17 || wire.ProtocolPublish != 16 || wire.ProtocolReadings != 15 || wire.ProtocolScheduler != 14 || wire.ProtocolResearch != 13 || wire.ProtocolMetered != 12 || wire.ProtocolPreviewHost != 11 || wire.ProtocolExplore != 10 || wire.ProtocolPreview != 9 {
t.Fatalf("current %d", wire.ProtocolCurrent)
}
}
diff --git a/internal/wire/schedule_test.go b/internal/wire/schedule_test.go
index c0b1f260..a136784a 100644
--- a/internal/wire/schedule_test.go
+++ b/internal/wire/schedule_test.go
@@ -17,7 +17,7 @@ import (
// refused anything that spends, never handed it), and a dispatch loses
// its priority, deadline and release; what 13 already had is unchanged.
func TestEncodeBelowProtocol14DropsScheduler(t *testing.T) {
- if wire.ProtocolScheduler != wire.Protocol14 || wire.ProtocolCurrent != wire.ProtocolDesign {
+ if wire.ProtocolScheduler != wire.Protocol14 || wire.ProtocolCurrent != wire.ProtocolHostedRunners {
t.Fatalf("scheduler %d, current %d", wire.ProtocolScheduler, wire.ProtocolCurrent)
}
by := time.Date(2026, 11, 20, 17, 0, 0, 0, time.UTC)
diff --git a/internal/wire/stuck_test.go b/internal/wire/stuck_test.go
index 398ae11d..1b5d3805 100644
--- a/internal/wire/stuck_test.go
+++ b/internal/wire/stuck_test.go
@@ -14,7 +14,7 @@ import (
// Stuck tasks (protocol 30): a hello's tool health is a fixed state per
// pinned tool, never a path, and an older instance never hears it.
func TestProtocol30ToolHealth(t *testing.T) {
- if wire.ProtocolStuckTasks != wire.Protocol30 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.Spoken(99) != 38 {
+ if wire.ProtocolStuckTasks != wire.Protocol30 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 {
t.Fatalf("stuck %d, current %d", wire.ProtocolStuckTasks, wire.ProtocolCurrent)
}
caps := func(h *wire.ToolHealth) wire.Capabilities {
diff --git a/internal/wire/usage_test.go b/internal/wire/usage_test.go
index 4026a092..e366e933 100644
--- a/internal/wire/usage_test.go
+++ b/internal/wire/usage_test.go
@@ -44,7 +44,7 @@ func headrooms(t *testing.T, raw []byte) []map[string]json.RawMessage {
// decodes strictly against the frozen protocol 14 headroom, and the
// caller's own values are untouched; at 15 nothing changes.
func TestEncodeBelowProtocol15DropsReadingTimes(t *testing.T) {
- if wire.ProtocolReadings != wire.Protocol15 || wire.ProtocolCurrent != wire.ProtocolDesign {
+ if wire.ProtocolReadings != wire.Protocol15 || wire.ProtocolCurrent != wire.ProtocolHostedRunners {
t.Fatalf("readings %d, current %d", wire.ProtocolReadings, wire.ProtocolCurrent)
}
at := time.Date(2026, 11, 12, 9, 58, 0, 0, time.UTC)
diff --git a/internal/wire/warm_test.go b/internal/wire/warm_test.go
index dfde3f8a..85776769 100644
--- a/internal/wire/warm_test.go
+++ b/internal/wire/warm_test.go
@@ -13,7 +13,7 @@ import (
// other (durable, acked), and Encode refuses it below 24: an older
// runner's strict decoder would close the stream on it.
func TestEncodeWarmBelow24(t *testing.T) {
- if wire.ProtocolWarm != 24 || wire.ProtocolCurrent != wire.ProtocolDesign || wire.Spoken(99) != 38 {
+ if wire.ProtocolWarm != 24 || wire.ProtocolCurrent != wire.ProtocolHostedRunners || wire.Spoken(99) != 39 {
t.Fatalf("protocols %d %d", wire.ProtocolWarm, wire.ProtocolCurrent)
}
f, err := wire.NewFrame("c1", wire.FrameWarm, wire.WarmCommand{Person: "ana@example.com"})