Plan hosted runners slice 1: the foundation behind a flag
Thirty-one test-first tasks for spec section 13 slice 1: containment suite fixes, the isolatedjob adapter (fake, contract suite, AWS), equipo-hosted-controller with intent replay, pause generations, epochs, proxy credentials, reaper and a lifecycle simulation, the egress proxy and resolver, root init and image build, the certification gate, and OpenTofu for the dev account. Human tasks, slice 2 needs and open questions at the end. Allowlists the plan's runner and registry names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+781
−0
docs/superpowers/plans/2026-11-19-hosted-runners-slice-1.md+760 −0scripts/runner-reference-allowlist.json+21 −0
CI passed — 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/design-hosted-runners: Type Size Avail | ext4 96G 86G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type Size Avail | ext4 96G 86G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.4s
ci-box: codex: fetched and verified in 4.3s
ci-box: codex-code-mode-host: fetched and verified in 1.6s
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.8s
ci-box: pi: installed and verified in 7.5s
ci-box: opencode: installed and verified in 1.9s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 9.3s
ci-box: clone deepened in 2.8s
ci-box: file times set from content: 2679 files, 174 directories
ci-box: ready in 16.8s
=== 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.242s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
1.0s
+ go list -export -test -tags testbuild -f ./...
0.5s
+ go list -export -test -tags browser,testbuild -f ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
0.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-11 02:51:11 +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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m17.996s 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 1m16.495s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m16.49s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 37.22, cpu waiting 22.18%, memory waiting 0.00%, io waiting 1.27%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m20.812s 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.196s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m19.2s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 36.72, cpu waiting 21.48%, memory waiting 0.00%, io waiting 1.19%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m21.7s 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.751s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m9.65s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.57s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.54s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 36.72, cpu waiting 21.48%, memory waiting 0.00%, io waiting 1.19%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m17.323s 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 1m15.839s amadan.net/oficina/equipo/internal/headless
receipt: slow test 36.67s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 19.91s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.9s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.35s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 37.22, cpu waiting 22.18%, memory waiting 0.00%, io waiting 1.27%
--- 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_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m34.311s 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 1m32.706s amadan.net/oficina/equipo/internal/headless
receipt: slow test 58.16s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.93s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 9.58s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 8.42s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 5.62s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 30.99, cpu waiting 17.59%, memory waiting 0.00%, io waiting 0.94%
--- 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_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 3m12.939s 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 3m10.987s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m42.32s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 23.18s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 20.14s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 7.85s amadan.net/oficina/equipo/internal/headless TestHeadlessClaudeSignIn
receipt: slow test 7.25s amadan.net/oficina/equipo/internal/headless TestHeadlessBatchAfterRefusedReply
machine: 32 CPUs, load 7.44, cpu waiting 3.47%, memory waiting 0.00%, io waiting 0.17%
--- 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 311ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m58.418s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 7.73s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.74s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 3.88s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 3.47s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 3.36s amadan.net/oficina/equipo/internal/thintest TestContractTeamUpdatePersonNeeds
machine: 32 CPUs, load 1.92, cpu waiting 0.29%, memory waiting 0.00%, io waiting 4.54%
--- 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 1m8.125s 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 1m6.756s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 6.77s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 3.72s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.34s amadan.net/oficina/equipo/internal/thintest TestContractPreview
receipt: slow test 2.01s amadan.net/oficina/equipo/internal/thintest TestContractHostedBindingRules
receipt: slow test 1.77s amadan.net/oficina/equipo/internal/thintest TestContractTokenConnection
machine: 32 CPUs, load 39.15, cpu waiting 22.76%, memory waiting 0.00%, io waiting 1.46%
--- 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
cache miss: amadan.net/oficina/equipo/internal/runner/thin: its inputs changed
budget note: internal/runner/thin took 4m14.94s, over the 45s its record on line 44 allows; reported only, timing fails on CI
receipt: test step 4m27.544s 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 4m14.94s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 36.77s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.68s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.61s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.37s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.68s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 2.68, cpu waiting 0.97%, memory waiting 0.00%, io waiting 0.04%
--- 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
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed
receipt: test step 47.021s 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 45.969s amadan.net/oficina/equipo/internal/runner
receipt: slow test 25.94s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 34.34, cpu waiting 21.04%, memory waiting 0.00%, io waiting 2.10%
--- 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
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed
receipt: test step 47.952s 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 46s amadan.net/oficina/equipo/internal/runner
receipt: slow test 35.92s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 32.02s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.45s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.62s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 34.34, cpu waiting 21.04%, memory waiting 0.00%, io waiting 2.10%
--- 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
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed
receipt: test step 34.927s 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 34.109s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.13s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.53s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.12s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 1.98s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 26.24, cpu waiting 14.87%, memory waiting 0.00%, io waiting 2.57%
--- 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 28.5%, load 19.56
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
cache miss: amadan.net/oficina/equipo/internal/equipotest: its inputs changed
receipt: test step 1m3.132s 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 1m1.523s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 25.87s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 25.81s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 23.89s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 21.53s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 21.39s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelDuplicates
machine: 32 CPUs, load 32.99, cpu waiting 18.15%, memory waiting 0.00%, io waiting 0.97%
--- 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 29.5%, load 19.56
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 528ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m12.593s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 19.02s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 19.01s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
receipt: slow test 18.98s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 18.96s amadan.net/oficina/equipo/internal/equipotest TestProjectBindingUniqueness
receipt: slow test 18.87s amadan.net/oficina/equipo/internal/equipotest TestProjectRequestActorAndUpdate
machine: 32 CPUs, load 19.56, cpu waiting 11.87%, memory waiting 0.00%, io waiting 2.75%
--- 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 29.5%, load 19.56
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
cache miss: amadan.net/oficina/equipo/internal/equipotest: its inputs changed
receipt: test step 1m13.231s 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 1m2.191s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 14.27s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 12.75s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 9.72s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 9.66s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 6.62s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 28.75, cpu waiting 15.43%, memory waiting 0.00%, io waiting 0.82%
--- 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 29.5%, load 19.56
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 461ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m4.891s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 24.23s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 23.15s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 23.13s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 21.36s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedOnce
receipt: slow test 21.32s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsRollbackAndUnavailable
machine: 32 CPUs, load 19.56, cpu waiting 11.87%, memory waiting 0.00%, io waiting 2.75%
--- 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 28.5%, load 19.56
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 563ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 50.134s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.53s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 3.48s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 1.54s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.44s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.23s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorMessageSourcesUpgrade
machine: 32 CPUs, load 19.56, cpu waiting 11.87%, memory waiting 0.00%, io waiting 2.75%
--- 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 28.5%, load 19.56
test lane rest: ./cmd/equipo ./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/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./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/personapi ./internal/equipo/planning ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./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/testci ./internal/toolproxy ./internal/websource ./internal/wire ./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-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/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./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/personapi ./internal/equipo/planning ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./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/testci ./internal/toolproxy ./internal/websource ./internal/wire ./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/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/codex: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/checks: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/containment: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
budget note: internal/equipo took 20.611s, 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/chat took 10.188s, 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 10.085s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/idtest took 41.767s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/runner/containment took 39.438s, over the 15s its record on line 40 allows; reported only, timing fails on CI
receipt: test step 2m13.931s against a 60s target (the gate's other steps are not in this figure)
receipt: 11 packages ran, 49 cached, 18 without tests, 0 failed
receipt: slow package 53.285s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 51.461s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 41.767s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 39.438s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow package 37.023s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow test 21.05s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeAcceptanceHostileRepository
receipt: slow test 15.59s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringOfflineGo
receipt: slow test 15.14s amadan.net/oficina/equipo/cmd/equipo-runner TestReleaseRunnerHasNoFakeWorker
receipt: slow test 12.05s amadan.net/oficina/equipo/internal/idtest TestIDCallbackGuardAndPendingNonce
receipt: slow test 9.29s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringMissingModuleCache
machine: 32 CPUs, load 10.78, cpu waiting 5.53%, memory waiting 0.00%, io waiting 0.28%
--- 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 1m21.732s 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 1m20.483s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.25s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 15s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.4s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.73s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 5.74s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 36.72, cpu waiting 21.01%, memory waiting 0.00%, io waiting 1.15%
--- 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
receipt: test step 1m30.424s 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 1m29.052s amadan.net/oficina/equipo/internal/headless
receipt: slow test 25.87s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 21.83s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13.92s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 9.81s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 7.91s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 32.99, cpu waiting 18.70%, memory waiting 0.00%, io waiting 1.01%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m38.791s 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 1m37.168s amadan.net/oficina/equipo/internal/headless
receipt: slow test 13.64s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 12.83s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.78s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 10.35s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.07s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 30.99, cpu waiting 16.46%, memory waiting 0.00%, io waiting 0.88%
--- 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|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|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
time=2026-11-19T13:54:39.573Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-19T13:54:39.573Z level=INFO msg="startup phase done" phase=state_lock took=197µs
time=2026-11-19T13:54:39.573Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-19T13:54:39.573Z level=INFO msg="startup phase done" phase=claim_roots took=106µs
time=2026-11-19T13:54:39.573Z level=INFO msg="startup phase" phase=sweep
time=2026-11-19T13:54:39.607Z level=INFO msg="startup phase done" phase=sweep took=33.053ms
time=2026-11-19T13:54:39.607Z level=INFO msg="startup phase" phase=credentials
time=2026-11-19T13:54:39.607Z level=INFO msg="startup phase done" phase=credentials took=200µs
time=2026-11-19T13:54:39.607Z level=INFO msg="startup phase" phase=open_state
time=2026-11-19T13:54:39.650Z level=INFO msg="startup phase done" phase=open_state took=42.671ms
time=2026-11-19T13:54:39.650Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-19T13:54:39.651Z level=INFO msg=connecting host=127.0.0.1:44375 protocol=26
time=2026-11-19T13:54:39.652Z level=INFO msg=connected host=127.0.0.1:44375 took=978µs
time=2026-11-19T13:54:39.652Z level=INFO msg="capabilities gathering"
time=2026-11-19T13:54:39.653Z level=INFO msg="capabilities gathered" took=448µs tags=linux,claude,go
time=2026-11-19T13:54:39.653Z level=INFO msg="hello sent" protocol=26
time=2026-11-19T13:54:39.659Z level=INFO msg=welcome protocol=26 role=primary generation=1
browser_copy_test.go:93: continue did not reach Checks: 0 <nil>
--- FAIL: TestBrowserCopyContinue (1.83s)
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN TestBrowserEmptyExplore
time=2026-11-19T13:55:10.344Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-19T13:55:10.344Z level=INFO msg="startup phase done" phase=state_lock took=60µs
time=2026-11-19T13:55:10.344Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-19T13:55:10.344Z level=INFO msg="startup phase done" phase=claim_roots took=78µs
time=2026-11-19T13:55:10.344Z level=INFO msg="startup phase" phase=sweep
time=2026-11-19T13:55:10.370Z level=INFO msg="startup phase done" phase=sweep took=26.577ms
time=2026-11-19T13:55:10.370Z level=INFO msg="startup phase" phase=credentials
time=2026-11-19T13:55:10.371Z level=INFO msg="startup phase done" phase=credentials took=96µs
time=2026-11-19T13:55:10.371Z level=INFO msg="startup phase" phase=open_state
time=2026-11-19T13:55:10.409Z level=INFO msg="startup phase done" phase=open_state took=38.78ms
time=2026-11-19T13:55:10.410Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-19T13:55:10.410Z level=INFO msg=connecting host=127.0.0.1:44303 protocol=26
time=2026-11-19T13:55:10.412Z level=INFO msg=connected host=127.0.0.1:44303 took=1.165ms
time=2026-11-19T13:55:10.412Z level=INFO msg="capabilities gathering"
time=2026-11-19T13:55:10.412Z level=INFO msg="capabilities gathered" took=423µs tags=linux,claude,go
time=2026-11-19T13:55:10.413Z level=INFO msg="hello sent" protocol=26
time=2026-11-19T13:55:10.418Z level=INFO msg=welcome protocol=26 role=primary generation=1
time=2026-11-19T13:55:11.393Z level=INFO msg="connection checked" connection=claude-1 state=healthy
browser_receipts_test.go:169: waiting for [...document.querySelectorAll('[equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes("I'm your coordinator")): context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserEmptyExplore (5.77s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m25.773s
FAIL amadan.net/oficina/equipo/internal/headless 86.045s
receipt: test step 1m27.03s 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 1m25.773s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.01s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
rastrillo: budget test: go test failed
receipt: slow test 10.98s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.42s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 10.2s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.86s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|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$|^TestBrowserEmptyExplore$' -count=1 ./internal/headless (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest f201a020adca7ed5201a85a108ed369be8373a6e 1.83s 34.82
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserEmptyExplore browser-headless-rest f201a020adca7ed5201a85a108ed369be8373a6e 5.77s 34.82
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 28.75, cpu waiting 16.46%, memory waiting 0.00%, io waiting 0.88%
--- 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/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor)$' ./internal/idtest
receipt: test step 298ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1.647s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 1.65s 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 282ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1.95s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 1.95s 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|TestBrowserCoordinatorQueue|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackStarCentre)$' ./internal/thintest
receipt: test step 304ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 3m2.437s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 17.69s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.35s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 10.83s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.13s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 8.6s amadan.net/oficina/equipo/internal/thintest TestBrowserInnerScreens
machine: 32 CPUs, load 1.92, cpu waiting 1.39%, memory waiting 0.00%, io waiting 4.39%
--- 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 (52s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 5.28s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.36s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.12s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.57s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 24.62s
+ 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 (62s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 12.79s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 13.74s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 20.25s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 12.96s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (21s)
ok ./internal/headless TestMixedVersions 19.21s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.78s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin (0s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 37.34, cpu waiting 22.68%, memory waiting 0.00%, io waiting 1.66%
--- 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 8.251s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 3 without tests, 0 failed
receipt: slow package 7.188s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 148ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 67ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 4ms amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow test 5.19s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.62s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 290ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 150ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 80ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxToolchain
CGO_ENABLED=0 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 2.946s 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.625s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 270ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 180ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReapsOrphans
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
machine: 32 CPUs, load 5.27, cpu waiting 4.40%, memory waiting 0.00%, io waiting 3.84%
--- 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 28.5%, load 19.56
shard 25: make runner-dead-references lanes-check build vet fmt-check budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2393 text files, 2750 matches, 0 failures
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 87 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok amadan.net/oficina/equipo/internal/equipo 2.421s
machine: 32 CPUs, load 32.63, cpu waiting 20.50%, memory waiting 0.00%, io waiting 2.18%
--- 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 29.5%, load 19.56
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 19.56, cpu waiting 13.51%, memory waiting 0.00%, io waiting 2.66%
--- 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 28.5%, load 19.56
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 0 vulnerabilities in packages you import and 5
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 26.24, cpu waiting 16.02%, memory waiting 0.00%, io waiting 2.49%
--- 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 28.5%, load 19.56
shard 28: make gitleaks
[90m1:54PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m1:54PM[0m [32mINF[0m [1m1004 commits scanned.[0m
[90m1:54PM[0m [32mINF[0m [1mscanned ~59586344 bytes (59.59 MB) in 13.4s[0m
[90m1:54PM[0m [32mINF[0m [1mno leaks found[0m
machine: 32 CPUs, load 32.63, cpu waiting 19.88%, memory waiting 0.00%, io waiting 2.25%
=== perf ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -require TestPerfScreens,TestPerfBoot -tags perf -count=1 -p 1 -parallel 1 -run '^TestPerf' ./...
perf: GET /: median 1.058ms, worst 1.139ms, budget 150ms
perf: GET /api/runner/protocol: median 74µs, worst 114µs, budget 150ms
perf: GET /api/v1/account-setups/{id}: median 609µs, worst 636µs, budget 150ms
perf: GET /api/v1/accounts: median 404µs, worst 443µs, budget 150ms
perf: GET /api/v1/auth/devices: median 468µs, worst 493µs, budget 150ms
perf: GET /api/v1/budgets: median 488µs, worst 529µs, budget 150ms
perf: GET /api/v1/capabilities: median 242µs, worst 256µs, budget 150ms
perf: GET /api/v1/cards/{id}: median 1.24ms, worst 1.282ms, budget 150ms
perf: GET /api/v1/connections: median 572µs, worst 588µs, budget 150ms
perf: GET /api/v1/connections/{id}: median 535µs, worst 578µs, budget 150ms
perf: GET /api/v1/conversation: median 926µs, worst 1.716ms, budget 150ms
perf: GET /api/v1/conversation/cards: median 1.516ms, worst 1.653ms, budget 150ms
perf: GET /api/v1/coordinator: median 1.821ms, worst 1.885ms, budget 150ms
perf: GET /api/v1/invites/{id}: median 456µs, worst 475µs, budget 150ms
perf: GET /api/v1/journey: median 7.385ms, worst 7.482ms, budget 150ms
perf: GET /api/v1/me: median 409µs, worst 449µs, budget 150ms
perf: GET /api/v1/me/settings: median 489µs, worst 523µs, budget 150ms
perf: GET /api/v1/needs-you: median 7.22ms, worst 7.3ms, budget 150ms
perf: GET /api/v1/notifications: median 1.591ms, worst 1.699ms, budget 150ms
perf: GET /api/v1/onboarding: median 380µs, worst 430µs, budget 150ms
perf: GET /api/v1/people: median 434µs, worst 468µs, budget 150ms
perf: GET /api/v1/playbooks: median 582µs, worst 621µs, budget 150ms
perf: GET /api/v1/playbooks/{id}: median 530µs, worst 559µs, budget 150ms
perf: GET /api/v1/playbooks/{id}/template-diff: median 818µs, worst 840µs, budget 150ms
perf: GET /api/v1/preferences: median 749µs, worst 796µs, budget 150ms
perf: GET /api/v1/projects/{id}: median 452µs, worst 487µs, budget 150ms
perf: GET /api/v1/projects/{id}/settings: median 577µs, worst 663µs, budget 150ms
perf: GET /api/v1/roster: median 460µs, worst 511µs, budget 150ms
perf: GET /api/v1/runners/{id}: median 420µs, worst 444µs, budget 150ms
perf: GET /api/v1/specialists: median 8.014ms, worst 8.252ms, budget 150ms
perf: GET /api/v1/specialists/{id}: median 7.914ms, worst 8.099ms, budget 150ms
perf: GET /api/v1/specialists/{id}/template-diff: median 816µs, worst 888µs, budget 150ms
perf: GET /api/v1/tasks/{id}/plan: median 1.069ms, worst 1.138ms, budget 150ms
perf: GET /api/v1/tasks/{id}/thread: median 689µs, worst 736µs, budget 150ms
perf: GET /api/v1/teams: median 437µs, worst 464µs, budget 150ms
perf: GET /api/v1/templates: median 589µs, worst 619µs, budget 150ms
perf: GET /api/v1/templates/{id}: median 424µs, worst 486µs, budget 150ms
perf: GET /auth/callback: median 84µs, worst 100µs, budget 150ms
perf: GET /auth/devices/{id}: median 3.01ms, worst 3.147ms, budget 150ms
perf: GET /auth/verify: median 78µs, worst 90µs, budget 150ms
perf: GET /connections: median 3.482ms, worst 3.601ms, budget 150ms
perf: GET /conversation: median 7.321ms, worst 9.559ms, budget 150ms
perf: GET /conversation/connections: median 252µs, worst 323µs, budget 150ms
perf: GET /conversation/notebook: median 240µs, worst 257µs, budget 150ms
perf: GET /conversation/settings: median 3.587ms, worst 3.788ms, budget 150ms
perf: GET /conversation/settings/connections: median 5.764ms, worst 5.971ms, budget 150ms
perf: GET /conversation/settings/connections/add: median 5.876ms, worst 6.058ms, budget 150ms
perf: GET /conversation/settings/copy: median 3.277ms, worst 3.393ms, budget 150ms
perf: GET /conversation/settings/housekeeping: median 3.793ms, worst 3.862ms, budget 150ms
perf: GET /conversation/settings/machines: median 4.126ms, worst 4.334ms, budget 150ms
perf: GET /conversation/settings/machines/add: median 4.346ms, worst 6.635ms, budget 150ms
perf: GET /conversation/settings/notebook: median 3.356ms, worst 3.733ms, budget 150ms
perf: GET /conversation/settings/thinking: median 3.715ms, worst 3.786ms, budget 150ms
perf: GET /housekeeping: median 3.519ms, worst 3.604ms, budget 150ms
perf: GET /invites/new: median 568µs, worst 633µs, budget 150ms
perf: GET /invites/{id}: median 613µs, worst 633µs, budget 150ms
perf: GET /jobs: median 3.019ms, worst 3.082ms, budget 150ms
perf: GET /jobs/{id}: median 4.097ms, worst 4.163ms, budget 150ms
perf: GET /journey: median 9.922ms, worst 10.245ms, budget 150ms
perf: GET /nav/rail: median 2.627ms, worst 2.749ms, budget 150ms
perf: GET /needs-you: median 9.795ms, worst 13.216ms, budget 150ms
perf: GET /onboarding: median 3.823ms, worst 3.943ms, budget 150ms
perf: GET /people: median 3.164ms, worst 3.298ms, budget 150ms
perf: GET /playbook-suggestions/{suggestion}: median 4.148ms, worst 4.265ms, budget 150ms
perf: GET /playbooks: median 3.777ms, worst 3.917ms, budget 150ms
perf: GET /playbooks/new: median 3.9ms, worst 3.932ms, budget 150ms
perf: GET /playbooks/{id}: median 4.312ms, worst 4.326ms, budget 150ms
perf: GET /playbooks/{id}/edit: median 4.22ms, worst 4.335ms, budget 150ms
perf: GET /playbooks/{id}/template-diff: median 3.426ms, worst 3.536ms, budget 150ms
perf: GET /preferences: median 3.864ms, worst 3.935ms, budget 150ms
perf: GET /preferences/sources/{source}: median 3.668ms, worst 3.796ms, budget 150ms
perf: GET /projects: median 4.895ms, worst 6.496ms, budget 150ms
perf: GET /projects/accounts: median 3.462ms, worst 3.527ms, budget 150ms
perf: GET /projects/new: median 3.387ms, worst 3.489ms, budget 150ms
perf: GET /projects/{id}: median 9.946ms, worst 10.134ms, budget 150ms
perf: GET /projects/{id}/edit: median 3.49ms, worst 3.587ms, budget 150ms
perf: GET /runners/enrol: median 4.046ms, worst 4.197ms, budget 150ms
perf: GET /settings: median 3.128ms, worst 3.213ms, budget 150ms
perf: GET /settings/coordinator: median 5.075ms, worst 5.192ms, budget 150ms
perf: GET /settings/devices: median 2.975ms, worst 3.059ms, budget 150ms
perf: GET /settings/recovery: median 3.199ms, worst 3.249ms, budget 150ms
perf: GET /settings/recovery/release: median 3.221ms, worst 4.814ms, budget 150ms
perf: GET /settings/thinking: median 253µs, worst 275µs, budget 150ms
perf: GET /signin: median 320µs, worst 338µs, budget 150ms
perf: GET /specialists/new: median 3.209ms, worst 3.361ms, budget 150ms
perf: GET /specialists/{key}: median 10.432ms, worst 10.732ms, budget 150ms
perf: GET /specialists/{key}/edit: median 3.39ms, worst 3.482ms, budget 150ms
perf: GET /specialists/{key}/template-diff: median 3.467ms, worst 3.585ms, budget 150ms
perf: GET /tasks: median 4.613ms, worst 4.902ms, budget 150ms
perf: GET /tasks/new: median 2.952ms, worst 3.072ms, budget 150ms
perf: GET /tasks/{id}: median 5.153ms, worst 5.305ms, budget 150ms
perf: GET /tasks/{id}/merge: median 4.499ms, worst 4.646ms, budget 150ms
perf: GET /tasks/{id}/move: median 4.339ms, worst 6.369ms, budget 150ms
perf: GET /tasks/{id}/plan: median 5.535ms, worst 5.988ms, budget 150ms
perf: GET /tasks/{id}/questions/{question}: median 5.094ms, worst 5.187ms, budget 150ms
perf: GET /tasks/{id}/rendered-change: median 4.534ms, worst 4.627ms, budget 150ms
perf: GET /tasks/{id}/rendered-change/{hash}.png: median 4.128ms, worst 4.298ms, budget 150ms
perf: GET /tasks/{id}/thread: median 7.931ms, worst 8.109ms, budget 150ms
perf: GET /team/{specialist}: median 3.92ms, worst 4.067ms, budget 150ms
perf: GET /teams: median 9.537ms, worst 9.72ms, budget 150ms
perf: GET /templates: median 3.114ms, worst 5.229ms, budget 150ms
perf: GET /usage: median 3.954ms, worst 4.038ms, budget 150ms
perf: GET /work: median 2.847ms, worst 2.89ms, budget 150ms
perf: cold boot: median 251ms of [249.553617ms 251.284776ms 252.153465ms], budget 500ms
receipt: test step 28.192s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 83 without tests, 0 failed
receipt: slow package 8.527s amadan.net/oficina/equipo/internal/equipotest
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-runner
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-tool-proxy
receipt: slow package 0s amadan.net/oficina/equipo/internal/advice
receipt: slow package 0s amadan.net/oficina/equipo/internal/attach
receipt: slow test 7.73s amadan.net/oficina/equipo/internal/equipotest TestPerfScreens
receipt: slow test 800ms amadan.net/oficina/equipo/internal/equipotest TestPerfBoot
=== cache ===
ci-box: build cache /home/ci/work/repos/oficina__equipo/cache/go-build: 2.70 GiB in 18293 files
ci-box: module cache /home/ci/work/repos/oficina__equipo/cache/go-mod: 0.84 GiB in 27329 files
diff --git a/docs/superpowers/plans/2026-11-19-hosted-runners-slice-1.md b/docs/superpowers/plans/2026-11-19-hosted-runners-slice-1.md| new file mode 100644 |
| index 00000000..1d9a7675 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/2026-11-19-hosted-runners-slice-1.md |
| @@ -0,0 +1,760 @@ |
| +# Hosted runners, slice 1: foundation (plan, 2026-11-19) |
| + |
| +> **For agentic workers:** REQUIRED SUB-SKILL: use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task by task. Steps use checkbox (`- [ ]`) syntax for tracking. Tasks marked **HUMAN** are not agent work: stop and ask Paul. |
| + |
| +**Goal:** Build the hosted runner foundation in the dev AWS account, behind a flag and with nothing user-facing: the isolated job runner adapter, the controller, the egress stack, the image pipeline, the certification gate and the leaked-VM reaper, ending with a certified image that slice 2 (hosted checks) can launch. |
| + |
| +**Architecture:** A provider-neutral `isolatedjob.Runner` (interface, in-memory fake, AWS adapter) sits under `equipo-hosted-controller`, which owns the job table, launch intents, deadlines, pause generations, epochs, proxy credentials and the reaper, and answers a signed HTTPS API. An authenticated egress proxy and an exact-name resolver are the VM's only network. A root init inside the image fixes the managed mounts and runs the runner unprivileged. Certification runs the containment suite and the egress matrix inside a real VM and produces a signed certificate the controller requires before any ordinary launch. |
| + |
| +**Tech stack:** Go (module floor 1.26.0, gate `GOTOOLCHAIN=go1.26.11`, `CGO_ENABLED=0`), modernc SQLite through `database/sql` for the controller, `crypto/ed25519` and `crypto/x509` for signatures and proxy certificates, `golang.org/x/net/dns/dnsmessage` for the resolver, aws-sdk-go-v2 inside the AWS adapter only, OpenTofu for infrastructure (new to this repository, see Task 29 and open question 2). |
| + |
| +**Spec:** `docs/superpowers/specs/2026-11-18-hosted-runners-microvms.md` (approved 2026-11-19, rulings in §16, authority rules in §17). Executors read the spec and this plan together. |
| + |
| +**Baseline:** `design-hosted-runners` at `5ab8c160`. Implement Tasks 1 to 31 in order unless a task says it can run in parallel. H1 and H2 are Paul's and can start now. |
| + |
| +## Global constraints |
| + |
| +- Provider-neutral core: AWS SDK types and AWS names appear only under `internal/isolatedjob/awsjob/` and `cmd/equipo-hosted-controller/`. Task 6's guard test enforces this. |
| +- Every launch: `NO_INGRESS`, the VPC connector as only egress, no execution role, no idle policy, maximum duration at most 28,800 s, x86_64, and `additionalOsCapabilities: ["ALL"]` (without it bubblewrap cannot mount `/proc`). Sizes: Small 2 GB / 1 vCPU, Large 4 GB / 2 vCPU. Region `eu-west-1`. |
| +- The deadline is launch time plus the launch's MaxLifetime (8 h by default) and never moves. Suspended time counts. |
| +- Leaked VMs: reaper every 60 s; an incomplete `List` skips the pass; a live launch intent is replayed first; an unmatched VM is stopped after 10 minutes, once ownership is rechecked; a VM past its stop time is stopped. |
| +- Pause barrier: suspend only on a `quiescent` acknowledgement for the current generation; no acknowledgement within 2 minutes cancels that generation and late acknowledgements are ignored; resume carries an operation ID and raises the epoch once. |
| +- Bootstrap code: 2 minutes, single use, one attempt and VM. The run payload carries codes only, never tokens or keys. |
| +- Egress: exact fully qualified hostnames, port 443, no suffix match or wildcard. `proxy.golang.org`, `sum.golang.org`, `registry.npmjs.org`, `pypi.org`, `files.pythonhosted.org` and `amadan.net` are refused as service names. An unset service name blocks launch. Logs carry no credentials, request bodies or model text. |
| +- Slice 1 issues no forge token and no gateway token, runs no model work, and holds no provider key anywhere. The policy version built here refuses a gateway hostname (Task 9). |
| +- Flags: the controller refuses every launch unless `EQUIPO_HOSTED_ENABLED=1`. The instance-side client (Task 19) refuses construction unless `EQUIPO_HOSTED_RUNNERS=1`, and nothing in the instance calls it in this slice. No UI, no copy strings. |
| +- AWS: slice 1 runs in the dev account `640012953448` with profile `kass`, tag `purpose=equipo-hosted-dev`. The production account is organisation member `149757027610` (`equipo-hosted`); nothing is applied there in this slice and no agent sets up access to it. |
| +- Tests first. Each guard gets a mutation check: break the guard, watch the named test fail, restore it (spec §17, last paragraph). Record each command and result in `docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md`. |
| +- Local verification is targeted: `go test ./internal/<pkg> -run 'TestX' -count=1`. CI runs the full suite. No sudo. Scratch under `$TMPDIR`. Servers in tests bind `127.0.0.1`. Default Go caches. Each new package stays inside its 10 s test budget and 5,000 source lines. |
| +- Live AWS tests use the build tag `hostedlive` (the `e2elive` precedent) and never run in CI. |
| +- Commit subjects under 80 characters; never merge, never push the default branch, never deploy without Paul's GO. |
| + |
| +## Review focus |
| + |
| +1. **The VM is gone while the controller was down** (AWS maximum duration, a crash). On restart the job table still says running; the controller must find it gone, record stop proof and revoke its proxy access. Test: `TestRestartFindsVMGone` (Task 13). |
| +2. **The controller host's clock steps backwards.** Deadlines must not stretch and the 10-minute orphan wait must not restart. Test: `TestDeadlinesIgnoreClockRollback` (Task 15). |
| +3. **A long-lived tunnel survives revocation.** A runner stream opened before stop or an epoch change must be cut, not only new requests refused. Test: `TestRevocationClosesOpenTunnels` (Task 21). |
| +4. **Hostname spelling variants** (`Instance.Example.`, trailing dot, upper case, punycode, `host:443` versus `host`) must match the manifest name exactly once normalised, and nothing else. Tests: `TestServiceNameNormalisation` (Task 9), `TestProxyAuthorityNormalisation` (Task 22), `TestResolverNameNormalisation` (Task 23). |
| +5. **Two retries of one launch race each other.** Exactly one intent and one VM. Test: `TestConcurrentLaunchSameAttempt` (Task 12). |
| + |
| +--- |
| + |
| +## Human tasks (run in parallel with Phase A) |
| + |
| +### H1: Set up access to the `equipo-hosted` account (HUMAN: Paul or operator) |
| + |
| +Not needed for any agent task in this slice; needed before slice 2 can run in production. |
| + |
| +- [ ] Create a CLI profile `equipo-hosted` for account `149757027610` (through the `titogo` organisation management account), with MFA, and confirm `aws sts get-caller-identity --profile equipo-hosted`. |
| +- [ ] Create the OpenTofu state bucket and lock table in that account (names recorded in `infra/hosted/envs/prod/backend.tf` by Task 29). |
| +- [ ] Read the applied MicroVM memory quota for `eu-west-1` in that account and record it in the progress file (spec §10: the dev account's is 2,048 GB). |
| +- [ ] Enable CloudTrail data events for the MicroVM APIs there (spec §11). |
| + |
| +### H2: Rulings and names before dev bring-up (HUMAN: Paul) |
| + |
| +- [ ] Answer the open questions at the end of this plan, or accept the recommendations. |
| +- [ ] Choose the exact hostnames: dev staging instance, controller endpoint. Gateway and mirror are `none` for slice 1 (open question 6). |
| +- [ ] Say whether agents may run `tofu apply` in `kass` for `purpose=equipo-hosted-dev` resources, or whether Paul applies (Task 31 assumes Paul applies). |
| + |
| +--- |
| + |
| +## Phase A: containment suite fixes (spec §7, "test-suite fixes first") |
| + |
| +### Task 1: Retry `poll` on `EINTR` |
| + |
| +**Files:** Create `internal/runner/containment/poll_linux.go`, `internal/runner/containment/poll_linux_test.go`. Modify `internal/runner/containment/linux_test.go` (`exited`, `alive`, the stop-before-exit check near line 489), `internal/runner/containment/recovery.go:78-79`. |
| + |
| +**Interfaces:** Produces `pollRetry(fds []unix.PollFd, timeout time.Duration, poll func([]unix.PollFd, int) (int, error)) (int, error)`: retries on `unix.EINTR` with the remaining time, never extending the overall timeout; `pollFD(fds, timeout)` calls it with `unix.Poll`. |
| + |
| +- [ ] **Red:** `TestPollRetriesEINTR`: a poll stub returns `EINTR` twice, then `(1, nil)`; expect `(1, nil)` and three calls. `TestPollRetryKeepsDeadline`: a stub that sleeps 30 ms and returns `EINTR` forever, timeout 100 ms; expect a return within 200 ms with `n == 0`. Run `go test ./internal/runner/containment -run 'TestPollRetr' -count=1`; fails on the missing symbol. |
| +- [ ] **Implement** `pollRetry`; use it in `exited`, `alive`, the stop check, and in `recovery.go`'s zero-timeout exit check (today an `EINTR` there reports `errIdentity`, a spurious refusal). |
| +- [ ] **Green:** the same command, plus `go test ./internal/runner/containment -run 'TestNamespaceParentDeath|TestRecover' -count=1` on a runner host. |
| +- [ ] **Mutation:** return on the first `EINTR` in `pollRetry`; `TestPollRetriesEINTR` fails. Restore. |
| +- [ ] **Commit:** `containment: retry poll on EINTR in exit checks`. |
| + |
| +### Task 2: Source-reading tests run from the source tree only |
| + |
| +The two tests read files a compiled test binary does not carry (`TestNamespaceVersionTracksImplementation` reads `linux.go`; `TestBubblewrapPins` reads `../../../scripts/ci-box.json`), so they fail in a VM. |
| + |
| +**Files:** Modify `internal/runner/containment/helper_version_test.go`, `bubblewrap_pin_test.go`, `scripts/ci-test.py` (lane names if either test is named there), `Makefile` (`runner-namespace-test` pattern only if needed). |
| + |
| +**Interfaces:** Produces the test-name prefix `TestSource`, and the certification skip pattern `^TestSource` used by Task 27. |
| + |
| +- [ ] **Red:** rename to `TestSourceNamespaceVersionTracksImplementation`, and split the `ci-box.json` comparison out of `TestBubblewrapPins` into `TestSourceBubblewrapPinsMatchCIBox` (the manifest comparison stays in `TestBubblewrapPins`, which reads no file). Add `TestSourceTestsAreNamed` in the same package: it parses the package's `_test.go` files with `go/parser` and fails if a test function outside the `TestSource` prefix calls `os.ReadFile` or `os.Open` with a relative path literal. Run `go test ./internal/runner/containment -run 'TestSource' -count=1`. |
| +- [ ] **Implement** the rename and split; update lanes so `python3 scripts/ci-test.py check` passes. |
| +- [ ] **Green:** `go test ./internal/runner/containment -run 'TestSource|TestBubblewrapPins' -count=1` and `python3 scripts/ci-test.py check`. Then `go test -c -o $TMPDIR/containment.test ./internal/runner/containment && (cd $TMPDIR && ./containment.test -test.run 'TestBubblewrapPins' -test.skip '^TestSource')` passes outside the tree. |
| +- [ ] **Mutation:** move the `ci-box.json` read back into `TestBubblewrapPins`; `TestSourceTestsAreNamed` fails. Restore. |
| +- [ ] **Commit:** `containment: name the source-reading tests TestSource`. |
| + |
| +### Task 3: Skip the delegated-cgroup test where no user session exists |
| + |
| +**Files:** Modify `internal/runner/containment/linux_test.go` (`TestNamespaceCgroupMoveKeepsMembership`), `Makefile` (`runner-namespace-test`), `scripts/ci-test.py` only if the env must pass through. |
| + |
| +**Interfaces:** Produces env `EQUIPO_REQUIRE_USER_SESSION=1`: when set, the test fails instead of skipping. `runner-namespace-test` sets it, so the CI runner host still proves the cgroup move. |
| + |
| +- [ ] **Red:** `TestCgroupSessionRule` (pure function `cgroupSkip(base string, stat func(string) error, require bool) (skip bool, reason string, fail bool)`): missing `user@UID.service` directory and `require=false` gives skip with reason `no systemd user session; production containment does not use cgroups`; `require=true` gives fail; present directory gives neither. |
| +- [ ] **Implement** `cgroupSkip` and call it first in the cgroup test; add `EQUIPO_REQUIRE_USER_SESSION=1` to the `runner-namespace-test` recipe. |
| +- [ ] **Green:** `go test ./internal/runner/containment -run 'TestCgroupSessionRule' -count=1`; on docs-t1 also `-run TestNamespaceCgroupMoveKeepsMembership` still passes. |
| +- [ ] **Mutation:** ignore `require`; `TestCgroupSessionRule` fails. Restore. |
| +- [ ] **Commit:** `containment: skip the cgroup test without a user session`. |
| + |
| +--- |
| + |
| +## Phase B: the isolated job runner adapter (spec §2) |
| + |
| +### Task 4: `isolatedjob` types and validation |
| + |
| +**Files:** Create `internal/isolatedjob/isolatedjob.go`, `validate.go`, `isolatedjob_test.go`. |
| + |
| +**Interfaces (produces):** the spec §2 `Runner`, `LaunchSpec`, `Job`, `Limits` exactly, plus: |
| + |
| +```go |
| +type Ref string |
| +type ImageDigest string // "sha256:" + 64 lower-case hex |
| +type Size string // SizeSmall = "small" (2 GB, 1 vCPU), SizeLarge = "large" (4 GB, 2 vCPU) |
| +type State string // starting running suspending suspended stopping stopped failed |
| +func (State) Live() bool // starting, running, suspending, suspended, stopping |
| +func (State) Terminal() bool // stopped, failed |
| +const HardMaxLifetime = 28800 * time.Second |
| +var ErrNotFound, ErrInvalid, ErrConflict, ErrThrottled, ErrIncomplete, ErrBootstrapTooLarge error |
| +func (s LaunchSpec) Validate(l Limits) error |
| +type ImageRegistry interface { |
| + Register(ctx context.Context, src ImageSource) (ImageDigest, error) |
| + Status(ctx context.Context, d ImageDigest) (ImageStatus, error) // Building, Ready, Failed |
| +} |
| +type ImageSource struct{ Digest ImageDigest; OCILayout string } // path to an OCI image layout |
| +type NetworkAuditor interface{ AuditNetwork(ctx context.Context) (NetworkAudit, error) } |
| +type NetworkAudit struct { |
| + ResolverDisabled bool // provider DNS off for the VM network |
| + IngressClosed bool |
| + EgressOnly []netip.AddrPort // the proxy and resolver addresses, nothing else |
| + RouteOutAbsent bool // no default route on the VM subnet |
| + CheckedAt time.Time |
| +} |
| +func (a NetworkAudit) OK(want []netip.AddrPort) error |
| +``` |
| + |
| +- [ ] **Red:** `TestLaunchSpecValidate` table: AttemptID empty, over 64 bytes, or outside `[A-Za-z0-9-]`; image not `sha256:` + 64 hex; unknown size; MaxLifetime zero, negative, above `Limits.MaxLifetime`, above 28,800 s (28,801 s refused, as the spike found); Bootstrap empty or one byte over `MaxBootstrapBytes` (`ErrBootstrapTooLarge`); a valid spec at exactly each limit passes. `TestStateSets`: every state is exactly one of Live or Terminal. `TestNetworkAuditOK`: DNS on, ingress open, an extra egress address or a default route each fail. |
| +- [ ] **Implement.** Validate wraps `ErrInvalid` except the bootstrap case. |
| +- [ ] **Green:** `go test ./internal/isolatedjob -run 'TestLaunchSpecValidate|TestStateSets|TestNetworkAuditOK' -count=1`. |
| +- [ ] **Mutations:** compare MaxLifetime with `>=` instead of `>`; the at-limit row fails. Drop the extra-address check; `TestNetworkAuditOK` fails. Restore. |
| +- [ ] **Commit:** `isolatedjob: runner interface, launch spec and validation`. |
| + |
| +### Task 5: In-memory fake and the shared contract suite |
| + |
| +**Files:** Create `internal/isolatedjob/fake.go`, `fake_test.go`, `internal/isolatedjob/isolatedjobtest/contract.go`. |
| + |
| +**Interfaces (produces):** |
| + |
| +```go |
| +type Clock interface{ Now() time.Time } |
| +func NewFake(c Clock, l Limits) *Fake // implements Runner, ImageRegistry, NetworkAuditor |
| +func (*Fake) Inject(op Op, f Fault) // Op: OpLaunch OpGet OpSuspend OpResume OpStop OpList; Fault: FaultThrottle, FaultLostReply (apply, then error), FaultIncompleteList |
| +func (*Fake) Tick() // applies MaxLifetime expiry, counting suspended time, as AWS does |
| +func (*Fake) Plant(s LaunchSpec) Ref // a VM the controller never launched |
| +func (*Fake) LiveByAttempt() map[string]int // for simulation invariants |
| +func (*Fake) SetBackstop(on bool) // the simulation turns AWS's own expiry off |
| +// isolatedjobtest: |
| +type Harness struct { |
| + Runner isolatedjob.Runner |
| + Image isolatedjob.ImageDigest |
| + Settle func(ctx context.Context, ref isolatedjob.Ref, want func(isolatedjob.State) bool) (isolatedjob.Job, error) |
| +} |
| +func Contract(t *testing.T, h Harness) |
| +``` |
| + |
| +Fake limits match the spike: `MaxLifetime` 8 h, `SuspendUsesLifetime` true, `ConnectionsSurvive` false. |
| + |
| +- [ ] **Red:** `Contract` subtests: `LaunchIdempotentOnAttempt` (same spec twice gives one Ref and one VM in `List`); `ChangedSpecConflicts` (same AttemptID, other size gives `ErrConflict`); `StopTwice` and `StopUnknownRef` both nil; `GetAfterStop` gives a terminal state or `ErrNotFound`; `SuspendResumeRoundTrip`; `OversizeBootstrapRefusedBeforeProvider`; `LimitsAreSane`. `TestFakeContract` runs `Contract` on the fake. `TestFakeFaults`: `FaultLostReply` on Launch leaves a VM and returns an error; `FaultIncompleteList` returns `ErrIncomplete` with no jobs; `Tick` stops a VM at launch plus MaxLifetime whether it was suspended or not. |
| +- [ ] **Implement** the fake (mutex-guarded maps, deterministic Refs `fake-1`, `fake-2`). |
| +- [ ] **Green:** `go test ./internal/isolatedjob/... -run 'TestFake' -count=1`. |
| +- [ ] **Mutations:** key idempotency on Ref instead of AttemptID; `LaunchIdempotentOnAttempt` fails. Exclude suspended time in `Tick`; `TestFakeFaults` fails. Restore. |
| +- [ ] **Commit:** `isolatedjob: in-memory fake and adapter contract suite`. |
| + |
| +### Task 6: AWS adapter |
| + |
| +**Files:** Create `internal/isolatedjob/awsjob/{runner.go,images.go,network.go,errors.go,runner_test.go,network_test.go,live_test.go}`, `internal/isolatedjob/providerguard_test.go`. Modify `go.mod`, `go.sum`. |
| + |
| +**Interfaces:** Consumes Task 4. Produces: |
| + |
| +```go |
| +type Config struct { |
| + Region string // "eu-west-1" |
| + ConnectorID string // the VPC connector, the only egress |
| + ImageVersions map[isolatedjob.ImageDigest]string // filled by Registry |
| + ProxyAndResolver []netip.AddrPort |
| + VPCID, VMSubnetID, VMSecurityGroupID string |
| +} |
| +type API interface { /* the six MicroVM operations, image build and status, and the four EC2 Describe calls the audit needs, in SDK input/output types */ } |
| +func New(cfg Config, api API) (*Runner, error) // refuses an empty field |
| +func NewRegistry(cfg Config, api API) (*Registry, error) |
| +``` |
| + |
| +- [ ] **Step 1, decide the client:** check whether aws-sdk-go-v2 publishes a MicroVM service package (`go list -m -versions github.com/aws/aws-sdk-go-v2/service/...` for the service the spike's `run-microvm` CLI command belongs to). If it does, use it. If not, write the six calls against the documented HTTP API with `github.com/aws/aws-sdk-go-v2/aws/signer/v4`, inside this package only. Record the choice, the hook transport and the client-token idempotency window from AWS's documentation in the package comment (open question 1). |
| +- [ ] **Red:** `TestRunRequestShape` against a recording `API` stub: ingress `NO_INGRESS`; egress only `ConnectorID`; no execution role field set; no idle policy; maximum duration equals `MaxLifetime` seconds; architecture x86_64; `additionalOsCapabilities` exactly `["ALL"]` (on the launch or the image version, wherever the API takes it); memory 2048 or 4096 by size; client token equals AttemptID; payload equals Bootstrap byte for byte; image is the registered version for the digest (unregistered digest gives `ErrInvalid`, so a suspended VM's snapshot can never be a launch source). `TestStateMapping` table from every provider state to `isolatedjob.State` (an unknown provider state maps to `failed`, never to a live state). `TestErrorMapping`: throttling to `ErrThrottled`, idempotency mismatch to `ErrConflict`, not found to `ErrNotFound`. `TestListAllPages`: three pages concatenate; an error on page two returns `ErrIncomplete` and no jobs. `TestAuditNetwork`: VPC `enableDnsSupport` true, a security-group egress rule beyond proxy and resolver, any ingress rule, or a `0.0.0.0/0` or `::/0` route on the VM subnet each fail `NetworkAudit.OK`. `TestProviderTypesStayInAdapter` (in `internal/isolatedjob`): `go list -deps` of `./cmd/equipo`, `./cmd/equipo-runner`, `./internal/hostedctl/...`, `./internal/egressproxy/...` contains no `github.com/aws/` path and no `internal/isolatedjob/awsjob`. |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/isolatedjob/... -run 'TestRunRequestShape|TestStateMapping|TestErrorMapping|TestListAllPages|TestAuditNetwork|TestProviderTypesStayInAdapter' -count=1`; `make build vet govulncheck`. |
| +- [ ] **Mutations:** set an execution role; `TestRunRequestShape` fails. Set an idle policy; it fails. Drop the capabilities field; it fails. Map an unknown state to `running`; `TestStateMapping` fails. Return partial pages; `TestListAllPages` fails. Import `awsjob` from `internal/hostedctl`; the guard fails. Restore each. |
| +- [ ] **Live (agent, `kass`, under $1):** `live_test.go` (`//go:build hostedlive`) runs `Contract` against a throwaway image and a pre-existing dev connector, then lists and confirms no VM it launched remains. Run once with `AWS_PROFILE=kass go test -tags hostedlive ./internal/isolatedjob/awsjob -run TestLiveContract -count=1` after Task 31's network exists, not before. Record output and teardown proof. |
| +- [ ] **Commit:** `isolatedjob: AWS MicroVM adapter behind the runner interface`. |
| + |
| +--- |
| + |
| +## Phase C: the controller (spec §2 controller, §3, §10 leaked VMs) |
| + |
| +### Task 7: Signed requests and responses (`hostedwire`) |
| + |
| +**Files:** Create `internal/hostedwire/{sign.go,verify.go,types.go,sign_test.go}`. |
| + |
| +**Interfaces (produces):** |
| + |
| +```go |
| +type KeyID string |
| +type Role string // RoleInstance, RoleOperator, RoleProxy |
| +func SignRequest(r *http.Request, body []byte, id KeyID, key ed25519.PrivateKey, now time.Time, nonce string) error |
| +type NonceStore interface{ Remember(ctx context.Context, id KeyID, nonce string, until time.Time) (fresh bool, err error) } |
| +type Verifier struct { |
| + Keys map[KeyID]VerifyKey // VerifyKey{Public ed25519.PublicKey; Role Role} |
| + Nonces NonceStore |
| + Now func() time.Time |
| +} |
| +func (v *Verifier) Verify(r *http.Request, body []byte) (KeyID, Role, error) |
| +func SignResponse(h http.Header, status int, requestNonce string, body []byte, key ed25519.PrivateKey) |
| +func VerifyResponse(resp *http.Response, body []byte, requestNonce string, pub ed25519.PublicKey) error |
| +const MaxBody = 1 << 20 |
| +``` |
| + |
| +Headers `Equipo-Key-Id`, `Equipo-Timestamp` (Unix seconds), `Equipo-Nonce` (32 hex), `Equipo-Signature` (base64). The request message is `"equipo-hosted-request-v1\n" + method + "\n" + escaped path and raw query + "\n" + timestamp + "\n" + nonce + "\n" + hex(sha256(body))`; the response message is `"equipo-hosted-response-v1\n" + status + "\n" + request nonce + "\n" + hex(sha256(body))`. Skew limit 60 s; nonces kept 10 minutes. |
| + |
| +- [ ] **Red:** `TestSignedRequestRoundTrip`; `TestSignatureCoversEveryField` (changed method, path, query, timestamp, nonce or body each fail); `TestSkewRefused` (61 s either way); `TestNonceReplayRefused`; `TestUnknownKeyRefused`; `TestNonceStoreErrorDenies`; `TestResponseBoundToRequestNonce` (a valid response replayed for another request fails); `TestOversizeBodyRefused`. |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/hostedwire -count=1`. |
| +- [ ] **Mutations:** drop the body hash from the message; `TestSignatureCoversEveryField` fails. Skip `Remember`; `TestNonceReplayRefused` fails. Treat a store error as fresh; `TestNonceStoreErrorDenies` fails. Restore. |
| +- [ ] **Commit:** `hostedwire: signed requests and responses for the controller`. |
| + |
| +### Task 8: Controller store |
| + |
| +**Files:** Create `internal/hostedctl/{store.go,schema/0001_jobs.sql,store_test.go}`. |
| + |
| +**Interfaces (produces):** `Open(ctx, path string, clock isolatedjob.Clock) (*Store, error)` (one writer connection, WAL, schema version table, refuses a newer schema); `(*Store) Tx(ctx, fn func(*sql.Tx) error) error`; `(*Store) Close() error`; `(*Store).Remember` implements `hostedwire.NonceStore`; `appendAudit(tx *sql.Tx, a Audit) error` with `Audit{Actor hostedwire.KeyID; Account, Task, Attempt, Action, Reason string}`; `(*Store) Now() time.Time` returns the larger of the clock and a persisted high-water mark. |
| + |
| +Tables: `jobs` (attempt_id primary key; launch_id unique; task_id, account_id, purpose `job` or `certification`, replaces_attempt; request_json and request_sha256, the exact `LaunchSpec`; proxy_code_sha256, proxy_code_expires_at, proxy_code_used_at; vm_ref unique nullable; state; image_digest, certificate_digest; launched_at, deadline, drain_at, stop_at; epoch, resume_operation_id; pause_generation, pause_started_at, pause_quiescent, pause_cancelled; stop_requested_at, stop_reason, stop_proof_json; revision), `unmatched_vms` (vm_ref, first_seen_at), `certificates` (image_digest, digest, payload, signature, stored_at), `nonces`, `audit`, `clock` (high-water), `feed` (revision counter). |
| + |
| +- [ ] **Red:** `TestStoreMigratesTwice` (second open applies nothing); `TestStoreRefusesNewerSchema`; `TestAuditRollsBackWithTx`; `TestHighWaterNeverMovesBack` (clock set back one hour, `Now` stays at the high-water mark); `TestOneWriterConnection`. |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/hostedctl -run 'TestStore|TestAudit|TestHighWater|TestOneWriter' -count=1`. |
| +- [ ] **Mutations:** write audit outside the transaction; `TestAuditRollsBackWithTx` fails. Return the raw clock from `Now`; `TestHighWaterNeverMovesBack` fails. Restore. |
| +- [ ] **Commit:** `hostedctl: job table, audit and clock high-water store`. |
| + |
| +### Task 9: Egress policy model |
| + |
| +**Files:** Create `internal/egresspolicy/{names.go,policy.go,policy_test.go}`. |
| + |
| +**Interfaces (produces):** |
| + |
| +```go |
| +type ServiceNames struct{ Instance, Gateway, Mirror string } // exact FQDN, or None; "" is unset |
| +const None = "none" |
| +var ErrUnset, ErrDeniedName, ErrBadName error |
| +func ParseServiceNames(in ServiceNames) (ServiceNames, error) // lower-cases, strips one trailing dot, IDNA to ASCII |
| +type Purpose string // PurposeJob, PurposeCertification |
| +type Policy struct { |
| + Version string // "hosted-egress-1" |
| + Services ServiceNames |
| + ReportHost string // controller host for certification reports |
| +} |
| +type Request struct{ Host, Method, Path string; WebSocket bool; Purpose Purpose } |
| +type Decision struct{ Allowed bool; Service, PathClass, Reason string } |
| +func Compile(p Policy) (*Rules, error) |
| +func (r *Rules) Decide(q Request) Decision |
| +func (r *Rules) Hosts(p Purpose) []string // exact names the resolver answers |
| +func Digest(p Policy) string // sha256 of canonical JSON |
| +``` |
| + |
| +Path classes for `hosted-egress-1`: |
| + |
| +| Service | Method | Path | WebSocket | |
| +| --- | --- | --- | --- | |
| +| instance | GET | `/healthz` | no | |
| +| instance | POST | `/api/hosted/enrol` | no | |
| +| instance | GET | `/api/runner/stream` | required | |
| +| instance | GET, POST | `/api/runner/v2/` prefix, `/api/runner/protocol` | no | |
| +| mirror | GET, HEAD | `/v1/objects/sha256/{64 hex}` | no | |
| +| report (certification purpose only) | POST | `/v1/certification/report` | no | |
| + |
| +A gateway name other than `none` is a `Compile` error in this version (no model work). Paths are matched raw: percent-encoded `/`, `.` or `%`, dot segments, `//`, a query on the mirror class, or a fragment are refused before matching. |
| + |
| +- [ ] **Red:** `TestServiceNamesRefuse` table: `*.example.com`, `.example.com`, an IPv4 or IPv6 literal, `host:443`, userinfo, every denied registry name and `amadan.net`, an empty label. `TestServiceNameNormalisation`: `Instance.Example.` equals `instance.example`; a punycode name equals its Unicode form; `instance.example.evil` never equals `instance.example`. `TestUnsetBlocks` (any "" gives `ErrUnset`). `TestNoneDeniesService`. `TestPathClasses` table covering every row above and its near misses (`/api/runner/stream` without upgrade, `/api/runner/v2/../x`, `%2e%2e`, `%2F`, `PUT` on the mirror, a mirror query string). `TestGatewayRefusedInThisVersion`. `TestReportRouteOnlyForCertification`. `TestDigestCoversEveryField`. |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/egresspolicy -count=1`. |
| +- [ ] **Mutations:** allow a suffix match; the `.evil` row fails. Decode the path before matching; the `%2F` row fails. Allow the report route for jobs; its test fails. Restore. |
| +- [ ] **Commit:** `egresspolicy: exact service names and path classes`. |
| + |
| +### Task 10: Image certificate format and verification |
| + |
| +**Files:** Create `internal/hostedcert/{certificate.go,certificate_test.go}`. |
| + |
| +**Interfaces:** Consumes `egresspolicy.ServiceNames`, `egresspolicy.Digest`, `isolatedjob.ImageDigest`. Produces: |
| + |
| +```go |
| +type Certificate struct { |
| + Version int // 1 |
| + Image isolatedjob.ImageDigest |
| + RunnerDigest string // sha256 of the runner binary in the image |
| + SandboxPolicyDigest string // containment LauncherVersion and launch policy hash |
| + ProxyPolicyVersion string |
| + ProxyPolicyDigest string // egresspolicy.Digest without ReportHost |
| + Services egresspolicy.ServiceNames |
| + MirrorConfigDigest string // "none" while Mirror is none |
| + Containment SuiteResult // Total, Passed int; Failed, Skipped []string |
| + Matrix []MatrixRow // Name, Actor, Expected, Observed string |
| + Network isolatedjob.NetworkAudit |
| + ReportDigest string |
| + IssuedAt time.Time |
| + KeyID string |
| +} |
| +type Signed struct{ Payload, Signature []byte } |
| +type Expectation struct { |
| + Image isolatedjob.ImageDigest |
| + RunnerDigest, SandboxPolicyDigest, ProxyPolicyDigest, MirrorConfigDigest string |
| + Services egresspolicy.ServiceNames |
| + ContainmentTotal int // from the image manifest (Task 26) |
| + AllowedSkips []string // exactly {"TestNamespaceCgroupMoveKeepsMembership"} |
| + MatrixRows []string // every row name of Task 27 |
| +} |
| +func Sign(c Certificate, id string, key ed25519.PrivateKey) (Signed, error) |
| +func Verify(s Signed, keys map[string]ed25519.PublicKey, want Expectation) (Certificate, string /*digest*/, error) |
| +``` |
| + |
| +- [ ] **Red:** `TestCertificateVerifies`; `TestCertificateRefusesEachMismatch` (one row per Expectation field); `TestCertificateRefusesFailures` (one failed test, an extra skip, a missing matrix row, a row whose Observed differs from Expected, a failing NetworkAudit, Total below the manifest count); `TestCertificateRefusesBadSignatureAndUnknownKey`; `TestCertificateRefusesUnknownFields` (strict decoding). |
| +- [ ] **Implement.** The digest is sha256 of `Payload`. |
| +- [ ] **Green:** `go test ./internal/hostedcert -count=1`. |
| +- [ ] **Mutations:** skip the Skipped comparison; the extra-skip row fails. Skip the Services comparison; its row fails. Restore. |
| +- [ ] **Commit:** `hostedcert: signed image certificate and verification`. |
| + |
| +### Task 11: Bootstrap payload and proxy credentials |
| + |
| +**Files:** Create `internal/hostedctl/{bootstrap.go,credential.go,credential_test.go}`, `internal/hostedwire/identity.go`. |
| + |
| +**Interfaces (produces):** |
| + |
| +```go |
| +type Bootstrap struct { // JSON, the LaunchSpec.Bootstrap bytes |
| + Version int |
| + LaunchID string |
| + Purpose egresspolicy.Purpose |
| + ProxyCode string // controller-minted, single use, 2 minutes |
| + InstanceCode string // opaque, from the instance; empty for certification |
| +} |
| +type CA struct{ /* Ed25519 x509 CA, key loaded from a 0600 file */ } |
| +func LoadCA(path string) (*CA, error) |
| +func (*Controller) Redeem(ctx context.Context, r RedeemRequest) (certDER []byte, err error) |
| +// RedeemRequest{LaunchID, VMRef, ProxyCode string; PublicKey ed25519.PublicKey} |
| +func (*Controller) Renew(ctx context.Context, presented *x509.Certificate, pub ed25519.PublicKey) ([]byte, error) |
| +// in hostedwire, so the proxy never imports the controller: |
| +func hostedwire.ParseIdentity(c *x509.Certificate) (hostedwire.Identity, error) |
| +// Identity{LaunchID, AttemptID, VMRef string; Epoch int64}; URI SAN |
| +// equipo-hosted://launch/<launch>/attempt/<attempt>/vm/<vm>/epoch/<n> |
| +const CredentialLifetime = 15 * time.Minute |
| +``` |
| + |
| +- [ ] **Red:** `TestRedeemSingleUse`; `TestRedeemWrongVMRefused` (VMRef differs from the job's saved ref); `TestRedeemExpiredCode` (2 minutes and 1 second after the provider call returned); `TestRedeemAfterStopRequested`; `TestRedeemStoresOnlyCodeHash`; `TestRenewKeepsIdentityAndEpoch`; `TestRenewRefusedAfterEpochChange`; `TestIdentityRoundTrip`; `TestBootstrapFitsLimit` (a maximal payload is under the fake's `MaxBootstrapBytes`). |
| +- [ ] **Implement.** Redeem and Renew run in one store transaction each and append audit. |
| +- [ ] **Green:** `go test ./internal/hostedctl -run 'TestRedeem|TestRenew|TestIdentity|TestBootstrap' -count=1`. |
| +- [ ] **Mutations:** skip the used-at check; `TestRedeemSingleUse` fails. Skip the VM comparison; `TestRedeemWrongVMRefused` fails. Restore. |
| +- [ ] **Commit:** `hostedctl: bootstrap codes and short-lived proxy credentials`. |
| + |
| +### Task 12: Launch with intent replay and admission gates |
| + |
| +**Files:** Create `internal/hostedctl/{controller.go,launch.go,launch_test.go}`. |
| + |
| +**Interfaces:** Consumes Tasks 4, 8 to 11. Produces: |
| + |
| +```go |
| +type Config struct { |
| + Enabled bool // EQUIPO_HOSTED_ENABLED=1 |
| + Policy egresspolicy.Policy |
| + Expect func(isolatedjob.ImageDigest) (hostedcert.Expectation, error) |
| + CertificateKeys map[string]ed25519.PublicKey |
| + AuditMaxAge time.Duration // 5 minutes |
| +} |
| +func New(cfg Config, s *Store, r isolatedjob.Runner, a isolatedjob.NetworkAuditor, ca *CA) (*Controller, error) |
| +type LaunchRequest struct { |
| + AttemptID, TaskID, Account, Replaces string |
| + Image isolatedjob.ImageDigest |
| + Size isolatedjob.Size |
| + MaxLifetime time.Duration // default 8 h |
| + InstanceCode []byte |
| + Purpose egresspolicy.Purpose |
| +} |
| +type JobView struct{ AttemptID, LaunchID, State string; VMRef isolatedjob.Ref; Deadline, DrainAt, StopAt time.Time; Epoch int64; CertificateDigest string } |
| +func (*Controller) Launch(ctx context.Context, actor hostedwire.KeyID, role hostedwire.Role, q LaunchRequest) (JobView, error) |
| +func (*Controller) Replay(ctx context.Context) error |
| +func Deadlines(launched time.Time, max time.Duration) (deadline, drainAt, stopAt time.Time) |
| +// deadline = launched+max; drainAt = deadline-45m; stopAt = deadline-10m; both clamped to launched |
| +var ErrDisabled, ErrUncertified, ErrNetworkAudit, ErrReplacementLive error |
| +``` |
| + |
| +Order inside `Launch`: refuse unless enabled; parse service names (unset refuses); certification purpose requires `RoleOperator` and a registered image, a job requires `RoleInstance` and a stored certificate that verifies against the current Expectation; require a passing network audit no older than `AuditMaxAge`; a `Replaces` attempt must have stop proof; then transaction 1 saves the intent (exact `LaunchSpec` bytes, hash, deadlines, certificate digest, proxy code hash) or returns the existing job when the request hash matches (`ErrConflict` when it differs); then `Runner.Launch`; then transaction 2 saves the Ref and state `starting`. `ErrThrottled` leaves the intent in state `waiting` for `Replay`. |
| + |
| +- [ ] **Red:** `TestLaunchSavesIntentBeforeProvider` (the Runner stub reads the store during its call and finds the intent); `TestLaunchIdempotentOnAttempt`; `TestLaunchConflictOnChangedRequest`; `TestConcurrentLaunchSameAttempt` (20 goroutines, one VM, one intent); `TestCrashBetweenLaunchAndSave` (`FaultLostReply`, reopen the store, `Replay`, exactly one VM and the Ref saved); `TestLaunchRefusals` table (disabled, unset name, uncertified image, certificate for other services, stale or failing audit, job purpose from operator, certification from instance, live replaced attempt); `TestLaunchRecordsCertificateDigest`; `TestThrottleWaitsThenReplays`; `TestDeadlines` (8 h gives 7 h 15 and 7 h 50; 15 min gives 0 and 5 min). |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/hostedctl -run 'TestLaunch|TestConcurrentLaunch|TestCrashBetween|TestThrottle|TestDeadlines' -count=1`. |
| +- [ ] **Mutations:** save the intent after the provider call; `TestCrashBetweenLaunchAndSave` fails. Skip certificate verification; `TestLaunchRefusals` fails. Skip the Replaces check; it fails. Restore. |
| +- [ ] **Commit:** `hostedctl: launch intents, replay and certified admission`. |
| + |
| +### Task 13: Get, stop and stop proof |
| + |
| +**Files:** Create `internal/hostedctl/{stop.go,stop_test.go}`. |
| + |
| +**Interfaces (produces):** `(*Controller) Get(ctx, attemptID) (JobView, error)`; `(*Controller) Stop(ctx, actor, attemptID, reason string) (StopProof, error)` with `StopProof{AttemptID string; VMRef isolatedjob.Ref; State isolatedjob.State; ObservedAt time.Time}`; `ErrStopPending`. Stop first records `stop_requested_at` and bumps the feed revision (proxy access ends, Task 21), then calls `Runner.Stop`, then `Runner.Get`; proof exists only for a terminal state or `ErrNotFound` after the stop request. `(*Controller) Refresh(ctx) error` reconciles live jobs with `Get`. |
| + |
| +- [ ] **Red:** `TestStopRevokesBeforeProvider` (the feed shows the launch revoked when the Runner stub's Stop runs); `TestStopProofNeedsTerminalState` (a `stopping` VM gives `ErrStopPending`); `TestLostStopReplyRetries` (`FaultLostReply` on Stop, a second Stop gives proof, one provider stop applied); `TestStopOfGoneVMSucceeds`; `TestRestartFindsVMGone` (review focus 1: the fake expires the VM while the controller is closed; after reopen, `Refresh` records proof and revokes). |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/hostedctl -run 'TestStop|TestLostStop|TestRestartFindsVMGone' -count=1`. |
| +- [ ] **Mutations:** call the provider before recording the stop request; `TestStopRevokesBeforeProvider` fails. Accept `stopping` as proof; `TestStopProofNeedsTerminalState` fails. Restore. |
| +- [ ] **Commit:** `hostedctl: stop with revocation first and terminal proof`. |
| + |
| +### Task 14: Pause barrier and resume epochs (controller half) |
| + |
| +**Files:** Create `internal/hostedctl/{pause.go,pause_test.go}`. |
| + |
| +**Interfaces (produces):** `Drain(ctx, attemptID) (generation int64, error)`; `Quiescent(ctx, attemptID string, generation int64) error`; `Suspend(ctx, attemptID string, generation int64) error`; `Reopen(ctx, attemptID string, generation int64) error`; `Resume(ctx, attemptID, operationID string) (epoch int64, error)`; `ErrGenerationCancelled`, `ErrNotQuiescent`, `ErrPastDeadline`. `PauseAckTimeout = 2 * time.Minute`. The instance owns admission (slice 2); the controller owns the generation, the acknowledgement and the epoch. |
| + |
| +- [ ] **Red:** `TestSuspendNeedsCurrentAck` (no ack, ack for an older generation, ack for a cancelled generation each refuse); `TestLateAckIgnored` (ack at 2 min 1 s gives `ErrGenerationCancelled` and Suspend refuses); `TestResumeRaisesEpochOnce` (same operation ID twice gives the same epoch; a new ID raises it again); `TestResumeRevokesOldEpoch` (a credential minted before resume is refused by `Renew` and by the feed); `TestResumePastDeadlineRefused`; `TestSuspendedTimeCountsToDeadline`. |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/hostedctl -run 'TestSuspend|TestLateAck|TestResume' -count=1`. |
| +- [ ] **Mutations:** compare generations with `>=`; `TestSuspendNeedsCurrentAck` fails. Raise the epoch on every Resume call; `TestResumeRaisesEpochOnce` fails. Restore. |
| +- [ ] **Commit:** `hostedctl: pause generations and resume epochs`. |
| + |
| +### Task 15: Reaper, deadlines and the network audit loop |
| + |
| +**Files:** Create `internal/hostedctl/{reaper.go,reaper_test.go}`. |
| + |
| +**Interfaces (produces):** `(*Controller) Reap(ctx) (ReapReport, error)` with `ReapReport{Skipped bool; Replayed, Drained, Stopped, OrphansSeen, OrphansStopped int}`; `(*Controller) Loop(ctx, every time.Duration)` running `Replay`, `Refresh`, `Reap` and the network audit; `ReapInterval = 60 * time.Second`; `OrphanGrace = 10 * time.Minute`. |
| + |
| +Pass order: replay live intents; `List`, and skip on `ErrIncomplete`; for each listed VM without a job row, record `first_seen_at` (store time, Task 8) and, once `OrphanGrace` has passed, recheck ownership (replay again, re-read the table, `List` again) before `Stop`; mark jobs past `drain_at` as draining (visible in `JobView`); stop jobs past `stop_at`. A failing audit refuses launches until it passes and raises an alert (Task 18). |
| + |
| +- [ ] **Red:** `TestReapSkipsIncompleteList`; `TestReapReplaysIntentFirst` (a VM whose Ref is not yet saved is claimed by replay, not stopped); `TestReapStopsOrphanAfterTenMinutes` (9 min 59 s no, 10 min yes); `TestReapRechecksOwnership` (a job row appears between the two Lists; no stop); `TestReapDrainsThenStops` (7 h 15 and 7 h 50); `TestDeadlinesIgnoreClockRollback` (review focus 2); `TestFailingAuditBlocksLaunch`. |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/hostedctl -run 'TestReap|TestDeadlinesIgnore|TestFailingAudit' -count=1`. |
| +- [ ] **Mutations:** reap on an incomplete List; `TestReapSkipsIncompleteList` fails. Drop the recheck; `TestReapRechecksOwnership` fails. Use the raw clock; `TestDeadlinesIgnoreClockRollback` fails. Restore. |
| +- [ ] **Commit:** `hostedctl: leaked-VM reaper, deadlines and network audit loop`. |
| + |
| +### Task 16: Lifecycle simulation with invariants (spec §14) |
| + |
| +**Files:** Create `internal/hostedctl/{sim_test.go,sim_model_test.go}`. |
| + |
| +**Interfaces:** Consumes Tasks 5, 11 to 15. Produces `TestLifecycleSimulation`, 200 seeds by default inside the 10 s budget, `EQUIPO_SIM_SEEDS=n` for longer runs; a failing seed prints its seed and step log. |
| + |
| +Operations, chosen at random per step: launch (fresh or replacement), concurrent duplicate launch, crash and reopen the controller, lost reply on Launch or Stop, throttle, incomplete List, drain, acknowledge (current, stale or late), suspend, resume (new or repeated operation ID), stop, redeem and renew a credential, a proxy authorisation check with a random held credential, plant an orphan, advance the clock by up to 9 h, reaper tick. The fake's own lifetime backstop is off, so the controller alone must hold the deadline. |
| + |
| +Invariants, checked after every step: |
| + |
| +| ID | Invariant | Mutation that must break it | |
| +| --- | --- | --- | |
| +| I1 | At most one live VM per attempt ID | Save the intent after the provider call | |
| +| I2 | No proxy authorisation succeeds for an epoch other than the current one, or for a stopped, stop-requested or suspended launch | Skip the epoch comparison in the feed | |
| +| I3 | No VM is live after its job's `stop_at` plus one reaper interval | Reap only at `deadline` | |
| +| I4 | A provider Suspend happens only with an acknowledgement for the current, uncancelled generation | Accept late acknowledgements | |
| +| I5 | Every listed VM is a job's Ref, a live intent's, or an orphan stopped within 10 min plus one interval | Stop orphans on first sight (breaks I1 via replay) or never (breaks I5) | |
| +| I6 | A replacement launches only after its predecessor's stop proof | Skip the Replaces check | |
| +| I7 | A proxy code is redeemed at most once, and only for its own VM | Skip the used-at check | |
| + |
| +- [ ] **Red:** write the model and invariants; run with the Task 12 to 15 code present. Each mutation in the table, applied alone, must fail within the default seeds. |
| +- [ ] **Green:** `go test ./internal/hostedctl -run TestLifecycleSimulation -count=1`, then once with `EQUIPO_SIM_SEEDS=5000`. |
| +- [ ] **Commit:** `hostedctl: randomised lifecycle simulation with invariants`. |
| + |
| +Slice 2 extends this model with the instance's two invariants: nothing starts while draining, and only one attempt publishes. |
| + |
| +### Task 17: Controller HTTP API and command |
| + |
| +**Files:** Create `internal/hostedctl/{http.go,http_test.go}`, `cmd/equipo-hosted-controller/{main.go,config.go,config_test.go}`. |
| + |
| +**Interfaces:** Consumes Tasks 7 to 15 and `awsjob`. Produces routes (JSON, strict decoding, `hostedwire.MaxBody`, every response signed): |
| + |
| +| Route | Role | |
| +| --- | --- | |
| +| `POST /v1/jobs` | instance (job), operator (certification) | |
| +| `GET /v1/jobs/{attempt}` | instance, operator | |
| +| `POST /v1/jobs/{attempt}/stop`, `/drain`, `/quiescent`, `/suspend`, `/reopen`, `/resume` | instance | |
| +| `GET /v1/vms` | operator | |
| +| `PUT /v1/certificates/{image}`, `GET /v1/certifications/{attempt}/report` | operator | |
| +| `GET /v1/feed?after=n` (long poll, 25 s) | proxy | |
| +| `POST /v1/credentials/redeem`, `/renew`, `POST /v1/certification/report` | proxy, forwarding for a VM | |
| + |
| +An instance key may act only on jobs it created. Configuration comes from a file named by `-config`: listen address (required, no default), TLS certificate and key, database path, CA key path, signing key path, verify keys with roles, certificate keys, service names, policy version, region and network IDs. `Enabled` comes only from `EQUIPO_HOSTED_ENABLED=1`. |
| + |
| +- [ ] **Red:** `TestRoutesEnforceRoles` (each route with each wrong role is 403 and audited); `TestInstanceKeySeesOnlyItsJobs`; `TestUnknownFieldsRefused`; `TestResponsesSigned`; `TestConfigRefusesMissingListenOrKeys`; `TestDisabledRefusesLaunchButServesStop` (stop and get keep working with the flag off, so a switched-off controller can still clean up). |
| +- [ ] **Implement.** `main` wires `awsjob` only here. |
| +- [ ] **Green:** `go test ./internal/hostedctl ./cmd/equipo-hosted-controller -run 'TestRoutes|TestInstanceKey|TestUnknownFields|TestResponsesSigned|TestConfig|TestDisabled' -count=1`; `make build vet`. |
| +- [ ] **Mutations:** drop the role check on `/stop`; `TestRoutesEnforceRoles` fails. Drop the creator check; `TestInstanceKeySeesOnlyItsJobs` fails. Restore. |
| +- [ ] **Commit:** `hosted controller: signed HTTPS API and command`. |
| + |
| +### Task 18: Metrics and alerts |
| + |
| +**Files:** Create `internal/hostedctl/{metrics.go,alerts.go,metrics_test.go}`, `internal/isolatedjob/awsjob/alerts.go`. |
| + |
| +**Interfaces (produces):** `Alerter interface{ Alert(ctx context.Context, a Alert) error }`, `Alert{Kind, Detail string; At time.Time}`, kinds `leaked_vm`, `network_audit_failed` (covers VPC DNS switched on), `no_healthy_proxy` (no proxy has polled the feed for 2 minutes); `MetricsHandler()` serving text counters on a separate listener (loopback in tests): jobs by state, launches, launch errors by kind, orphans stopped, credential renewals and failures, audit status. `awsjob.SNSAlerter` publishes to one topic. Daily-spend alerts and VM-hour cost wait for slice 3. |
| + |
| +- [ ] **Red:** `TestOrphanStopRaisesLeakAlert`; `TestAuditFailureAlertsOnce` (not every tick); `TestNoHealthyProxyAlert`; `TestMetricsCountJobsByState`; `TestAlertCarriesNoSecrets` (no code, credential or bootstrap bytes in Detail). |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/hostedctl -run 'TestOrphanStopRaises|TestAuditFailureAlerts|TestNoHealthyProxy|TestMetrics|TestAlertCarries' -count=1`. |
| +- [ ] **Mutation:** alert on every failing tick; `TestAuditFailureAlertsOnce` fails. Restore. |
| +- [ ] **Commit:** `hostedctl: lifecycle metrics and leak, audit and proxy alerts`. |
| + |
| +### Task 19: Instance-side controller client (flag off, no callers) |
| + |
| +**Files:** Create `internal/hostedclient/{client.go,client_test.go}`. |
| + |
| +**Interfaces (produces):** `New(cfg Config) (*Client, error)` where `Config{BaseURL string; KeyID hostedwire.KeyID; Key ed25519.PrivateKey; ControllerKey ed25519.PublicKey; HTTP *http.Client}`; refuses unless `EQUIPO_HOSTED_RUNNERS=1`; methods `Launch`, `Get`, `Stop`, `Drain`, `Quiescent`, `Suspend`, `Reopen`, `Resume` with the Task 17 request and response types, each verifying the response signature against its own request nonce. |
| + |
| +- [ ] **Red:** `TestClientAgainstController` (an `httptest` TLS server with the real handler, fake runner and test certificate: launch, get, stop with proof); `TestClientRefusesUnsignedResponse`; `TestClientRefusesWithoutFlag`; `TestInstanceDoesNotCallHostedClient` (`go list -deps ./cmd/equipo` has no `internal/hostedclient` in this slice; slice 2 deletes this test when it wires the client). |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/hostedclient -count=1`. |
| +- [ ] **Mutation:** skip response verification; `TestClientRefusesUnsignedResponse` fails. Restore. |
| +- [ ] **Commit:** `hostedclient: signed controller client behind a flag`. |
| + |
| +--- |
| + |
| +## Phase D: the egress stack (spec §6) |
| + |
| +### Task 20: Proxy listener, client authentication and the launch-state feed |
| + |
| +**Files:** Create `internal/egressproxy/{server.go,auth.go,feed.go,auth_test.go,feed_test.go}`. |
| + |
| +**Interfaces:** Consumes `egresspolicy` and `hostedwire` (including `ParseIdentity`), never `hostedctl`. Produces: |
| + |
| +```go |
| +type Server struct { |
| + Rules *egresspolicy.Rules |
| + ClientCA *x509.CertPool // the controller CA |
| + InterceptCA *ecdsa.PrivateKey // signs per-host leaves; trusted only by the runner's dialer |
| + Feed *Feed |
| + Upstream Upstream // Task 22 |
| + Log DecisionLog |
| + Now func() time.Time |
| +} |
| +func (*Server) Serve(ctx context.Context, l net.Listener) error // TLS 1.3, client certificate required |
| +type Feed struct{ /* polls GET /v1/feed with a proxy key; holds launch state */ } |
| +func (*Feed) Allow(id hostedwire.Identity) (Launch, error) // denies everything when the last good poll is older than 30 s |
| +``` |
| + |
| +The proxy also serves two local, unauthenticated-by-certificate routes that forward to the controller: `POST /v1/credentials/redeem` (body carries the bootstrap proxy code) and, with a valid certificate, `POST /v1/credentials/renew`. |
| + |
| +- [ ] **Red:** `TestProxyRefusesClientCerts` table: none, expired, other CA, unparseable identity, an epoch below the feed's, a stopped or stop-requested launch, a VM ref that differs from the feed's (a certificate replayed from another VM); `TestStaleFeedDeniesAll`; `TestFeedVerifiesControllerSignature`; `TestRedeemForwardsOnlyTheRedeemShape`. |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/egressproxy -run 'TestProxyRefusesClientCerts|TestStaleFeed|TestFeedVerifies|TestRedeemForwards' -count=1`. |
| +- [ ] **Mutations:** skip the epoch comparison; its row fails. Ignore feed age; `TestStaleFeedDeniesAll` fails. Restore. |
| +- [ ] **Commit:** `egressproxy: certificate-bound clients and launch-state feed`. |
| + |
| +### Task 21: Revocation of open tunnels |
| + |
| +**Files:** Modify `internal/egressproxy/server.go`; create `internal/egressproxy/revoke_test.go`. |
| + |
| +**Interfaces:** Produces `(*Server) revoke(launchID string)` driven by feed changes; every open tunnel is registered by launch and epoch. |
| + |
| +- [ ] **Red:** `TestRevocationClosesOpenTunnels` (review focus 3: an open WebSocket through the proxy is closed within one feed poll of stop, and of an epoch change); `TestUnrelatedTunnelsSurvive`. |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/egressproxy -run 'TestRevocation|TestUnrelated' -count=1`. |
| +- [ ] **Mutation:** check revocation only on new requests; `TestRevocationClosesOpenTunnels` fails. Restore. |
| +- [ ] **Commit:** `egressproxy: close open tunnels on stop and epoch change`. |
| + |
| +### Task 22: CONNECT inspection, origin TLS and decision logs |
| + |
| +**Files:** Create `internal/egressproxy/{connect.go,inspect.go,upstream.go,log.go,inspect_test.go,log_test.go}`. |
| + |
| +**Interfaces (produces):** `Upstream interface{ Dial(ctx context.Context, host string) (net.Conn, error) }` with `NewUpstream(resolver string /*DNS-over-TLS address*/, roots *x509.CertPool)`: resolves upstream names itself (VPC DNS is off) and refuses an answer in private, loopback, link-local (including 169.254.169.254) or IPv6 unique-local ranges; `DecisionLog` writes JSON lines `{at, vm, task, attempt, launch, host, method, path_class, decision, reason, bytes_up, bytes_down}`, never headers, query strings, bodies or credentials. |
| + |
| +Per connection: the CONNECT target must be an exact compiled host on port 443 (no IP literal, no other port); the proxy terminates the inner TLS with a leaf for that host from `InterceptCA`; SNI must be present and equal the CONNECT host; a ClientHello with the encrypted ClientHello extension (`0xfe0d`) is refused. Per request (HTTP/1.1 or HTTP/2): Host or `:authority` must equal the CONNECT host after normalisation (an explicit `:443` is allowed, nothing else); an absolute-form target with another authority, userinfo, a `CONNECT` method, an `Upgrade: h2c`, or a WebSocket upgrade outside the stream class is refused; `Rules.Decide` must allow method and path. The proxy then opens TLS to the exact host and validates its certificate against system roots. A 3xx response whose `Location` names another host is replaced with 502 and logged `redirect_refused`. |
| + |
| +- [ ] **Red:** `TestProxyInspection` table with an in-process origin: allowed `GET /healthz`; allowed runner stream WebSocket; SNI differs; SNI missing; ECH extension present; Host differs; HTTP/2 `:authority` differs; IP literal CONNECT (IPv4 and IPv6); port 8443; CONNECT to each denied registry; userinfo authority; `%2e%2e` path; `%2F` path; nested CONNECT; `h2c` upgrade; WebSocket on `/healthz`; `PUT` to mirror while mirror is `none`; redirect to another host; origin resolving to 169.254.169.254; report route from a job launch. `TestProxyAuthorityNormalisation` (review focus 4). `TestDecisionLogCarriesNoSecrets` (a request with `Authorization`, a query token and a body: none appears in the log; byte counts do). |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/egressproxy -run 'TestProxyInspection|TestProxyAuthority|TestDecisionLog' -count=1`. |
| +- [ ] **Mutations, one at a time:** drop the SNI comparison; drop the Host comparison; allow the ECH extension; follow cross-host redirects; allow private upstream answers. Each makes its row fail. Restore. |
| +- [ ] **Commit:** `egressproxy: CONNECT inspection, origin TLS and decision log`. |
| + |
| +### Task 23: Exact-name resolver |
| + |
| +**Files:** Create `internal/egressdns/{server.go,server_test.go}`. Modify `go.mod` (`golang.org/x/net`). |
| + |
| +**Interfaces (produces):** `Server{Names func() []string; Answer []netip.Addr; Log DecisionLog}`; `(*Server) ServeUDP(ctx, net.PacketConn) error`, `ServeTCP(ctx, net.Listener) error`. `Names` is `Rules.Hosts` for every live launch purpose in the feed. Known name and type A: the proxies' IPv4 addresses. Known name, other type: no data. Unknown name: NXDOMAIN. Recursion-available is always off; ANY, AXFR and more than one question are refused. |
| + |
| +- [ ] **Red:** `TestResolverAnswers` table; `TestResolverNameNormalisation` (review focus 4: case and trailing dot match, `instance.example.evil` and `xinstance.example` do not); `TestResolverNeverRecurses`; `TestResolverRefusesMultipleQuestions`. |
| +- [ ] **Implement** with `golang.org/x/net/dns/dnsmessage`. |
| +- [ ] **Green:** `go test ./internal/egressdns -count=1`; `make govulncheck`. |
| +- [ ] **Mutation:** suffix-match names; `TestResolverNameNormalisation` fails. Restore. |
| +- [ ] **Commit:** `egressdns: resolver that answers only launch service names`. |
| + |
| +### Task 24: Proxy command and the trusted-side dialer |
| + |
| +**Files:** Create `cmd/equipo-egress-proxy/{main.go,config_test.go}`, `internal/egressproxy/client/{dialer.go,credential.go,dialer_test.go}`. |
| + |
| +**Interfaces (produces):** the command serves the proxy, the resolver (UDP and TCP 53) and metrics, each on an explicit configured address. `client.Dialer{Proxies []string; Credential *Credential; ProxyRoots, InterceptRoots *x509.CertPool}` with `DialContext(ctx, network, addr string) (net.Conn, error)` (tries each proxy in order) and `HTTPClient() *http.Client`. `client.Credential` generates an Ed25519 key in memory, redeems the bootstrap code, renews at half the lifetime, and swaps atomically. This package must build for darwin and linux, since slice 2 wires it into the runner. |
| + |
| +- [ ] **Red:** `TestDialerFailsOverToSecondProxy`; `TestDialerTrustsInterceptRootsOnlyThroughProxy`; `TestCredentialRenewsAtHalfLife`; `TestRenewFailureStopsUse` (a failed renewal past expiry returns an error, never a stale credential, as spec §10 requires); `TestProxyConfigRefusesWildcardListen` (`0.0.0.0`, `::`, `:port`). |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/egressproxy/... ./cmd/equipo-egress-proxy -count=1`; `make build vet` (darwin vet includes `internal/egressproxy/client` once slice 2 imports it from the runner). |
| +- [ ] **Mutation:** use a credential past expiry; `TestRenewFailureStopsUse` fails. Restore. |
| +- [ ] **Commit:** `egress proxy command and trusted-side dialer`. |
| + |
| +--- |
| + |
| +## Phase E: the image (spec §4, §7) |
| + |
| +### Task 25: Root init and lifecycle hooks |
| + |
| +**Files:** Create `cmd/equipo-vm-init/main.go`, `internal/vminit/{init_linux.go,hooks.go,drop_linux.go,init_test.go}`, `internal/isolatedjob/awsjob/vmhooks/{hooks.go,hooks_test.go}`. |
| + |
| +**Interfaces (produces):** `vminit.Hooks interface{ Ready(ctx) error; Run(ctx, payload []byte) error; Resume(ctx) error }`; `vminit.New(sys Sys, cfg Config) (*Init, error)` where `Sys` wraps mount, chown, prctl and exec so tests inject it; `Config{ResolverAddr netip.Addr; RunnerUser string /*"equipo"*/; StateDir string /*"/var/lib/equipo-runner"*/; RunnerPath string}`. `vmhooks.Serve(ctx, h vminit.Hooks)` maps the provider's hook transport (recorded in Task 6) to `Hooks`; it is the only provider-specific code in the image. |
| + |
| +Init, as root: bind-mounts generated `/etc/resolv.conf` (one nameserver, the resolver) and `/etc/hosts` over the managed mounts and remounts them read-only; becomes child subreaper and reaps; creates the empty state directory owned by the runner user. `Ready` fails if the state directory holds anything, or if any machine key, token, SSH host key or `.aws` directory exists. `Run` validates the payload (Task 11 `Bootstrap`, size limit), generates per-VM machine ID and random seed, writes the payload to `/run/equipo/bootstrap.json` (0400, runner user), and starts the runner (or, for the certification purpose, the Task 27 harness) through `equipo-vm-init drop`, which sets no-new-privileges, clears the bounding and ambient capability sets, sets the runner user's IDs and execs. `Resume` signals the runner to rotate its credential. |
| + |
| +- [ ] **Red:** `TestInitReplacesResolverMounts`; `TestReadyRefusesState` table (one row per forbidden item); `TestRunWritesBootstrapForRunnerOnly`; `TestRunRefusesOversizePayload`; `TestDropClearsCapabilities` (the recorded `Sys` calls show no-new-privileges, empty sets, the runner IDs, in that order before exec); `TestHooksTransport`. |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/vminit ./internal/isolatedjob/awsjob/vmhooks -count=1`; `make build`. |
| +- [ ] **Mutations:** skip the read-only remount; `TestInitReplacesResolverMounts` fails. Skip the bounding-set clear; `TestDropClearsCapabilities` fails. Restore. |
| +- [ ] **Commit:** `vm init: resolver mounts, reaping and an unprivileged runner`. |
| + |
| +### Task 26: Image manifest and deterministic build |
| + |
| +**Files:** Create `internal/hostedimage/{manifest.go,manifest.json,build.go,build_test.go}`, `cmd/equipo-hosted-image/main.go`, `scripts/hosted-image-inputs-check.sh`. Modify `Makefile` (`hosted-image-check`, added to `ci`). |
| + |
| +**Interfaces:** Consumes `containment.BubblewrapSHA256`, `release.BuildManifest()`. Produces: |
| + |
| +```go |
| +type Manifest struct { |
| + Version int |
| + Base string // OCI base image by digest |
| + Files []File // Path, SHA256, Mode, Owner; Source names a release artifact |
| + RunnerDigest string |
| + BwrapSHA256 string |
| + Toolchains []File // what the containment suite needs: python3, git; slice 2 adds check toolchains |
| + ContainmentTests int // `containment.test -test.list` count minus ^TestSource |
| + CertTools []File // containment.test, equipo-vm-certcheck |
| +} |
| +func Load() (Manifest, error) // embedded manifest.json |
| +func Build(ctx context.Context, m Manifest, inputs fs.FS, out string) (isolatedjob.ImageDigest, error) |
| +``` |
| + |
| +`cmd/equipo-hosted-image build` writes an OCI image layout; `register` calls `awsjob.Registry.Register` and waits for `Ready`. Build refuses a file whose digest differs from the manifest and any path in a forbidden set (`.ssh`, `.aws`, `*.pem`, `*.key`, runner state, OAuth homes). `hosted-image-check` runs gitleaks over the inputs directory and `go test ./internal/hostedimage`. |
| + |
| +- [ ] **Red:** `TestBuildIsDeterministic` (two builds, one digest: fixed mtimes, sorted entries, fixed owners); `TestBuildRefusesDigestMismatch`; `TestBuildRefusesForbiddenPaths`; `TestManifestPinsBubblewrap` (equals `containment.BubblewrapSHA256`); `TestManifestRunnerMatchesRelease`; `TestContainmentCountMatchesSuite` (compares with `go test -list` on the package, minus `TestSource`). |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/hostedimage -count=1`; `make hosted-image-check`. |
| +- [ ] **Mutations:** drop the fixed mtime; `TestBuildIsDeterministic` fails. Change one pin byte; `TestManifestPinsBubblewrap` fails. Restore. |
| +- [ ] **Commit:** `hosted image: pinned manifest and reproducible build`. |
| + |
| +--- |
| + |
| +## Phase F: the certification gate (spec §7, §14 egress matrix, §17) |
| + |
| +### Task 27: In-VM certification harness and the egress matrix |
| + |
| +**Files:** Create `cmd/equipo-vm-certcheck/main.go`, `internal/hostedcert/matrix/{rows.go,run_linux.go,report.go,matrix_test.go}`. |
| + |
| +**Interfaces:** Consumes Tasks 2, 3, 10, 24, 25. Produces `matrix.Rows() []Row` (`Row{Name, Actor /*root, runner, sandbox*/, Expected /*allowed, refused*/}`), `matrix.Run(ctx, env Env) (hostedcert.Certificate fields: Containment, Matrix)`, and the report JSON posted to the report route through the proxy with the VM's credential. |
| + |
| +The harness runs the containment suite as the runner user: `containment.test -test.v -test.count=1 -test.skip '^TestSource'`, and records each test's result; only `TestNamespaceCgroupMoveKeepsMembership` may skip. Then the matrix. The sandbox actor runs inside the containment manager with the hosted launch policy, exactly as checks will. |
| + |
| +| Row | Actor | Expected | |
| +| --- | --- | --- | |
| +| `instance_healthz_via_proxy` | runner | allowed | |
| +| `no_credential_refused`, `expired_credential_refused`, `other_vm_credential_refused`, `old_epoch_refused` | runner | refused | |
| +| `sni_mismatch`, `missing_sni`, `ech`, `host_mismatch`, `h2_authority_mismatch`, `redirect_cross_host`, `encoded_authority`, `nested_connect`, `ip_literal_v4`, `ip_literal_v6`, `other_proxy_port` | runner | refused | |
| +| `denied_registry_<name>` (one per denied name), `mirror_upload`, `mirror_cache_miss_url`, `gateway_route` | runner | refused | |
| +| `unknown_name_nxdomain` | runner | refused | |
| +| `managed_resolver_<n>` (each managed resolver address) | root and runner | refused | |
| +| `metadata_credentials` (role path empty, no AWS keys in env or files) | root and runner | refused | |
| +| `resolver_files_read_only`, `no_capabilities`, `no_new_privileges`, `no_setuid_binaries` | runner | refused | |
| +| `sandbox_any_host`, `sandbox_resolver`, `sandbox_proxy_socket`, `sandbox_metadata`, `sandbox_ipv6` | sandbox | refused | |
| +| `sandbox_build_script_network` (a lifecycle script that resolves and connects), `sandbox_shell_dns` | sandbox | refused | |
| + |
| +- [ ] **Red:** `TestRowsCoverSpec` (every spec §14 and §17 network item named above exists exactly once); `TestUnexpectedSuccessFailsReport`; `TestOnlyCgroupSkipAllowed`; `TestReportCarriesNoSecrets`. |
| +- [ ] **Implement.** Rows that need a real VM are built and run there in Task 31; local tests cover report logic with injected probes. |
| +- [ ] **Green:** `go test ./internal/hostedcert/matrix -count=1`. |
| +- [ ] **Mutation:** treat a probe error as refused when the row expected allowed; `TestUnexpectedSuccessFailsReport`'s mirror case fails. Restore. |
| +- [ ] **Commit:** `certification: in-VM containment run and egress matrix`. |
| + |
| +### Task 28: Operator certification flow |
| + |
| +**Files:** Create `cmd/equipo-hosted-controller/certify.go`, `internal/hostedctl/{certify.go,certify_test.go}`. |
| + |
| +**Interfaces:** Consumes Tasks 10, 12, 13, 17, 27. Produces `equipo-hosted-controller certify -image sha256:... -key <operator certification key> -config <client config>`: launch a Large certification VM as operator, wait up to 20 minutes for the report, stop it with proof, verify the report against `Expectation` plus the controller's own network audit taken during the run, sign the certificate with the operator's key, upload with `PUT /v1/certificates/{image}`; the controller verifies before storing (Task 10) and records it with the audit. `(*Controller) StoreCertificate(ctx, actor, hostedcert.Signed) error`. |
| + |
| +- [ ] **Red:** `TestCertifyRefusesFailedReport` (each Task 10 failure kind); `TestReportFromJobLaunchRefused`; `TestCertificationLaunchCannotEnrol` (its Bootstrap has an empty InstanceCode); `TestStoreCertificateVerifiesFirst`; `TestCertifiedImageThenLaunches` (end to end on the fake: uncertified launch refused, certify, launch accepted with the digest recorded). |
| +- [ ] **Implement.** |
| +- [ ] **Green:** `go test ./internal/hostedctl -run 'TestCertif|TestReportFromJob|TestStoreCertificate' -count=1`. |
| +- [ ] **Mutation:** store without verifying; `TestStoreCertificateVerifiesFirst` fails. Restore. |
| +- [ ] **Commit:** `certification: operator flow from report to signed certificate`. |
| + |
| +--- |
| + |
| +## Phase G: infrastructure, release and dev bring-up |
| + |
| +### Task 29: OpenTofu for the hosted network, controller and proxies |
| + |
| +This repository has no infrastructure code. This task proposes `infra/hosted/` in OpenTofu, following carlos/platform's `infra/modules` style (open question 2). |
| + |
| +**Files:** Create `infra/hosted/modules/{network,controller,proxies}/{main.tf,variables.tf,outputs.tf}`, `infra/hosted/envs/dev/{main.tf,backend.tf}` (account `640012953448`, profile `kass`, `eu-west-1`, tag `purpose=equipo-hosted-dev`), `infra/hosted/envs/prod/{main.tf,backend.tf}` (account `149757027610`, profile `equipo-hosted`, not applied), `infra/hosted/README.md`, `scripts/hosted-infra-check.py`. |
| + |
| +Network: VPC with `enable_dns_support = false` and `enable_dns_hostnames = false`; VM subnets in two zones whose route table has no default route; an egress subnet per zone for the proxies with internet access; VM security group with no ingress and egress only to the two proxies' port and the resolver's UDP and TCP 53; proxy security group allowing those from the VM group, and egress 443 and 853 (DNS over TLS) only. Controller: one arm64 instance with an instance profile allowed only the MicroVM operations, image registry writes for its own repository, the EC2 `Describe*` calls the audit needs, and `sns:Publish` to its topic; its database on an encrypted volume. Proxies: two instances in two zones with fixed private addresses. No role is attached to any VM. The VPC connector and MicroVM image resources go in OpenTofu if the AWS provider supports them; otherwise `equipo-hosted-controller ops ensure-connector` creates them idempotently (open question 1). |
| + |
| +- [ ] **Red:** `scripts/hosted-infra-check.py` reads `tofu show -json` of a plan and fails on: DNS support on, any VM-subnet default route, any VM ingress rule, VM egress beyond proxy and resolver, a role or instance profile attached outside the controller, a controller policy action outside its list. A fixture plan under `scripts/testdata/` drives `python3 scripts/hosted-infra-check.py --self-test`. |
| +- [ ] **Implement** the modules; `tofu fmt -check` and `tofu validate` in each env. |
| +- [ ] **Green:** `python3 scripts/hosted-infra-check.py --self-test`; with `kass`, `tofu plan -out` in `envs/dev` and the check over its JSON (agent may run plan; plan only). |
| +- [ ] **Mutation:** flip DNS support in the fixture; the self-test fails. Restore. |
| +- [ ] **Commit:** `infra: OpenTofu for the hosted network, controller and proxies`. |
| + |
| +### Task 30: Hosted release artifacts |
| + |
| +**Files:** Modify `Makefile` (`release-hosted`), `scripts/release-isolated.sh` (a hosted mode), create `scripts/hosted-release-check.py`. |
| + |
| +**Interfaces (produces):** `make release-hosted` builds in an isolated clean tree at one commit: `equipo-hosted-controller` and `equipo-egress-proxy` for linux/arm64; `equipo-vm-init`, `equipo-vm-certcheck`, `containment.test` (`go test -c -trimpath`) and the runner for linux/amd64; a provenance manifest of digests and commit. `hosted-image` consumes these as its inputs. |
| + |
| +- [ ] **Red:** `python3 scripts/hosted-release-check.py --self-test`: a binary whose build information names another commit, a dirty tree flag, or a missing artifact each fail. |
| +- [ ] **Implement.** |
| +- [ ] **Green:** the self-test; `make release-hosted` once, then the check over its output. |
| +- [ ] **Commit:** `release: hosted controller, proxy and image artifacts`. |
| + |
| +### Task 31: Dev bring-up, certification and drills (HUMAN-gated) |
| + |
| +Every step that changes AWS needs Paul's GO first (H2). Agents run the checks and drills with `kass` once the resources exist. |
| + |
| +- [ ] **HUMAN:** Paul applies `infra/hosted/envs/dev` (or authorises the agent to). Agent then runs `hosted-infra-check.py` against the applied state. |
| +- [ ] **HUMAN:** Paul deploys the controller and both proxies from a `release-hosted` build, with the H2 hostnames, gateway `none`, mirror `none`, and `EQUIPO_HOSTED_ENABLED=1`. |
| +- [ ] Agent: run Task 6's live contract test; record teardown. |
| +- [ ] Agent: `equipo-hosted-image build` and `register`; record the digest. |
| +- [ ] **HUMAN for the key:** Paul (or the operator holding the certification key, open question 4) runs `equipo-hosted-controller certify`. Record the certificate digest, the full containment result (expect every test but the cgroup test to pass, against the spike's 71 of 79) and every matrix row. |
| +- [ ] Agent drills, each recorded in the progress file: launch a Small job with an operator-supplied dummy instance code and stop it with proof; plant an orphan with the AWS CLI and watch the reaper stop it after 10 minutes; kill the controller between launch and save, restart, see one VM; stop one proxy and see the dialer fail over, then both and see the trusted route refuse rather than fall back; switch VPC DNS support on in a scratch copy of the network module, see the audit fail, launches refuse and the alert fire, then restore; a launch with a 15-minute lifetime is drained at once and stopped at 5 minutes by the controller. |
| +- [ ] Agent: list every VM and confirm none remain; record the dev spend so far. |
| +- [ ] One whole-branch review (Astra or Fable, as Paul directs), at most three rounds. Paul lands it. |
| + |
| +**Slice 1 is done when:** a certified image digest exists in dev; the controller launches it only with that certificate; the drills pass; no VM is left running; and everything is off unless `EQUIPO_HOSTED_ENABLED=1`. |
| + |
| +--- |
| + |
| +## What slice 2 then needs |
| + |
| +Slice 2 (hosted checks) builds on the above and needs, in roughly this order: |
| + |
| +1. **Dependency mirror and importer** (spec §6, Paul's ruling 4): required before any hosted code runs. Its exact hostname goes in the manifest, the mirror path class is already in policy, and the image is recertified with the mirror set. |
| +2. **Enrolment on the instance:** `POST /api/hosted/enrol` (bootstrap code, VM ID, machine public key), minted bootstrap codes passed as `InstanceCode`, runner bearer of 1 hour renewable to the deadline, epochs, and the 2-minute enrolment timeout (stop, retry once, fail with a reason). |
| +3. **Runner changes:** `Link` reads the current bearer on each dial; the runner uses `egressproxy/client` and its `Credential`; a Linux checks worker on the containment manager with namespace proof, since `thin.Run` starts the worker loop only on a Mac or the test fake. |
| +4. **Instance admission:** a hosted VM enrols as a worker bound to one job (`fits`, authorisation and dispatch refuse anything else); the instance accepts `bubblewrap` from a worker only when the controller's launch record carries a current certificate; a hello's claimed image or profile is diagnostic only, with the M8 test that a hello claiming another certified image fails. |
| +5. **Placement and limits:** the project setting (off by default) read by `place` before its early return; the `waiting_hosted` placement; offline-withdrawal exemption for starting, draining and suspended VMs; per-person limits of 2 running VMs, 8 VM-hours a day and $50 a month. |
| +6. **The instance half of the pause barrier**, if slice 2 pauses at all: `draining` with the generation in the admission transaction. |
| +7. **Wiring `hostedclient`** into the instance (deleting `TestInstanceDoesNotCallHostedClient`), the launch-to-enrolled metric, and the slice 2 end-to-end test: pack transfer, checks in the sandbox, certified report. |
| +8. **Simulation:** add the instance invariants (nothing starts while draining, one attempt publishes) to Task 16's model. |
| +9. **Production:** H1 done, `infra/hosted/envs/prod` applied, the controller and proxies deployed there, the quota confirmed, and the image certified in that account. |
| + |
| +## Open questions |
| + |
| +1. **MicroVM client in Go.** If aws-sdk-go-v2 has no package for the MicroVM API yet, what do we call it with? *Recommendation:* use the SDK package if it exists; otherwise a SigV4-signed client for the six calls, kept inside `awsjob` and replaced when the SDK ships. The same applies to OpenTofu: resources the AWS provider lacks are created by an idempotent controller `ops` command. |
| +2. **Where infrastructure code lives.** This repository has none. *Recommendation:* `infra/hosted/` in oficina/equipo, OpenTofu, in the style of carlos/platform's `infra/modules`, with state in each account. The alternative is a private infrastructure repository like platform-infrastructure; that only pays off once a second deployment exists. |
| +3. **Controller compute and job table durability.** *Recommendation:* one small arm64 EC2 instance with SQLite on an encrypted volume and daily snapshots in dev; add continuous replication to S3 in the same account before production. No high availability: running VMs continue while it is down (spec §10). |
| +4. **Who holds the certification key.** *Recommendation:* an Ed25519 key held by Paul (or a named operator) offline for dev; for production, a key that only a certification role can use, created in `equipo-hosted`. The controller pins the public key either way. |
| +5. **Codex in the image.** Five containment tests need the codex binary, but hosted VMs run no Codex. *Recommendation:* include the release-pinned codex binary, with no credentials, so the full suite passes as §7 requires; drop it only with a spec change that names those five tests as not applicable. |
| +6. **Gateway and mirror names before they exist.** The spec says an unset name blocks launch. *Recommendation:* a third value, `none`, recorded in the certificate, which denies the route; unset still blocks. Slice 1 certifies with both `none`. Slice 2 sets the mirror and recertifies. |
| +7. **How certification results leave the VM.** *Recommendation:* one controller report route through the proxy, allowed only for certification launches and left out of the policy digest that production launches compare against, so production policy is unchanged. |
| +8. **Upstream DNS for the proxies while VPC DNS is off.** *Recommendation:* the proxies resolve upstream names over DNS over TLS to a pinned public resolver, keeping the spike's single VPC; a separate egress VPC is the alternative if that is not acceptable. |
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json| index a01def4d..638bffe0 100644 |
| --- a/scripts/runner-reference-allowlist.json |
| +++ b/scripts/runner-reference-allowlist.json |
| @@ -15853,5 +15853,26 @@ |
| "match": "equipo-runner", |
| "count": 1, |
| "reason": "Hosted runners spec (design-hosted-runners): names the runner executable and the denied package registries; this line grants no runtime authority." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/2026-11-19-hosted-runners-slice-1.md", |
| + "line_sha256": "713e8f48d4ba60502e11ad13b0ac88ef87d2c498df6acd76683d0921b78daa54", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Hosted runners slice 1 plan (design-hosted-runners): names the runner executable, its state path and the denied package registries; this line grants no runtime authority." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/2026-11-19-hosted-runners-slice-1.md", |
| + "line_sha256": "95b04b29a0dff68ffdc483a4491dde9fe9c7850764c3a1f329957a294615d499", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Hosted runners slice 1 plan (design-hosted-runners): names the runner executable, its state path and the denied package registries; this line grants no runtime authority." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/2026-11-19-hosted-runners-slice-1.md", |
| + "line_sha256": "e2458cbf4f611f48ea8a1bf5ca2bd84a2bd0356ebfb55ff5192b36531f7f1aa7", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Hosted runners slice 1 plan (design-hosted-runners): names the runner executable, its state path and the denied package registries; this line grants no runtime authority." |
| } |
| ] |