oficina / equipo Public

hostedctl: never reap a VM an intent may still own

Fix round 1 of the Task 13 review (rulings R22, R23).

- An expired orphan is deferred, not stopped, while a waiting intent
  that has been dispatched exists (OrphansDeferred, audited once per
  run); abandoned intents still leave orphans.
- An ownership RWMutex: dispatch holds it for reading from its dispatch
  mark to the settled answer; the orphan final check (fresh List, saved
  Refs, deferral check) holds it for writing through its last Stop.
- Both reaper audits share one run of failures and report their errors.
- New guards: proven jobs still match, the final check lists again, an
  incomplete final-check List stops nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 03c772adf5783d48d90b5499983379c00db82125 parent 8d91a60
5 files changed, +530 −34
  • docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md +39 −0
  • internal/hostedctl/controller.go +10 −9
  • internal/hostedctl/launch.go +3 −0
  • internal/hostedctl/reaper.go +116 −25
  • internal/hostedctl/reaper_test.go +362 −0

CI passed — run details

CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/hosted-runners-1a: Type  Size Avail | ext4   96G   85G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   85G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.5s
ci-box: codex: fetched and verified in 3.4s
ci-box: codex-code-mode-host: fetched and verified in 1.3s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.9s
ci-box: pi: installed and verified in 7.7s
ci-box: opencode: installed and verified in 2.2s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.6s
ci-box: clone deepened in 3.7s
ci-box: file times set from content: 2883 files, 192 directories
ci-box: ready in 17.4s
=== 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.248s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  1.1s
+ go list -export -test -tags testbuild -f  ./...
  1.0s
+ go list -export -test -tags browser,testbuild -f  ./internal/equipo ./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-11 02:51:11 +0000 UTC

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

receipt: test step 1m20.963s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m19.327s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m19.33s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 28.31, cpu waiting 20.95%, memory waiting 0.00%, io waiting 0.66%
--- 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 1m22.952s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m21.338s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m21.34s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 28.31, cpu waiting 20.49%, memory waiting 0.00%, io waiting 0.63%
--- 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 1m24.672s 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.58s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m12.1s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.7s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.77s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 27.56, cpu waiting 19.95%, memory waiting 0.00%, io waiting 0.61%
--- 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 1m18.813s 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 1m17.18s amadan.net/oficina/equipo/internal/headless
receipt: slow test 36.84s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 20.27s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.51s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.57s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 29.55, cpu waiting 21.28%, memory waiting 0.00%, io waiting 0.68%
--- shard 4 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-guards: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

receipt: test step 1m37.212s 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 1m35.475s amadan.net/oficina/equipo/internal/headless
receipt: slow test 59.57s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.2s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 9.97s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 8.82s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 5.91s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 24.85, cpu waiting 16.60%, memory waiting 0.00%, io waiting 0.50%
--- shard 5 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-rest: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$|^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$|^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$|^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$|^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

receipt: test step 3m8.987s 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 3m6.95s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m44.55s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 24.09s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.53s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 8.13s amadan.net/oficina/equipo/internal/headless TestHeadlessClaudeSignIn
receipt: slow test 7.34s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 7.32, cpu waiting 3.61%, memory waiting 0.00%, io waiting 0.10%
--- 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 1.101s 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 2m1.624s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 7.84s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.74s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 4.31s amadan.net/oficina/equipo/internal/thintest TestContractTeamUpdatePersonNeeds
receipt: slow test 3.81s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 3.52s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
machine: 32 CPUs, load 5.94, cpu waiting 0.52%, memory waiting 0.00%, io waiting 2.51%
--- 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 1.155s 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 1m26.784s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.08s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5.03s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.41s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.4s amadan.net/oficina/equipo/internal/thintest TestContractPreview
receipt: slow test 2.34s amadan.net/oficina/equipo/internal/thintest TestContractPublishNameTaken
machine: 32 CPUs, load 5.94, cpu waiting 0.52%, memory waiting 0.00%, io waiting 2.51%
--- shard 8 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-thin: ./internal/runner/thin
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/runner/thin
cache miss: amadan.net/oficina/equipo/internal/runner/thin: its inputs changed
budget note: internal/runner/thin took 4m28.84s, over the 45s its record on line 44 allows; reported only, timing fails on CI

receipt: test step 4m41.864s 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 4m28.84s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 36.95s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.89s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.79s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.47s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.79s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 2.03, cpu waiting 0.77%, memory waiting 0.00%, io waiting 0.01%
--- shard 9 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-bug: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$' ./internal/runner
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

receipt: test step 47.191s 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 46.041s amadan.net/oficina/equipo/internal/runner
receipt: slow test 26.01s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 30.27, cpu waiting 20.26%, memory waiting 0.00%, io waiting 1.16%
--- 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 46.304s 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 44.391s amadan.net/oficina/equipo/internal/runner
receipt: slow test 34.38s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 30.83s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.38s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 30.27, cpu waiting 20.20%, memory waiting 0.00%, io waiting 1.20%
--- 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 35.161s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 34.284s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.5s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.12s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.23s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 25.59, cpu waiting 15.32%, memory waiting 0.00%, io waiting 1.42%
--- 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 27.1%, load 17.89
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest
cache miss: amadan.net/oficina/equipo/internal/equipotest: its inputs changed

receipt: test step 1m3.611s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m1.757s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 25.77s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 25.73s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 23.79s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 21.46s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 21.17s amadan.net/oficina/equipo/internal/equipotest TestAuthorityRejectsMismatchedTarget
machine: 32 CPUs, load 26.31, cpu waiting 17.71%, memory waiting 0.00%, io waiting 0.53%
--- 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 27.1%, load 14.49
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 1.302s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m12.399s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 19.2s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 19.12s amadan.net/oficina/equipo/internal/equipotest TestProjectOwnersAreMembers
receipt: slow test 19.11s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 19.11s amadan.net/oficina/equipo/internal/equipotest TestProjectRetryAndRevision
receipt: slow test 19.08s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
machine: 32 CPUs, load 17.89, cpu waiting 12.17%, memory waiting 0.00%, io waiting 1.52%
--- 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 27.1%, load 14.49
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest
cache miss: amadan.net/oficina/equipo/internal/equipotest: its inputs changed

receipt: test step 1m14.986s 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 1m3.105s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 14.29s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 12.72s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 9.66s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 9.65s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 6.57s amadan.net/oficina/equipo/internal/equipotest TestRosterAuditFailureRollsBack
machine: 32 CPUs, load 21.33, cpu waiting 14.56%, memory waiting 0.00%, io waiting 0.44%
--- 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 27.1%, load 14.49
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 487ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1m4.231s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 24.45s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 23.28s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 23.2s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 21.61s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
receipt: slow test 21.57s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsRollbackAndUnavailable
machine: 32 CPUs, load 17.89, cpu waiting 11.06%, memory waiting 0.00%, io waiting 1.57%
--- 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 27.1%, load 17.89
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 568ms 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 48.756s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.61s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.41s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.5s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.47s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.21s amadan.net/oficina/equipo/internal/plan3test TestPlanMigrationUpgrade
machine: 32 CPUs, load 17.89, cpu waiting 12.17%, memory waiting 0.00%, io waiting 1.52%
--- 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 30.4%, load 17.89
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/hostedctl ./internal/hostedwire ./internal/idtest ./internal/isolatedjob ./internal/isolatedjob/awsjob ./internal/isolatedjob/guardfixture ./internal/isolatedjob/isolatedjobtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/hostedctl ./internal/hostedwire ./internal/idtest ./internal/isolatedjob ./internal/isolatedjob/awsjob ./internal/isolatedjob/guardfixture ./internal/isolatedjob/isolatedjobtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/isolatedjob: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude: 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
--- FAIL amadan.net/oficina/equipo/internal/runner/webread TestTimeouts
=== RUN   TestTimeouts
    fetch_test.go:537: s1: {Source:s1 Origin:paul Parent: URL:https://shop.example.com/slow-body Hops:[{URL:https://shop.example.com/slow-body Address:151.101.1.1 Status:200}] Address:151.101.1.1 Status:200 Type:text/plain Bytes:5 SHA256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 Millis:304 Reason: File:s001.txt}
--- FAIL: TestTimeouts (0.62s)

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

budget note: internal/equipo took 45.275s, 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 12.529s, 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 39.84s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/release took 34.981s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/runner/containment took 38.729s, over the 15s its record on line 40 allows; reported only, timing fails on CI

receipt: test step 2m15.259s against a 60s target (the gate's other steps are not in this figure)
receipt: 12 packages ran, 52 cached, 20 without tests, 1 failed
receipt: slow package 51.453s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 51.268s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 45.275s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 39.84s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 38.729s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 21.39s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeAcceptanceHostileRepository
receipt: slow test 15.15s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringOfflineGo
receipt: slow test 10.89s amadan.net/oficina/equipo/internal/idtest TestIDCallbackGuardAndPendingNonce
receipt: slow test 10.82s amadan.net/oficina/equipo/internal/equipo TestAgentReadRechecksIdentity
receipt: slow test 9.24s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringMissingModuleCache
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestTimeouts$' -count=1 ./internal/runner/webread   (retry, once)
##############################################################################
FLAKE ./internal/runner/webread:TestTimeouts rest 03c772adf5783d48d90b5499983379c00db82125 0.62s 9.83
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 9.83, cpu waiting 5.20%, memory waiting 0.00%, io waiting 0.15%
--- 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.322s 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.733s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.21s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 15.21s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.38s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.85s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 5.61s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 28.31, cpu waiting 20.49%, memory waiting 0.00%, io waiting 0.63%
--- 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 1m32.049s 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.271s amadan.net/oficina/equipo/internal/headless
receipt: slow test 25.52s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 22.6s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 14.11s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 10.23s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 7.99s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 26.31, cpu waiting 17.71%, memory waiting 0.00%, io waiting 0.53%
--- 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 1m40.544s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m38.894s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.01s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.26s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 13.02s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 10.22s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
receipt: slow test 10.12s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
machine: 32 CPUs, load 23.02, cpu waiting 15.53%, memory waiting 0.00%, io waiting 0.47%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN   TestBrowserEmptyExplore
time=2026-11-22T18:45:23.207Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T18:45:23.207Z level=INFO msg="startup phase done" phase=state_lock took=61µs
time=2026-11-22T18:45:23.207Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T18:45:23.207Z level=INFO msg="startup phase done" phase=claim_roots took=91µs
time=2026-11-22T18:45:23.207Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T18:45:23.239Z level=INFO msg="startup phase done" phase=sweep took=31.926ms
time=2026-11-22T18:45:23.239Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T18:45:23.239Z level=INFO msg="startup phase done" phase=credentials took=109µs
time=2026-11-22T18:45:23.239Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T18:45:23.282Z level=INFO msg="startup phase done" phase=open_state took=42.842ms
time=2026-11-22T18:45:23.282Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T18:45:23.283Z level=INFO msg=connecting host=127.0.0.1:42845 protocol=28
time=2026-11-22T18:45:23.285Z level=INFO msg=connected host=127.0.0.1:42845 took=1.609ms
time=2026-11-22T18:45:23.285Z level=INFO msg="capabilities gathering"
time=2026-11-22T18:45:23.286Z level=INFO msg="capabilities gathered" took=397µs tags=linux,claude,go
time=2026-11-22T18:45:23.286Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T18:45:23.294Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-22T18:45:24.288Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_receipts_test.go:169: waiting for [...document.querySelectorAll('[equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes("I'm your coordinator")): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserEmptyExplore (5.81s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m26.449s
FAIL	amadan.net/oficina/equipo/internal/headless	86.730s


receipt: test step 1m27.738s 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 1m26.449s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.07s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.2s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.46s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 10.3s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 8.1s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' -v -run '^TestBrowserEmptyExplore$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserEmptyExplore browser-headless-rest 03c772adf5783d48d90b5499983379c00db82125 5.81s 27.56
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 24.85, cpu waiting 16.06%, memory waiting 0.00%, io waiting 0.48%
--- 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)$' ./internal/equipo

receipt: test step 975ms 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 573ms amadan.net/oficina/equipo/internal/equipo
receipt: slow test 570ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor)$' ./internal/idtest

receipt: test step 844ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1.673s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 1.67s 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 259ms against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 1.856s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 1.86s 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|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingSteady|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackPulse|TestBrowserTrackStarCentre|TestBrowserTryAgain)$' ./internal/thintest

receipt: test step 1.127s 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 3m20.199s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 17.52s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.35s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.02s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.55s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 7.93s amadan.net/oficina/equipo/internal/thintest TestBrowserInnerScreens
machine: 32 CPUs, load 5.94, cpu waiting 2.06%, memory waiting 0.00%, io waiting 2.35%
--- 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   (53s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 5.34s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.34s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.55s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 10.58s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 24.76s
+ 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   (73s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 24.06s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 12.95s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 11.45s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 22.15s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (22s)
ok ./internal/headless TestMixedVersions 20.77s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (1s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.79s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (0s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 29.42, cpu waiting 21.87%, memory waiting 0.00%, io waiting 0.75%
--- 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.239s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 3 without tests, 0 failed
receipt: slow package 7.06s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 158ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 70ms 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/pi
receipt: slow test 5.04s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.6s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 320ms 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/checks TestCheckSandboxToolchain
CGO_ENABLED=0 EQUIPO_REQUIRE_USER_SESSION=1 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment

receipt: test step 3.109s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.758s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 290ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 170ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryReusedPID
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReapsOrphans
machine: 32 CPUs, load 11.03, cpu waiting 4.40%, memory waiting 0.00%, io waiting 2.13%
--- 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 27.1%, load 17.89
shard 25: make runner-dead-references lanes-check build vet fmt-check budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2596 text files, 2854 matches, 0 failures
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 94 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipo	2.533s
machine: 32 CPUs, load 28.91, cpu waiting 19.59%, memory waiting 0.00%, io waiting 1.24%
--- 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 30.4%, load 17.89
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 17.89, cpu waiting 13.54%, memory waiting 0.00%, io waiting 1.47%
--- 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 27.1%, load 14.49
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===

No vulnerabilities found.

Your code is affected by 0 vulnerabilities.
This scan also found 0 vulnerabilities in packages you import and 5
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
machine: 32 CPUs, load 25.59, cpu waiting 15.32%, memory waiting 0.00%, io waiting 1.42%
--- 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 27.1%, load 14.49
shard 28: make gitleaks
6:44PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
6:44PM INF 1126 commits scanned.
6:44PM INF scanned ~61905119 bytes (61.91 MB) in 13.2s
6:44PM INF no leaks found
machine: 32 CPUs, load 28.91, cpu waiting 19.59%, memory waiting 0.00%, io waiting 1.24%
=== perf ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -require TestPerfScreens,TestPerfBoot -tags perf -count=1 -p 1 -parallel 1 -run '^TestPerf' ./...
perf: GET /: median 1.07ms, worst 1.106ms, budget 150ms
perf: GET /api/runner/protocol: median 82µs, worst 116µs, budget 150ms
perf: GET /api/v1/account-setups/{id}: median 598µs, worst 652µs, budget 150ms
perf: GET /api/v1/accounts: median 414µs, worst 447µs, budget 150ms
perf: GET /api/v1/auth/devices: median 447µs, worst 495µs, budget 150ms
perf: GET /api/v1/budgets: median 494µs, worst 583µs, budget 150ms
perf: GET /api/v1/capabilities: median 241µs, worst 280µs, budget 150ms
perf: GET /api/v1/cards/{id}: median 1.226ms, worst 1.302ms, budget 150ms
perf: GET /api/v1/connections: median 578µs, worst 638µs, budget 150ms
perf: GET /api/v1/connections/{id}: median 515µs, worst 599µs, budget 150ms
perf: GET /api/v1/conversation: median 923µs, worst 984µs, budget 150ms
perf: GET /api/v1/conversation/cards: median 1.444ms, worst 1.534ms, budget 150ms
perf: GET /api/v1/coordinator: median 1.875ms, worst 1.98ms, budget 150ms
perf: GET /api/v1/invites/{id}: median 442µs, worst 509µs, budget 150ms
perf: GET /api/v1/journey: median 7.614ms, worst 10.596ms, budget 150ms
perf: GET /api/v1/me: median 412µs, worst 443µs, budget 150ms
perf: GET /api/v1/me/settings: median 498µs, worst 532µs, budget 150ms
perf: GET /api/v1/needs-you: median 6.993ms, worst 7.157ms, budget 150ms
perf: GET /api/v1/notifications: median 1.576ms, worst 1.679ms, budget 150ms
perf: GET /api/v1/onboarding: median 371µs, worst 439µs, budget 150ms
perf: GET /api/v1/people: median 441µs, worst 455µs, budget 150ms
perf: GET /api/v1/playbooks: median 568µs, worst 619µs, budget 150ms
perf: GET /api/v1/playbooks/{id}: median 514µs, worst 560µs, budget 150ms
perf: GET /api/v1/playbooks/{id}/template-diff: median 789µs, worst 872µs, budget 150ms
perf: GET /api/v1/preferences: median 753µs, worst 776µs, budget 150ms
perf: GET /api/v1/projects/{id}: median 445µs, worst 470µs, budget 150ms
perf: GET /api/v1/projects/{id}/settings: median 577µs, worst 609µs, budget 150ms
perf: GET /api/v1/roster: median 445µs, worst 495µs, budget 150ms
perf: GET /api/v1/runners/{id}: median 416µs, worst 429µs, budget 150ms
perf: GET /api/v1/specialists: median 7.922ms, worst 8.007ms, budget 150ms
perf: GET /api/v1/specialists/{id}: median 7.826ms, worst 7.924ms, budget 150ms
perf: GET /api/v1/specialists/{id}/template-diff: median 817µs, worst 837µs, budget 150ms
perf: GET /api/v1/tasks/{id}/plan: median 1.072ms, worst 1.177ms, budget 150ms
perf: GET /api/v1/tasks/{id}/thread: median 694µs, worst 751µs, budget 150ms
perf: GET /api/v1/teams: median 418µs, worst 470µs, budget 150ms
perf: GET /api/v1/templates: median 585µs, worst 621µs, budget 150ms
perf: GET /api/v1/templates/{id}: median 438µs, worst 480µs, budget 150ms
perf: GET /auth/callback: median 77µs, worst 109µs, budget 150ms
perf: GET /auth/devices/{id}: median 3.228ms, worst 3.306ms, budget 150ms
perf: GET /auth/verify: median 85µs, worst 105µs, budget 150ms
perf: GET /connections: median 3.512ms, worst 3.597ms, budget 150ms
perf: GET /conversation: median 7.296ms, worst 7.478ms, budget 150ms
perf: GET /conversation/connections: median 263µs, worst 282µs, budget 150ms
perf: GET /conversation/notebook: median 249µs, worst 286µs, budget 150ms
perf: GET /conversation/settings: median 4.057ms, worst 6.505ms, budget 150ms
perf: GET /conversation/settings/autonomy: median 3.527ms, worst 3.612ms, budget 150ms
perf: GET /conversation/settings/connections: median 6.027ms, worst 6.119ms, budget 150ms
perf: GET /conversation/settings/connections/add: median 6.213ms, worst 6.439ms, budget 150ms
perf: GET /conversation/settings/copy: median 3.475ms, worst 3.525ms, budget 150ms
perf: GET /conversation/settings/housekeeping: median 3.961ms, worst 4.082ms, budget 150ms
perf: GET /conversation/settings/machines: median 4.259ms, worst 4.324ms, budget 150ms
perf: GET /conversation/settings/machines/add: median 4.254ms, worst 4.356ms, budget 150ms
perf: GET /conversation/settings/notebook: median 3.434ms, worst 3.534ms, budget 150ms
perf: GET /conversation/settings/thinking: median 4.072ms, worst 5.376ms, budget 150ms
perf: GET /housekeeping: median 3.656ms, worst 3.794ms, budget 150ms
perf: GET /invites/new: median 589µs, worst 618µs, budget 150ms
perf: GET /invites/{id}: median 620µs, worst 651µs, budget 150ms
perf: GET /jobs: median 3.172ms, worst 3.317ms, budget 150ms
perf: GET /jobs/{id}: median 4.293ms, worst 4.395ms, budget 150ms
perf: GET /journey: median 11.721ms, worst 12.042ms, budget 150ms
perf: GET /nav/rail: median 3.049ms, worst 3.172ms, budget 150ms
perf: GET /needs-you: median 11.312ms, worst 11.537ms, budget 150ms
perf: GET /onboarding: median 4.212ms, worst 6.601ms, budget 150ms
perf: GET /people: median 3.593ms, worst 3.693ms, budget 150ms
perf: GET /playbook-suggestions/{suggestion}: median 5.021ms, worst 5.219ms, budget 150ms
perf: GET /playbooks: median 4.56ms, worst 4.748ms, budget 150ms
perf: GET /playbooks/new: median 4.714ms, worst 4.828ms, budget 150ms
perf: GET /playbooks/{id}: median 4.432ms, worst 4.523ms, budget 150ms
perf: GET /playbooks/{id}/edit: median 4.403ms, worst 4.485ms, budget 150ms
perf: GET /playbooks/{id}/template-diff: median 3.627ms, worst 3.786ms, budget 150ms
perf: GET /preferences: median 4.035ms, worst 4.091ms, budget 150ms
perf: GET /preferences/sources/{source}: median 3.809ms, worst 3.91ms, budget 150ms
perf: GET /projects: median 5.02ms, worst 5.16ms, budget 150ms
perf: GET /projects/accounts: median 3.601ms, worst 5.066ms, budget 150ms
perf: GET /projects/new: median 3.665ms, worst 3.926ms, budget 150ms
perf: GET /projects/{id}: median 10.196ms, worst 10.342ms, budget 150ms
perf: GET /projects/{id}/edit: median 3.589ms, worst 3.729ms, budget 150ms
perf: GET /runners/enrol: median 4.289ms, worst 4.411ms, budget 150ms
perf: GET /settings: median 3.299ms, worst 3.456ms, budget 150ms
perf: GET /settings/coordinator: median 5.299ms, worst 5.434ms, budget 150ms
perf: GET /settings/devices: median 3.2ms, worst 3.238ms, budget 150ms
perf: GET /settings/recovery: median 3.263ms, worst 3.371ms, budget 150ms
perf: GET /settings/recovery/release: median 3.352ms, worst 3.464ms, budget 150ms
perf: GET /settings/thinking: median 253µs, worst 271µs, budget 150ms
perf: GET /signin: median 300µs, worst 346µs, budget 150ms
perf: GET /specialists/new: median 3.254ms, worst 3.302ms, budget 150ms
perf: GET /specialists/{key}: median 10.511ms, worst 10.979ms, budget 150ms
perf: GET /specialists/{key}/edit: median 3.502ms, worst 3.559ms, budget 150ms
perf: GET /specialists/{key}/template-diff: median 3.58ms, worst 3.629ms, budget 150ms
perf: GET /tasks: median 4.98ms, worst 5.181ms, budget 150ms
perf: GET /tasks/new: median 3.092ms, worst 3.194ms, budget 150ms
perf: GET /tasks/{id}: median 5.305ms, worst 5.379ms, budget 150ms
perf: GET /tasks/{id}/merge: median 4.576ms, worst 4.676ms, budget 150ms
perf: GET /tasks/{id}/move: median 4.48ms, worst 4.613ms, budget 150ms
perf: GET /tasks/{id}/plan: median 5.513ms, worst 6.91ms, budget 150ms
perf: GET /tasks/{id}/preview: median 1.568ms, worst 1.654ms, budget 150ms
perf: GET /tasks/{id}/questions/{question}: median 5.164ms, worst 5.299ms, budget 150ms
perf: GET /tasks/{id}/rendered-change: median 4.712ms, worst 4.751ms, budget 150ms
perf: GET /tasks/{id}/rendered-change/{hash}.png: median 4.105ms, worst 4.262ms, budget 150ms
perf: GET /tasks/{id}/thread: median 7.603ms, worst 7.833ms, budget 150ms
perf: GET /team/{specialist}: median 4.272ms, worst 4.416ms, budget 150ms
perf: GET /teams: median 9.658ms, worst 9.815ms, budget 150ms
perf: GET /templates: median 3.355ms, worst 3.412ms, budget 150ms
perf: GET /usage: median 4.019ms, worst 4.052ms, budget 150ms
perf: GET /work: median 3.098ms, worst 4.602ms, budget 150ms
perf: cold boot: median 261ms of [260.76089ms 261.105731ms 262.320118ms], budget 500ms

receipt: test step 30.615s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 90 without tests, 0 failed
receipt: slow package 8.784s amadan.net/oficina/equipo/internal/equipotest
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-runner
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-tool-proxy
receipt: slow package 0s amadan.net/oficina/equipo/internal/advice
receipt: slow package 0s amadan.net/oficina/equipo/internal/attach
receipt: slow test 7.95s amadan.net/oficina/equipo/internal/equipotest TestPerfScreens
receipt: slow test 830ms amadan.net/oficina/equipo/internal/equipotest TestPerfBoot
=== cache ===
ci-box: build cache /home/ci/work/repos/oficina__equipo/cache/go-build: 3.70 GiB in 23620 files
ci-box: module cache /home/ci/work/repos/oficina__equipo/cache/go-mod: 0.90 GiB in 32632 files
diff --git a/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md b/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md
index e6d4bf6f..76b54fa6 100644
--- a/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md
+++ b/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md
@@ -567,3 +567,42 @@ min) so the controller time since the sighting stays under the grace.
| M9 unknown_state alerted every pass | `^TestUnknownStateRetriedAndAlerted$` | `reaper_test.go:524: pass 4: unknown_state alerts [... 4 alerts ...], want 2` | yes, passes |
| M10 orphans before the replay | `^TestReapReplaysIntentFirst$` | `reaper_test.go:152: report {... Replayed:1 ... OrphansSeen:1 ...}, want one replayed and no orphans` | yes, passes |
| M11 recheck without running a missing audit | `^TestOrphanGraceExpiresAfterRestart$` | `reaper_test.go:469: first pass after the restart: report {... Replayed:0 ... OrphansStopped:2 ...}, want one orphan stopped and one replayed` | yes, passes |
+
+### Task 13 fix round 1 (review r1, rulings R22, R23)
+
+1. R22: the orphan final check counts waiting (not abandoned) Ref-less intents with
+ `last_dispatch_t` set; while any exist, every expired candidate is deferred, not stopped
+ (`ReapReport.OrphansDeferred`, audit `orphan_deferred` once per candidate per run of
+ deferrals). Abandoned intents never defer.
+2. R23: `ownershipLock` (an RWMutex in reaper.go, field `Controller.ownership`). `dispatch`
+ (launch.go, two lines) holds it for reading from just before `markDispatch` to the settled
+ answer; `finalOrphanCheck` holds it for writing from its fresh List through the last provider
+ Stop. Order: attempt lock, then ownership; the orphan path takes no attempt lock; never inside a
+ Tx. A test-only `waiting` hook reports a dispatch that has to wait.
+3. Every reaper audit (the recheck's and step 6) goes through `reaperAudit`: one run of failures
+ across both, the recheck's error joins the pass error.
+4. New guards: a stale live List entry for a proven job; the final check's own List; an incomplete
+ final-check List; the R22 deferral; the ownership lock; audit runs across both audit points.
+
+- New tests: `TestReapDefersOrphansWhileIntentWaits` (8 subtests: throttled, launches off, image
+ removed, audit failing; each ended by a stop request and by the stop time),
+ `TestReapOwnershipLockHoldsClaims`, `TestReapAuditEpisodesAcrossBothAudits`,
+ `TestReapProvenJobIsNeverOrphan`, `TestReapRecheckListsAgain`,
+ `TestReapIncompleteRecheckListStopsNothing`. RED: each fails under the mutation that restores
+ the round 0 behaviour it guards (R1 to R6 below).
+- GREEN: the brief's command ok 0.47 s; whole package `-v` ok 4.33 s, 89 tests, load average 6 to
+ 7; the new tests under `-race -count=10` ok; vet, gofmt, staticcheck v0.7.0, `make budget`,
+ dead-reference scan clean. M1 to M11 re-run against this code (M3, M3b, M6 and M11 rewritten
+ for it): all fail as below and pass unmutated.
+
+| Mutation | Test | Observed failure | Restored |
+| --- | --- | --- | --- |
+| M3 final check ignores the fresh List and table | `^TestReapRechecksOwnership$` | `reaper_test.go:238: pass at 10 min: report {... Replayed:1 ... OrphansStopped:2 ...}, want one orphan stopped and one replayed` | yes, passes |
+| M6 abandoned intents defer too (count without the state filter) | `^(TestReapStopsAbandonedIntentVM\|TestReapDefersOrphansWhileIntentWaits)$` | `reaper_test.go:270: at 10 min: report {... OrphansStopped:0 OrphansDeferred:1 ...}, want the abandoned intent's VM stopped`; `reaper_test.go:727: pass after the intent was abandoned: ... OrphansDeferred:2 ..., want both orphans stopped` | yes, passes |
+| M11 recheck without running a missing audit | `^TestOrphanGraceExpiresAfterRestart$` | `reaper_test.go:470: first pass after the restart: report {... Replayed:0 ... OrphansStopped:0 OrphansDeferred:2 ...}, want one orphan stopped and one replayed` | yes, passes |
+| R1 R22 deferral dropped | `^TestReapDefersOrphansWhileIntentWaits$` | all 8 subtests: `reaper_test.go:711: pass 0 after the grace: report {... OrphansStopped:2 OrphansDeferred:0 ...}, want both orphans deferred` | yes, passes |
+| R2 R23 write lock dropped | `^TestReapOwnershipLockHoldsClaims$` | `reaper_test.go:828: VM vm-0002 was stopped as an orphan while a job held it` (5 of 5 runs) | yes, passes (10 of 10 under `-race`) |
+| R3 recheck audit result ignored (round 0) | `^TestReapAuditEpisodesAcrossBothAudits$` | `reaper_test.go:890: pass 1: audit_failed alerts 1, want 2` | yes, passes |
+| R4 matched query excludes proven jobs | `^TestReapProvenJobIsNeverOrphan$` | `reaper_test.go:922: report {... OrphansSeen:1 ...}, want no orphan` | yes, passes |
+| R5 final check reuses the first List | `^TestReapRecheckListsAgain$` | `reaper_test.go:975: report {... OrphansStopped:1 ...}, want no stop of a VM the fresh list does not show` | yes, passes |
+| R6 incomplete final-check List used | `^TestReapIncompleteRecheckListStopsNothing$` | `reaper_test.go:993: pass with an incomplete recheck list: report {Skipped:false ... OrphansStopped:1 ...}, want skipped, no stop` | yes, passes |
diff --git a/internal/hostedctl/controller.go b/internal/hostedctl/controller.go
index 2126dff0..bf271b1a 100644
--- a/internal/hostedctl/controller.go
+++ b/internal/hostedctl/controller.go
@@ -39,15 +39,16 @@ type Deps struct {
// Controller owns the job table and the VMs launched for it.
type Controller struct {
- cfg Config
- store *Store
- runner isolatedjob.Runner
- auditor isolatedjob.NetworkAuditor
- alerter Alerter
- audit auditState // the last network audit result (audit.go)
- rebased rebasedSet // jobs re-based after a restart (refresh.go)
- attempts attemptLocks // per-attempt locks (attemptlock.go)
- reap reapState // the reaper's in-memory state (reaper.go)
+ cfg Config
+ store *Store
+ runner isolatedjob.Runner
+ auditor isolatedjob.NetworkAuditor
+ alerter Alerter
+ audit auditState // the last network audit result (audit.go)
+ rebased rebasedSet // jobs re-based after a restart (refresh.go)
+ attempts attemptLocks // per-attempt locks (attemptlock.go)
+ reap reapState // the reaper's in-memory state (reaper.go)
+ ownership ownershipLock // dispatches against the orphan reaper's final check (reaper.go)
}
// New builds a controller. It refuses a nil dependency, including a nil
diff --git a/internal/hostedctl/launch.go b/internal/hostedctl/launch.go
index 696dfc07..b4ede8b2 100644
--- a/internal/hostedctl/launch.go
+++ b/internal/hostedctl/launch.go
@@ -466,6 +466,9 @@ func (c *Controller) dispatch(ctx context.Context, actor hostedwire.KeyID, attem
if gate := c.creatable(spec.Image, c.store.Clock().Now()); gate != nil {
return view, gate, nil
}
+ // R23: from the dispatch mark to the settled answer, the orphan reaper's
+ // final check cannot run (ownershipLock, reaper.go).
+ defer c.ownership.rlock()()
if err := c.markDispatch(ctx, attempt); err != nil {
return JobView{}, nil, err
}
diff --git a/internal/hostedctl/reaper.go b/internal/hostedctl/reaper.go
index 156a377d..486cf5da 100644
--- a/internal/hostedctl/reaper.go
+++ b/internal/hostedctl/reaper.go
@@ -50,6 +50,7 @@ const (
actionOrphanSeen = "orphan_seen"
actionOrphanStopped = "orphan_stopped"
actionOrphanStopFailed = "orphan_stop_failed"
+ actionOrphanDeferred = "orphan_deferred"
actionUnknownState = "unknown_state"
actionNetworkAuditFailed = "network_audit_failed"
actionNetworkAuditPassed = "network_audit_passed"
@@ -71,6 +72,10 @@ type ReapReport struct {
OrphansSeen int
// OrphansStopped: orphans the provider was asked to stop in this pass.
OrphansStopped int
+ // OrphansDeferred: orphans whose grace is over left running in this
+ // pass because a waiting intent that has been dispatched might own
+ // them (ruling R22).
+ OrphansDeferred int
// Unknown: jobs whose VM read unknown in this pass's Refresh.
Unknown int
}
@@ -98,8 +103,37 @@ type reapState struct {
unknownRuns map[string]int // attempt -> passes in a row its VM read unknown
unknownAlerted map[string]bool // attempt -> its current run was alerted
orphanAlerted map[isolatedjob.Ref]bool
- auditFailing bool // an audit_failed episode is open
- queued []Alert // alerts not yet delivered, oldest first
+ orphanDeferred map[isolatedjob.Ref]bool // orphans whose current deferral was audited
+ auditFailing bool // an audit_failed episode is open
+ queued []Alert // alerts not yet delivered, oldest first
+}
+
+// ownershipLock keeps VM ownership still while the orphan reaper decides
+// (ruling R23). Every dispatch holds it for reading from its dispatch mark
+// to its settled answer (a saved Ref, or the intent left waiting); the
+// orphan final check holds it for writing from its fresh List to its last
+// provider Stop. So no Ref is saved, and no intent is newly marked
+// dispatched, between the reaper reading ownership and stopping a VM.
+//
+// Lock order: an attempt lock, then this. The orphan path takes no attempt
+// lock. Never take it inside a store transaction.
+type ownershipLock struct {
+ mu sync.RWMutex
+ // waiting, when set, is called each time a dispatch finds the lock
+ // held for writing and is about to wait. Tests use it to see the wait
+ // without sleeping; production leaves it nil.
+ waiting func()
+}
+
+// rlock takes the lock for reading and returns its release.
+func (o *ownershipLock) rlock() func() {
+ if !o.mu.TryRLock() {
+ if o.waiting != nil {
+ o.waiting()
+ }
+ o.mu.RLock()
+ }
+ return o.mu.RUnlock
}
// observeGet records what Refresh's Get said about attempt's VM, for the
@@ -181,9 +215,11 @@ func (c *Controller) Loop(ctx context.Context, every time.Duration) error {
// already sent a requested stop again). See reapJob and trackUnknown.
// 5. Orphans, only on a complete List (reapOrphans): VMs that match no
// job's saved Ref are recorded in unmatched_vms and stopped once
-// OrphanGrace has passed and a recheck still finds them unclaimed.
-// 6. The network audit (RunAudit). While it fails, launches are refused;
-// an audit_failed alert goes out when a run of failures begins.
+// OrphanGrace has passed and a recheck still finds them unclaimed,
+// unless a dispatched waiting intent may own them (deferred, R22).
+// 6. The network audit (reaperAudit). While it fails, launches are
+// refused; an audit_failed alert goes out when a run of failures
+// begins.
//
// Then the pass's alerts are delivered. A step's failure, an Alerter's
// included, does not stop the steps after it; the pass returns every
@@ -210,7 +246,7 @@ func (c *Controller) reapPass(ctx context.Context, rep *ReapReport) error {
errs = append(errs, c.Refresh(ctx))
errs = append(errs, c.reapJobs(ctx, rep))
errs = append(errs, c.reapOrphans(ctx, rep))
- errs = append(errs, c.reapAudit(ctx))
+ errs = append(errs, c.reaperAudit(ctx))
errs = append(errs, c.sendAlerts(ctx))
return errors.Join(errs...)
}
@@ -489,6 +525,11 @@ func (c *Controller) trackOrphans(ctx context.Context, vms []isolatedjob.Job, re
delete(c.reap.orphanAlerted, ref)
}
}
+ for ref := range c.reap.orphanDeferred {
+ if !live[ref] {
+ delete(c.reap.orphanDeferred, ref)
+ }
+ }
return expired, nil
}
@@ -506,50 +547,97 @@ func (c *Controller) graceOver(first, now T) bool {
// 1. Replay again, so a waiting intent whose lost launch reply made the VM
// claims it through its client token. A controller with no fresh
// passing audit (a fresh one has none until step 6) runs the audit
-// first, or Replay would create nothing and so claim nothing.
-// 2. List again. It must be complete; otherwise nothing is stopped.
-// 3. Read the saved Refs again, after the List, so a Ref saved while the
-// List ran is seen.
+// first (reaperAudit, so its result counts like step 6's), or Replay
+// would create nothing and so claim nothing.
+// 2. The final check, holding the ownership lock for writing until the
+// last provider Stop (R23), so no dispatch saves a Ref or marks an
+// intent dispatched meanwhile: List again (it must be complete;
+// otherwise nothing is stopped), then read the saved Refs and count the
+// waiting intents that have been dispatched, after the List, so a Ref
+// saved while the List ran is seen.
//
-// Only an orphan still listed, not terminal, not stopping and still
-// unmatched is stopped (stopOrphan).
+// An orphan no longer listed, terminal, stopping or now matched is left.
+// While any waiting intent has been dispatched (last_dispatch_t set), the
+// rest are deferred, not stopped (R22): the table cannot tell which unlinked
+// VM such an intent's lost launch reply made. Each deferral is audited once
+// until the orphan is stopped or leaves the candidates. Abandoned intents
+// never defer: their VMs are orphans. A waiting intent is abandoned by its
+// stop time at the latest, so deferral ends within the job's lifetime.
+// Otherwise the orphan is stopped (stopOrphan).
func (c *Controller) recheckOrphans(ctx context.Context, expired []orphan, rep *ReapReport) error {
+ var errs []error
if c.audit.check(c.store.Clock().Now()) != nil {
- _ = c.RunAudit(ctx) // a failure is reported and alerted by step 6
+ errs = append(errs, c.reaperAudit(ctx))
}
- n, rerr := c.replayCounted(ctx)
+ n, err := c.replayCounted(ctx)
rep.Replayed += n
+ errs = append(errs, err)
+ return errors.Join(append(errs, c.finalOrphanCheck(ctx, expired, rep))...)
+}
+
+// finalOrphanCheck is step 2 of recheckOrphans, under the ownership lock.
+func (c *Controller) finalOrphanCheck(ctx context.Context, expired []orphan, rep *ReapReport) error {
+ c.ownership.mu.Lock()
+ defer c.ownership.mu.Unlock()
vms, err := c.runner.List(ctx)
if err != nil {
rep.Skipped = true
if errors.Is(err, isolatedjob.ErrIncomplete) {
- return rerr
+ return nil
}
- return errors.Join(rerr, fmt.Errorf("hostedctl: reap: list VMs for the ownership recheck: %w", err))
+ return fmt.Errorf("hostedctl: reap: list VMs for the ownership recheck: %w", err)
}
var saved map[isolatedjob.Ref]bool
+ var dispatched int
if err := c.store.Tx(ctx, func(tx *sql.Tx) error {
var err error
- saved, err = savedRefs(ctx, tx)
- return err
+ if saved, err = savedRefs(ctx, tx); err != nil {
+ return err
+ }
+ if err := tx.QueryRowContext(ctx, `SELECT count(*) FROM jobs WHERE state = ? AND vm_ref IS NULL
+ AND last_dispatch_t IS NOT NULL`, JobWaiting).Scan(&dispatched); err != nil {
+ return fmt.Errorf("hostedctl: reap: count dispatched intents: %w", err)
+ }
+ return nil
}); err != nil {
- return errors.Join(rerr, err)
+ return err
}
listed := make(map[isolatedjob.Ref]isolatedjob.State, len(vms))
for _, vm := range vms {
listed[vm.Ref] = vm.State
}
- errs := []error{rerr}
+ var errs []error
for _, o := range expired {
st, ok := listed[o.ref]
if !ok || st.Terminal() || st == isolatedjob.StateStopping || saved[o.ref] {
continue
}
+ if dispatched > 0 {
+ errs = append(errs, c.deferOrphan(ctx, o, dispatched, rep))
+ continue
+ }
+ delete(c.reap.orphanDeferred, o.ref)
errs = append(errs, c.stopOrphan(ctx, o, rep))
}
return errors.Join(errs...)
}
+// deferOrphan counts an orphan left running because n waiting intents have
+// been dispatched (R22), and audits it once per run of deferrals.
+func (c *Controller) deferOrphan(ctx context.Context, o orphan, n int, rep *ReapReport) error {
+ rep.OrphansDeferred++
+ if c.reap.orphanDeferred[o.ref] {
+ return nil
+ }
+ if c.reap.orphanDeferred == nil {
+ c.reap.orphanDeferred = map[isolatedjob.Ref]bool{}
+ }
+ c.reap.orphanDeferred[o.ref] = true
+ return c.auditReaper(context.WithoutCancel(ctx), actionOrphanDeferred, fmt.Sprintf(
+ "VM %s matches no job and its grace is over, but %d waiting launch intent(s) were dispatched and may own it; "+
+ "it is stopped once they hold a VM or are abandoned", o.ref, n))
+}
+
// stopOrphan sends the provider stop for an orphan, with the reason
// "orphan", then audits it and raises one orphan_stopped alert per VM. No
// job owns the VM, so no proof is recorded. A failed stop call is audited
@@ -579,11 +667,14 @@ func (c *Controller) stopOrphan(ctx context.Context, o orphan, rep *ReapReport)
return c.auditReaper(rec, actionOrphanStopped, reason)
}
-// reapAudit is step 6: RunAudit, which records the result the launch gates
-// read. When a run of failures begins it audits the failure and raises one
-// audit_failed alert; the first pass after the run ends audits that.
-// A failing audit is returned. An audit cut short by ctx starts no run.
-func (c *Controller) reapAudit(ctx context.Context) error {
+// reaperAudit runs every audit the reaper triggers: step 6, and the
+// recheck's when no fresh passing audit is held. It calls RunAudit, which
+// records the result the launch gates read, and tracks runs of failures
+// across both: when a run begins it audits the failure and raises one
+// audit_failed alert; the first passing audit after it ends the run and is
+// audited. A failing audit is returned. An audit cut short by ctx starts no
+// run.
+func (c *Controller) reaperAudit(ctx context.Context) error {
err := c.RunAudit(ctx)
rec := context.WithoutCancel(ctx)
switch {
diff --git a/internal/hostedctl/reaper_test.go b/internal/hostedctl/reaper_test.go
index eb52f6c4..fb4676a9 100644
--- a/internal/hostedctl/reaper_test.go
+++ b/internal/hostedctl/reaper_test.go
@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"slices"
+ "strings"
"sync"
"testing"
"time"
@@ -639,3 +640,364 @@ func TestReapLoopRunsPassesUntilDone(t *testing.T) {
t.Fatalf("unmatched_vms after Loop's passes = %v, want the orphan recorded", u)
}
}
+
+// auditCount counts the audit rows with action whose reason names ref.
+func (e *launchEnv) auditCount(action string, ref isolatedjob.Ref) int {
+ e.t.Helper()
+ n := 0
+ for _, a := range auditRows(e.t, e.store) {
+ if a.Action == action && strings.Contains(a.Reason, string(ref)) {
+ n++
+ }
+ }
+ return n
+}
+
+// While a waiting intent that has been dispatched exists, an orphan whose
+// grace is over may be the VM its lost launch reply made: it is deferred,
+// whichever gate keeps the intent from claiming it (R22). Once the intent is
+// abandoned, the VM is an orphan again and is stopped.
+func TestReapDefersOrphansWhileIntentWaits(t *testing.T) {
+ t.Parallel()
+ bad := isolatedjob.NetworkAudit{IngressClosed: true, RouteOutAbsent: true} // resolver on
+ gates := []struct {
+ name string
+ set func(e *launchEnv)
+ }{
+ {"throttled", func(e *launchEnv) {
+ for range 20 {
+ e.fake.Inject(isolatedjob.OpLaunch, isolatedjob.FaultThrottle)
+ }
+ }},
+ {"launches off", func(e *launchEnv) { e.c.cfg.Enabled = false }},
+ {"image removed", func(e *launchEnv) { delete(e.c.cfg.Images, imgA) }},
+ {"audit failing", func(e *launchEnv) {
+ e.fake.SetAudit(bad, nil)
+ _ = e.c.RunAudit(e.ctx) // recorded now, so the first pass's replay is gated too
+ }},
+ }
+ ends := []struct {
+ name string
+ end func(e *launchEnv)
+ }{
+ {"stop asked for", func(e *launchEnv) {
+ if _, err := e.c.Stop(e.ctx, "inst-1", instKey, "att-1", "done"); !errors.Is(err, ErrStopPending) {
+ e.t.Fatalf("Stop of the waiting intent = %v, want ErrStopPending", err)
+ }
+ }},
+ {"stop time passed", func(e *launchEnv) {
+ e.clk.AdvanceMono(time.Duration(T(e.stopCols("att-1").stop) - e.store.Clock().Now()))
+ }},
+ }
+ for _, g := range gates {
+ for _, end := range ends {
+ t.Run(g.name+", "+end.name, func(t *testing.T) {
+ t.Parallel()
+ e := newLaunchEnv(t)
+ ref := e.lostLaunch("att-1")
+ stray := e.plant("stray-1")
+ g.set(e)
+ pass := func() ReapReport {
+ r, err := e.c.Reap(e.ctx)
+ if err != nil && g.name != "audit failing" {
+ t.Fatalf("Reap = (%+v, %v)", r, err)
+ }
+ return r
+ }
+ pass()
+ e.clk.AdvanceMono(OrphanGrace)
+ for i := range 2 {
+ if r := pass(); r.OrphansDeferred != 2 || r.OrphansStopped != 0 {
+ t.Fatalf("pass %d after the grace: report %+v, want both orphans deferred", i, r)
+ }
+ e.clk.AdvanceMono(time.Minute)
+ }
+ e.wantStops()
+ if j, _ := e.job("att-1"); j.state != JobWaiting {
+ t.Fatalf("att-1 is %q, want still waiting", j.state)
+ }
+ for _, r := range []isolatedjob.Ref{ref, stray} {
+ if n := e.auditCount(actionOrphanDeferred, r); n != 1 {
+ t.Fatalf("orphan_deferred rows for %s = %d, want one for the run of deferrals", r, n)
+ }
+ }
+
+ end.end(e)
+ if r := pass(); r.OrphansStopped != 2 || r.OrphansDeferred != 0 {
+ t.Fatalf("pass after the intent was abandoned: report %+v, want both orphans stopped", r)
+ }
+ if j, _ := e.job("att-1"); j.state != JobAbandoned {
+ t.Fatalf("att-1 is %q, want abandoned", j.state)
+ }
+ e.wantStops(ref, stray)
+ })
+ }
+ }
+}
+
+// stopGate wraps the provider. The first Stop signals entered and waits for
+// release. Every Stop records whether its Ref was a job's saved Ref at the
+// moment of the call.
+type stopGate struct {
+ *isolatedjob.Fake
+ store *Store
+ entered, release chan struct{}
+ mu sync.Mutex
+ calls int
+ savedAtStop map[isolatedjob.Ref]bool
+}
+
+func (g *stopGate) Stop(ctx context.Context, ref isolatedjob.Ref, reason string) error {
+ g.mu.Lock()
+ g.calls++
+ first := g.calls == 1
+ g.mu.Unlock()
+ if first {
+ close(g.entered)
+ <-g.release
+ }
+ var n int
+ if err := g.store.Tx(ctx, func(tx *sql.Tx) error {
+ return tx.QueryRowContext(ctx, `SELECT count(*) FROM jobs WHERE vm_ref = ?`, string(ref)).Scan(&n)
+ }); err != nil {
+ return err
+ }
+ g.mu.Lock()
+ g.savedAtStop[ref] = n > 0
+ g.mu.Unlock()
+ return g.Fake.Stop(ctx, ref, reason)
+}
+
+// The orphan final check holds the ownership lock through its last Stop
+// (R23): a Replay that tries to claim the second candidate while the first
+// Stop is in flight waits, and no Stop ever reaches a VM a job holds.
+func TestReapOwnershipLockHoldsClaims(t *testing.T) {
+ t.Parallel()
+ e := newLaunchEnv(t)
+ g := &stopGate{Fake: e.fake, store: e.store, entered: make(chan struct{}), release: make(chan struct{}),
+ savedAtStop: map[isolatedjob.Ref]bool{}}
+ e.run = g
+ e.newController()
+ e.audit()
+ stray := e.plant("stray-1")
+ ref := e.lostLaunch("att-1")
+ // The lost launch marked a dispatch, so R22 alone would defer both
+ // orphans. Clearing the mark isolates the lock.
+ e.exec(`UPDATE jobs SET last_dispatch_t = NULL WHERE attempt_id = 'att-1'`)
+ e.c.cfg.Enabled = false // the pass's own replays create and claim nothing
+ e.reap()
+ e.clk.AdvanceMono(OrphanGrace)
+
+ waited := make(chan struct{})
+ e.c.ownership.waiting = func() { close(waited) }
+ reaped := make(chan error, 1)
+ go func() { _, err := e.c.Reap(e.ctx); reaped <- err }()
+ select {
+ case <-g.entered:
+ case <-time.After(5 * time.Second):
+ t.Fatal("the reaper never stopped the first orphan")
+ }
+ e.c.cfg.Enabled = true // the reaper read it before the Stop; a claim may go ahead now
+ replayed := make(chan error, 1)
+ go func() { replayed <- e.c.Replay(e.ctx) }()
+ select {
+ case <-waited: // the dispatch waits for the reaper
+ case err := <-replayed: // the claim landed during the Stop
+ replayed <- err
+ case <-time.After(5 * time.Second):
+ t.Fatal("the Replay neither waited nor finished")
+ }
+ close(g.release)
+ for _, ch := range []chan error{reaped, replayed} {
+ select {
+ case err := <-ch:
+ if err != nil {
+ t.Fatalf("Reap or Replay = %v", err)
+ }
+ case <-time.After(5 * time.Second):
+ t.Fatal("Reap or Replay did not finish")
+ }
+ }
+ g.mu.Lock()
+ defer g.mu.Unlock()
+ if len(g.savedAtStop) != 2 {
+ t.Fatalf("orphan stops = %v, want %s and %s", g.savedAtStop, stray, ref)
+ }
+ for r, saved := range g.savedAtStop {
+ if saved {
+ t.Fatalf("VM %s was stopped as an orphan while a job held it", r)
+ }
+ }
+ if j, _ := e.job("att-1"); isolatedjob.Ref(j.ref.String) != ref {
+ t.Fatalf("att-1 ref %v, want %s claimed once the reaper let go", j.ref, ref)
+ }
+}
+
+// scriptAuditor answers AuditNetwork from a script: true passes, false
+// fails. Calls past the script pass.
+type scriptAuditor struct {
+ mu sync.Mutex
+ script []bool
+ n int
+}
+
+func (s *scriptAuditor) AuditNetwork(context.Context) (isolatedjob.NetworkAudit, error) {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ s.n++
+ a := isolatedjob.NetworkAudit{ResolverDisabled: true, IngressClosed: true, RouteOutAbsent: true}
+ if s.n <= len(s.script) && !s.script[s.n-1] {
+ a.ResolverDisabled = false
+ }
+ return a, nil
+}
+
+// The recheck's audit and step 6's share one run of failures: a pass at
+// either point ends it, a failure at either begins one.
+func TestReapAuditEpisodesAcrossBothAudits(t *testing.T) {
+ t.Parallel()
+ e := newLaunchEnv(t)
+ sa := &scriptAuditor{script: []bool{
+ true, // the setup audit
+ false, // pass 0, step 6
+ true, false, // pass 1: recheck, step 6
+ true, // pass 2, step 6
+ false, true, // pass 3: recheck, step 6
+ }}
+ c, err := New(e.cfg, Deps{Store: e.store, Runner: e.run, Auditor: sa, Alerter: &recordingAlerter{}})
+ if err != nil {
+ t.Fatal(err)
+ }
+ e.c = c
+ e.audit()
+ passed := func() int { return e.auditCount(actionNetworkAuditPassed, "") }
+ check := func(n int, wantErr bool, alerts, passes int) {
+ t.Helper()
+ _, err := e.c.Reap(e.ctx)
+ if (err != nil) != wantErr {
+ t.Fatalf("pass %d = %v, want an error %v", n, err, wantErr)
+ }
+ if a := e.alerts(AlertAuditFailed); len(a) != alerts {
+ t.Fatalf("pass %d: audit_failed alerts %d, want %d", n, len(a), alerts)
+ }
+ if p := passed(); p != passes {
+ t.Fatalf("pass %d: network_audit_passed rows %d, want %d", n, p, passes)
+ }
+ }
+ e.plant("stray-1")
+ check(0, true, 1, 0)
+ e.clk.AdvanceMono(OrphanGrace)
+ check(1, true, 2, 1) // failure, then success at the recheck, then failure: a new run
+ e.plant("stray-2")
+ check(2, false, 2, 2)
+ e.clk.AdvanceMono(OrphanGrace)
+ check(3, true, 3, 3) // the recheck's failure counts though step 6 passes
+ if sa.n != len(sa.script) {
+ t.Fatalf("audits run = %d, want %d", sa.n, len(sa.script))
+ }
+}
+
+// A stale live List entry for a job that already has proof still matches
+// its saved Ref: it is never an orphan.
+func TestReapProvenJobIsNeverOrphan(t *testing.T) {
+ t.Parallel()
+ e := newLaunchEnv(t)
+ sr := &slowRunner{Fake: e.fake, clk: e.clk}
+ e.run = sr
+ e.newController()
+ e.audit()
+ ref := e.launchWith("att-1", 2*time.Hour)
+ e.fake.Tick()
+ if _, err := e.c.Stop(e.ctx, "inst-1", instKey, "att-1", "done"); !errors.Is(err, ErrStopPending) {
+ t.Fatalf("Stop = %v, want ErrStopPending", err)
+ }
+ e.fake.Tick()
+ e.refresh()
+ if w := e.wireProof("att-1"); w.VMRef != ref {
+ t.Fatalf("proof = %+v, want one for %s", w, ref)
+ }
+ e.fake.Vanish(ref)
+ sr.setExtra(isolatedjob.Job{Ref: ref, State: isolatedjob.StateRunning})
+ if r := e.reap(); r.OrphansSeen != 0 {
+ t.Fatalf("report %+v, want no orphan", r)
+ }
+ e.clk.AdvanceMono(OrphanGrace)
+ if r := e.reap(); r.OrphansSeen != 0 || r.OrphansStopped != 0 {
+ t.Fatalf("after the grace: report %+v, want no orphan", r)
+ }
+ e.wantStops(ref) // the instance's own stop only
+}
+
+// listScript wraps the provider's List. After List call n (counting from
+// 1) it runs script(n), which may change the fake; when script returns
+// true the answer comes with ErrIncomplete, VMs and all.
+type listScript struct {
+ *isolatedjob.Fake
+ mu sync.Mutex
+ n int
+ script func(n int) bool
+}
+
+func (l *listScript) List(ctx context.Context) ([]isolatedjob.Job, error) {
+ vms, err := l.Fake.List(ctx)
+ if err != nil {
+ return vms, err
+ }
+ l.mu.Lock()
+ l.n++
+ n := l.n
+ l.mu.Unlock()
+ if l.script(n) {
+ return vms, fmt.Errorf("%w: test stopped paging", isolatedjob.ErrIncomplete)
+ }
+ return vms, nil
+}
+
+// The final check lists again: a VM the first List showed and the provider
+// has since forgotten is not stopped.
+func TestReapRecheckListsAgain(t *testing.T) {
+ t.Parallel()
+ e := newLaunchEnv(t)
+ var stray isolatedjob.Ref
+ ls := &listScript{Fake: e.fake, script: func(n int) bool {
+ if n == 2 { // the expiry pass's first List
+ e.fake.Vanish(stray)
+ }
+ return false
+ }}
+ e.run = ls
+ e.newController()
+ e.audit()
+ stray = e.plant("stray-1")
+ e.reap()
+ e.clk.AdvanceMono(OrphanGrace)
+ if r := e.reap(); r.OrphansStopped != 0 {
+ t.Fatalf("report %+v, want no stop of a VM the fresh list does not show", r)
+ }
+ e.wantStops()
+}
+
+// An incomplete List in the final check stops nothing; the next complete
+// one does.
+func TestReapIncompleteRecheckListStopsNothing(t *testing.T) {
+ t.Parallel()
+ e := newLaunchEnv(t)
+ ls := &listScript{Fake: e.fake, script: func(n int) bool { return n == 3 }} // the expiry pass's recheck
+ e.run = ls
+ e.newController()
+ e.audit()
+ stray := e.plant("stray-1")
+ e.reap()
+ e.clk.AdvanceMono(OrphanGrace)
+ if r := e.reap(); !r.Skipped || r.OrphansStopped != 0 {
+ t.Fatalf("pass with an incomplete recheck list: report %+v, want skipped, no stop", r)
+ }
+ e.wantStops()
+ if u := e.unmatched(); len(u) != 1 {
+ t.Fatalf("unmatched_vms = %v, want the orphan kept", u)
+ }
+ if r := e.reap(); r.Skipped || r.OrphansStopped != 1 {
+ t.Fatalf("next pass: report %+v, want the orphan stopped", r)
+ }
+ e.wantStops(stray)
+}