plan: slice 2 rev 3 and account plan rev 2 after Astra
Slice 2 round 2 (1 Critical, 7 Important, 1 Minor) and account plan round 1 (5 Critical, 13 Important, 2 Minor) taken. Adds Task 33, the equipo-hosted-ops run kit, used by the dev drill and production.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+460
−384
docs/superpowers/plans/2026-11-30-hosted-prod-account-plan.md+384 −337docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md+76 −47
CI cancelled — superseded by a newer push — run details
CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/hosted-runners-slice-2-plan: Type Size Avail | ext4 96G 84G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type Size Avail | ext4 96G 84G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.3s
ci-box: codex: fetched and verified in 3.5s
ci-box: codex-code-mode-host: fetched and verified in 2.4s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.4s
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.4s
ci-box: opencode: installed and verified in 2.4s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 9.3s
ci-box: clone deepened in 5.7s
ci-box: file times set from content: 3753 files, 244 directories
ci-box: ready in 19.5s
=== 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.232s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
1.6s
+ go list -export -test -tags testbuild -f ./...
0.8s
+ go list -export -test -tags browser,testbuild -f ./internal/equipo ./internal/equipotest ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
0.3s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-24 15:56:00 +0000 UTC
go run github.com/zricethezav/gitleaks/v8@v8.30.1 version
version is set by build process
=== check ===
--- shard 0 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-work: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m11.857s 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 1m9.977s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m9.98s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 43.34, cpu waiting 25.36%, memory waiting 0.00%, io waiting 1.16%
--- 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 1m10.003s 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 1m8.088s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m8.09s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 43.80, cpu waiting 25.07%, memory waiting 0.00%, io waiting 1.20%
--- 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 1m14.034s 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 1m11.805s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m2.75s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.05s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 43.34, cpu waiting 25.36%, memory waiting 0.00%, io waiting 1.16%
--- 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 2m35.535s 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 2m33.61s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m59.86s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 15.55s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.29s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 8.91s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 17.51, cpu waiting 7.65%, memory waiting 0.00%, io waiting 0.28%
--- shard 4 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-guards: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m28.798s 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 1m26.769s amadan.net/oficina/equipo/internal/headless
receipt: slow test 57.19s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.15s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.21s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7.44s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.77s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 40.39, cpu waiting 22.72%, memory waiting 0.00%, io waiting 0.89%
--- shard 5 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-rest: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$|^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$|^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$|^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$|^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
amadan: job cancelled — a newer push superseded it
--- 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 523ms 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 3m27.032s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 15.73s amadan.net/oficina/equipo/internal/thintest TestTasklessHoldResumes
receipt: slow test 10.96s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.68s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 5.46s amadan.net/oficina/equipo/internal/thintest TestNudgeResumesHeldJob
receipt: slow test 5.43s amadan.net/oficina/equipo/internal/thintest TestAbilityHoldResumes
machine: 32 CPUs, load 1.12, cpu waiting 0.22%, memory waiting 0.00%, io waiting 3.89%
--- 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 619ms 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 2m23.332s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.44s amadan.net/oficina/equipo/internal/thintest TestContractRetryPreviewUnverifiedMerge
receipt: slow test 9.07s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 4.93s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 4.9s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 3.04s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
machine: 32 CPUs, load 6.63, cpu waiting 0.22%, memory waiting 0.00%, io waiting 3.89%
--- 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
amadan: job cancelled — a newer push superseded it
--- 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 48.167s 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 47.044s amadan.net/oficina/equipo/internal/runner
receipt: slow test 27.01s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 43.29, cpu waiting 24.68%, memory waiting 0.00%, io waiting 1.74%
--- 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 49.806s 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 47.929s amadan.net/oficina/equipo/internal/runner
receipt: slow test 37.95s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 32.72s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.38s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.58s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 43.29, cpu waiting 24.68%, memory waiting 0.00%, io waiting 1.74%
--- 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 40.77s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 39.849s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 5.01s amadan.net/oficina/equipo/internal/runner TestEnrolCommitsTheCredentialLast
receipt: slow test 3.25s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.13s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.64s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
machine: 32 CPUs, load 35.12, cpu waiting 20.28%, memory waiting 0.00%, io waiting 1.99%
--- 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 32.0%, load 25.74
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
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/equipotest TestDirectDeadReferencesRepository
=== RUN TestDirectDeadReferencesRepository
direct_cutover_test.go:221: repository reference inventory: exit status 1
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:9:210: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:234:744: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:234:783: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:285:60: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:294:119: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:316:225: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:380:97: unclassified equipo-runner
reference scan: 3465 text files, 3991 matches, 7 failures
--- FAIL: TestDirectDeadReferencesRepository (2.71s)
--- FAIL amadan.net/oficina/equipo/internal/equipotest (package output)
FAIL
rastrillo-budget/v1 ran 1m11.681s
FAIL amadan.net/oficina/equipo/internal/equipotest 71.975s
receipt: test step 1m13.685s 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 1m11.681s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 32.94s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 32.84s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 30.51s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 27.36s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 27.16s amadan.net/oficina/equipo/internal/equipotest TestAuthorityUsesLiveRoster
exit status 1
+ go test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' -v -run '^TestDirectDeadReferencesRepository$' -count=1 ./internal/equipotest (retry, once)
FAILED TWICE ./internal/equipotest:TestDirectDeadReferencesRepository equipotest-a
=== RUN TestDirectDeadReferencesRepository
direct_cutover_test.go:221: repository reference inventory: exit status 1
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:9:210: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:234:744: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:234:783: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:285:60: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:294:119: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:316:225: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:380:97: unclassified equipo-runner
reference scan: 3465 text files, 3991 matches, 7 failures
--- FAIL: TestDirectDeadReferencesRepository (2.67s)
FAIL
rastrillo-budget/v1 ran 2.673s
FAIL amadan.net/oficina/equipo/internal/equipotest 2.844s
FAIL
machine: 32 CPUs, load 32.75, cpu waiting 17.35%, memory waiting 0.00%, io waiting 0.66%
make: *** [Makefile:113: ci-shard] Error 1
amadan: step check shard 12 of 29 failed: exit status 2
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-e started 30s late; cpu waiting 32.0%, load 25.74
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 624ms 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 2m22.502s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 23.6s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 23.59s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 23.51s amadan.net/oficina/equipo/internal/equipotest TestProjectsAccountRevisionAndValidation
receipt: slow test 23.51s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 23.49s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
machine: 32 CPUs, load 25.74, cpu waiting 13.28%, memory waiting 0.00%, io waiting 2.35%
--- 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 32.0%, load 25.74
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
amadan: job cancelled — a newer push superseded it
--- 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 32.0%, load 25.74
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 556ms 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 1m11.828s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 30.35s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 29.9s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 29.8s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 27.57s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsRollbackAndUnavailable
receipt: slow test 27.5s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
machine: 32 CPUs, load 25.74, cpu waiting 13.28%, memory waiting 0.00%, io waiting 2.35%
--- 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 32.9%, load 25.74
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 692ms 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 57.81s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 4.51s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.52s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.88s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.53s amadan.net/oficina/equipo/internal/plan3test TestInviteMigration
receipt: slow test 1.52s amadan.net/oficina/equipo/internal/plan3test TestOnboardingAccountMigration
machine: 32 CPUs, load 32.17, cpu waiting 13.28%, memory waiting 0.00%, io waiting 2.35%
--- 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 32.0%, load 25.74
test lane rest: ./cmd/equipo ./cmd/equipo-hosted-controller ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/hostedclient ./internal/hostedctl ./internal/hostedwire ./internal/idtest ./internal/isolatedjob ./internal/isolatedjob/awsjob ./internal/isolatedjob/guardfixture ./internal/isolatedjob/isolatedjobtest ./internal/ownermodetest ./internal/release ./internal/release/renderertest ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/designstep ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mac/creds ./internal/runner/mac/denylist ./internal/runner/mac/fprobe ./internal/runner/mac/proc ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/pause ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/render ./internal/runner/renderpage ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/teamprobe ./internal/testci ./internal/toolproxy ./internal/websearch ./internal/websearch/websearchtest ./internal/websource ./internal/websource/guard ./internal/websource/hostaddrs ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-hosted-controller ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/hostedclient ./internal/hostedctl ./internal/hostedwire ./internal/idtest ./internal/isolatedjob ./internal/isolatedjob/awsjob ./internal/isolatedjob/guardfixture ./internal/isolatedjob/isolatedjobtest ./internal/ownermodetest ./internal/release ./internal/release/renderertest ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/designstep ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mac/creds ./internal/runner/mac/denylist ./internal/runner/mac/fprobe ./internal/runner/mac/proc ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/pause ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/render ./internal/runner/renderpage ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/teamprobe ./internal/testci ./internal/toolproxy ./internal/websearch ./internal/websearch/websearchtest ./internal/websource ./internal/websource/guard ./internal/websource/hostaddrs ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/idtest: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/isolatedjob: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude/realcli: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/release: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/render: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/testci: 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 2m43.709s, 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 51.898s, 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/github took 40.217s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/equipo/setup took 15.02s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/hostedctl took 31.81s, 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 2m3.116s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 34.61s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/containment took 41.825s, over the 15s its record on line 41 allows; reported only, timing fails on CI
budget note: internal/runner/mac took 46.024s, over the 45s its record on line 44 allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/runner/mac/fprobe took 14.761s, 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/render took 1m27.028s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 2m19.35s against a 60s target (the gate's other steps are not in this figure)
receipt: 17 packages ran, 68 cached, 22 without tests, 0 failed
receipt: slow package 2m43.709s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 2m3.116s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m27.028s amadan.net/oficina/equipo/internal/runner/render
receipt: slow package 56.629s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 53.123s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow test 1m4.84s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 55.8s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 55.26s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
receipt: slow test 55.01s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
receipt: slow test 54.99s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
machine: 32 CPUs, load 15.43, cpu waiting 6.27%, memory waiting 0.00%, io waiting 0.23%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m22.171s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m20.471s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.7s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.71s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 9.66s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.6s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 5.8s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 41.73, cpu waiting 24.16%, memory waiting 0.00%, io waiting 0.98%
--- 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
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m24.799s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m22.932s amadan.net/oficina/equipo/internal/headless
receipt: slow test 24.97s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 19.76s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 8.76s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 7.25s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 40.39, cpu waiting 23.31%, memory waiting 0.00%, io waiting 0.92%
--- 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 1m49.505s 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 1m47.637s amadan.net/oficina/equipo/internal/headless
receipt: slow test 13.45s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.44s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 12.11s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.13s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
receipt: slow test 10.53s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
machine: 32 CPUs, load 32.75, cpu waiting 16.23%, memory waiting 0.00%, io waiting 0.61%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed
receipt: test step 1m32.036s 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 1m30.225s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.18s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.25s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.07s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 9.19s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.44s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
machine: 32 CPUs, load 38.44, cpu waiting 21.41%, memory waiting 0.00%, io waiting 0.83%
--- shard 22 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-rest: ./internal/equipo
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserPreviewBlocksNavigation|TestBrowserPreviewPassExchange)$' ./internal/equipo
receipt: test step 406ms 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 2.586s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 1.99s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 590ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/equipotest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserGitHubManifestCSP)$' ./internal/equipotest
receipt: test step 275ms 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 6.528s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 6.53s amadan.net/oficina/equipo/internal/equipotest TestBrowserGitHubManifestCSP
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor|TestBrowserSmartDoor)$' ./internal/idtest
budget note: internal/idtest took 11.229s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
receipt: test step 237ms 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 11.229s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 8.98s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.25s 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 234ms 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 2.575s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.57s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAskMacOffline|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPausedWork|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRhythm|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingSteady|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackPulse|TestBrowserTrackStarCentre|TestBrowserTryAgain)$' ./internal/thintest
receipt: test step 463ms 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 3m38.868s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 27.16s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.37s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.1s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.72s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.42s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 6.63, cpu waiting 1.53%, memory waiting 0.00%, io waiting 3.76%
--- 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 (50s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.92s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.40s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 8.81s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 8.55s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 24.48s
+ 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 (49s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 11.09s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 11.03s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 10.42s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 14.69s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (21s)
ok ./internal/headless TestMixedVersions 18.57s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks (1s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.78s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin (1s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.06s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 43.29, cpu waiting 25.05%, memory waiting 0.00%, io waiting 1.68%
--- 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.812s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 4 without tests, 0 failed
receipt: slow package 7.281s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 163ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 76ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow test 5.2s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.71s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 300ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 160ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 80ms amadan.net/oficina/equipo/internal/runner/provider/codex TestDirectJournalAdapterBarrier
CGO_ENABLED=0 EQUIPO_REQUIRE_USER_SESSION=1 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment
receipt: test step 3.529s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 3.195s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 300ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 200ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryReusedPID
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceExitStatus
machine: 32 CPUs, load 12.87, cpu waiting 5.47%, memory waiting 0.00%, io waiting 3.18%
--- 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 32.9%, load 25.74
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:9:210: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:234:744: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:234:783: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:285:60: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:294:119: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:316:225: unclassified equipo-runner
docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md:380:97: unclassified equipo-runner
reference scan: 3465 text files, 3991 matches, 7 failures
machine: 32 CPUs, load 32.17, cpu waiting 14.61%, memory waiting 0.00%, io waiting 2.28%
make[1]: *** [Makefile:238: runner-dead-references] Error 1
make: *** [Makefile:113: ci-shard] Error 2
amadan: step check shard 25 of 29 failed: exit status 2
--- shard 26 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: staticcheck started 30s late; cpu waiting 32.0%, load 25.74
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 32.17, cpu waiting 14.61%, memory waiting 0.00%, io waiting 2.28%
--- 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 32.9%, load 25.74
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===
No vulnerabilities found.
Your code is affected by 0 vulnerabilities.
This scan also found 1 vulnerability in packages you import and 10
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
machine: 32 CPUs, load 44.66, cpu waiting 25.73%, memory waiting 0.00%, io waiting 1.38%
--- 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 32.0%, load 25.74
shard 28: make gitleaks
[90m6:00PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m6:00PM[0m [32mINF[0m [1m1330 commits scanned.[0m
[90m6:00PM[0m [32mINF[0m [1mscanned ~75124197 bytes (75.12 MB) in 17.1s[0m
[90m6:00PM[0m [32mINF[0m [1mno leaks found[0m
machine: 32 CPUs, load 43.29, cpu waiting 23.59%, memory waiting 0.00%, io waiting 1.80%
diff --git a/docs/superpowers/plans/2026-11-30-hosted-prod-account-plan.md b/docs/superpowers/plans/2026-11-30-hosted-prod-account-plan.md| index 13317cac..093a8244 100644 |
| --- a/docs/superpowers/plans/2026-11-30-hosted-prod-account-plan.md |
| +++ b/docs/superpowers/plans/2026-11-30-hosted-prod-account-plan.md |
| @@ -1,58 +1,92 @@ |
| # Hosted runners: production account bring-up (149757027610, `equipo-hosted`) |
| -**Revision:** 1 (2026-11-30), draft for Astra, then for Paul's one GO. Written in the shape of the |
| -Task 17 revision 5 and Task 17b plans (safety-only hard stops, FINDING lines, a ledger, verified |
| -teardown). **No AWS command or SDK call of any kind was made while writing it, not even a read.** |
| +**Revision:** 2 (2026-11-30), after Astra round 1 (NOT READY: 5 Critical, 13 Important, 2 Minor, all |
| +taken; `.superpowers/sdd/2026-11-30-hosted-slice-2-plan/acct-r1.md`). Written in the shape of the |
| +Task 17 revision 5 and Task 17b plans: safety-only hard stops, FINDING lines, a ledger, verified |
| +teardown, a safe stop. **No AWS command or SDK call of any kind was made while writing it, not even |
| +a read.** |
| -**Runs after:** slice 2 (`docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md`) is built, |
| -merged and released, and its dev drill (Task 33) passed in `kass`. Block 0.1 checks this. |
| +**What changed from revision 1, in one line:** the run machinery (guard, ledger, estimator, |
| +provider-level VM settlement, connector handling, bucket emptying, units, safe stop) is no longer |
| +shell adapted from Task 17b. It is `equipo-hosted-ops`, a Go tool built and tested offline in slice 2 |
| +Task 33 and run first in the dev drill (Task 34), so every block below calls tested code. |
| + |
| +**Runs after:** slice 2 (`2026-11-30-hosted-runners-slice-2.md`, revision 3) is built, merged and |
| +released, and its dev drill passed (`Task 34 PASSED` in `HOSTED-SLICE2-PROGRESS.md` at the release). |
| +Block 0.1 checks both. |
| ## What Paul approves |
| One bring-up of the hosted-runner stack in account `149757027610` (`equipo-hosted`), region |
| `eu-west-1`, reached through the organisation's `OrganizationAccountAccessRole` from the `titogo` |
| -profile, as the other member accounts are. Every block checks the caller's account and region first. |
| -The global services are the named exceptions: IAM (inside OpenTofu), AWS Budgets and Cost Anomaly |
| -Detection (inside the `account` stack only). No Cost Explorer or billing read is made. |
| - |
| -Everything the stack needs is created by OpenTofu from `infra/hosted/envs/prod/` at the pinned |
| -release, except the state bucket (block 1.1), the MicroVM image (section 5) and the certification |
| -and smoke VMs (sections 6 and 8), which the controller launches. Every `tofu apply` runs only a |
| -saved plan that `infra/hosted/scripts/plan-check.py` has passed: only the resource addresses this |
| -document lists for that phase, only creates (no update, replace or delete of anything already |
| -there), every ARN in this account and region. |
| - |
| -The run stops hard only for safety: |
| -- the wrong account or region; |
| -- spend: the run's own estimate reaching $10 (the approval ceiling is $20); |
| -- a MicroVM alive outside the step that launched it; |
| -- anything not in the ledger or the checked plan, including a name collision with an existing resource; |
| -- a step that later steps need cannot complete. |
| - |
| -Everything else that differs from expectation is a `FINDING:` line, and the run goes on where it |
| +profile, as the other member accounts are. |
| + |
| +**Envelope.** Every block starts with `ops guard`, which checks through STS that the caller is |
| +`149757027610` under `OrganizationAccountAccessRole/equipo-hosted-bringup` and the region is |
| +`eu-west-1`. Every OpenTofu provider block carries `allowed_account_ids = ["149757027610"]` and |
| +`region = "eu-west-1"`, so the provider itself refuses any other account. The named exceptions to |
| +"one region, this account's ARNs": |
| +- IAM and STS (global endpoints; STS also for the credential chain from `titogo`); |
| +- AWS Budgets (global endpoint; ARNs `arn:aws:budgets::149757027610:*`); |
| +- the CloudTrail trail, which records management events from every region into one bucket in |
| + `eu-west-1`; |
| +- AWS-owned ARNs used read-only or by reference: the managed policy |
| + `arn:aws:iam::aws:policy/AWSLambdaNetworkConnectorOperatorPolicy`, the `NO_INGRESS` connector |
| + `arn:aws:lambda:eu-west-1:aws:network-connector:aws-network-connector:NO_INGRESS`, and AWS's base |
| + MicroVM image versions in `eu-west-1`. |
| + |
| +No Cost Explorer call of any kind is made (revision 1's anomaly monitor is dropped). |
| + |
| +**Hard stops, the whole list** (each `exit 99` from `ops`, then section S): |
| +1. `ops guard` fails: wrong account, role or region. |
| +2. `ops estimate` reaches $10 (the approval ceiling is $20). |
| +3. A MicroVM of this run's image is live more than 10 minutes after the step that launched it |
| + ended, or is live and not in the ledger. |
| +4. Anything outside the ledger or the checked plan: a name collision (0.5), a plan that |
| + `plan-check.py` refuses, a bucket whose owner is not this account. |
| +5. The egress boundary differs from this plan (3.3), the network audit fails (5.3), the controller's |
| + pin changes (5.3), the database cannot be restored (5.4), the image digest differs from the |
| + release's (4.1), or certification fails (6.3). |
| +6. A step later steps need cannot complete. |
| + |
| +Everything else that differs from expectation is a `FINDING:` line and the run goes on where it |
| safely can. Guarded, read-only calls on this run's own resources are pre-approved. Pre-approved |
| -fallbacks: 3.3's connector delete-policy condition retry (the Task 17 10.2 rule) and 5.3's base |
| -image step-down by one version. Expected bring-up spend about $3; the stack then costs about $45 to |
| -$52 a month before use (section 11). Any other change, or any other AWS call, comes back to Paul. |
| +fallbacks: the connector delete fallback of Task 17b's 10.2 (inside `ops connector delete`), and one |
| +base image version down in 4.3. |
| + |
| +**Expected spend** about $3.70 for the bring-up; the stack then costs about $41 to $49 a month before |
| +use (section 11). Any other change, or any other AWS call, comes back to Paul. |
| -**Paul's own steps:** confirm the SNS email subscription (2.3), sign the image certificate offline |
| -(6.4), and turn the project setting on for the first project (8.1). The run waits at each. |
| +**Paul's own steps, each bounded at 24 hours** (`ops wait-human`; past the bound, section S, with |
| +the hosts left running at about $1.50 a day): confirm the SNS subscription (2.3; required before |
| +hand-over, not before later steps), sign the certificate (6.4), turn the project setting on for the |
| +first project (8.1). |
| ## Decisions owed to Paul (with recommendations) |
| -1. **Budget numbers.** *Recommendation:* a monthly cost budget of $150 that emails at 50%, 80% and |
| - 100% actual and 100% forecast; and a budget action at $300 actual that attaches a deny policy to |
| - the controller's role for `RunMicrovm` and `ResumeMicrovm`, so AWS itself stops new VMs. Running |
| - VMs still end by their 90-minute lifetime. Lifting the action is a hand step. |
| -2. **Run section 0 early, on its own GO.** It is read-only, costs nothing, and answers the two |
| - questions that could block everything later: whether `OrganizationAccountAccessRole` exists in |
| - this account (it was renamed from "Keymail" and may have been invited rather than created), and |
| - the applied MicroVM quota. *Recommendation:* yes. |
| -3. **The controller's address.** *Recommendation:* its Elastic IP with a pinned self-signed |
| - certificate. The instance and the proxies already verify signed responses, so a DNS name adds |
| - nothing but a dependency. |
| -4. **The Equipo instance this stack serves** (`INSTANCE_HOST`): its exact hostname, which every |
| - certificate covers. Paul names it at GO. |
| +1. **The budget and its action.** *Recommendation:* a monthly budget of $150 that emails at 50%, |
| + 80% and 100% actual and 100% forecast, and a budget action at $300 actual that attaches a deny |
| + policy for `RunMicrovm` and `ResumeMicrovm` to the controller's role. Budgets updates its figures |
| + a few times a day, so this is a delayed backstop, not a hard cap; the instance's per-person |
| + limits are the real limit. Lifting the action is a hand step. |
| +2. **Run section 0 early, on its own GO.** It is read-only and free, and answers what could block |
| + everything later: whether `OrganizationAccountAccessRole` exists in this account, the applied |
| + MicroVM quota, MFA on the access path, and the account's current singleton settings. |
| + *Recommendation:* yes. |
| +3. **MFA on the access path.** Nothing today shows that `titogo-source` requires MFA. 0.3 reads the |
| + local profile and records whether it names an `mfa_serial`. *Recommendation:* require it before |
| + GO, by adding `mfa_serial` to `titogo-source` (Paul's step); otherwise accept the current path |
| + knowingly. |
| +4. **Account singletons.** The account-wide S3 public access block and EBS default encryption are |
| + settings, not resources. *Recommendation:* turn both on if they are off (2.0), record what they |
| + were, and leave them on at teardown, since on is stricter. Revision 1's IAM password policy is |
| + dropped: the account has no IAM users. |
| +5. **The controller's address.** *Recommendation:* its Elastic IP with a pinned self-signed |
| + certificate. The instance and the proxies pin it, and requests and responses are signed. No VM |
| + reaches the controller directly: certification reports travel through the proxies' bootstrap |
| + listener, signed by the VM's own key (slice 2 Task 13). |
| +6. **`INSTANCE_HOST`:** the exact hostname of the Equipo instance this stack serves. Paul names it |
| + at GO. |
| ## Order of execution |
| @@ -60,65 +94,49 @@ $52 a month before use (section 11). Any other change, or any other AWS call, co |
| | --- | --- | --- | |
| | 1 | 0. Access, guard rails, inventory, quota | 15 min | |
| | 2 | 1. State bucket and keys | 10 min | |
| -| 3 | 2. Account baseline (`envs/prod/account`) | 10 min, plus Paul's email confirmation | |
| -| 4 | 3. Network and connector (`envs/prod/network`) | 15 min | |
| -| 5 | 4. Controller and proxies (`envs/prod/services`) | 20 min | |
| -| 6 | 5. Image | 20 min | |
| +| 3 | 2. Account baseline (`envs/prod/account`) | 10 min, plus Paul's email confirmation by hand-over | |
| +| 4 | 3. Network, config stack, connector, keys into place | 25 min | |
| +| 5 | 4. Image | 20 min | |
| +| 6 | 5. Controller and proxies (`envs/prod/services`) | 25 min | |
| | 7 | 6. Certification | 30 min, plus Paul's signature | |
| | 8 | 7. Instance wiring | 20 min | |
| | 9 | 8. Smoke checks | 30 min, with Paul | |
| -| 10 | 9. Hand-over | 10 min | |
| +| 10 | 9. Hand-over | 15 min | |
| Sections R (rollback), T (full teardown) and S (safe stop) run only when called. |
| ## Rules for every block |
| - **Shape.** Every block runs with the agent sandbox off, as its own script (`bash <file>`), and |
| - begins `set -euo pipefail; P='<P printed by 0.2>'; . "$P/env.sh"; guard`. Long blocks (3.2, 4.2, |
| - 5.3, 6.2) run as transient systemd user units, started, waited on and stopped by name exactly as |
| - Task 17b's `unitctl.sh` does (rulings R44, R45), with unit names `hprod-<RUN>-<block>`. |
| -- **`env.sh`** is Task 17b's `env.sh` (plan `2026-11-30-hosted-1a-task17b-live-plan.md` at |
| - `78620c94`, the block that begins `# env.sh: sourced by every block`) with exactly these changes: |
| - `AWS_PROFILE=equipo-hosted`; `ACCOUNT=149757027610`; `TAGV=equipo-hosted-prod`; `T17` renamed `P` |
| - with default `$TMPDIR/equipo-hosted-prod`; `REPO` set to the pinned checkout from 0.1; `arn_ok` |
| - accepts only `arn:aws:*:eu-west-1:149757027610:*`, `arn:aws:iam::149757027610:*`, |
| - `arn:aws:budgets::149757027610:*` and `arn:aws:s3:::equipo-hosted-*`, and dies on any ARN naming |
| - `640012953448`, `271376211898`, `658785697856`, `051457670018` or `665106592142`; the `_kind` |
| - table lists `STATE_BUCKET`, `IMAGE_ARN`, `CERT_LAUNCH` and `SMOKE_JOBS`; the controller, livectl, |
| - `API` and `METRICS` lines are removed (production uses `equipo-hosted-image` and the deployed |
| - controller). Its `die`, `finding`, `jw`, `need`, `try`, `must`, `get`, `gone0`, `have`, |
| - `creation_state`, `poll` and `fact_eq` helpers are used unchanged. |
| -- **`guard`**: `aws sts get-caller-identity` must answer `Account` `149757027610` and an `Arn` |
| - under `assumed-role/OrganizationAccountAccessRole/equipo-hosted-bringup`, with `AWS_REGION` and |
| - `AWS_DEFAULT_REGION` both `eu-west-1`; else `die`. |
| -- **`tf ROOT PHASE`**, defined in `env.sh`: |
| - |
| - ```sh |
| - tf() { local r=$1 ph=$2 d="$REPO/infra/hosted/envs/prod/$1" |
| - tofu -chdir="$d" init -input=false -backend-config="bucket=$STATE_BUCKET" \ |
| - -backend-config="key=prod/$r.tfstate" -backend-config="region=eu-west-1" -backend-config="use_lockfile=true" >"$P/tf-$r-init.log" 2>&1 || die "tofu init $r" |
| - tofu -chdir="$d" plan -input=false -var-file="$P/prod.tfvars" -out="$P/tf-$r.plan" >"$P/tf-$r-plan.log" 2>&1 || die "tofu plan $r" |
| - tofu -chdir="$d" show -json "$P/tf-$r.plan" > "$P/tf-$r.plan.json" || die "tofu show $r" |
| - python3 -I "$REPO/infra/hosted/scripts/plan-check.py" --phase "$ph" --account "$ACCOUNT" --region eu-west-1 "$P/tf-$r.plan.json" \ |
| - || die "plan-check refused the $r plan (phase $ph): nothing applied" |
| - jw "INTENT tofu-apply $r $(sha256sum "$P/tf-$r.plan" | cut -c1-64)" |
| - tofu -chdir="$d" apply -input=false "$P/tf-$r.plan" >"$P/tf-$r-apply.log" 2>&1 || die "tofu apply $r (state is in s3://$STATE_BUCKET; reconcile with S.2)" |
| - tofu -chdir="$d" output -json > "$P/out-$r.json" || die "tofu output $r" |
| - jw "APPLIED $r"; } |
| - ``` |
| - |
| - `plan-check.py` is built in slice 2 Task 28, with the allowed address list per phase in |
| - `infra/hosted/scripts/phases.json`; this document's sections 2 to 4 restate each list. |
| -- **Ledger.** OpenTofu state is the ledger for what it creates. Everything else gets an `INTENT` |
| - line before its create call and a `rec` line after (Task 17b rules). Teardown acts only on |
| - confirmed records and `tofu destroy`. |
| + begins `set -euo pipefail; P='<P printed by 0.2>'; . "$P/run.env"; ops guard; ops estimate --stop 10`. |
| + `run.env` (0.2) defines `ops`, `img` and `cert`. Long blocks (3.4, 4.3, 5.2, 6.2) run as transient |
| + systemd user units through `ops unit start|wait|stop` (Task 17b's R44 and R45 rules, ported: units |
| + `hprod-<RUN>-<block>`, journalled before start, stopped by journalled name only, environment |
| + allowlisted). |
| +- **Ledger.** OpenTofu state is the ledger for what it creates. Everything else goes through |
| + `ops ledger intent KIND NAME` before its create call and `ops ledger rec KIND ID` after; the `ops` |
| + subcommands that create things do both themselves. `rec` accepts this account's ARNs and the |
| + listed AWS-owned ones and refuses any other account's. Teardown acts only on confirmed records |
| + and OpenTofu state. |
| +- **`ops tf ROOT PHASE`** checks the state bucket's owner, runs `tofu init` with the S3 backend |
| + (`use_lockfile=true`, key `prod/<ROOT>.tfstate`), `tofu plan -out` (`plan -destroy -out` for a |
| + `destroy-*` phase), `tofu show -json`, then `plan-check.py --phase PHASE`, and only then |
| + `tofu apply` of the saved plan. `plan-check.py` (slice 2 Task 28) refuses a plan unless: every |
| + provider configuration has `allowed_account_ids` equal to this account and region `eu-west-1`; |
| + there are no provider aliases, provisioners, `terraform_data` or `null_resource`; every resource |
| + address is in `phases.json` for the phase; every action is `create` (or `delete` for a `destroy-*` |
| + phase); and the security values `phases.json` pins for the phase (VPC DNS flags, route |
| + destinations and targets, security group rules, IAM policy documents, bucket policies) equal the |
| + planned values, with no unknown value among them. |
| +- **Fatal assertions are `ops assert`,** which exits 99 on a mismatch; observations are `ops fact`, |
| + which writes a FINDING. |
| - **Tags.** Every taggable resource carries `purpose=equipo-hosted-prod` and `run=<RUN>` (OpenTofu |
| - `default_tags`). MicroVMs have no tags; they are tracked through the controller's job table and |
| - `GET /v1/vms`. |
| -- **Never touched:** every other account, every resource this run did not create, and anything in |
| - the inventory from 0.5. |
| + `default_tags`, and `ops` for what it creates). MicroVMs have no tags; `ops vms` finds them by this |
| + run's image ARN, from the provider's own list. |
| +- **Never touched:** every other account, every resource this run did not create, and anything 0.5 |
| + found. |
| - **Records.** Results go to `docs/superpowers/plans/HOSTED-PROD-BRINGUP.md`, committed locally at |
| - the end (subject under 80 characters). Secrets never enter the journal, the record or a commit. |
| + the end. Secrets never enter the journal, the record or a commit. |
| --- |
| @@ -130,31 +148,42 @@ Sections R (rollback), T (full teardown) and S (safe stop) run only when called. |
| set -euo pipefail |
| R=/home/paulca/amadan.net/oficina/equipo |
| git -C "$R" fetch -q origin |
| -PIN=$(git -C "$R" rev-parse "refs/tags/<HOSTED_RELEASE>^{commit}") # filled at GO |
| +PIN=$(git -C "$R" rev-parse "refs/tags/<HOSTED_RELEASE>^{commit}") |
| git -C "$R" merge-base --is-ancestor "$PIN" origin/main || { echo "ABORT: release not on main"; exit 1; } |
| -grep -q 'Task 33 PASSED' <(git -C "$R" show "$PIN:docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md") \ |
| +git -C "$R" show "$PIN:docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md" | grep -q '^Task 34 PASSED' \ |
| || { echo "ABORT: no recorded dev drill pass at the pin"; exit 1; } |
| tofu version | head -1 | grep -q '^OpenTofu v1\.12\.' || { echo "ABORT: tofu 1.12 needed"; exit 1; } |
| -aws --version; go version |
| -echo "PIN=$PIN" |
| +aws --version; go version; echo "PIN=$PIN" |
| ``` |
| -### 0.2 Scratch, worktree and run name (no AWS call) |
| +### 0.2 Scratch, worktree, binaries and run name (no AWS call) |
| ```sh |
| set -euo pipefail |
| -P=$(mktemp -d "$TMPDIR/equipo-hosted-prod-XXXX"); RUN=$(date -u +%m%d)-$(head -c3 /dev/urandom | od -An -tx1 | tr -d ' \n') |
| -git -C /home/paulca/amadan.net/oficina/equipo worktree add --detach "$P/repo" "<PIN from 0.1>" |
| -mkdir -m 700 "$P/keys" "$P/blocks" |
| -# env.sh as described under "Rules", with REPO="$P/repo"; unitctl.sh copied from Task 17b with the hprod- prefix. |
| -printf 'RUN=%s\nPIN=%s\n' "$RUN" "<PIN>" > "$P/run.env"; : > "$P/journal.tsv"; : > "$P/ledger.env" |
| +PIN='<PIN from 0.1>' |
| +P=$(mktemp -d "$TMPDIR/equipo-hosted-prod-XXXX") |
| +RUN=$(date -u +%m%d)-$(head -c3 /dev/urandom | od -An -tx1 | tr -d ' \n') |
| +git -C /home/paulca/amadan.net/oficina/equipo worktree add --detach "$P/repo" "$PIN" |
| +mkdir -m 700 "$P/keys" "$P/bin" |
| +for c in equipo-hosted-ops equipo-hosted-controller equipo-hosted-image equipo-hosted-certify; do |
| + (cd "$P/repo" && CGO_ENABLED=0 go build -o "$P/bin/$c" "./cmd/$c"); done |
| +cat > "$P/run.env" <<EOF |
| +P=$P |
| +RUN=$RUN |
| +PIN=$PIN |
| +REPO=$P/repo |
| +ops() { "$P/bin/equipo-hosted-ops" -dir "$P" -run "$RUN" -profile equipo-hosted -account 149757027610 -region eu-west-1 "\$@"; } |
| +img() { "$P/bin/equipo-hosted-image" -profile equipo-hosted -account 149757027610 -region eu-west-1 -prefix "equipo-hosted-prod-$RUN" "\$@"; } |
| +cert() { "$P/bin/equipo-hosted-certify" "\$@"; } |
| +EOF |
| +"$P/bin/equipo-hosted-ops" -dir "$P" -run "$RUN" ledger init |
| echo "P=$P RUN=$RUN" |
| ``` |
| -### 0.3 The profile (local file, no AWS call) |
| +### 0.3 The profile and MFA (local files, no AWS call) |
| -Append once to `~/.aws/config`, unless a `[profile equipo-hosted]` block already exists, in which case |
| -it must match exactly or the run stops: |
| +Append once to `~/.aws/config`, unless a `[profile equipo-hosted]` block exists, in which case it |
| +must match exactly or the run stops: |
| ```ini |
| [profile equipo-hosted] |
| @@ -164,343 +193,361 @@ role_session_name = equipo-hosted-bringup |
| region = eu-west-1 |
| ``` |
| -### 0.4 First AWS call: who am I |
| +Then `aws configure get mfa_serial --profile titogo-source`, and `ops ledger note MFA yes|no`. `MFA no` |
| +is a FINDING, unless Paul made MFA a condition of GO (section 13), in which case the run stops here. |
| -```sh |
| -guard |
| -jw "IDENTITY $(aws sts get-caller-identity --query Arn --output text)" |
| -``` |
| +### 0.4 First AWS call: who am I |
| -`AccessDenied` on the assume-role is a hard stop: the role does not exist or does not trust the |
| -management account. Paul then chooses how to create access (the account's root user, or a |
| -service-managed StackSet from the management account); this plan does not. |
| +`ops guard`. An `AccessDenied` on the assume-role is a hard stop: the role does not exist or does not |
| +trust the management account, and Paul decides how to create access (the account's root user, or a |
| +service-managed StackSet from the management account). |
| ### 0.5 Inventory (read-only) |
| -```sh |
| -guard |
| -for c in "ec2 describe-vpcs --query length(Vpcs[?IsDefault==\`false\`])" \ |
| - "ec2 describe-instances --query length(Reservations[].Instances[])" \ |
| - "s3api list-buckets --query length(Buckets)" \ |
| - "cloudtrail describe-trails --query length(trailList)" \ |
| - "budgets describe-budgets --account-id 149757027610 --query length(Budgets||\`[]\`)"; do |
| - try aws $c --output text; [ "$RC" = 0 ] && jw "INVENTORY $c = $OUT" || finding "inventory read failed: $c ($ECODE)" |
| -done |
| -get NAMES aws iam list-roles --query 'Roles[?starts_with(RoleName,`equipo-hosted`)].RoleName' --output text |
| -[ -z "$NAMES" ] || die "roles named equipo-hosted* already exist: $NAMES" |
| -get B aws s3api list-buckets --query 'Buckets[?starts_with(Name,`equipo-hosted`)].Name' --output text |
| -[ -z "$B" ] || die "buckets named equipo-hosted* already exist: $B" |
| -equipo_image list --account 149757027610 --region eu-west-1 --prefix equipo-hosted-prod > "$P/images0.json" || die "image list" |
| -[ "$(jq '.Items|length' "$P/images0.json")" = 0 ] || die "MicroVM images named equipo-hosted-prod* already exist" |
| -``` |
| - |
| -Anything non-zero in the first loop is a FINDING (an account that "cost $0" may still hold free |
| -resources); nothing found there is ever changed. `equipo_image` is |
| -`"$P/bin/equipo-hosted-image"` built from the pin in 1.2. |
| +`ops inventory` writes `inventory.json`: counts of non-default VPCs, instances, buckets, trails, |
| +budgets and MicroVM images; every IAM role, bucket and MicroVM image whose name starts with |
| +`equipo-hosted`; and the account's S3 public access block and EBS default encryption. A name |
| +collision is a hard stop. Anything else non-zero is a FINDING and is never touched. |
| ### 0.6 The applied MicroVM quota (read-only) |
| -```sh |
| -guard |
| -try aws service-quotas list-service-quotas --service-code lambda --query 'Quotas[?contains(QuotaName, `MicroVM`)]' --output json |
| -[ "$RC" = 0 ] && jw "QUOTA $OUT" || finding "MicroVM quota unreadable ($ECODE); dev had 2048 GB" |
| -``` |
| - |
| -Need: 2 running Large VMs per person, so 8 GB per person. Below 64 GB is a FINDING to raise with |
| -Paul after the run, not a stop. |
| +`ops quota` lists the Lambda service quotas whose names mention MicroVMs. Unreadable, or under 64 GB |
| +of VM memory, is a FINDING to raise with Paul after the run. |
| ## 1. State bucket and keys |
| -### 1.1 The OpenTofu state bucket (CLI, the one bootstrap resource) |
| +### 1.1 The OpenTofu state bucket (the one bootstrap resource) |
| -```sh |
| -guard; STATE_BUCKET=equipo-hosted-tfstate-149757027610 |
| -intent s3-bucket "$STATE_BUCKET" |
| -aws s3api create-bucket --bucket "$STATE_BUCKET" --create-bucket-configuration LocationConstraint=eu-west-1 >/dev/null |
| -rec STATE_BUCKET "$STATE_BUCKET" |
| -aws s3api put-public-access-block --bucket "$STATE_BUCKET" --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true |
| -aws s3api put-bucket-versioning --bucket "$STATE_BUCKET" --versioning-configuration Status=Enabled |
| -aws s3api put-bucket-encryption --bucket "$STATE_BUCKET" --server-side-encryption-configuration '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}' |
| -aws s3api put-bucket-tagging --bucket "$STATE_BUCKET" --tagging "TagSet=[{Key=purpose,Value=equipo-hosted-prod},{Key=run,Value=$RUN}]" |
| -fact_eq "state bucket versioning" Enabled aws s3api get-bucket-versioning --bucket "$STATE_BUCKET" --query Status --output text |
| -``` |
| +`ops bucket create --name equipo-hosted-tfstate-149757027610 --versioning --sse AES256 --block-public --expected-owner 149757027610` |
| +records the intent, creates the bucket, records it, sets the public access block, versioning, |
| +encryption and tags, and confirms each by a read. |
| -### 1.2 Binaries and keys (no AWS call) |
| +### 1.2 Keys (no AWS call) |
| ```sh |
| -cd "$REPO"; mkdir -p "$P/bin" |
| -for c in equipo-hosted-controller equipo-hosted-image equipo-hosted-certify; do go build -o "$P/bin/$c" "./cmd/$c"; done |
| -K="$P/keys"; ctl="$P/bin/equipo-hosted-controller" |
| -$ctl keygen -ed25519 -out "$K/controller" # response and feed signing |
| -$ctl keygen -ed25519 -out "$K/instance" # the Equipo instance's request key (RoleInstance) |
| -$ctl keygen -ed25519 -out "$K/operator" # this run's operator key (RoleOperator), deleted in 9.2 |
| -$ctl keygen -ed25519 -out "$K/proxy-a"; $ctl keygen -ed25519 -out "$K/proxy-b" # RoleProxy |
| -$ctl keygen -ca -out "$K/client-ca" # the proxy client CA (S2-8), held by the controller |
| -$ctl keygen -ca -out "$K/intercept-ca" # the proxies' inner-TLS CA; its SPKI pin goes in every bootstrap |
| +. "$P/run.env"; K="$P/keys"; c="$P/bin/equipo-hosted-controller" |
| +$c keygen -ed25519 -out "$K/controller" # response, feed and evidence signing |
| +$c keygen -ed25519 -out "$K/instance" # the Equipo instance's request key |
| +$c keygen -ed25519 -out "$K/operator" # this run's operator key (rotation: 9.3) |
| +$c keygen -ed25519 -out "$K/proxy-a"; $c keygen -ed25519 -out "$K/proxy-b" |
| +$c keygen -ca -out "$K/client-ca" # proxy client CA (S2-8), held by the controller |
| +$c keygen -ca -out "$K/intercept-ca" # proxies' inner-TLS CA; its SPKI pin is in every bootstrap |
| chmod -R go-rwx "$K" |
| +ops tfvars --out "$P/prod.tfvars" --instance-host '<INSTANCE_HOST>' --alert-email '<ALERT_EMAIL>' \ |
| + --budget 150 --budget-action 300 --release '<HOSTED_RELEASE>' --keys "$K" |
| ``` |
| -`prod.tfvars` is written from these public halves, `INSTANCE_HOST`, the release digests and the |
| -budget numbers. Private halves reach the hosts only through the config bucket (4.1), each object |
| -readable by one host role. |
| +`ops tfvars` writes only public halves, hostnames, fixed addresses and numbers. |
| + |
| +## 2. Account baseline |
| -## 2. Account baseline (`envs/prod/account`, phase `account`) |
| +### 2.0 Account singletons (decision 4) |
| -### 2.1 Plan and apply |
| +`ops singleton ensure s3-account-public-access-block` and `ops singleton ensure ebs-default-encryption`: |
| +each reads and records the current value, turns the setting on only if it is off, and confirms by a |
| +read. Teardown and rollback never turn them off. |
| -`tf account account`. Allowed addresses: `aws_cloudtrail.main`, `aws_s3_bucket.trail` (plus its |
| -versioning, encryption, public access block, policy and lifecycle at 400 days), `aws_ebs_encryption_by_default.on`, |
| -`aws_s3_account_public_access_block.on`, `aws_iam_account_password_policy.strict`, |
| -`aws_sns_topic.alerts`, `aws_sns_topic_policy.alerts`, `aws_sns_topic_subscription.paul_email`, |
| -`aws_budgets_budget.monthly`, `aws_budgets_budget_action.stop_launches`, |
| -`aws_iam_role.budget_action`, `aws_iam_policy.deny_launches`, `aws_ce_anomaly_monitor.service`, |
| -`aws_ce_anomaly_subscription.daily`. The trail logs management events in every region and the |
| -Lambda MicroVM data events in `eu-west-1`. |
| +### 2.1 Plan and apply (`envs/prod/account`, phase `account`) |
| -### 2.2 Checks (read-only) |
| +`ops tf account account`. Addresses: `aws_s3_bucket.trail` with its versioning, encryption, public |
| +access block, bucket policy (CloudTrail writes only) and a 400-day lifecycle; `aws_cloudtrail.main` |
| +(multi-region management events, plus one advanced event selector for data events with |
| +`resources.type` `AWS::Lambda::MicrovmImage`); `aws_sns_topic.alerts`, `aws_sns_topic_policy.alerts` |
| +(publish allowed to this account's CloudWatch and Budgets and to the controller role's ARN by name); |
| +`aws_sns_topic_subscription.paul_email`; `aws_budgets_budget.monthly` (cost, monthly, $150, four |
| +notifications to the topic). |
| -`fact_eq` on: the trail is logging; EBS default encryption is on; the budget's limit is the |
| -approved amount; the anomaly subscription's threshold is "daily spend above twice the trailing |
| -average" as far as AWS can express it (a FINDING otherwise; the monthly budget's alerts remain). |
| +### 2.2 Checks |
| -### 2.3 Paul confirms the email subscription (HUMAN) |
| +`ops assert` that the trail is logging and has the data-event selector; `ops fact` that the budget's |
| +limit is $150. |
| -The run waits for Paul to confirm. `get-subscription-attributes` must then show |
| -`PendingConfirmation` `false`; until then, a FINDING, and the run goes on (alerts are not needed by |
| -later steps). |
| +### 2.3 Paul confirms the email subscription (HUMAN, by hand-over) |
| -## 3. Network and connector (`envs/prod/network`, phase `network`) |
| +`ops wait-human sns-confirmed --max 24h --background` starts the clock here; 9.1 checks it. Later |
| +steps do not wait for it. |
| -### 3.1 Plan and apply |
| +## 3. Network, config stack, connector, keys into place |
| -`tf network network`. Allowed addresses: `aws_vpc.vm` (DNS support and hostnames off), |
| -`aws_subnet.vm[0]`, `aws_route_table.vm`, `aws_route_table_association.vm[0]`, |
| -`aws_route.vm_to_proxy[0..1]`, `aws_security_group.vm`, `aws_vpc_security_group_egress_rule.vm_proxy[0..3]`, |
| -`aws_network_acl.vm` and its rules, `aws_default_security_group.vm`, `aws_default_route_table.vm`, |
| -`aws_default_network_acl.vm`, `aws_vpc.services` (DNS on), `aws_subnet.services[0..1]` (two AZs), |
| -`aws_internet_gateway.services`, `aws_route_table.services`, `aws_route_table_association.services[0..1]`, |
| -`aws_route.services_to_vm`, `aws_vpc_peering_connection.vm_services`, `aws_iam_role.connector_operator`, |
| +### 3.1 Network (`envs/prod/network`, phase `network`) |
| + |
| +`ops tf network network`. Fixed addresses come from `prod.tfvars`: services VPC `10.42.0.0/16` with |
| +subnet A `10.42.1.0/24` in `eu-west-1a` and B `10.42.2.0/24` in `eu-west-1b`; proxy A at |
| +`10.42.1.10`, proxy B at `10.42.2.10`; VM VPC `10.43.0.0/16` with VM subnet `10.43.1.0/24`. |
| +Addresses: `aws_vpc.vm` (DNS support and hostnames off), `aws_default_security_group.vm` (no rules), |
| +`aws_default_route_table.vm`, `aws_default_network_acl.vm`, `aws_subnet.vm`, `aws_route_table.vm`, |
| +`aws_route_table_association.vm`, `aws_route.vm_to_proxy_a`, `aws_route.vm_to_proxy_b` (each a |
| +`/32` over the peering), `aws_security_group.vm` with `aws_vpc_security_group_egress_rule.vm_proxy_a_egress`, |
| +`.vm_proxy_a_boot`, `.vm_proxy_b_egress`, `.vm_proxy_b_boot` (each one address on 8443 or 8444) and |
| +no ingress rule, `aws_network_acl.vm` and its rules; `aws_vpc.services` (DNS on), `aws_subnet.services_a`, |
| +`aws_subnet.services_b`, `aws_internet_gateway.services`, `aws_route_table.services`, |
| +`aws_route.services_default` (`0.0.0.0/0` to the internet gateway), `aws_route.services_to_vm` (the |
| +VM subnet over the peering), `aws_route_table_association.services_a`, `.services_b`; |
| +`aws_vpc_peering_connection.vm_services` (same account, auto-accept); `aws_iam_role.connector_operator`, |
| `aws_iam_role_policy_attachment.connector_managed` (`AWSLambdaNetworkConnectorOperatorPolicy`), |
| -`aws_iam_role_policy.connector_delete_eni` (subnet-scoped `ec2:DeleteNetworkInterface`), |
| -`aws_lambda_network_connector.vm_egress` (or the stack's `terraform_data` wrapper around the |
| -publish tool if the AWS provider has no resource for it at the pinned version; slice 2 Task 28 |
| -decides and `phases.json` names the one used). |
| +`aws_iam_role_policy.connector_delete_eni` (`ec2:DeleteNetworkInterface` conditioned on the VM subnet |
| +and the Lambda-managed operator, as Task 17b's). |
| -### 3.2 Wait for the connector (unit, bound 20 min) |
| +### 3.2 Config stack (`envs/prod/config`, phase `config`) |
| -`equipo_image connector-wait --arn "$(jq -r .connector_arn.value "$P/out-network.json")" --timeout 18m`; |
| -ACTIVE, then record the `:1` version ARN (Task 17's 2.4 fact) as `CONN_VERSION_ARN`. |
| +`ops tf config config`. Addresses: `aws_s3_bucket.config`, `aws_s3_bucket.litestream`, |
| +`aws_s3_bucket.image_inputs`, each with versioning, encryption, public access block and a bucket |
| +policy that denies any principal outside this account; `aws_iam_role.controller`, |
| +`aws_iam_role.proxy_a`, `aws_iam_role.proxy_b` (trusted by EC2, no permissions yet: their policies |
| +come with the hosts in 5.1); `aws_iam_role.image_build` with `aws_iam_role_policy.image_build` (read |
| +`images/` in the image-input bucket, write its log group) and `aws_cloudwatch_log_group.image_build`. |
| -### 3.3 Checks (read-only) |
| +### 3.3 Checks (fatal) |
| -`fact_eq`: the VM VPC's `enableDnsSupport` is false; the VM route table holds the local route and |
| -exactly the two proxy `/32` routes over the peering; the VM security group's egress set is exactly |
| -the two proxies on 8443 and 8444 and it has no ingress. A difference in any of these is a **hard |
| -stop** (it is the egress boundary), not a FINDING. |
| +`ops assert`: the VM VPC's `enableDnsSupport` and `enableDnsHostnames` are false; the VM route table |
| +holds the local route and exactly the two proxy `/32` routes over the one peering; the services |
| +route table routes the VM subnet over that peering; the VM security group's egress is exactly the |
| +two addresses on 8443 and 8444, with no ingress; the peering is `active`. Any difference is a hard |
| +stop. |
| -## 4. Controller and proxies (`envs/prod/services`, phase `services`) |
| +### 3.4 The connector (unit, bound 20 min) |
| -### 4.1 Config bucket objects, then plan and apply |
| +`ops connector create --subnet <vm subnet> --security-group <vm sg> --role <connector_operator ARN>` |
| +records the intent, creates the `VPC_EGRESS` connector for MicroVMs with no Elastic IPs, waits for |
| +`ACTIVE`, reads the `:1` qualified ARN (Task 17 fact) and records both. A refusal or a timeout is a |
| +hard stop. |
| -The `services` stack creates `aws_s3_bucket.config` first in the same apply; the private keys are |
| -uploaded in 4.2 after it exists, and the hosts wait for them at boot (cloud-init retries for 15 |
| -minutes, then leaves the unit off). Allowed addresses: `aws_s3_bucket.config` (+ versioning, |
| -encryption, public access block, policy), `aws_s3_bucket.litestream` (+ the same), |
| -`aws_s3_bucket.image_inputs` (+ the same), `aws_iam_role.controller`, `aws_iam_role_policy.controller`, |
| -`aws_iam_instance_profile.controller`, `aws_iam_role.proxy`, `aws_iam_role_policy.proxy` (only |
| -`s3:GetObject` on `proxy/<name>/*`), `aws_iam_instance_profile.proxy`, `aws_instance.controller`, |
| -`aws_eip.controller`, `aws_security_group.controller`, `aws_instance.proxy[0..1]`, `aws_eip.proxy[0..1]`, |
| -`aws_security_group.proxy`, `aws_cloudwatch_metric_alarm.status_check[0..2]`. Then `tf services services`. |
| +### 3.5 Private keys into the config bucket |
| -### 4.2 Upload the private keys (CLI) |
| +`ops keys upload --bucket <config bucket> --expected-owner 149757027610 --keys "$P/keys"` uploads |
| +with SSE, each to its own key: `controller/controller.key`, `controller/client-ca.key`, |
| +`controller/operators.json` (the operator public key), `proxy/a/proxy.key`, `proxy/a/intercept.key`, |
| +`proxy/b/proxy.key`, `proxy/b/intercept.key`. Each is confirmed by a `HeadObject`. Keys are in place |
| +before any host exists. |
| -```sh |
| -guard; CB=$(jq -r .config_bucket.value "$P/out-services.json") |
| -for o in controller/controller.key:controller client-ca/ca.key:controller proxy/a/proxy.key:proxy-a \ |
| - proxy/a/intercept.key:intercept-ca proxy/b/proxy.key:proxy-b proxy/b/intercept.key:intercept-ca; do |
| - key=${o%%:*}; src=${o##*:} |
| - aws s3api put-object --bucket "$CB" --key "$key" --body "$P/keys/$src.key" --server-side-encryption AES256 >/dev/null |
| - jw "KEY-UPLOADED $key" |
| -done |
| -``` |
| +## 4. Image |
| + |
| +### 4.1 Build (no AWS call) |
| -### 4.3 Hosts up (unit, bound 20 min) |
| +`img build -manifest "$REPO/infra/hosted/image/manifest.json" -out "$P/image.zip"`; `ops assert` that |
| +its digest equals `IMAGE_DIGEST` in `$REPO/release/<HOSTED_RELEASE>.json`, the one the dev drill |
| +certified. A difference is a hard stop. |
| -Poll until the controller's `/healthz` (over the pinned TLS from 4.4) answers and its metrics show |
| -`network_audit_passing 1` and one `provider_bound` row for `aws:149757027610:eu-west-1`, and each |
| -proxy's feed poll appears in the controller's `proxy_last_feed_seconds{proxy="a|b"}` below 90 s. |
| -A failing network audit is a **hard stop**. |
| +### 4.2 Upload |
| -### 4.4 Pins (read-only) |
| +`ops object put --bucket <image-input bucket> --key "images/$IMAGE_DIGEST.zip" --file "$P/image.zip" --expected-owner 149757027610` |
| +(ledgered; the checksum is verified by a read). |
| -Read `pins/controller.spki` from the config bucket (written by the controller at first boot); |
| -record it as `CTL_PIN`. A pin that changes between two reads 60 s apart is a hard stop. |
| +### 4.3 Create the image and its Large version (unit, bound 50 min) |
| -## 5. Image |
| +`img publish -name "equipo-hosted-prod-$RUN" -bucket <image-input bucket> -key "images/$IMAGE_DIGEST.zip" -build-role-arn <image_build role ARN> -log-group <image_build log group> -size large -capabilities ALL -timeout 45m -out "$P/image.json"`, |
| +then `ops ledger rec microvm-image "$(jq -r .ImageArn "$P/image.json")"` and |
| +`ops ledger rec microvm-image-version "$(jq -r .VersionArn "$P/image.json")"`. Pre-approved fallback: |
| +one base image version down, once. |
| -### 5.1 Build (no AWS call) |
| +## 5. Controller and proxies (`envs/prod/services`, phase `services`) |
| -`equipo_image build -manifest "$REPO/infra/hosted/image/manifest.json" -out "$P/image.zip"`; record |
| -`IMAGE_DIGEST`. It must equal the digest the release recorded for `<HOSTED_RELEASE>` and the dev |
| -drill certified; else a hard stop. |
| +### 5.1 Plan and apply |
| -### 5.2 Upload |
| +`ops tfvars --add-image "$P/image.json" --add-connector` adds the image map (digest to image and |
| +version ARN) and the connector's `:1` ARN from the ledger. `ops tf services services`. Addresses: |
| +`aws_iam_role_policy.controller` (slice 2 Task 28's permissions), `aws_iam_instance_profile.controller`, |
| +`aws_instance.controller` (`t4g.small`, standard credits, IMDSv2 required), `aws_eip.controller`, |
| +`aws_security_group.controller`, `aws_iam_role_policy.proxy_a`, `aws_iam_role_policy.proxy_b` (each |
| +`s3:GetObject` on its own prefix only), `aws_iam_instance_profile.proxy_a`, `.proxy_b`, |
| +`aws_instance.proxy_a`, `aws_instance.proxy_b` (`t4g.micro`, standard credits, IMDSv2, the fixed |
| +private addresses), `aws_eip.proxy_a`, `aws_eip.proxy_b`, `aws_security_group.proxy`; the alarms |
| +`aws_cloudwatch_metric_alarm.heartbeat` (the controller's `Heartbeat`, published only after a clean |
| +reaper pass; missing for 3 minutes is breaching), `.audit` (`AuditPassing` below 1), `.leaked_vm` |
| +(`OrphansSeen` above 0 for 15 minutes), `.proxy_silent` (`ProxySilent` above 0), `.sns_failed` (the |
| +topic's `NumberOfNotificationsFailed` above 0), `.status_controller`, `.status_proxy_a`, |
| +`.status_proxy_b`, each notifying the topic; `aws_iam_policy.deny_launches`, |
| +`aws_iam_role.budget_action` (trusted by `budgets.amazonaws.com`, allowed only |
| +`iam:AttachRolePolicy` and `iam:DetachRolePolicy` on the controller role with that policy ARN as the |
| +condition), and `aws_budgets_budget_action.stop_launches` (`APPLY_IAM_POLICY`, threshold |
| +`ABSOLUTE_VALUE` 300 on `ACTUAL`, `AUTOMATIC`, policy `deny_launches`, roles `[controller]`, |
| +subscriber the topic). |
| -`intent s3-object image.zip`; `aws s3api put-object --bucket "$(jq -r .image_inputs_bucket.value "$P/out-services.json")" --key "images/$IMAGE_DIGEST.zip" --body "$P/image.zip" --checksum-algorithm SHA256 --tagging "purpose=equipo-hosted-prod&run=$RUN"`; `rec ARTIFACT`. |
| +### 5.2 Hosts up (unit, bound 20 min) |
| -### 5.3 Create the image and its Large version (unit, bound 50 min) |
| +The controller's `ExecStartPre` fetches its keys and config, then runs `litestream restore |
| +-if-replica-exists` (none on a first boot); the controller and Litestream start; the controller writes |
| +`pins/controller.spki`. `ops wait object --bucket <config bucket> --key pins/controller.spki --max |
| +15m`, then `ops ledger rec controller-pin <value>`. |
| -`intent microvm-image equipo-hosted-prod-<RUN>`; `equipo_image publish --account 149757027610 --region eu-west-1 --name equipo-hosted-prod-<RUN> --bucket ... --key ... --size large --capabilities ALL --timeout 45m`; |
| -`rec IMAGE_ARN`, `rec IMAGE_VERSION`. Pre-approved fallback: one base image version down, once. |
| +### 5.3 Status, through the pin (fatal) |
| + |
| +`ops status --controller https://<controller EIP> --pin <pin> --operator-key "$P/keys/operator.key"` |
| +calls the operator route `GET /v1/status` (slice 2 Task 5). `ops assert`: network audit passing; one |
| +`provider_bound` row for `aws:149757027610:eu-west-1`; both proxies' last feed under 90 s; a clean |
| +reaper pass in the last 2 minutes; and the pin unchanged on a second read 60 s later. |
| + |
| +### 5.4 Restore check (fatal) |
| + |
| +`ops litestream-check --bucket <litestream bucket>` restores the latest generation into `$P` with the |
| +pinned Litestream binary and checks that it opens and holds the `provider_bound` row. A failure is a |
| +hard stop: launches stay off until the database is durable. |
| ## 6. Certification |
| -### 6.1 Controller config gains the candidate image, and launches go on (CLI) |
| +### 6.1 The candidate image, and launches on |
| -Upload `controller/certification-images.json` (`[{"digest": IMAGE_DIGEST, "image_arn": ..., "version": ...}]`) |
| -and `controller/env` with `EQUIPO_HOSTED_ENABLED=1` to the config bucket; then |
| -`equipo-hosted-certify reload --restart --controller https://<EIP> --pin "$CTL_PIN" --operator-key "$P/keys/operator.key"`. |
| -Launches have to be on for the certification launch. Nothing else can launch yet: no Equipo instance |
| -holds the instance key until 7.1, and the controller refuses a `checks` launch without a certificate. |
| -Metrics must show `enabled 1`. |
| +`ops object put` `controller/certification-images.json` (`[{"digest": IMAGE_DIGEST, "image_arn": |
| +<ledger>, "version_arn": <ledger>}]`) and `controller/env` with `EQUIPO_HOSTED_ENABLED=1`; then |
| +`cert reload --restart --controller https://<controller EIP> --pin <pin> --operator-key |
| +"$P/keys/operator.key"`; `ops status` must show `enabled 1`. Nothing else can launch: no instance |
| +holds the instance key until 7.1, and a `checks` launch needs a certificate. |
| ### 6.2 Certification launch (unit, bound 25 min) |
| -`intent cert-launch`; `equipo-hosted-certify launch --controller ... --image "$IMAGE_DIGEST" --wait 20m --out "$P/evidence.json"`; `rec CERT_LAUNCH`. |
| -The controller signs the evidence from its own launch record and stops the VM with proof. `GET /v1/vms` |
| -(operator) must list no live VM for this launch within 5 minutes of the evidence: a live one is a |
| -**hard stop**. |
| +`cert launch --controller https://<controller EIP> --pin <pin> --operator-key "$P/keys/operator.key" |
| +--image "$IMAGE_DIGEST" --wait 20m --out "$P/evidence.json"`, then `ops ledger rec cert-launch |
| +"$(jq -r .LaunchID "$P/evidence.json")"`. The certification VM's one egress service is |
| +`INSTANCE_HOST` (its positive control); its report goes through the proxy bootstrap listener, signed |
| +by its own key. The controller signs the evidence from its launch record and stops the VM with proof. |
| +Then `ops vms settle --image <image ARN> --max 10m`: no live VM of this image, three provider scans |
| +30 s apart. A live one after the bound is a hard stop. |
| -### 6.3 Judge locally (no AWS call) |
| +### 6.3 Judge (no AWS call; fatal) |
| -`equipo-hosted-certify judge -evidence "$P/evidence.json" -release "$REPO/release/<HOSTED_RELEASE>.json"` |
| -must pass: the controller's signature verifies, the measured runner, vm-init and policy digests equal |
| -the release's, and every probe meets the trusted matrix in the tool. A failure is a hard stop: |
| -production does not get an uncertified image. |
| +`cert judge -evidence "$P/evidence.json" -release "$REPO/release/<HOSTED_RELEASE>.json"` must pass. |
| -### 6.4 Paul signs (HUMAN) |
| +### 6.4 Paul signs (HUMAN, bounded 24 h) |
| -Paul copies `evidence.json` and the release manifest to his signing machine and runs |
| -`equipo-hosted-certify sign -evidence evidence.json -release <release>.json -key <his key>`, which |
| -judges again and signs the snapshot it derives from the evidence (there is no snapshot to hand it). |
| -He returns `certificate.json`. The agent checks it with `equipo-hosted-certify verify` against the |
| -public key in `prod.tfvars`, uploads it as `controller/certificates.json`, reloads, and reads |
| -`GET /v1/certs` (operator) to see it active. |
| +Paul copies `evidence.json` and the release manifest to his signing machine and runs `cert sign |
| +-evidence evidence.json -release <release>.json -key <his key>`, which judges again and signs the |
| +snapshot it derives from the evidence. The agent runs `cert verify -cert certificate.json -pub |
| +<public key from prod.tfvars>`, `ops object put` `controller/certificates.json`, `cert reload`, and |
| +`ops assert` that `GET /v1/certs` lists it. Within 15 minutes, `ops fact` that the trail holds a data |
| +event for the image. |
| ## 7. Instance wiring |
| ### 7.1 The Equipo instance's settings |
| -Through the instance's own configuration path (the one `scripts/upgrade-thin.sh` uses for its |
| -settings), set `EQUIPO_HOSTED_RUNNERS=1`, `EQUIPO_HOSTED_CONTROLLER_URL=https://<controller EIP>`, |
| -`EQUIPO_HOSTED_CONTROLLER_PIN=<CTL_PIN>`, `EQUIPO_HOSTED_CONTROLLER_KEY=<controller public key>`, |
| -`EQUIPO_HOSTED_KEY_ID=instance` and the secret `EQUIPO_HOSTED_KEY` (the instance private key, never |
| -echoed). The instance restarts; the settings section shows the new option to owners. |
| +Through the instance's configuration path that `scripts/upgrade-thin.sh` uses, set |
| +`EQUIPO_HOSTED_RUNNERS=1`, `EQUIPO_HOSTED_CONTROLLER_URL=https://<controller EIP>`, |
| +`EQUIPO_HOSTED_CONTROLLER_PIN=<pin>`, `EQUIPO_HOSTED_CONTROLLER_KEY=<controller public key>`, |
| +`EQUIPO_HOSTED_KEY_ID=instance`, and the secret `EQUIPO_HOSTED_KEY` from `$P/keys/instance.key`, |
| +never echoed. The instance restarts. |
| -### 7.2 The instance reaches the controller |
| +### 7.2 The instance reaches the controller (fatal) |
| -At start the instance's dispatcher asks the controller for the admission of a made-up attempt and |
| -logs `hosted_controller_reachable` when the signed not-found answer verifies (slice 2 Task 21). That |
| -line must appear within 2 minutes of the restart. A TLS pin or signature failure is a hard stop: |
| -nothing hosted can work without it. |
| +Within 2 minutes of the restart the instance's log shows `hosted_controller_reachable` (slice 2 |
| +Task 21). `hosted_controller_unreachable` is a hard stop. |
| ## 8. Smoke checks (with Paul) |
| -### 8.1 Paul turns the setting on for one project (HUMAN) |
| +### 8.1 Paul turns the setting on for one project (HUMAN, bounded 24 h) |
| -A scratch project of Paul's, with a Go repository whose checks pass. |
| +A scratch project of Paul's with a Go repository whose checks pass. |
| ### 8.2 Three steps, watched |
| -Paul starts three small tasks: one whose checks pass, one whose checks fail, one that adds a module |
| -the primary's cache lacks. Expected, each a FINDING if different: `waiting_hosted` within 10 s; a |
| -VM enrolled within 2 minutes; results `passed` (certified, `bubblewrap`), `failed`, and `cannot_run` |
| -`needs_network`; each VM stopped with proof within 2 minutes of its step ending; usage settled. A VM |
| -still live 10 minutes after its step ended is a **hard stop**. `rec SMOKE_JOBS` lists the attempts. |
| +Paul starts three small tasks: checks that pass, checks that fail, and a change that adds a module |
| +the base does not pin. Expected, each an `ops fact`: `waiting_hosted` within 10 s; enrolment within |
| +2 minutes; results `passed` (certified, `bubblewrap`), `failed`, and `cannot_run` `needs_network` |
| +`deps_new_module`; usage settled. After each step ends, `ops vms settle --image <image ARN> --max |
| +10m`; a live VM after the bound is hard stop 3. |
| ### 8.3 Alert path |
| -`equipo-hosted-certify alert-test` makes the controller publish one `test` alert; Paul sees the |
| -email. A FINDING if not. |
| +`cert alert-test --controller ... --pin ... --operator-key ...`; Paul sees the email. A FINDING if |
| +not. |
| ## 9. Hand-over |
| -### 9.1 What stays on, on purpose |
| +### 9.1 Prerequisites (fatal) |
| + |
| +`ops assert` that the SNS subscription is confirmed (2.3's wait, bounded 24 h from 2.3), and that |
| +every alarm in 5.1 is `OK` or `INSUFFICIENT_DATA`. |
| -The three stacks, the image and its certificate, the state bucket, the trail, the budget and its |
| -action. Record every output and ARN in `HOSTED-PROD-BRINGUP.md`, with the spend estimate. |
| +### 9.2 What stays on, on purpose |
| -### 9.2 Clean up docs-t1 |
| +The four stacks, the connector, the image and its certificate, the state bucket, the trail, the |
| +budget and its action, the singleton settings. `ops report` writes every output, ARN and the spend |
| +estimate into `HOSTED-PROD-BRINGUP.md`. |
| -Delete `$P/keys/operator.key` (a new one is minted when next needed), copy the other private keys |
| -nowhere, remove `$P` and its worktree (`git worktree remove`), stop every unit of this run, and |
| -check none is left. |
| +### 9.3 The operator key, and replacing it later |
| + |
| +The operator public key lives in `controller/operators.json`. To rotate: mint a new key pair, upload |
| +a new `operators.json`, and reboot the controller host (`aws ec2 reboot-instances`, which re-runs |
| +`ExecStartPre`); no existing operator key is needed. This run's private key is deleted in 9.4. |
| + |
| +### 9.4 Clean up docs-t1 |
| + |
| +Delete `$P/keys`, `ops unit stop --all` (journalled names only), `git worktree remove "$P/repo"`, |
| +remove `$P`, and check nothing of this run is left. |
| ## R. Rollback after a failed step |
| -Rollback undoes only what this run created, newest first, and keeps the account baseline (section 2) |
| -and the state bucket unless Paul asks for full teardown (T): |
| -1. Instance: unset `EQUIPO_HOSTED_RUNNERS` (hosted placements fall back to the primary at once). |
| -2. Controller: `EQUIPO_HOSTED_ENABLED` off; every live job stopped with proof; `GET /v1/vms` empty |
| - three times 30 s apart. |
| -3. Image: `equipo_image delete --arn "$IMAGE_ARN"` (all versions), verified absent by list. |
| -4. `tofu destroy` of `services`, then `network`, each from a saved destroy plan that |
| - `plan-check.py --phase destroy-<stack>` passed. On a connector `DELETE_FAILED`, the pre-approved |
| - condition retry; a second failure is a hard stop with the VPC left in place. |
| -5. Verify by type (direct reads) and by tag; tag index lag is recorded, not chased. |
| +Undoes only what this run created, newest first, and keeps section 2 and the state bucket unless Paul |
| +asks for T: |
| +1. Instance: unset `EQUIPO_HOSTED_RUNNERS`. |
| +2. Controller, if it answers: `EQUIPO_HOSTED_ENABLED` off and every live job stopped with proof. |
| + Then, whether or not it answered: `ops vms settle --image <image ARN> --terminate --max 15m` |
| + terminates every live VM of this run's image through the provider and proves none is left. |
| +3. Image: `img delete --arn <image ARN>` (all versions), verified absent by list. |
| +4. `ops tf services destroy-services`; `ops connector delete` (Task 17b's 10.2 logic: on |
| + `DELETE_FAILED`, one retry with the managed-operator condition dropped and the subnet condition |
| + kept; interfaces left after deletion are waited for and verified gone, never deleted by hand); |
| + `ops bucket empty` for the config, Litestream and image-input buckets (every version and delete |
| + marker, paginated, owner checked, after the hosts that write them are gone); |
| + `ops tf config destroy-config`; `ops tf network destroy-network`. |
| +5. `ops verify-gone` reads each recorded resource directly; the tag index is a cross-check, and its |
| + lag is recorded, not chased. |
| ## T. Full teardown |
| -R, then `tofu destroy` of `account` (the trail's bucket emptied first, versions included), then the |
| -state bucket emptied (all versions and delete markers) and deleted, then the profile block removed |
| -from `~/.aws/config`. Each verified by a direct read. |
| +R, then `ops bucket empty` for the trail bucket, `ops tf account destroy-account`, then |
| +`ops bucket empty` and `ops bucket delete` for the state bucket (last, after every other deletion is |
| +proven and recorded), then the profile block removed from `~/.aws/config`. The singleton settings |
| +stay on. |
| ## S. Safe stop |
| -S.0 stops this run's units by journalled name (Task 17b S.0). S.1 sets `EQUIPO_HOSTED_ENABLED` off |
| -if the controller exists and stops every live job with proof. S.2 reconciles every unresolved |
| -`INTENT` against a direct read and records `NOTCREATED` or `rec`. S.3 reports what exists, what it |
| -costs per month, and waits for Paul. Nothing is deleted in S without Paul's word, except VMs. |
| - |
| -## 10. Hard stops, in one list |
| - |
| -Wrong account or region; spend estimate at $10; a VM live outside its step (6.2, 8.2, R.2); a name |
| -collision or anything outside the ledger or the checked plan (0.5, every `tf`); the egress boundary |
| -differing from the plan (3.3); a failing network audit (4.3); a pin that changes (4.4); an image |
| -digest that differs from the release's (5.1); a certification that fails (6.3); a resource later |
| -steps need that cannot be created or deleted. |
| +S.0 `ops unit stop --all`. S.1 if the controller answers, launches off and live jobs stopped with |
| +proof; then, regardless, `ops vms settle --image <image ARN, if recorded> --terminate --max 15m`. |
| +S.2 `ops ledger reconcile`: every unresolved intent is resolved by a direct read into `rec` or |
| +`NOTCREATED`. S.3 `ops report --stopped` lists what exists and its monthly cost, and the run waits for |
| +Paul. Nothing but VMs is deleted in S without Paul's word. |
| ## 11. Spend |
| -**Bring-up (this run):** hosts for a day about $1.50; the certification VM (Large, about 30 min) |
| -$0.16; three smoke VMs (Large, about 15 min each) $0.24; image storage for the first week up to |
| -$1.50; S3, CloudTrail and SNS under $0.10. **Expected about $3.** The run's estimator (Task 17b's |
| -11.2, with these rates) stops at $10; the ceiling is $20. |
| +**Bring-up:** hosts for a day about $1.50; certification VM (Large, about 30 min) $0.16; three |
| +smoke VMs (Large, about 15 min each) $0.24; image builds about $0.20; image storage for the first |
| +week up to $1.50; S3, CloudTrail and SNS under $0.10. **Expected about $3.70.** |
| + |
| +**The run's own limit.** `ops estimate` adds, from the ledger and the provider: every host's hours |
| +since creation at its on-demand rate; every VM the provider lists for this run's image at four times |
| +the Large rate for its full 90-minute lifetime ($1.86 each); each image build at $1; image storage at |
| +$8 a month pro rata. It stops the run at $10. With the 24-hour human bounds, three waits add at most |
| +about $4.50 of host time; the ceiling is $20. |
| -**Running cost, before any use (eu-west-1 list prices, to confirm on the first bill):** |
| +**Running cost, before any use** (eu-west-1 on-demand rates, to confirm on the first bill; |
| +standard-credit T4g, so no surplus credit charges): |
| | Item | Monthly | |
| | --- | --- | |
| -| Controller, `t4g.small` | $13.40 | |
| -| Two proxies, `t4g.micro` | $13.40 | |
| -| Three public IPv4 addresses | $10.95 | |
| -| EBS, 3 x 8 GB gp3 | $2.11 | |
| -| Image storage | $0.50 to $6.50 (Task 17b's estimate; AWS does not publish it) | |
| -| CloudTrail data events, S3, SNS, Budgets, anomaly detection | under $2 | |
| -| **Total** | **about $41 to $48, call it $45 to $52 with slack** | |
| - |
| -**Use:** each person is capped at $50 a month by the instance (slice 2 Task 20). A 10-minute check |
| -on a Large VM costs about $0.05. The budget action at $300 (decision 1) is AWS's own backstop. |
| +| Controller, `t4g.small` ($0.0184/h) | $13.43 | |
| +| Two proxies, `t4g.micro` ($0.0092/h each) | $13.43 | |
| +| Three public IPv4 addresses ($0.005/h each) | $10.95 | |
| +| EBS, 3 x 8 GB gp3 ($0.088/GB) | $2.11 | |
| +| Image storage | $0.50 to $6.50 (Task 17b's estimate; AWS does not publish a rate) | |
| +| CloudTrail data events, S3, SNS, CloudWatch alarms, Budgets | under $2 | |
| +| **Total** | **$39.92 for the first four lines; about $41 to $49 in all** | |
| + |
| +**Use:** each person is capped at $50 a month by the instance (slice 2 Task 20), counted at the |
| +worst-case burst rate; a 10-minute check counts $0.22. The budget action at $300 (decision 1) is a |
| +delayed backstop. |
| ## 12. Unconfirmed |
| - Whether `OrganizationAccountAccessRole` exists in `149757027610` (0.4). |
| +- Whether `titogo-source` requires MFA (0.3). |
| - The applied MicroVM quota (0.6). |
| -- Whether the pinned AWS provider has a network connector resource (3.1). |
| -- Whether the anomaly subscription can express "twice the trailing average" (2.2). |
| -- Ireland prices for MicroVMs and image storage. |
| -- Lambda's cleanup of the connector's network interfaces (never exercised in dev). |
| +- The CloudTrail resource type for MicroVM data events, `AWS::Lambda::MicrovmImage` (2.2 asserts the |
| + selector; 6.4 observes an event). |
| +- Ireland prices for MicroVMs, T4g and image storage. |
| +- Lambda's cleanup of the connector's interfaces (exercised first in the dev drill). |
| -## 13. Placeholders filled at GO |
| +## 13. Inputs filled at GO |
| -`<HOSTED_RELEASE>` (and so `PIN`), `INSTANCE_HOST`, Paul's alert email address, the budget numbers. |
| +`<HOSTED_RELEASE>` (and so `PIN` and `IMAGE_DIGEST`), `<INSTANCE_HOST>`, `<ALERT_EMAIL>`, the budget |
| +numbers (decision 1), and whether MFA is a condition of GO (decision 3). Everything else is read from |
| +the ledger, `prod.tfvars` or OpenTofu outputs by `ops`. |
diff --git a/docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md b/docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md| index 44742153..1ed273b1 100644 |
| --- a/docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md |
| +++ b/docs/superpowers/plans/2026-11-30-hosted-runners-slice-2.md |
| @@ -1,6 +1,6 @@ |
| -# Hosted runners, slice 2: hosted checks (plan, 2026-11-30, revision 2) |
| +# Hosted runners, slice 2: hosted checks (plan, 2026-11-30, revision 3) |
| -**Status:** revision 2 after Astra round 1 (NOT READY: 4 Critical, 12 Important, 2 Minor, all taken; `.superpowers/sdd/2026-11-30-hosted-slice-2-plan/plan-r1.md`). Nothing built, nothing run against AWS. |
| +**Status:** revision 3 after Astra round 2 (NOT READY: 1 Critical, 7 Important, 1 Minor, all taken; `plan-r2.md`), and round 1 before it (`plan-r1.md`), both in `.superpowers/sdd/2026-11-30-hosted-slice-2-plan/`. Revision 3 also adds Task 33, the production run kit the account plan's Astra round 1 asked for. Nothing built, nothing run against AWS. |
| > **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. Steps marked **HUMAN** are not agent work: stop and ask Paul. |
| @@ -28,7 +28,7 @@ Slice 1a built the controller, the adapter and the reaper, with no egress stack: |
| - **S2-6. No pause or resume in slice 2.** A checks VM is launched, used once and stopped. The slice 1a pause barrier stays unused until slice 4; the VM's `/suspend` and `/resume` hooks answer 409 in one place. |
| - **S2-7. The proxy speaks HTTP/1.1 only** (ALPN `http/1.1`), including the WebSocket upgrade the runner's link uses. HTTP/2 is refused, which removes `:authority` disagreement by construction. |
| - **S2-8. The controller is the client CA for proxy certificates.** It mints a 15-minute certificate per VM against the launch record; both proxies trust that CA and the signed feed. |
| -- **S2-9. Limits are held and settled, conservatively.** Admission holds a job's full lifetime against every UTC day it could touch, and its cost at four times the baseline rate (AWS bills burst up to 4x and does not report it) against every UTC month it could touch. Settling replaces the hold with the instance-observed span from admission to stop proof, at the baseline rate, split at day and month boundaries; the estimate is labelled an estimate. A job without stop proof keeps its hold. |
| +- **S2-9. Limits are held and settled, conservatively, and count only what a person's jobs can cost.** A job's window is `HostedLaunchWindow` (10 minutes to launch) plus its lifetime, from admission. Admission holds the whole window in seconds against every UTC day the window touches, and its cost at four times the Large baseline rate (AWS bills burst up to 4x and does not report it) plus `HostedJobOverheadMicros` (launch calls and data transfer, $0.01) against every UTC month it touches. A job not launched within its launch window is failed and re-admitted with a fresh hold. Settling replaces the hold with the instance-observed span from admission to stop proof, still at four times the baseline rate plus the overhead, because actual burst is unknown; the person sees it as "at most". A job without stop proof keeps its hold. Fixed account costs (hosts, addresses, image storage) are not per person; the AWS budget covers them. With these numbers a 10-minute check counts $0.22 against the $50, so about 230 short checks a month; an owner can raise a person's limit. |
| - **S2-10. No mutation-evidence registry in certification.** Certification judges the probe matrix and the containment suite inside a real VM; guard mutation evidence stays where the house keeps it, in the progress file, checked at review. The 1b outline listed a registry; this drops it. |
| ## Global constraints |
| @@ -41,9 +41,9 @@ Slice 1a built the controller, the adapter and the reaper, with no egress stack: |
| - Package budgets (`.rastrillo/budgets.txt`): `internal/runner/thin`, `internal/runner`, `internal/wire`, `internal/runner/provider` and `internal/hostedctl` are at their recorded sizes. New code goes in new packages (each task names them); any line added to one of those five, or to `internal/equipo/chat`, raises its record in the same commit with the reason. |
| - Copy: new runtime strings only in `internal/equipo/copy.go`, marked pending with `python3 scripts/copy-status.py pending`, listed in `docs/superpowers/plans/2026-11-30-hosted-slice-2-copy.json`. Never accepted by an agent. Plain words, no em dashes, no exclamation marks. |
| - Tests first. Each guard gets a mutation check: break it, watch the named test compile, run at least one test and fail on its assertion (a build error, an infrastructure error or a run of zero tests does not count), restore. Record commands and results in `docs/superpowers/plans/HOSTED-SLICE2-PROGRESS.md`. |
| -- Local runs are targeted (`go test ./internal/<pkg> -run 'TestX' -count=1`). No sudo; scratch under `$TMPDIR` via `mktemp -d`; test servers on `127.0.0.1`; default Go caches. Live AWS tests use build tag `hostedlive` and run only inside Tasks 33 and 34's approved plans. |
| +- Local runs are targeted (`go test ./internal/<pkg> -run 'TestX' -count=1`). No sudo; scratch under `$TMPDIR` via `mktemp -d`; test servers on `127.0.0.1`; default Go caches. Live AWS tests use build tag `hostedlive` and run only inside Tasks 34 and 35's approved plans. |
| - Flags: the instance does nothing hosted unless `EQUIPO_HOSTED_RUNNERS=1`; the controller launches nothing unless `EQUIPO_HOSTED_ENABLED=1`; a project runs nothing hosted unless its owner turned the setting on. |
| -- Commit subjects under 80 characters, trailer `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`. Never merge, push the default branch or deploy. No AWS call outside Tasks 33 and 34's approved plans. |
| +- Commit subjects under 80 characters, trailer `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`. Never merge, push the default branch or deploy. No AWS call outside Tasks 34 and 35's approved plans. |
| ## Review focus |
| @@ -68,7 +68,7 @@ New controller code lives in subpackages `internal/hostedctl/ctlegress`, `ctlcer |
| ```go |
| // hostedwire |
| const RoleProxy Role = "proxy" |
| -type Service struct{ Host string; Port uint16; Class string } // Class "instance" | "cert_report" (slice 4 adds "gateway") |
| +type Service struct{ Host string; Port uint16; Class string } // Class "instance" (slice 4 adds "gateway") |
| type BootstrapV2 struct { |
| Version int `json:"v"` // 2 |
| Purpose string `json:"purpose"` // "checks" | "certification" |
| @@ -90,17 +90,20 @@ type FeedLaunch struct{ LaunchID, AttemptID string; VMRef isolatedjob.Ref; Epoch |
| type RedeemRequest struct{ LaunchID string; VMRef isolatedjob.Ref; ProxyCode string; CSR []byte } |
| type RedeemResponse struct{ Cert []byte; NotAfterNS int64 } |
| type RenewCertRequest struct{ Serial string; CSR []byte } // sent over the current client certificate (Task 6) |
| +type CertReport struct{ Serial string; Report []byte; Sig []byte } // Sig: the VM's certificate key (ECDSA P-256) over "equipo-hosted-cert-report-v1\n"+serial+"\n"+hex(sha256(Report)); sent through the proxy bootstrap listener |
| type CertLaunchRequest struct{ Image isolatedjob.ImageDigest; Size isolatedjob.Size } |
| // wire |
| const PlacementHosted = "waiting_hosted"; const PlacementHostedLimit = "hosted_limit" |
| const TransferKindHostedPack, TransferKindDeps = "hosted_pack", "deps" |
| -const DepsTransferMax = 256 << 20 // its own limit; the 64 MiB limit stays for every other kind |
| +const DepsTransferMax = 256 << 20 // its own byte limit; the 64 MiB limit stays for every other kind |
| +func MaxChunks(kind string) int // DepsTransferMax / chunk size for deps; MaxTransferChunks otherwise |
| +func MaxBytes(kind string) int64 // used by the instance (transfers.go:117) and the receiver (relay.go:174) alike |
| type HostedEnrolRequest struct{ Code, LaunchID string; VMRef string; MachinePublicKey []byte } |
| type HostedChallenge struct{ Nonce []byte; ExpiresAt time.Time } |
| type HostedRenewRequest struct{ RunnerID string; Epoch int64; Nonce, Signature []byte } // Ed25519 over "equipo-hosted-renew-v1\n"+runner+"\n"+epoch+"\n"+nonce |
| ``` |
| -- [ ] **Red:** `TestBootstrapV2Limit` (a maximal valid bootstrap with two proxies and two services encodes under 4096 bytes; 4097 refused; non-ASCII refused). `TestLaunchRequestV2Strict` (unknown field, unknown `Purpose`, empty `Person` for `checks`: refused). `TestDepsTransferLimit` (a `deps` header at 256 MiB accepted, one byte more refused; a `checks` header keeps 64 MiB). `TestHostedKindsNeedProtocol` (`wire.Encode` at protocol 38 refuses a `hosted_pack` or `deps` header with an error instead of dropping it). |
| +- [ ] **Red:** `TestBootstrapV2Limit` (a maximal valid bootstrap with two proxies and two services encodes under 4096 bytes; 4097 refused; non-ASCII refused). `TestLaunchRequestV2Strict` (unknown field, unknown `Purpose`, empty `Person` for `checks`: refused). `TestDepsTransferLimit` (a `deps` header at 256 MiB accepted, one byte more refused; a `checks` header keeps 64 MiB; `MaxChunks` agrees with `MaxBytes` for each kind). `TestHostedKindsNeedProtocol` (`wire.Encode` at protocol 38 refuses a `hosted_pack` or `deps` header with an error instead of dropping it). |
| - [ ] **Green:** `go test ./internal/hostedwire ./internal/wire -run 'TestBootstrapV2|TestLaunchRequestV2|TestDepsTransfer|TestHostedKinds' -count=1`. |
| - [ ] **Mutations:** drop the size check (`TestBootstrapV2Limit`); let `deps` use the 64 MiB limit (`TestDepsTransferLimit`). |
| - [ ] **Commit:** `hostedwire: bootstrap v2, services, admission and proxy feed types`. |
| @@ -109,7 +112,7 @@ type HostedRenewRequest struct{ RunnerID string; Epoch int64; Nonce, Signature [ |
| **Files:** Create `internal/hostedctl/ctlegress/{manifest.go,manifest_test.go}`, `internal/hostedctl/schema/0002_egress.sql`. Modify `internal/hostedctl/launch.go`, `cmd/equipo-hosted-controller/config.go`, `config_test.go`. |
| -**Interfaces:** `ctlegress.Manifest{Services map[string]hostedwire.Service; Proxies, ProxyBoot []netip.AddrPort; ProxyCAPin string}`; `func Load(raw []byte) (Manifest, error)`; `func (m Manifest) For(purpose string, reportHost string) ([]hostedwire.Service, error)` (`checks`: the `instance` class; `certification`: one `cert_report` service, the controller's own public host); `ErrServiceUnset`. Launch intents gain an immutable `services_json` column under the 1a immutability trigger; `Replay` uses it, never current config. |
| +**Interfaces:** `ctlegress.Manifest{Services map[string]hostedwire.Service; Proxies, ProxyBoot []netip.AddrPort; ProxyCAPin string}`; `func Load(raw []byte) (Manifest, error)`; `func (m Manifest) For(purpose string) ([]hostedwire.Service, error)` (both purposes: the `instance` class; a certification VM uses it for its positive control, and sends its report through the proxy bootstrap listener, not as egress); `ErrServiceUnset`. Launch intents gain an immutable `services_json` column under the 1a immutability trigger; `Replay` uses it, never current config. |
| - [ ] **Red:** `TestManifestRefusesWildcardsAndLiterals` (`*.x`, `.x`, `1.2.3.4`, `[::1]`, `amadan.net`, a trailing dot, upper case, port 8443: each refused at load). `TestUnsetServiceBlocksLaunch`. `TestLaunchSnapshotsServices` (the intent's services equal config at launch; later config changes do not reach a saved intent; `Replay` sends the snapshot). `TestSnapshotImmutable`. |
| - [ ] **Green:** `go test ./internal/hostedctl/... ./cmd/equipo-hosted-controller -run 'TestManifest|TestUnsetService|TestLaunchSnapshots|TestSnapshotImmutable' -count=1`. |
| @@ -165,7 +168,7 @@ func (*Client) Admission(ctx context.Context, attempt string) (hostedwire.Admiss |
| **Files:** Create `internal/hostedctl/ctlproxy/{ca.go,feed.go,ca_test.go,feed_test.go}`, `internal/hostedctl/schema/0003_proxy.sql`. Modify `internal/hostedctl/http.go:259` (accept `RoleProxy` on proxy routes only), `stop.go` (revoke on stop), `metrics.go`, `cmd/equipo-hosted-controller/config.go`. |
| -**Interfaces:** routes `GET /v1/proxy/feed`, `POST /v1/proxy/redeem`, `POST /v1/proxy/renew`, role `proxy` only. `CertLifetime = 15 * time.Minute`; `FeedLifetime = 5 * time.Minute`. A certificate's `NotAfter` is the earlier of 15 minutes and the job's deadline. It carries one URI SAN `equipo-launch://<launch_id>/<attempt_id>/<vm_ref>/<epoch>` and the VM's ECDSA P-256 key from the CSR. Proxy codes are stored as SHA-256 only, single use, valid 2 minutes from the moment the controller first sees the VM `running`, bound to the launch and the VM reference. Renewal is allowed once per serial, for the same launch, VM and epoch, before `NotAfter`; it revokes the old serial. Stop or epoch change revokes every serial of the launch. The controller records each proxy key's last feed request; `proxy_last_feed_seconds{proxy}` is a metric, and an alert `proxy_silent` fires once when a configured proxy has not polled for 3 minutes. |
| +**Interfaces:** routes `GET /v1/proxy/feed`, `POST /v1/proxy/redeem`, `POST /v1/proxy/renew` and `POST /v1/proxy/cert-report` (handled in Task 13), role `proxy` only. `CertLifetime = 15 * time.Minute`; `FeedLifetime = 5 * time.Minute`. A certificate's `NotAfter` is the earlier of 15 minutes and the job's deadline. It carries one URI SAN `equipo-launch://<launch_id>/<attempt_id>/<vm_ref>/<epoch>` and the VM's ECDSA P-256 key from the CSR. Proxy codes are stored as SHA-256 only, single use, valid 2 minutes from the moment the controller first sees the VM `running`, bound to the launch and the VM reference. Renewal is allowed once per serial, for the same launch, VM and epoch, before `NotAfter`; it revokes the old serial. Stop or epoch change revokes every serial of the launch. The controller records each proxy key's last feed request; `proxy_last_feed_seconds{proxy}` is a metric, and an alert `proxy_silent` fires once when a configured proxy has not polled for 3 minutes. |
| - [ ] **Red:** `TestRedeemSingleUse`, `TestRedeemBindsVMRef` (the right code from another VM: refused), `TestRedeemExpires` (2 min 1 s), `TestCertCappedAtDeadline`, `TestRenewOncePerSerial` (a replayed renewal is refused), `TestRenewNeedsCurrentEpoch`, `TestStopRevokesSerials`, `TestFeedSignedAndListsOnlyLive`, `TestProxyRoleOnlyOnProxyRoutes` (a proxy key on `/v1/jobs` and an instance key on `/v1/proxy/feed`: 403), `TestProxySilentAlertOnce`. |
| - [ ] **Green:** `go test ./internal/hostedctl/... -run 'TestRedeem|TestCertCapped|TestRenew|TestStopRevokes|TestFeed|TestProxyRole|TestProxySilent' -count=1`. |
| @@ -176,9 +179,9 @@ func (*Client) Admission(ctx context.Context, attempt string) (hostedwire.Admiss |
| **Files:** Modify `internal/hostedctl/http.go`, `launch.go`, `cmd/equipo-hosted-controller/main.go`. Create `internal/hostedctl/operator_test.go`. |
| -**Interfaces:** operator role only: `POST /v1/cert/launch` (`CertLaunchRequest`; the image must be in the operator's `certification-images.json`; purpose `certification`, `Person` empty, services from `Manifest.For("certification")`); `GET /v1/certs` (active certificate digests and their snapshots); `POST /v1/admin/reload` (re-read the certificate and certification-image files; a file that fails to verify leaves the old set in place and returns the error); `POST /v1/admin/restart` (exit 0 after in-flight requests, so systemd restarts it and `ExecStartPre` re-fetches config); `POST /v1/admin/alert-test` (one `test` alert). `GET /v1/vms` already exists. |
| +**Interfaces:** operator role only: `POST /v1/cert/launch` (`CertLaunchRequest`; the image must be in the operator's `certification-images.json`; purpose `certification`, `Person` empty, services from `Manifest.For("certification")`); `GET /v1/certs` (active certificate digests and their snapshots); `POST /v1/admin/reload` (re-read the certificate and certification-image files; a file that fails to verify leaves the old set in place and returns the error); `POST /v1/admin/restart` (exit 0 after in-flight requests, so systemd restarts it and `ExecStartPre` re-fetches config); `POST /v1/admin/alert-test` (one `test` alert); `GET /v1/status` (the network audit result, `provider_bound` rows, each proxy's last feed age, `enabled`, the last clean reaper pass), so an operator outside the VPC can see what the private metrics listener shows. `GET /v1/vms` already exists. |
| -- [ ] **Red:** `TestCertLaunchOperatorOnly`, `TestCertLaunchNeedsCandidateImage`, `TestReloadKeepsOldSetOnBadFile`, `TestAlertTestPublishesOnce`. |
| +- [ ] **Red:** `TestCertLaunchOperatorOnly`, `TestCertLaunchNeedsCandidateImage`, `TestReloadKeepsOldSetOnBadFile`, `TestAlertTestPublishesOnce`, `TestStatusOperatorOnly`. |
| - [ ] **Green:** `go test ./internal/hostedctl -run 'TestCertLaunch|TestReload|TestAlertTest' -count=1`. |
| - [ ] **Mutation:** accept an instance key on `/v1/cert/launch`. |
| - [ ] **Commit:** `hostedctl: operator routes for certification and reload`. |
| @@ -202,9 +205,9 @@ func Serve(ctx context.Context, cfg Config) error |
| type Config struct{ Egress, Boot netip.AddrPort; ControllerURL string; ControllerKey ed25519.PublicKey; ControllerTLSPin string; KeyID hostedwire.KeyID; Key ed25519.PrivateKey; ClientCA *x509.CertPool; InterceptCA tls.Certificate; OriginRoots *x509.CertPool /* nil: system roots */; Log io.Writer } |
| ``` |
| -Path classes, exact: `instance`: `GET /api/runner/stream` (WebSocket upgrade only), `GET /api/runner/protocol`, `POST /api/hosted/enrol`, `POST /api/hosted/challenge`, `POST /api/hosted/renew`; `cert_report`: `POST /v1/cert/report`. Reasons are fixed strings: `stale_feed`, `cert_expired`, `unknown_launch`, `revoked`, `wrong_epoch`, `not_in_manifest`, `ip_literal`, `no_sni`, `ech`, `sni_mismatch`, `host_mismatch`, `bad_port`, `bad_method`, `bad_path`, `alpn`, `redirect_refused`, `nested_tunnel`. |
| +Path class, exact: `instance`: `GET /api/runner/stream` (WebSocket upgrade only), `GET /api/runner/protocol`, `POST /api/hosted/enrol`, `POST /api/runner/v2/hosted/challenge`, `POST /api/runner/v2/hosted/renew`. Reasons are fixed strings: `stale_feed`, `cert_expired`, `unknown_launch`, `revoked`, `wrong_epoch`, `not_in_manifest`, `ip_literal`, `no_sni`, `ech`, `sni_mismatch`, `host_mismatch`, `bad_port`, `bad_method`, `bad_path`, `alpn`, `redirect_refused`, `nested_tunnel`. |
| -Egress listener: TLS requiring a client certificate from the controller CA; each tunnel is HTTP/1.1 `CONNECT host:443`; the proxy answers 200, terminates the inner TLS with a leaf for exactly that host minted from `InterceptCA` (ALPN `http/1.1` only), reads each request, applies `Decide` with CONNECT target, SNI, `Host`, method and path, and forwards over its own TLS to that exact host (SNI set, `OriginRoots`). A WebSocket upgrade is piped only after the same check. A 3xx naming another authority becomes 502. Every tunnel carries a timer at `Deadline`; at the deadline, or when a fresher feed revokes the identity, the tunnel and any piped WebSocket close. Bootstrap listener: server TLS only; `POST /redeem` (no client certificate) and `POST /renew` (requires the current client certificate, whose serial is sent), each forwarded to the controller under the proxy's signature. Decision log: one JSON line per decision with VM, launch, attempt, destination, method, path class, decision, reason, bytes in and out; never headers, bodies or tokens. `config.go` refuses wildcard listen addresses. |
| +Egress listener: TLS requiring a client certificate from the controller CA; each tunnel is HTTP/1.1 `CONNECT host:443`; the proxy answers 200, terminates the inner TLS with a leaf for exactly that host minted from `InterceptCA` (ALPN `http/1.1` only), reads each request, applies `Decide` with CONNECT target, SNI, `Host`, method and path, and forwards over its own TLS to that exact host (SNI set, `OriginRoots`). A WebSocket upgrade is piped only after the same check. A 3xx naming another authority becomes 502. Every tunnel carries a timer at `Deadline`; at the deadline, or when a fresher feed revokes the identity, the tunnel and any piped WebSocket close. Bootstrap listener: server TLS only; `POST /redeem` (no client certificate), `POST /renew` and `POST /cert-report` (each requires a current client certificate, whose serial must equal the body's), each forwarded to the controller under the proxy's signature. The proxy never asserts the VM's identity to the controller: renewal binds to the serial the controller issued, and a report carries the VM key's own signature (Task 13). Decision log: one JSON line per decision with VM, launch, attempt, destination, method, path class, decision, reason, bytes in and out; never headers, bodies or tokens. `config.go` refuses wildcard listen addresses. |
| - [ ] **Red:** `TestDecideTable` (one row per reason, plus allowed rows for each path). `TestStaleFeedDeniesAll` (at lifetime + 1 ms on the monotonic clock; wall clock jumps change nothing). `TestConfigRefusesWildcardListen`. `TestLogHasNoSecrets`. `TestPathClassCoversRunner` (scans `internal/runner/...` and `internal/wire` for instance paths the hosted runner uses and fails if one is outside the `instance` class). |
| - [ ] **Green:** `go test ./internal/hostedproxy ./cmd/equipo-hosted-proxy -run 'TestDecide|TestStaleFeed|TestConfig|TestLogHasNoSecrets|TestPathClass' -count=1`; `make build vet`. |
| @@ -217,7 +220,7 @@ Egress listener: TLS requiring a client certificate from the controller CA; each |
| **Interfaces:** `proxytest.Harness{Proxy *hostedproxy.Server; Origin, Other *httptest.Server; Controller *FakeController; Clock *FakeMono}`, all on `127.0.0.1`. The client side is the real hosted transport from Task 12 once it exists; until then the harness's `Client(id)` builds the same `http.Transport`, and Task 12 replaces it (this test must still pass). |
| -- [ ] **Red:** `TestFrontingMatrix`: allowed SNI with another `Host`; CONNECT to the allowed host then SNI of another; CONNECT to `127.0.0.1:443`, `[::1]:443`, the host on 8443; no SNI; ALPN `h2` only; `x@host` and `host%2Eexample`; an absolute-form URI naming another host; a WebSocket upgrade with another `Host`; a nested CONNECT. Each refused with its reason; the origin sees nothing. Positive control: the allowed runner path succeeds and a WebSocket round trip works. `TestNoCertificate`, `TestCertFromOtherCA`, `TestReplayedCertAfterRevoke`, `TestWrongEpochCert`. `TestOpenSocketClosesAtCertExpiry` (an upgraded WebSocket open across `NotAfter` is closed at it). `TestPartitionedProxy` (the controller is up but the proxy cannot reach it: open sockets close at the feed's expiry, new requests fail with `stale_feed`). `TestRenewalReplayRefused` (a captured renewal replayed through the bootstrap listener is refused). |
| +- [ ] **Red:** `TestFrontingMatrix`: allowed SNI with another `Host`; CONNECT to the allowed host then SNI of another; CONNECT to `127.0.0.1:443`, `[::1]:443`, the host on 8443; no SNI; ALPN `h2` only; `x@host` and `host%2Eexample`; an absolute-form URI naming another host; a WebSocket upgrade with another `Host`; a nested CONNECT. Each refused with its reason; the origin sees nothing. Positive control: the allowed runner path succeeds and a WebSocket round trip works. `TestNoCertificate`, `TestCertFromOtherCA`, `TestReplayedCertAfterRevoke`, `TestWrongEpochCert`. `TestOpenSocketClosesAtCertExpiry` (an upgraded WebSocket open across `NotAfter` is closed at it). `TestPartitionedProxy` (the controller is up but the proxy cannot reach it: open sockets close at the feed's expiry, new requests fail with `stale_feed`). `TestRenewalReplayRefused` (a captured renewal replayed through the bootstrap listener is refused). `TestCertReportThroughProxy` (a report signed by the VM key reaches the fake controller intact; a report with forged identity headers, another serial, or a signature by a different key is refused by the controller). |
| - [ ] **Green:** `go test ./internal/hostedproxy -run 'TestFronting|TestNoCertificate|TestCertFromOtherCA|TestReplayedCert|TestWrongEpoch|TestOpenSocket|TestPartitioned|TestRenewalReplay' -count=1` within the 10 s package budget. |
| - [ ] **Mutations:** accept `h2`; skip the tunnel deadline timer. Each fails a named row. |
| - [ ] **Commit:** `hostedproxy: fronting, expiry and revocation tests over TLS`. |
| @@ -239,9 +242,9 @@ Egress listener: TLS requiring a client certificate from the controller CA; each |
| **Files:** Modify `internal/isolatedjob/awsjob/network.go` (`onlyLocal` at `:198`, the audit), `network_test.go`, `internal/isolatedjob/isolatedjob.go` (`NetworkAudit`), `cmd/equipo-hosted-controller/config.go`. |
| -**Interfaces:** `awsjob.Config` gains `PeeringID string; ProxyRoutes []netip.Prefix` (each a `/32`). The VM subnet's route table may hold the local route and, for each configured prefix, exactly one route to it via `PeeringID`; any other route, a different peering, a prefix wider than `/32`, or a missing proxy route fails the audit. The peering itself must be `active`, between the configured VPCs, in this account. The connector check keeps one VM subnet (`network.go:112`). |
| +**Interfaces:** `awsjob.Config` gains `PeeringID, ServicesRouteTableID string; ProxyRoutes []netip.Prefix` (each a `/32`). The VM subnet's route table may hold the local route and, for each configured prefix, exactly one route to it via `PeeringID`; any other route, a different peering, a prefix wider than `/32`, or a missing proxy route fails the audit. The peering itself must be `active`, between the configured VPCs, in this account. `ServicesRouteTableID` is also audited: it must route the VM subnet's CIDR over the same peering and nothing else over any peering. The connector check keeps one VM subnet (`network.go:112`). |
| -- [ ] **Red:** `TestAuditAcceptsPinnedPeering`. `TestAuditRefusesOtherPeeringRoute` (a `/24` over the same peering; a `/32` to an address that is not a proxy; a second peering). `TestAuditRefusesMissingProxyRoute`. `TestAuditRefusesInactivePeering`. The existing audit tests still pass. |
| +- [ ] **Red:** `TestAuditAcceptsPinnedPeering`. `TestAuditRefusesOtherPeeringRoute` (a `/24` over the same peering; a `/32` to an address that is not a proxy; a second peering). `TestAuditRefusesMissingProxyRoute`. `TestAuditRefusesInactivePeering`. `TestAuditRefusesMissingReturnRoute` (no return route, or a return route over another peering). The existing audit tests still pass. |
| - [ ] **Green:** `go test ./internal/isolatedjob/... -run 'TestAudit' -count=1`. |
| - [ ] **Mutation:** accept any route via the peering. |
| - [ ] **Commit:** `awsjob: audit the VM subnet's routes to the proxies over one peering`. |
| @@ -313,13 +316,13 @@ func (*Session) Token() string |
| **Files:** Create `internal/hostedcert/{matrix.go,probe_linux.go,evidence.go,judge.go,matrix_test.go,judge_test.go}`, `internal/hostedctl/ctlcert/{report.go,report_test.go}`, `cmd/equipo-hosted-certify/main.go`. Modify `cmd/equipo-runner/main.go` (`hosted-certify`). |
| **Interfaces:** |
| -- Runner (`hosted-certify`, as the runner user): runs the user and sandbox probes, reads `root.json` and `measured.json` from `EQUIPO_HOSTED_RESULTS`, and posts `Report{LaunchID string; Root, User, Sandbox []ProbeResult; Measured map[string]string; Containment ContainmentResult}` to `POST /v1/cert/report` through the proxy (the launch's one service). |
| -- Controller (`ctlcert/report.go`): accepts a report only from a client certificate of a live `certification` launch with that launch ID, once; wraps it in `Evidence{EvidenceID, LaunchID string; Image isolatedjob.ImageDigest; ImageVersion string; ProxyPolicy int; Deployment []string; Report Report; ReceivedNS int64}`, where every field but `Report` comes from the controller's own launch record and config, and signs it with the controller key. `GET /v1/cert/evidence/{launch}` (operator) returns it. Then it stops the VM with proof. |
| +- Runner (`hosted-certify`, as the runner user): runs the user and sandbox probes, reads `root.json` and `measured.json` from `EQUIPO_HOSTED_RESULTS`, and sends `Report{LaunchID string; Root, User, Sandbox []ProbeResult; Measured map[string]string; Containment ContainmentResult}` as a `hostedwire.CertReport` signed with its certificate key to the proxy bootstrap listener's `POST /cert-report`, which forwards it to the controller's `POST /v1/proxy/cert-report` (role proxy). |
| +- Controller (`ctlcert/report.go`): accepts a report only when the serial is one it issued for a live `certification` launch with that launch ID, unrevoked, and the signature verifies against that certificate's public key; once per launch; headers carry no identity; wraps it in `Evidence{EvidenceID, LaunchID string; Image isolatedjob.ImageDigest; ImageVersion string; ProxyPolicy int; Deployment []string; Report Report; ReceivedNS int64}`, where every field but `Report` comes from the controller's own launch record and config, and signs it with the controller key. `GET /v1/cert/evidence/{launch}` (operator) returns it. Then it stops the VM with proof. |
| - `equipo-hosted-certify`: `launch` (Task 5's route; waits for the evidence), `judge -evidence e.json -release r.json` (verifies the controller's signature; checks `Measured` equals the release manifest's runner, vm-init and policy digests; runs `Judge(report, Matrix())`; writes `snapshot.json` derived from the evidence alone), `sign -evidence e.json -release r.json -key <file>` (repeats `judge` and signs the derived snapshot; there is no snapshot input to substitute), `verify`, `reload`, `alert-test`. |
| -Probes, each from its stage. Root, before the drop: VPC DNS answers nothing at each managed resolver address; the metadata endpoint gives no credential; `resolv.conf` is empty. User: cannot write `resolv.conf`; cannot gain a capability; a used proxy code is refused at the bootstrap listener. Sandbox: direct IPv4 and IPv6 to a public address, each managed resolver, the metadata endpoint, the proxy egress port without a certificate, the proxy bootstrap port, a DNS query, a build script and `go mod download` with an empty cache, all failing. Positive controls: the runner reaches the report host through the proxy; the containment suite passes in full (`containment.test -test.skip '^TestSource'`); the sandbox reads the Go tree. Expected outcomes live only in `Matrix()`. |
| +Probes, each from its stage. Root, before the drop: VPC DNS answers nothing at each managed resolver address; the metadata endpoint gives no credential; `resolv.conf` is empty. User: cannot write `resolv.conf`; cannot gain a capability; a used proxy code is refused at the bootstrap listener. Sandbox: direct IPv4 and IPv6 to a public address, each managed resolver, the metadata endpoint, the proxy egress port without a certificate, the proxy bootstrap port, a DNS query, a build script and `go mod download` with an empty cache, all failing. Positive controls: the runner gets `GET /api/runner/protocol` from the instance through the proxy (the certification launch's one service); the containment suite passes in full (`containment.test -test.skip '^TestSource'`); the sandbox reads the Go tree. Expected outcomes live only in `Matrix()`. |
| -- [ ] **Red:** `TestJudgeUsesTrustedMatrix` (a report claiming success for a failing probe still fails). `TestJudgeNeedsEveryProbe`. `TestJudgeNeedsPositiveControls`. `TestEvidenceFromLaunchRecord` (a report naming another image or launch cannot change the evidence's image). `TestReportOncePerLaunch`. `TestSignRefusesMeasuredMismatch` (evidence whose measured runner digest differs from the release's: refused). `TestSignHasNoSnapshotInput`. `TestEvidenceSignatureChecked`. |
| +- [ ] **Red:** `TestJudgeUsesTrustedMatrix` (a report claiming success for a failing probe still fails). `TestJudgeNeedsEveryProbe`. `TestJudgeNeedsPositiveControls`. `TestEvidenceFromLaunchRecord` (a report naming another image or launch cannot change the evidence's image). `TestReportOncePerLaunch`. `TestReportNeedsVMKeySignature` (right serial, wrong key; a revoked serial; a proxy-supplied identity header: each refused). `TestSignRefusesMeasuredMismatch` (evidence whose measured runner digest differs from the release's: refused). `TestSignHasNoSnapshotInput`. `TestEvidenceSignatureChecked`. |
| - [ ] **Green:** `go test ./internal/hostedcert ./internal/hostedctl/... ./cmd/equipo-hosted-certify -run 'TestJudge|TestEvidence|TestReportOnce|TestSign' -count=1`. |
| - [ ] **Mutations:** take the image from the report; skip the measured-digest comparison; skip one positive control. |
| - [ ] **Commit:** `hostedcert: certification evidence, trusted matrix and offline signer`. |
| @@ -420,15 +423,17 @@ type HostedLimits struct{ Running int; DailySeconds int64; MonthlyMicros int64 } |
| var DefaultHostedLimits = HostedLimits{Running: 2, DailySeconds: 8 * 3600, MonthlyMicros: 50_000_000} |
| const RateSmallMicrosPerHour, RateLargeMicrosPerHour = 155_000, 310_000 // spec §10, eu-west-1 x86_64 baseline |
| const BurstHoldFactor = 4 |
| +const HostedJobOverheadMicros = 10_000 |
| +const HostedLaunchWindow = 10 * time.Minute |
| const HostedChecksLifetime = 90 * time.Minute // per purpose; slice 4 adds its own |
| func (t *txn) hostedAdmit(person string, size isolatedjob.Size, lifetime time.Duration, now time.Time) (ok bool, reason string, err error) // "running" | "daily" | "monthly" |
| func Allocate(from, to time.Time) (days map[string]int64, months map[string]int64) // seconds per UTC day and month |
| func (s *Store) SetHostedLimits(ctx context.Context, owner, person string, l HostedLimits, revision int64) error |
| ``` |
| -Hold: `Allocate(now, now+lifetime)` seconds against each day, and `lifetime × rate × BurstHoldFactor` against each month the span touches (the whole amount in each, conservatively). Settle (once, with proof): `Allocate(admitted_at, stop proof observed at)` at the baseline rate, replacing the hold. Running counts every job not `ended` or `failed`. A count or read error denies and the step keeps waiting. |
| +Hold, with `window = HostedLaunchWindow + lifetime`: `window` seconds against each UTC day, and `window × rate × BurstHoldFactor + HostedJobOverheadMicros` against each UTC month, that `[now, now+window]` touches (the whole amount in each). Settle (once, with proof): `Allocate(admitted_at, stop proof observed at)` seconds per day, and that span × rate × `BurstHoldFactor` + overhead per month, replacing the hold. Running counts every job not `ended` or `failed`. A count or read error denies and the step keeps waiting. |
| -- [ ] **Red:** `TestLimitsHoldAndSettle`. `TestLimitsRace` (20 goroutines, one slot: one admitted). `TestHoldSpansMidnight` (admission at 23:00 UTC holds against both days; settling at 23:20 frees the second day). `TestHoldSpansMonthEnd`. `TestNoProofKeepsHold`. `TestLimitCountErrorDenies`. `TestOwnerRaisesLimit`. |
| +- [ ] **Red:** `TestLimitsHoldAndSettle`. `TestLimitsRace` (20 goroutines, one slot: one admitted). `TestHoldSpansMidnight` (admission at 23:00 UTC holds the whole window against both days; settling at 23:20 frees the second day). `TestDelayedLaunchReadmitted` (a job admitted at 23:55 and not launched by 00:05 is failed and re-admitted against the new day). `TestSettleStaysConservative` (a 10-minute job settles at 4x the baseline plus overhead). `TestHoldSpansMonthEnd`. `TestNoProofKeepsHold`. `TestLimitCountErrorDenies`. `TestOwnerRaisesLimit`. |
| - [ ] **Green:** `go test ./internal/equipo/chat -run 'TestLimits|TestHoldSpans|TestNoProofKeepsHold|TestLimitCount|TestOwnerRaises' -count=1`. |
| - [ ] **Mutations:** count only `enrolled` jobs; hold at the baseline rate; treat a count error as zero. |
| - [ ] **Commit:** `equipo: per-person hosted limits, held then settled`. |
| @@ -438,30 +443,30 @@ Hold: `Allocate(now, now+lifetime)` seconds against each day, and `lifetime × r |
| **Files:** Create `internal/equipo/hostedrun/{dispatcher.go,dispatcher_test.go,sim_test.go}`. Modify `internal/equipo/chat/runners.go` (`place`, `fits`, `waitingPlacements` at `:1047`, `offline` at `:1112`, `Authorize` at `:931`), `internal/equipo/chat/tasks.go` (`dispatchStep`, the step-terminal hook), `internal/equipo/app.go` (start the dispatcher only with the flag), `internal/hostedclient/client.go` (package comment), `client_test.go` (delete `TestInstanceDoesNotCallHostedClient`; add `TestOnlyHostedrunImportsHostedClient`). |
| **State machine in `place`, for a checks step of a project with `hostedChecks` on, before the early return at `runners.go:545`:** |
| -1. Needs a hosted VM cannot meet (a Mac, a tag the image lacks): today's path, unchanged. |
| -2. The primary is not online or speaks below `ProtocolHostedChecks`: today's path. |
| -3. The step has a live job: `pending`, `launching`, `enrolling` keep `waiting_hosted` with no new hold; `enrolled` sets `RunnerID` to the job's runner and dispatches. |
| -4. The step's last job `failed`, or `ended` without a report: if `retries < 1` and its stop proof is recorded, admit a new job with `retry_of`; else fail the step with that job's reason. |
| -5. No job: `hostedAdmit`; on success create it `pending` and set `waiting_hosted`; on refusal set `hosted_limit` with the reason. |
| +1. The step has a live job (checked first, whatever else has changed): `pending`, `launching`, `enrolling` keep `waiting_hosted` with no new hold; `enrolled` sets `RunnerID` to the job's runner and dispatches; `stopping` keeps `waiting_hosted` until proof arrives, then rule 2 applies. |
| +2. The step's last job `failed`, or `ended` without a report: if `retries < 1` and its stop proof is recorded, go on to rule 5 with `retry_of` set; else fail the step with that job's reason. |
| +3. Needs a hosted VM cannot meet (a Mac, a tag the image lacks): today's path, unchanged. |
| +4. The primary is not online or speaks below `ProtocolHostedChecks`: `waiting_hosted` if the project setting is on (the step waits for its primary as hosted work, never falls back to running on the primary); after `OfflineLimit` the step resolves `runner_offline`. |
| +5. Admit: `hostedAdmit`; on success create the job `pending` and set `waiting_hosted`; on refusal set `hosted_limit` with the reason. |
| Both placements are in `waitingPlacements`. A step with a live hosted job is exempt from offline withdrawal, by job identity. If the primary is offline past `OfflineLimit` while a job waits, the step resolves `runner_offline` and the job is stopped. |
| `fits`: a runner bound to a hosted job fits only that job's step; `Authorize` refuses any other step and any other attempt for it in its transaction. |
| -**Dispatcher:** `type Dispatcher struct{ Store *chat.Store; Client *hostedclient.Client; Clock func() time.Time }`; `func (*Dispatcher) Pass(ctx context.Context) error`, every 10 s. At start it asks the controller for the admission of a made-up attempt and logs `hosted_controller_reachable` when the signed not-found answer verifies, or `hosted_controller_unreachable` with the reason. Launch `pending` jobs outside any transaction (`Replaces` set to the predecessor's attempt for a retry; a throttle keeps `pending`, backoff 10 s to 5 min). Refresh `Admission` for every `enrolling` or `enrolled` job each pass and record it (`HostedAdmitted`). Stop a job not enrolled 2 min after the controller reports it running. When the step is terminal, the job failed, or the controller reports the VM gone, call `Stop` until it returns proof, revoke the runner, settle. |
| +**Dispatcher:** `type Dispatcher struct{ Store *chat.Store; Client *hostedclient.Client; Clock func() time.Time }`; `func (*Dispatcher) Pass(ctx context.Context) error`, every 10 s. At start it asks the controller for the admission of a made-up attempt and logs `hosted_controller_reachable` when the signed not-found answer verifies, or `hosted_controller_unreachable` with the reason. Launch `pending` jobs outside any transaction (`Replaces` set to the predecessor's attempt for a retry; a throttle keeps `pending`, backoff 10 s to 5 min). Refresh `Admission` for every `enrolling` or `enrolled` job each pass and record it (`HostedAdmitted`). Stop a job not enrolled 2 min after the controller reports it running. Fail and re-admit a job still `pending` past its `HostedLaunchWindow`. When the step is terminal, the job failed, or the controller reports the VM gone, call `Stop` until it returns proof, revoke the runner, settle. |
| -- [ ] **Red:** `TestHostedPlacementBeforeEarlyReturn`, `TestMacChecksNeverHosted`, `TestHostedNeedsCapablePrimary`, `TestRepeatedPlacementOneJob` (ten placement passes: one job, one hold), `TestEnrolledJobDispatches`, `TestHostedWaitsAtLimit`, `TestBoundRunnerFitsOnlyItsStep`, `TestAuthorizeRefusesOtherStep`, `TestHostedExemptFromWithdrawal`, `TestPrimaryLostDuringEnrolment`, `TestEnrolTimeoutRetriesOnce` (the retry launches only after the first job's proof, with `Replaces`), `TestVMGoneMidStep`, `TestStopUntilProofThenSettle`, `TestThrottleBacksOff`, `TestDispatcherOffWithoutFlag`, `TestReachabilityProbeLogged`, `TestOnlyHostedrunImportsHostedClient`. `TestDispatcherSimulation` (200 seeds; a fake controller with lost replies, throttles, VM deaths, instance restarts and certificate withdrawal; invariants: at most one live VM per step; never more running jobs per person than the limit; holds never exceed limits; every settled job has proof; no step is certified by a VM whose admission was stale or invalid). |
| +- [ ] **Red:** `TestHostedPlacementBeforeEarlyReturn`, `TestMacChecksNeverHosted`, `TestHostedNeedsCapablePrimary`, `TestRepeatedPlacementOneJob` (ten placement passes: one job, one hold), `TestEnrolledJobDispatches`, `TestHostedWaitsAtLimit`, `TestBoundRunnerFitsOnlyItsStep`, `TestAuthorizeRefusesOtherStep`, `TestHostedExemptFromWithdrawal`, `TestPrimaryLostDuringEnrolment` (the job is kept and the step waits; reconnect continues it; no fallback to the primary), `TestPlacementDuringStopping` (ten passes while `stopping`: no new job until proof), `TestEnrolTimeoutRetriesOnce` (the retry launches only after the first job's proof, with `Replaces`), `TestVMGoneMidStep`, `TestStopUntilProofThenSettle`, `TestThrottleBacksOff`, `TestDispatcherOffWithoutFlag`, `TestReachabilityProbeLogged`, `TestOnlyHostedrunImportsHostedClient`. `TestDispatcherSimulation` (200 seeds; a fake controller with lost replies, throttles, VM deaths, instance restarts and certificate withdrawal; invariants: at most one live VM per step; never more running jobs per person than the limit; holds never exceed limits; every settled job has proof; no step is certified by a VM whose admission was stale or invalid). |
| - [ ] **Green:** `go test ./internal/equipo/hostedrun ./internal/equipo/chat ./internal/hostedclient -run 'TestHosted|TestMacChecks|TestRepeated|TestEnrolled|TestBoundRunner|TestAuthorizeRefuses|TestPrimaryLost|TestEnrolTimeout|TestVMGone|TestStopUntil|TestThrottle|TestDispatcher|TestOnlyHostedrun' -count=1`. |
| - [ ] **Mutations:** place after the early return; let a bound runner fit any step; admit a new job on every placement pass; retry without the predecessor's proof (the simulation fails with its seed). |
| - [ ] **Commit:** `equipo: place checks on hosted VMs and see each VM to its end`. |
| ### Task 22: Hosted enrolment, challenge and renewal routes |
| -**Files:** Create `internal/equipo/{hosted_enrol.go,hosted_enrol_test.go}`. Modify `internal/equipo/app.go` (beside `:324`), `internal/equipo/personapi/auth.go:101` (public allowlist: `/api/hosted/enrol` only; challenge and renew need the runner bearer), `internal/equipo/runners.go:34` (`mintRunnerCredential` takes a lifetime and a cap). |
| +**Files:** Create `internal/equipo/{hosted_enrol.go,hosted_enrol_test.go}`. Modify `internal/equipo/app.go` (enrol beside `:324`; challenge and renew under the runner mount at `:326`, which already authenticates the runner bearer), `internal/equipo/personapi/auth.go:101` (public allowlist: `/api/hosted/enrol` only), `internal/equipo/runners.go:34` (`mintRunnerCredential` takes a lifetime and a cap), `internal/equipo/hostedrun/admitter.go`. |
| -**Interfaces:** `POST /api/hosted/enrol` (`wire.HostedEnrolRequest`): transaction 1 matches the code hash to a job in `enrolling`, unused, unexpired (2 min), and marks it used; then outside it `Client.Admission(attempt)`; transaction 2 re-checks the job and the person's roster membership and requires `State` `running`, `VMRef` equal to the request's, `CertValid`, and `Epoch` equal to the job's; creates the runner row (role `worker`, bound to the job, no device code), stores the machine key, records the admission, and issues a credential valid 1 hour and never past the job's deadline. `POST /api/hosted/challenge` (bearer): one nonce, 60 s, stored hashed. `POST /api/hosted/renew` (bearer + `wire.HostedRenewRequest`): the nonce unused and unexpired, the signature valid for the stored machine key, the epoch current, the job live; marks the nonce used and issues the next credential. Rate limits as `BeginEnrolment`'s (`setup/enrolment.go:52`). |
| +**Interfaces:** `type hostedrun.Admitter interface{ Admission(ctx context.Context, attempt string) (hostedwire.AdmissionView, error) }`, implemented in `hostedrun` over `hostedclient` and injected into the handler, so only `hostedrun` imports `hostedclient`. `POST /api/hosted/enrol` (`wire.HostedEnrolRequest`): transaction 1 matches the code hash to a job in `enrolling`, unused, unexpired (2 min), and marks it used; then outside it `Admitter.Admission(attempt)`; transaction 2 re-checks the job and the person's roster membership and requires `State` `running`, `VMRef` equal to the request's, `CertValid`, and `Epoch` equal to the job's; creates the runner row (role `worker`, bound to the job, no device code), stores the machine key, records the admission, and issues a credential valid 1 hour and never past the job's deadline. `POST /api/runner/v2/hosted/challenge` (runner bearer): one nonce, 60 s, stored hashed. `POST /api/runner/v2/hosted/renew` (runner bearer + `wire.HostedRenewRequest`): the nonce unused and unexpired, the signature valid for the stored machine key, the epoch current, the job live; marks the nonce used and issues the next credential. Rate limits as `BeginEnrolment`'s (`setup/enrolment.go:52`). |
| -- [ ] **Red:** `TestEnrolRefusesReplayAndWrongVM` (second use; right code, wrong `VMRef`; expired code). `TestEnrolNeedsCertifiedAdmission`. `TestEnrolRemovedPersonRefused`. `TestEnrolRouteIsPublicNotCSRF`. `TestRenewNonceSingleUse`. `TestRenewOldEpochRefused`. `TestRenewAfterStopRefused`. `TestHostedCredentialCappedAtDeadline`. |
| +- [ ] **Red:** `TestEnrolRefusesReplayAndWrongVM` (second use; right code, wrong `VMRef`; expired code). `TestEnrolNeedsCertifiedAdmission`. `TestEnrolRemovedPersonRefused`. `TestEnrolRouteIsPublicNotCSRF`. `TestRenewThroughFullMiddleware` (challenge and renew through the whole application stack with a runner bearer: accepted; with a browser cookie or no bearer: refused). `TestRenewNonceSingleUse`. `TestRenewOldEpochRefused`. `TestRenewAfterStopRefused`. `TestHostedCredentialCappedAtDeadline`. |
| - [ ] **Green:** `go test ./internal/equipo -run 'TestEnrol|TestRenew|TestHostedCredential' -count=1`. |
| - [ ] **Mutations:** skip the `VMRef` comparison; accept a used nonce. |
| - [ ] **Commit:** `equipo: hosted enrolment and renewal bound to one job`. |
| @@ -470,9 +475,9 @@ Both placements are in `waitingPlacements`. A step with a live hosted job is exe |
| **Files:** Modify `internal/equipo/chat/tasks.go` (the hosted step's send-pack command asks for the bundle), `internal/runner/thin/relay.go` (the primary builds with `depsbundle.Build` and sends `TransferKindDeps` under its own transfer ID), `internal/runner/thin/relay_test.go`, the instance relay's per-transfer storage limit for `deps` and its cleanup when the step ends. |
| -**Interfaces:** `wire.SendPackCommand` gains `Deps bool` (protocol-gated). The instance creates both transfer IDs. |
| +**Interfaces:** `wire.SendPackCommand` gains `Deps bool` (protocol-gated). The instance creates both transfer IDs. The instance's chunk check (`transfers.go:117`), its relay storage, and the receiver's assembly check (`relay.go:174`) all use `wire.MaxChunks(kind)` and `wire.MaxBytes(kind)`. |
| -- [ ] **Red:** `TestPrimarySendsBundleForHostedStep`, `TestNoBundleForPersonalWorker`, `TestBundleTooLargeEndsStep`, `TestDepsTransferCleanedUp`. |
| +- [ ] **Red:** `TestPrimarySendsBundleForHostedStep`, `TestNoBundleForPersonalWorker`, `TestBundleTooLargeEndsStep`, `TestDepsTransferCleanedUp`. `TestDepsTransferAbove64MiB` (a 100 MiB bundle travels primary to instance to hosted worker end to end; a 257 MiB one is refused at the header). |
| - [ ] **Green:** `go test ./internal/runner/thin ./internal/equipo/chat -run 'TestPrimarySendsBundle|TestNoBundle|TestBundleTooLarge|TestDepsTransfer' -count=1`. |
| - [ ] **Mutation:** always send the bundle. |
| - [ ] **Commit:** `runner: primary sends the dependency bundle to hosted checks`. |
| @@ -543,12 +548,12 @@ var ErrCheckpointMismatch, ErrNoReceipt error |
| ### Task 28: OpenTofu for the hosted stack |
| -**Files:** Create `infra/hosted/modules/{account,network,controller,proxy,config,alerts}/`, `infra/hosted/envs/dev/{network,services}/`, `infra/hosted/envs/prod/{account,network,services}/`, a `tests/` directory in each root, `infra/hosted/scripts/{plan-check.py,plan_check_test.py,phases.json}`, `infra/hosted/README.md`. Modify `.amadan/ci.d/` (a lane running `tofu validate` and `tofu test` with mocked providers in each root, and `plan_check_test.py`; no credentials in CI). |
| +**Files:** Create `infra/hosted/modules/{account,network,controller,proxy,config,alerts}/`, `infra/hosted/envs/dev/{network,config,services}/`, `infra/hosted/envs/prod/{account,network,config,services}/`, a `tests/` directory in each root, `infra/hosted/scripts/{plan-check.py,plan_check_test.py,phases.json}`, `infra/hosted/README.md`. Modify `.amadan/ci.d/` (a lane running `tofu validate` and `tofu test` with mocked providers in each root, and `plan_check_test.py`; no credentials in CI). |
| -**Shape (S2-4):** as `2026-11-30-hosted-prod-account-plan.md` sections 2 to 4 list them, address by address. `account` (prod only): CloudTrail with Lambda MicroVM data events, account S3 public access block, EBS encryption by default, password policy, the alert topic and email subscription, the monthly budget and its action (a deny policy on the controller role for `RunMicrovm` and `ResumeMicrovm`), the cost anomaly monitor. `network`: VM VPC with DNS support and hostnames off and one VM subnet; services VPC with DNS on, two public subnets in two AZs and an internet gateway; one peering; the VM route table (local plus a `/32` per proxy); the VM security group (egress only to the proxies on 8443 and 8444, no ingress); NACLs; the connector and its operator role (`AWSLambdaNetworkConnectorOperatorPolicy` plus the subnet-scoped `ec2:DeleteNetworkInterface`). `services`: the config, Litestream and image-input buckets; the controller (`t4g.small`, EIP; role: `lambda-microvms` actions on this account's MicroVMs and images in `eu-west-1`, `lambda:GetNetworkConnector` on the one connector, `ec2:Describe*` for the audit, `sns:Publish` on the topic, S3 on its Litestream bucket and on `controller/` and `pins/` in the config bucket; security group 443 from anywhere); two proxies (`t4g.micro`, EIPs, two AZs; role: `s3:GetObject` on `proxy/<name>/` only; listeners on their private addresses only); status-check alarms. `plan-check.py --phase P --account A --region R plan.json` passes only the addresses `phases.json` lists for `P`, only `create` actions (and only `delete` for the `destroy-*` phases), and only ARNs in `A` and `R`. |
| +**Shape (S2-4):** as `2026-11-30-hosted-prod-account-plan.md` sections 2 to 4 list them, address by address. Every provider block sets `allowed_account_ids` and `region`. `account` (prod only): CloudTrail (management events in every region, and an advanced selector for `AWS::Lambda::MicrovmImage` data events), the alert topic and email subscription, the monthly budget. Account singletons (S3 public access block, EBS default encryption) are not OpenTofu resources; `equipo-hosted-ops singleton` handles them. No password policy and no cost anomaly monitor. `network`: VM VPC with DNS support and hostnames off and one VM subnet; services VPC with DNS on, two public subnets in two AZs, an internet gateway and a default route to it; one peering with a return route; the VM route table (local plus a `/32` per proxy, at fixed private addresses from variables); the VM security group (egress only to the proxies on 8443 and 8444, no ingress); NACLs; the connector's operator role (`AWSLambdaNetworkConnectorOperatorPolicy` plus the subnet-scoped `ec2:DeleteNetworkInterface`). The connector itself is created by `equipo-hosted-ops connector` (Task 33), not OpenTofu. `config`: the config, Litestream and image-input buckets with owner-enforced policies; the controller, proxy A, proxy B and image-build roles (without instances), the image-build policy and log group. `services`: the controller (`t4g.small`, standard credits, IMDSv2 required, EIP; role: `lambda-microvms` actions on this account's MicroVMs and images in `eu-west-1`, `lambda:GetNetworkConnector` on the one connector, `ec2:Describe*` for the audit, `sns:Publish` on the topic, `cloudwatch:PutMetricData` in the `EquipoHosted` namespace, S3 on its Litestream bucket and on `controller/` and `pins/` in the config bucket; security group 443 from anywhere); proxies A and B (`t4g.micro`, standard credits, IMDSv2, EIPs, fixed private addresses, two AZs; each role `s3:GetObject` on its own `proxy/<name>/` only; listeners on private addresses only); alarms on the controller's `Heartbeat` (missing is breaching), `AuditPassing`, `OrphansSeen`, `ProxySilent`, the topic's failed notifications, and each host's status checks; the budget action (`APPLY_IAM_POLICY`, actual, absolute, automatic, a deny policy for `RunMicrovm` and `ResumeMicrovm` on the controller role) with its execution role, trusted by Budgets and limited to attaching and detaching that one policy on that one role. `plan-check.py --phase P --account A --region R plan.json` passes only the addresses `phases.json` lists for `P`, only `create` actions (and only `delete` for the `destroy-*` phases), and only ARNs in `A` and `R`. |
| -- [ ] **Red:** `envs/prod/network/tests/network.tftest.hcl`: DNS off on the VM VPC; no route to `0.0.0.0/0` or `::/0` from the VM subnet; only `/32` routes over the peering; the VM security group's egress set equals the proxies'; DNS on in the services VPC. `envs/prod/services/tests/iam.tftest.hcl`: the controller role has no `iam:*` and no MicroVM action outside the account and region; the proxy role allows only `s3:GetObject` on its prefix. `plan_check_test.py`: an unlisted address, an `update`, a `replace` and a foreign ARN are each refused. |
| -- [ ] **Green:** for each root `R` in `envs/dev/network envs/dev/services envs/prod/account envs/prod/network envs/prod/services`: `tofu -chdir=infra/hosted/$R init -backend=false && tofu -chdir=infra/hosted/$R validate && tofu -chdir=infra/hosted/$R test`; `python3 -I infra/hosted/scripts/plan_check_test.py`. |
| +- [ ] **Red:** `envs/prod/network/tests/network.tftest.hcl`: DNS off on the VM VPC; no route to `0.0.0.0/0` or `::/0` from the VM subnet; only `/32` routes over the peering; the VM security group's egress set equals the proxies'; DNS on in the services VPC. `envs/prod/config/tests/iam.tftest.hcl` and `envs/prod/services/tests/iam.tftest.hcl`: the controller role has no `iam:*` and no MicroVM action outside the account and region; each proxy role allows only `s3:GetObject` on its own prefix; the budget action role can attach only the deny policy to only the controller role. `plan_check_test.py` also refuses a provider without `allowed_account_ids`, a provider alias, a provisioner, `terraform_data`, `null_resource`, and an unknown value in a pinned security attribute. `plan_check_test.py`: an unlisted address, an `update`, a `replace` and a foreign ARN are each refused. |
| +- [ ] **Green:** for each root `R` in `envs/dev/network envs/dev/config envs/dev/services envs/prod/account envs/prod/network envs/prod/config envs/prod/services`: `tofu -chdir=infra/hosted/$R init -backend=false && tofu -chdir=infra/hosted/$R validate && tofu -chdir=infra/hosted/$R test`; `python3 -I infra/hosted/scripts/plan_check_test.py`. |
| - [ ] **Mutations:** add a default route on the VM subnet; widen the proxy role; let `plan-check.py` pass an `update`. Each fails its test. |
| - [ ] **Commit:** `infra: OpenTofu for the hosted stack, dev and prod`. |
| @@ -556,9 +561,9 @@ var ErrCheckpointMismatch, ErrNoReceipt error |
| **Files:** Create `scripts/release-hosted.sh`, `infra/hosted/modules/controller/cloud-init.yaml.tmpl`, `infra/hosted/modules/proxy/cloud-init.yaml.tmpl`, `internal/hostedctl/healthz.go`. Modify `cmd/equipo-hosted-controller/{main.go,config.go}` (subcommand `keygen -ed25519|-ca -out <prefix>`; read the deployment manifest and the config-bucket files fetched by `ExecStartPre`; write its TLS certificate's SPKI pin to `pins/controller.spki` at first boot), `Makefile`. |
| -**Interfaces:** `release-hosted.sh <version>` builds `equipo-hosted-controller`, `equipo-hosted-proxy`, `equipo-vm-init`, `equipo-hosted-image`, `equipo-hosted-certify` and the runner for the image, records SHA-256 sums, and publishes them on the forge under the release tag, as `publish-renderer.sh` does. Cloud-init downloads by URL and checks the digest before installing; a mismatch, or private keys absent from the config bucket after 15 minutes, leaves the unit off. `GET /healthz` on the metrics listener only. |
| +**Interfaces:** `release-hosted.sh <version>` builds `equipo-hosted-controller`, `equipo-hosted-proxy`, `equipo-vm-init`, `equipo-hosted-image`, `equipo-hosted-certify` and the runner for the image, records SHA-256 sums, and publishes them on the forge under the release tag, as `publish-renderer.sh` does. Cloud-init downloads by URL and checks the digest before installing; a mismatch, or private keys absent from the config bucket after 15 minutes, leaves the unit off. The controller unit's `ExecStartPre` fetches config and runs `litestream restore -if-replica-exists` before the controller starts; Litestream then replicates continuously to the Litestream bucket, and the controller exports `litestream_lag_seconds`. After a restore that trails live VMs, the 1a reaper treats unknown VMs as orphans and stops them after 10 minutes, which is the intended recovery. The controller publishes `Heartbeat` (only after a clean reaper pass), `AuditPassing`, `OrphansSeen` and `ProxySilent` to CloudWatch every minute. `GET /healthz` on the metrics listener only. |
| -- [ ] **Red:** `TestCloudInitChecksDigest`, `TestControllerReadsManifest`, `TestKeygenWritesPrivate0600`, `TestPinWrittenOnce`, `TestHealthzOnMetricsOnly`. |
| +- [ ] **Red:** `TestCloudInitChecksDigest`, `TestControllerReadsManifest`, `TestKeygenWritesPrivate0600`, `TestPinWrittenOnce`, `TestHealthzOnMetricsOnly`, `TestHeartbeatOnlyAfterCleanPass`, `TestRestoreBeforeStart` (the unit order). |
| - [ ] **Green:** `go test ./internal/hostedctl ./cmd/equipo-hosted-controller -run 'TestCloudInit|TestControllerReads|TestKeygen|TestPinWritten|TestHealthz' -count=1`; `scripts/release-hosted.sh --dry-run`. |
| - [ ] **Commit:** `hosted: release artifacts and host configuration by digest`. |
| @@ -582,14 +587,38 @@ var ErrCheckpointMismatch, ErrNoReceipt error |
| - [ ] `make ci` with every target passing except `copy-release-check`, whose only failures must be the pending keys from Task 31; one whole-branch Astra review, at most three rounds; fix what is clearly right; record what stays open. |
| - [ ] **Commit:** `hosted slice 2: review fixes`. |
| -### Task 33: Dev live drill in `kass` (HUMAN GO) |
| +### Task 33: The production run kit, `equipo-hosted-ops` |
| -- [ ] Write `docs/superpowers/plans/2026-MM-DD-hosted-2-dev-live-plan.md` in the shape of Task 17b (safety-only hard stops, FINDING lines, ledger, systemd user units, teardown verified by type and tag): `tofu apply` of `envs/dev/*` in `kass` / `eu-west-1`, image build and publish, a certification launch, **HUMAN:** Paul signs offline, then hosted checks from the staging Equipo instance end to end, the Task 30 drills against real VMs, the egress matrix from inside a real VM, the connector interface cleanup (still unexercised), then `tofu destroy` and verification. Record `Task 33 PASSED` in the progress file only if every safety check passed. Astra reviews the plan, three rounds at most. |
| +The account plan's Astra round 1 showed that live-run machinery adapted by hand from Task 17b's shell does not hold for a new account. This task builds it as a tested tool, used by the dev drill first and then by production. |
| + |
| +**Files:** Create `internal/hostedops/{guard.go,ledger.go,estimate.go,vms.go,connector.go,buckets.go,singleton.go,units.go,tf.go,report.go,*_test.go}`, `cmd/equipo-hosted-ops/main.go`. Modify `internal/isolatedjob/providerguard_test.go` (allowed list). |
| + |
| +**Interfaces:** global flags `-dir -run -profile -account -region`; every subcommand exits 99 on a safety failure (a hard stop), 1 on an ordinary failure, 0 on success, and writes one journal line per action. |
| +- `guard`: STS identity and region equal to the flags, else 99. Credentials are resolved once and fixed for the process (livectl's R41 and R42 rules). |
| +- `ledger init|intent|rec|deleted|reconcile`: the Task 17b ledger rules (intent before create, `rec` after, skip-never-created, unresolved blocks teardown); `rec` accepts this account's ARNs, the region's, and an explicit list of AWS-owned ARNs, and refuses any other account's. |
| +- `estimate --stop USD`: hosts' hours since creation at on-demand rates, every VM the provider lists for the run's image at four times the Large rate for its full lifetime, image builds at $1 each, image storage at $8 a month pro rata; 99 at `--stop`. |
| +- `vms scan|settle --image ARN [--terminate] --max D`: provider-level, image-scoped, every page and state; settle proves no live VM by three scans 30 s apart, terminating with `--terminate`; it never consults the controller. |
| +- `connector create|delete`: create, wait `ACTIVE`, read the `:1` qualified ARN; delete with Task 17b's 10.2 fallback, interfaces verified gone and never deleted by hand. |
| +- `bucket create|empty|delete --expected-owner`: versions and delete markers, paginated. |
| +- `singleton ensure|get NAME`: the account S3 public access block and EBS default encryption; records the prior value; never turns one off. |
| +- `tf ROOT PHASE`: the bucket owner check, init, `plan -out` (or `plan -destroy -out` for `destroy-*`), `show -json`, `plan-check.py`, apply of the saved plan. |
| +- `unit start|wait|stop [--all]`: Task 17b's systemd user units (R44, R45), with the run's prefix. |
| +- `assert` (99 on mismatch) and `fact` (a FINDING); `ledger note`; `wait-human NAME --max D [--background]`; `wait object`; `object put`; `keys upload`; `status` (the operator route of Task 5, through the pin); `litestream-check` (restore the latest generation into scratch and open it); `inventory`; `quota`; `tfvars [--add-image --add-connector]`; `verify-gone` (direct reads per recorded type); `report [--stopped]`. |
| +- Each subcommand's exact flags are the ones `2026-11-30-hosted-prod-account-plan.md` uses; that plan is the acceptance list for this tool. |
| + |
| +- [ ] **Red:** `TestGuardRefusesOtherAccount`, `TestLedgerSkipNeverCreated`, `TestLedgerUnresolvedBlocksTeardown`, `TestRecRefusesForeignAccount`, `TestRecAcceptsListedAWSOwned`, `TestEstimateStops` (a ledger whose worst case reaches the stop: 99), `TestSettleNeedsThreeCleanScans`, `TestSettleIgnoresController`, `TestConnectorDeleteFallback` (DELETE_FAILED, then the one retry; a second failure is 99), `TestBucketEmptyPaginates` (versions and markers over several pages), `TestBucketOwnerChecked`, `TestSingletonNeverTurnsOff`, `TestTfRefusesUnsavedApply`, `TestUnitStopOnlyJournalled`. AWS is faked with SDK middleware; no test reaches AWS. |
| +- [ ] **Green:** `go test ./internal/hostedops ./cmd/equipo-hosted-ops -count=1`; `make build vet govulncheck`. |
| +- [ ] **Mutations:** let `guard` pass on a region mismatch; let `settle` stop after one clean scan; let `rec` accept another account. |
| +- [ ] **Commit:** `hostedops: tested run kit for the dev drill and production`. |
| + |
| +### Task 34: Dev live drill in `kass` (HUMAN GO) |
| + |
| +- [ ] Write `docs/superpowers/plans/2026-MM-DD-hosted-2-dev-live-plan.md` in the shape of Task 17b (safety-only hard stops, FINDING lines, ledger, systemd user units, teardown verified by type and tag): `tofu apply` of `envs/dev/*` in `kass` / `eu-west-1`, image build and publish, a certification launch, **HUMAN:** Paul signs offline, then hosted checks from the staging Equipo instance end to end, the Task 30 drills against real VMs, the egress matrix from inside a real VM, the connector interface cleanup (still unexercised), then `tofu destroy` and verification. Run every AWS step through `equipo-hosted-ops` (Task 33) with `-account 640012953448 -profile kass`, so the production tool is exercised first. Record `Task 34 PASSED` in the progress file only if every safety check passed. Astra reviews the plan, three rounds at most. |
| - [ ] **HUMAN:** Paul's one GO. The agent runs it, records spend, tears down. |
| -### Task 34: Production bring-up (HUMAN GO) |
| +### Task 35: Production bring-up (HUMAN GO) |
| -- [ ] Run `docs/superpowers/plans/2026-11-30-hosted-prod-account-plan.md` after Task 33 passes and the branch is merged and released. **HUMAN:** Paul's one GO; Paul signs the production certificate; Paul turns the setting on for the first project. |
| +- [ ] Run `docs/superpowers/plans/2026-11-30-hosted-prod-account-plan.md` after Task 34 passes and the branch is merged and released. **HUMAN:** Paul's one GO; Paul signs the production certificate; Paul turns the setting on for the first project. |
| **Slice 2 is done when** a project with the setting on runs its checks in a hosted VM in `149757027610`, the result is certified through a fresh controller admission, limits hold under the simulation and the chain tests, the dev drill and the production bring-up are recorded with nothing left running that the plan did not leave on purpose, and everything is off unless flagged. |
| @@ -601,9 +630,9 @@ var ErrCheckpointMismatch, ErrNoReceipt error |
| 2. **S2-1, dependencies from the primary, against base pins only, instead of a mirror service.** Spec §16 ruling 4 requires the mirror before hosted code runs; this meets the mirror's properties without the importer, and a candidate that adds a dependency cannot pass hosted checks until a mirror exists. The coordinator's brief quotes the earlier wording of ruling 4 ("the registry leak gap is accepted for a team's own repos in v1"); the spec's later text, written after Fable's H3, says no network for agent code in any project, and this plan follows the spec. *Recommendation:* accept S2-1. |
| 3. **S2-2, S2-3 and S2-10:** no resolver; one expiry rule with no continuation; no mutation-evidence registry in certification. *Recommendation:* accept all three. |
| 4. **S2-4:** two VPCs, peered, with the network audit changed to accept exactly that, and the 1b pinned resolver for proxies dropped. *Recommendation:* accept. |
| -5. **S2-5 and S2-9:** Large VMs, 90-minute lifetime; holds at 4x the baseline rate ($1.86 per job against the $50). *Recommendation:* accept. |
| +5. **S2-5 and S2-9:** Large VMs, 90-minute lifetime; holds and settlements at 4x the baseline rate plus $0.01 a job, because AWS does not report burst. A full hold (100-minute window) is $2.08; a 10-minute check settles at $0.22, so about 230 a month within $50. *Recommendation:* accept, and raise a person's limit if it bites; the alternative, settling at baseline, lets real spend reach about 4x the limit. |
| 6. **Who holds the certification key.** *Recommendation:* Paul, on a machine that is not docs-t1; each new image needs one signature. |
| ## Open questions carried from slice 1a |
| -- The connector's network-interface cleanup permission has never been exercised (Task 17b). Task 33 exercises it. |
| +- The connector's network-interface cleanup permission has never been exercised (Task 17b). Task 34 exercises it. |