oficina / equipo Public

hostedctl: harden the store: no replace, one owner, durable alerts

Review round 1 (rulings R10-R13). Jobs rows are never deleted, and
recursive_triggers makes INSERT OR REPLACE hit that trigger, so a spec
and its resume history cannot be swapped out. Close checkpoints
controller time; the Tx checkpoint is sampled after fn. Open takes an
exclusive flock beside the database, so a second owner fails at once.
Rollback alerts live in a durable outbox with a stable ID and are
delivered at least once. A pruned-through mark denies nonces whose
window the wall clock went back into. Typed-nil dependencies and clocks
are refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 60eeb37830e59a8c0a8e88f6f2f29dfa5081aa7f parent 3e07467
6 files changed, +459 −66
  • docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md +29 −0
  • internal/hostedctl/clock_test.go +58 −8
  • internal/hostedctl/controller.go +19 −4
  • internal/hostedctl/schema/0001_jobs.sql +27 −1
  • internal/hostedctl/store.go +178 −43
  • internal/hostedctl/store_test.go +148 −10

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   86G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   86G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 2.1s
ci-box: codex: fetched and verified in 3.5s
ci-box: codex-code-mode-host: fetched and verified in 1.4s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.4s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.9s
ci-box: pi: installed and verified in 7.2s
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 9.5s
ci-box: clone deepened in 3.7s
ci-box: file times set from content: 2868 files, 192 directories
ci-box: ready in 17.1s
=== 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.246s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  1.2s
+ go list -export -test -tags testbuild -f  ./...
  0.7s
+ 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 1m21.418s 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.795s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m19.79s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 31.32, cpu waiting 21.10%, memory waiting 0.00%, io waiting 0.47%
--- 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 1m23.891s 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.151s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m22.15s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 31.32, cpu waiting 20.67%, memory waiting 0.00%, io waiting 0.45%
--- 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.947s 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.893s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m12.17s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.9s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.82s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 31.32, cpu waiting 20.67%, memory waiting 0.00%, io waiting 0.45%
--- 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 1m19.496s 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.801s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.15s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 20.54s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.57s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.54s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 32.74, cpu waiting 21.51%, memory waiting 0.00%, io waiting 0.49%
--- 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.822s 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 1m36.063s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m0.23s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.07s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 10.05s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 8.81s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 5.9s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 27.31, cpu waiting 16.84%, memory waiting 0.00%, io waiting 0.36%
--- 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 3m10.445s 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 3m8.387s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m45.16s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 24.46s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.69s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 8.2s amadan.net/oficina/equipo/internal/headless TestHeadlessClaudeSignIn
receipt: slow test 7.39s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 10.06, cpu waiting 3.68%, memory waiting 0.00%, io waiting 0.07%
--- 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.183s 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.60, cpu waiting 0.00%, memory waiting 0.00%, io waiting 1.84%
--- 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.13s 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.60, cpu waiting 1.21%, memory waiting 0.00%, io waiting 1.82%
--- 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 4m30.441s, over the 45s its record on line 44 allows; reported only, timing fails on CI

receipt: test step 4m43.516s 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 4m30.441s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 36.99s 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.78s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.48s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.97s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 2.69, cpu waiting 0.79%, 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.132s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 45.967s amadan.net/oficina/equipo/internal/runner
receipt: slow test 25.93s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 32.15, cpu waiting 20.20%, memory waiting 0.00%, io waiting 0.87%
--- shard 10 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-plans: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

receipt: test step 47.54s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 45.617s amadan.net/oficina/equipo/internal/runner
receipt: slow test 35.53s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 30.99s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.41s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.66s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 32.15, cpu waiting 20.62%, memory waiting 0.00%, io waiting 0.84%
--- 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.337s 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.509s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.13s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.73s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.12s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.25s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 22.39, cpu waiting 14.05%, memory waiting 0.00%, io waiting 1.06%
--- 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 26.8%, load 15.80
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 1m5.227s 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.198s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 27.03s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 26.96s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 25.04s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 22.45s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 22.24s amadan.net/oficina/equipo/internal/equipotest TestAuthorityUsesLiveRoster
machine: 32 CPUs, load 27.31, cpu waiting 17.41%, memory waiting 0.00%, io waiting 0.37%
--- 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 26.8%, load 15.80
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.337s 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 22.39, cpu waiting 11.03%, memory waiting 0.00%, io waiting 1.14%
--- 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 26.8%, load 15.80
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 1m15.324s 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.339s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 14.17s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 12.64s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 9.59s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 9.54s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 6.51s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 28.41, cpu waiting 15.30%, memory waiting 0.00%, io waiting 0.32%
--- 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 26.8%, load 15.80
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 453ms 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 15.80, cpu waiting 11.03%, memory waiting 0.00%, io waiting 1.14%
--- 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 26.8%, load 15.80
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 552ms 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 22.39, cpu waiting 11.03%, memory waiting 0.00%, io waiting 1.14%
--- 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 26.8%, load 15.80
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/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/isolatedjob: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider: 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/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/codex: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/checks: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/containment: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
budget note: internal/equipo took 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 39.736s, over the 15s its record on line 40 allows; reported only, timing fails on CI

receipt: test step 2m14.643s against a 60s target (the gate's other steps are not in this figure)
receipt: 14 packages ran, 51 cached, 20 without tests, 0 failed
receipt: slow package 53.094s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 52.283s 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 39.736s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 21.4s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeAcceptanceHostileRepository
receipt: slow test 15.37s 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.36s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringMissingModuleCache
machine: 32 CPUs, load 11.50, cpu waiting 5.49%, memory waiting 0.00%, io waiting 0.11%
--- 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.564s 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.192s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.43s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 15.15s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.61s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.79s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 5.83s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 31.32, cpu waiting 20.67%, memory waiting 0.00%, io waiting 0.45%
--- 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 1m33.183s 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 1m31.451s amadan.net/oficina/equipo/internal/headless
receipt: slow test 26.1s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 22.93s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 14.09s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 10.33s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 8.17s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 28.99, cpu waiting 17.96%, memory waiting 0.00%, io waiting 0.38%
--- 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.421s 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.668s amadan.net/oficina/equipo/internal/headless
receipt: slow test 13.81s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.23s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 12.88s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 10.28s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.24s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 28.41, cpu waiting 16.29%, memory waiting 0.00%, io waiting 0.35%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN   TestBrowserCopyContinue
time=2026-11-22T16:54:40.520Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T16:54:40.520Z level=INFO msg="startup phase done" phase=state_lock took=61µs
time=2026-11-22T16:54:40.520Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T16:54:40.520Z level=INFO msg="startup phase done" phase=claim_roots took=85µs
time=2026-11-22T16:54:40.520Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T16:54:40.568Z level=INFO msg="startup phase done" phase=sweep took=47.807ms
time=2026-11-22T16:54:40.568Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T16:54:40.568Z level=INFO msg="startup phase done" phase=credentials took=159µs
time=2026-11-22T16:54:40.568Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T16:54:40.625Z level=INFO msg="startup phase done" phase=open_state took=57.016ms
time=2026-11-22T16:54:40.626Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T16:54:40.627Z level=INFO msg=connecting host=127.0.0.1:39225 protocol=28
time=2026-11-22T16:54:40.632Z level=INFO msg=connected host=127.0.0.1:39225 took=3.306ms
time=2026-11-22T16:54:40.632Z level=INFO msg="capabilities gathering"
time=2026-11-22T16:54:40.632Z level=INFO msg="capabilities gathered" took=390µs tags=linux,claude,go
time=2026-11-22T16:54:40.636Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T16:54:40.638Z level=INFO msg=welcome protocol=28 role=primary generation=1
    browser_copy_test.go:93: continue did not reach Checks: 0 <nil>
--- FAIL: TestBrowserCopyContinue (1.80s)

--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN   TestBrowserEmptyExplore
rastrillo: budget test: go test failed
time=2026-11-22T16:55:11.977Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T16:55:11.977Z level=INFO msg="startup phase done" phase=state_lock took=59µs
time=2026-11-22T16:55:11.977Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T16:55:11.977Z level=INFO msg="startup phase done" phase=claim_roots took=86µs
time=2026-11-22T16:55:11.977Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T16:55:12.007Z level=INFO msg="startup phase done" phase=sweep took=29.662ms
time=2026-11-22T16:55:12.007Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T16:55:12.007Z level=INFO msg="startup phase done" phase=credentials took=177µs
time=2026-11-22T16:55:12.007Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T16:55:12.047Z level=INFO msg="startup phase done" phase=open_state took=39.691ms
time=2026-11-22T16:55:12.047Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T16:55:12.048Z level=INFO msg=connecting host=127.0.0.1:44883 protocol=28
time=2026-11-22T16:55:12.049Z level=INFO msg=connected host=127.0.0.1:44883 took=861µs
time=2026-11-22T16:55:12.049Z level=INFO msg="capabilities gathering"
time=2026-11-22T16:55:12.050Z level=INFO msg="capabilities gathered" took=406µs tags=linux,claude,go
time=2026-11-22T16:55:12.052Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T16:55:12.055Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-22T16:55:13.108Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_receipts_test.go:169: waiting for [...document.querySelectorAll('[equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes("I'm your coordinator")): context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserEmptyExplore (5.86s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m27.382s
FAIL	amadan.net/oficina/equipo/internal/headless	87.678s


receipt: test step 1m28.774s 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 1m27.382s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.13s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.28s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.51s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 10.47s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 7.98s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' -v -run '^TestBrowserCopyContinue$|^TestBrowserEmptyExplore$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest 60eeb37830e59a8c0a8e88f6f2f29dfa5081aa7f 1.80s 29.77
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserEmptyExplore browser-headless-rest 60eeb37830e59a8c0a8e88f6f2f29dfa5081aa7f 5.86s 29.77
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 28.41, cpu waiting 15.82%, memory waiting 0.00%, io waiting 0.33%
--- 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 1.02s 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 847ms 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 213ms 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.091s 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.60, cpu waiting 1.66%, memory waiting 0.00%, io waiting 1.76%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless   (53s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 5.34s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.40s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.38s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.98s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 24.86s
+ 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   (63s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 12.88s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 14.52s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 20.54s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 13.16s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (22s)
ok ./internal/headless TestMixedVersions 20.11s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.77s
+ 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 34.08, cpu waiting 21.94%, memory waiting 0.00%, io waiting 0.64%
--- 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.281s 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.12s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 166ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 81ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 2ms amadan.net/oficina/equipo/internal/runner/provider/gotoolchain
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow test 5.05s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.69s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 290ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 170ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 80ms amadan.net/oficina/equipo/internal/runner/provider/codex TestDirectJournalAdapterBarrier
CGO_ENABLED=0 EQUIPO_REQUIRE_USER_SESSION=1 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment

receipt: test step 3.168s 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.834s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 300ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 170ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceExitStatus
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryMalformedRecord
machine: 32 CPUs, load 8.52, cpu waiting 4.76%, memory waiting 0.00%, io waiting 1.54%
--- 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 26.8%, load 15.80
shard 25: make runner-dead-references lanes-check build vet fmt-check budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2581 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.602s
machine: 32 CPUs, load 28.77, cpu waiting 19.76%, memory waiting 0.00%, io waiting 0.90%
--- 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 26.8%, load 15.80
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 22.39, cpu waiting 12.53%, memory waiting 0.00%, io waiting 1.10%
--- 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 26.8%, load 15.80
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.88, cpu waiting 16.53%, memory waiting 0.00%, io waiting 0.99%
--- 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 26.8%, load 15.80
shard 28: make gitleaks
4:54PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
4:54PM INF 1114 commits scanned.
4:54PM INF scanned ~61530628 bytes (61.53 MB) in 13.7s
4:54PM INF no leaks found
machine: 32 CPUs, load 28.77, cpu waiting 19.76%, memory waiting 0.00%, io waiting 0.90%
=== 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.102ms, worst 1.188ms, budget 150ms
perf: GET /api/runner/protocol: median 87µs, worst 113µs, budget 150ms
perf: GET /api/v1/account-setups/{id}: median 614µs, worst 690µs, budget 150ms
perf: GET /api/v1/accounts: median 424µs, worst 446µs, budget 150ms
perf: GET /api/v1/auth/devices: median 491µs, worst 516µs, budget 150ms
perf: GET /api/v1/budgets: median 712µs, worst 1.925ms, budget 150ms
perf: GET /api/v1/capabilities: median 249µs, worst 290µs, budget 150ms
perf: GET /api/v1/cards/{id}: median 1.291ms, worst 1.371ms, budget 150ms
perf: GET /api/v1/connections: median 588µs, worst 613µs, budget 150ms
perf: GET /api/v1/connections/{id}: median 565µs, worst 599µs, budget 150ms
perf: GET /api/v1/conversation: median 948µs, worst 1.019ms, budget 150ms
perf: GET /api/v1/conversation/cards: median 1.497ms, worst 1.567ms, budget 150ms
perf: GET /api/v1/coordinator: median 1.977ms, worst 2.009ms, budget 150ms
perf: GET /api/v1/invites/{id}: median 450µs, worst 485µs, budget 150ms
perf: GET /api/v1/journey: median 7.629ms, worst 7.929ms, budget 150ms
perf: GET /api/v1/me: median 425µs, worst 452µs, budget 150ms
perf: GET /api/v1/me/settings: median 523µs, worst 556µs, budget 150ms
perf: GET /api/v1/needs-you: median 7.507ms, worst 7.764ms, budget 150ms
perf: GET /api/v1/notifications: median 1.746ms, worst 1.869ms, budget 150ms
perf: GET /api/v1/onboarding: median 398µs, worst 427µs, budget 150ms
perf: GET /api/v1/people: median 459µs, worst 481µs, budget 150ms
perf: GET /api/v1/playbooks: median 591µs, worst 642µs, budget 150ms
perf: GET /api/v1/playbooks/{id}: median 534µs, worst 583µs, budget 150ms
perf: GET /api/v1/playbooks/{id}/template-diff: median 847µs, worst 912µs, budget 150ms
perf: GET /api/v1/preferences: median 773µs, worst 861µs, budget 150ms
perf: GET /api/v1/projects/{id}: median 459µs, worst 477µs, budget 150ms
perf: GET /api/v1/projects/{id}/settings: median 610µs, worst 655µs, budget 150ms
perf: GET /api/v1/roster: median 490µs, worst 512µs, budget 150ms
perf: GET /api/v1/runners/{id}: median 447µs, worst 480µs, budget 150ms
perf: GET /api/v1/specialists: median 8.358ms, worst 8.57ms, budget 150ms
perf: GET /api/v1/specialists/{id}: median 8.08ms, worst 8.184ms, budget 150ms
perf: GET /api/v1/specialists/{id}/template-diff: median 859µs, worst 899µs, budget 150ms
perf: GET /api/v1/tasks/{id}/plan: median 1.137ms, worst 1.202ms, budget 150ms
perf: GET /api/v1/tasks/{id}/thread: median 734µs, worst 768µs, budget 150ms
perf: GET /api/v1/teams: median 434µs, worst 463µs, budget 150ms
perf: GET /api/v1/templates: median 612µs, worst 686µs, budget 150ms
perf: GET /api/v1/templates/{id}: median 446µs, worst 460µs, budget 150ms
perf: GET /auth/callback: median 96µs, worst 111µs, budget 150ms
perf: GET /auth/devices/{id}: median 3.48ms, worst 3.596ms, budget 150ms
perf: GET /auth/verify: median 77µs, worst 111µs, budget 150ms
perf: GET /connections: median 3.873ms, worst 4.004ms, budget 150ms
perf: GET /conversation: median 7.895ms, worst 8.035ms, budget 150ms
perf: GET /conversation/connections: median 252µs, worst 276µs, budget 150ms
perf: GET /conversation/notebook: median 252µs, worst 290µs, budget 150ms
perf: GET /conversation/settings: median 3.892ms, worst 3.943ms, budget 150ms
perf: GET /conversation/settings/autonomy: median 3.475ms, worst 3.544ms, budget 150ms
perf: GET /conversation/settings/connections: median 6.213ms, worst 6.259ms, budget 150ms
perf: GET /conversation/settings/connections/add: median 6.463ms, worst 6.558ms, budget 150ms
perf: GET /conversation/settings/copy: median 3.639ms, worst 3.737ms, budget 150ms
perf: GET /conversation/settings/housekeeping: median 4.112ms, worst 4.377ms, budget 150ms
perf: GET /conversation/settings/machines: median 4.801ms, worst 7.272ms, budget 150ms
perf: GET /conversation/settings/machines/add: median 4.488ms, worst 4.685ms, budget 150ms
perf: GET /conversation/settings/notebook: median 3.333ms, worst 3.43ms, budget 150ms
perf: GET /conversation/settings/thinking: median 4.05ms, worst 4.114ms, budget 150ms
perf: GET /housekeeping: median 3.775ms, worst 3.813ms, budget 150ms
perf: GET /invites/new: median 572µs, worst 612µs, budget 150ms
perf: GET /invites/{id}: median 616µs, worst 653µs, budget 150ms
perf: GET /jobs: median 3.272ms, worst 3.436ms, budget 150ms
perf: GET /jobs/{id}: median 4.637ms, worst 4.817ms, budget 150ms
perf: GET /journey: median 12.344ms, worst 12.635ms, budget 150ms
perf: GET /nav/rail: median 3.323ms, worst 3.488ms, budget 150ms
perf: GET /needs-you: median 12.381ms, worst 13.122ms, budget 150ms
perf: GET /onboarding: median 4.482ms, worst 4.683ms, budget 150ms
perf: GET /people: median 3.77ms, worst 3.905ms, budget 150ms
perf: GET /playbook-suggestions/{suggestion}: median 5.085ms, worst 5.295ms, budget 150ms
perf: GET /playbooks: median 4.546ms, worst 4.694ms, budget 150ms
perf: GET /playbooks/new: median 4.888ms, worst 5.055ms, budget 150ms
perf: GET /playbooks/{id}: median 4.475ms, worst 4.679ms, budget 150ms
perf: GET /playbooks/{id}/edit: median 4.476ms, worst 4.577ms, budget 150ms
perf: GET /playbooks/{id}/template-diff: median 3.607ms, worst 3.725ms, budget 150ms
perf: GET /preferences: median 4.496ms, worst 7.04ms, budget 150ms
perf: GET /preferences/sources/{source}: median 4.294ms, worst 4.508ms, budget 150ms
perf: GET /projects: median 5.112ms, worst 5.318ms, budget 150ms
perf: GET /projects/accounts: median 3.542ms, worst 3.789ms, budget 150ms
perf: GET /projects/new: median 3.668ms, worst 3.837ms, budget 150ms
perf: GET /projects/{id}: median 10.662ms, worst 10.947ms, budget 150ms
perf: GET /projects/{id}/edit: median 3.636ms, worst 3.77ms, budget 150ms
perf: GET /runners/enrol: median 4.361ms, worst 4.541ms, budget 150ms
perf: GET /settings: median 3.417ms, worst 3.456ms, budget 150ms
perf: GET /settings/coordinator: median 5.45ms, worst 5.708ms, budget 150ms
perf: GET /settings/devices: median 3.421ms, worst 5.499ms, budget 150ms
perf: GET /settings/recovery: median 3.665ms, worst 3.928ms, budget 150ms
perf: GET /settings/recovery/release: median 3.515ms, worst 3.699ms, budget 150ms
perf: GET /settings/thinking: median 248µs, worst 271µs, budget 150ms
perf: GET /signin: median 321µs, worst 350µs, budget 150ms
perf: GET /specialists/new: median 3.353ms, worst 3.453ms, budget 150ms
perf: GET /specialists/{key}: median 10.995ms, worst 11.133ms, budget 150ms
perf: GET /specialists/{key}/edit: median 3.603ms, worst 3.668ms, budget 150ms
perf: GET /specialists/{key}/template-diff: median 3.727ms, worst 3.825ms, budget 150ms
perf: GET /tasks: median 5.265ms, worst 5.404ms, budget 150ms
perf: GET /tasks/new: median 3.309ms, worst 3.362ms, budget 150ms
perf: GET /tasks/{id}: median 5.537ms, worst 6.874ms, budget 150ms
perf: GET /tasks/{id}/merge: median 5.202ms, worst 5.357ms, budget 150ms
perf: GET /tasks/{id}/move: median 4.694ms, worst 4.811ms, budget 150ms
perf: GET /tasks/{id}/plan: median 5.738ms, worst 5.99ms, budget 150ms
perf: GET /tasks/{id}/preview: median 1.53ms, worst 1.621ms, budget 150ms
perf: GET /tasks/{id}/questions/{question}: median 5.29ms, worst 5.431ms, budget 150ms
perf: GET /tasks/{id}/rendered-change: median 4.83ms, worst 5.139ms, budget 150ms
perf: GET /tasks/{id}/rendered-change/{hash}.png: median 4.446ms, worst 4.602ms, budget 150ms
perf: GET /tasks/{id}/thread: median 7.927ms, worst 8.118ms, budget 150ms
perf: GET /team/{specialist}: median 4.43ms, worst 4.516ms, budget 150ms
perf: GET /teams: median 10.566ms, worst 12.337ms, budget 150ms
perf: GET /templates: median 3.433ms, worst 3.553ms, budget 150ms
perf: GET /usage: median 4.232ms, worst 4.304ms, budget 150ms
perf: GET /work: median 3.1ms, worst 3.222ms, budget 150ms
perf: cold boot: median 263ms of [262.612163ms 263.308916ms 265.512363ms], budget 500ms

receipt: test step 32.117s 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.998s 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 8.16s amadan.net/oficina/equipo/internal/equipotest TestPerfScreens
receipt: slow test 840ms amadan.net/oficina/equipo/internal/equipotest TestPerfBoot
=== cache ===
ci-box: build cache /home/ci/work/repos/oficina__equipo/cache/go-build: 3.47 GiB in 23911 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 bfc46eac..b221b6b3 100644
--- a/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md
+++ b/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md
@@ -235,3 +235,32 @@ Fix round 1 (review r1). `StopProof.ObservedAt` is controller time, a `time.Dura
| extra: rollback alert sent again by a second `New` (`s.delivered = 0` after delivery) | same | `clock_test.go:146: alerts delivered after Open and two News = [{Kind:clock_rollback ...} {Kind:clock_rollback ...}], want exactly [...]` | yes, passes |
| extra: no checkpoint in `Tx` commits | `go test ./internal/hostedctl -run 'TestRestartKeepsCommittedTime' -count=1` | `clock_test.go:98: Now after a restart = 0s, below the 7m0s a committed row already holds` | yes, passes |
| extra: Open keeps the old checkpoint (`ON CONFLICT (id) DO NOTHING`) | `go test ./internal/hostedctl -run 'TestRestartMarksElapsedUntrusted' -count=1` | `clock_test.go:72: Now after a second restart with the wall clock 20m back = 15m0s, want 35m` | yes, passes |
+
+Fix round 1 (review r1, rulings R10-R13). These are the changes:
+- Jobs rows are never deleted: a `jobs_never_deleted` trigger, with `recursive_triggers` on so the implicit delete of `INSERT OR REPLACE` fires it. `resume_ops` no longer cascades.
+- `Close` checkpoints. The `Tx` checkpoint is sampled after `fn`. The invariant is narrowed to T persisted or acted on (R10).
+- One owner per database: `Open` takes a non-blocking `flock` on `path.lock` and fails at once with `ErrStoreInUse`.
+- Startup alerts sit in a durable `alert_outbox`. Each detail starts with `alert <id>: `. `New` delivers each alert and marks it delivered, at least once.
+- `nonce_pruned` keeps the latest pruned expiry. `Remember` denies with `ErrNoncePruned` when `until <= mark + 2 MaxSkew`. The margin covers a replay up to 2 MaxSkew later than the original, which still passes the skew check.
+- Typed-nil Runner, Auditor, Alerter and Clock are refused, using reflect.
+
+RED came after adding only the new names (`closed`, `release`, `ErrStoreInUse` stub). Every new or extended test failed except `TestRestartKeepsCommittedTime`, which R2b turns red. Examples:
+- `store_test.go:260: replace on the attempt ID = <nil>, want "jobs are never deleted"`
+- `store_test.go:290: second Open while the first is open = nil error, want ErrStoreInUse`
+- `clock_test.go:207: New after a crash = <nil> with alerts [], want ...`
+- `store_test.go:319: replay of a pruned nonce after the wall clock went back = (true, <nil>), want (false, an error)`
+
+GREEN: `go test ./internal/hostedctl -count=1` ok, 0.8-1.2 s. Line numbers in the Task 9 rows above are as of `3e074674`. M7, M8 and M10 were re-run against this round's code and still fail (`clock_test.go:157`, `:109`, `:178`).
+
+| Mutation | Command | Observed failure | Restored |
+| --- | --- | --- | --- |
+| R1 `recursive_triggers(0)` | `go test ./internal/hostedctl -run '^TestJobsNeverReplaced$' -count=1` | `store_test.go:260: replace on the attempt ID = <nil>, want "jobs are never deleted"` and `store_test.go:274: after refused replaces: spec "{\"image\":\"b\"}" "bbbb", ...; want the original spec and its one done row` | yes, passes |
+| R2a `Close` without a checkpoint | `go test ./internal/hostedctl -run '^TestRestartAfterClose$' -count=1` | `clock_test.go:130: Now after Close and a wall clock 1h back = 0s, below the 10m0s seen before Close` | yes, passes |
+| R2b `Tx` checkpoint sampled before `fn` | `go test ./internal/hostedctl -run '^TestRestartKeepsCommittedTime$' -count=1` | `clock_test.go:109: Now after a crash and a wall clock 1h back = 0s, below the 7m0s a committed row already holds` | yes, passes |
+| R3 no `flock` (`if err := error(nil); err != nil {`) | `go test ./internal/hostedctl -run '^TestStoreOneOwner$' -count=1` | `store_test.go:290: second Open while the first is open = nil error, want ErrStoreInUse` | yes, passes |
+| R4a outbox reloaded only for this Open's rollback (`if rollback == 0 { pending = nil }`) | `go test ./internal/hostedctl -run '^TestRestartWithRollback$' -count=1` | `clock_test.go:207: New after a crash = <nil> with alerts [], want nil and exactly [{Kind:clock_rollback Detail:alert 2: ...}]` | yes, passes |
+| R4b delivery not marked (`SET delivered = 0`) | same | `clock_test.go:186: StartupAlerts on the next restart = [{Kind:clock_rollback Detail:alert 1: ...}], want none` | yes, passes |
+| R5a no pruned-through check (`if false && (...)`) | `go test ./internal/hostedctl -run '^TestStoreDeniesNonceAfterPruneAndRollback$' -count=1` | `store_test.go:319: replay of a pruned nonce after the wall clock went back = (true, <nil>), want (false, an error)` | yes, passes |
+| R5b no skew margin (`untilNs <= through`) | same | `store_test.go:325: replay 90s after the original = (true, <nil>), want (false, ErrNoncePruned)` | yes, passes |
+| R6 plain `== nil` for Runner, Auditor, Alerter | `go test ./internal/hostedctl -run '^TestNewRefusesNilDependency$' -count=1` | `store_test.go:438: New with typed nil runner = (&{...}, <nil>), want (nil, an error)` (and auditor, alerter) | yes, passes |
+| R6b plain `c == nil` in `Open` | `go test ./internal/hostedctl -run '^TestStoreRefusesNilClock$' -count=1` | `store_test.go:457: Open with a typed nil clock panicked (runtime error: invalid memory address or nil pointer dereference), want an error` | yes, passes |
diff --git a/internal/hostedctl/clock_test.go b/internal/hostedctl/clock_test.go
index f8f7724a..beedcfbd 100644
--- a/internal/hostedctl/clock_test.go
+++ b/internal/hostedctl/clock_test.go
@@ -76,6 +76,15 @@ func TestRestartMarksElapsedUntrusted(t *testing.T) {
}
}
+// crash stops s the way a killed process would: no checkpoint, no cleanup
+// beyond what the operating system does.
+func crash(s *Store) {
+ s.mu.Lock()
+ s.closed = true
+ s.mu.Unlock()
+ _ = s.release()
+}
+
func TestRestartKeepsCommittedTime(t *testing.T) {
ctx := context.Background()
path := filepath.Join(t.TempDir(), "hosted.db")
@@ -84,18 +93,41 @@ func TestRestartKeepsCommittedTime(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- clk.AdvanceMono(7 * time.Minute)
- stored := s.Clock().Now()
+ var stored T
if err := s.Tx(ctx, func(tx *sql.Tx) error {
+ clk.AdvanceMono(7 * time.Minute) // time passes inside the transaction
+ stored = s.Clock().Now()
return appendAudit(tx, Audit{Action: "launch", At: stored})
}); err != nil {
t.Fatal(err)
}
- _ = s.Close() // no reaper checkpoint since the write
+ clk.SetWall(testWall.Add(-time.Hour))
+ crash(s) // no reaper checkpoint and no Close since the write
- s = openStore(t, path, isolatedjobtest.NewFakeClock(testWall))
+ s = openStore(t, path, isolatedjobtest.NewFakeClock(testWall.Add(-time.Hour)))
if got := s.Clock().Now(); got < stored {
- t.Fatalf("Now after a restart = %v, below the %v a committed row already holds", time.Duration(got), time.Duration(stored))
+ t.Fatalf("Now after a crash and a wall clock 1h back = %v, below the %v a committed row already holds", time.Duration(got), time.Duration(stored))
+ }
+}
+
+func TestRestartAfterClose(t *testing.T) {
+ ctx := context.Background()
+ path := filepath.Join(t.TempDir(), "hosted.db")
+ clk := isolatedjobtest.NewFakeClock(testWall)
+ s, err := Open(ctx, path, clk)
+ if err != nil {
+ t.Fatal(err)
+ }
+ clk.AdvanceMono(10 * time.Minute)
+ seen := s.Clock().Now() // read, never written by a transaction
+ clk.SetWall(testWall.Add(-time.Hour))
+ if err := s.Close(); err != nil {
+ t.Fatal(err)
+ }
+
+ s = openStore(t, path, isolatedjobtest.NewFakeClock(testWall.Add(-time.Hour)))
+ if got := s.Clock().Now(); got < seen {
+ t.Fatalf("Now after Close and a wall clock 1h back = %v, below the %v seen before Close", time.Duration(got), time.Duration(seen))
}
}
@@ -155,15 +187,33 @@ func TestRestartWithRollback(t *testing.T) {
}
_ = s.Close()
- // An alert that cannot be delivered stops the controller starting.
+ // An alert that cannot be delivered stops the controller starting, and
+ // survives a crash until it is delivered.
s = openStore(t, path, isolatedjobtest.NewFakeClock(testWall.Add(-2*time.Hour)))
+ pending := s.StartupAlerts()
+ if len(pending) != 1 {
+ t.Fatalf("StartupAlerts after a second rollback = %+v, want one", pending)
+ }
down := errors.New("alert channel down")
c, err := New(Config{}, Deps{Store: s, Runner: nopRunner{}, Auditor: nopAuditor{}, Alerter: &recordingAlerter{fail: down}})
if c != nil || !errors.Is(err, down) {
t.Fatalf("New with an undeliverable rollback alert = (%v, %v), want (nil, the alert error)", c, err)
}
+ crash(s)
+
+ s = openStore(t, path, isolatedjobtest.NewFakeClock(testWall.Add(-2*time.Hour)))
+ rec = &recordingAlerter{}
+ if _, err := New(Config{}, Deps{Store: s, Runner: nopRunner{}, Auditor: nopAuditor{}, Alerter: rec}); err != nil || len(rec.got) != 1 || rec.got[0] != pending[0] {
+ t.Fatalf("New after a crash = %v with alerts %+v, want nil and exactly [%+v]", err, rec.got, pending[0])
+ }
+ if !strings.HasPrefix(pending[0].Detail, "alert ") || pending[0].Detail == alerts[0].Detail {
+ t.Fatalf("alert details %q and %q, want each to start with its own stable event ID", alerts[0].Detail, pending[0].Detail)
+ }
+ _ = s.Close()
+
+ s = openStore(t, path, isolatedjobtest.NewFakeClock(testWall.Add(-2*time.Hour)))
rec = &recordingAlerter{}
- if _, err := New(Config{}, Deps{Store: s, Runner: nopRunner{}, Auditor: nopAuditor{}, Alerter: rec}); err != nil || len(rec.got) != 1 {
- t.Fatalf("New after the channel recovers = %v with %d alerts, want nil and 1", err, len(rec.got))
+ if _, err := New(Config{}, Deps{Store: s, Runner: nopRunner{}, Auditor: nopAuditor{}, Alerter: rec}); err != nil || len(rec.got) != 0 {
+ t.Fatalf("New after the alert was delivered and the store reopened = %v with alerts %+v, want nil and none", err, rec.got)
}
}
diff --git a/internal/hostedctl/controller.go b/internal/hostedctl/controller.go
index 6920297d..a354d330 100644
--- a/internal/hostedctl/controller.go
+++ b/internal/hostedctl/controller.go
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"maps"
+ "reflect"
"amadan.net/oficina/equipo/internal/isolatedjob"
)
@@ -42,7 +43,8 @@ type Controller struct {
alerter Alerter
}
-// New builds a controller. It refuses a nil dependency. It then delivers the
+// New builds a controller. It refuses a nil dependency, including a nil
+// pointer inside a non-nil interface. It then delivers the
// store's startup alerts (a clock rollback found by Open) through
// d.Alerter, once each; if one cannot be delivered New returns that error
// and no controller, so a controller never runs with an undelivered rollback
@@ -51,11 +53,11 @@ func New(cfg Config, d Deps) (*Controller, error) {
switch {
case d.Store == nil:
return nil, errors.New("hostedctl: controller needs a store")
- case d.Runner == nil:
+ case isNil(d.Runner):
return nil, errors.New("hostedctl: controller needs a runner")
- case d.Auditor == nil:
+ case isNil(d.Auditor):
return nil, errors.New("hostedctl: controller needs a network auditor")
- case d.Alerter == nil:
+ case isNil(d.Alerter):
return nil, errors.New("hostedctl: controller needs an alerter")
}
if err := d.Store.deliverStartupAlerts(context.Background(), d.Alerter); err != nil {
@@ -64,3 +66,16 @@ func New(cfg Config, d Deps) (*Controller, error) {
cfg.Images = maps.Clone(cfg.Images)
return &Controller{cfg: cfg, store: d.Store, runner: d.Runner, auditor: d.Auditor, alerter: d.Alerter}, nil
}
+
+// isNil reports whether v is nil or an interface holding a nil pointer, map,
+// slice, function or channel, which would panic on first use.
+func isNil(v any) bool {
+ if v == nil {
+ return true
+ }
+ switch rv := reflect.ValueOf(v); rv.Kind() {
+ case reflect.Pointer, reflect.Map, reflect.Slice, reflect.Func, reflect.Chan, reflect.Interface:
+ return rv.IsNil()
+ }
+ return false
+}
diff --git a/internal/hostedctl/schema/0001_jobs.sql b/internal/hostedctl/schema/0001_jobs.sql
index 35326f45..09aaafbc 100644
--- a/internal/hostedctl/schema/0001_jobs.sql
+++ b/internal/hostedctl/schema/0001_jobs.sql
@@ -41,10 +41,19 @@ BEGIN
SELECT RAISE(ABORT, 'spec is immutable');
END;
+-- Jobs rows are never deleted: a deleted row would lose its spec and its
+-- resume history. The store turns on recursive_triggers, so the implicit
+-- delete of INSERT OR REPLACE fires this trigger too.
+CREATE TRIGGER jobs_never_deleted
+BEFORE DELETE ON jobs
+BEGIN
+ SELECT RAISE(ABORT, 'jobs are never deleted');
+END;
+
-- Resume operations, kept for the attempt's lifetime so a retried operation
-- ID returns its original epoch.
CREATE TABLE resume_ops (
- attempt_id TEXT NOT NULL REFERENCES jobs(attempt_id) ON DELETE CASCADE,
+ attempt_id TEXT NOT NULL REFERENCES jobs(attempt_id),
operation_id TEXT NOT NULL,
status TEXT NOT NULL CHECK (status IN ('pending', 'done', 'failed')),
prepared_epoch INTEGER NOT NULL,
@@ -74,6 +83,13 @@ CREATE TABLE nonces (
CREATE INDEX nonces_until ON nonces(until_unix_ns);
+-- The latest expiry among pruned nonces: one row. A nonce valid only up to
+-- this time may already have been forgotten, so Remember denies it.
+CREATE TABLE nonce_pruned (
+ id INTEGER PRIMARY KEY CHECK (id = 1),
+ through_unix_ns INTEGER NOT NULL
+);
+
-- Every decision the controller takes. Never holds credentials.
CREATE TABLE audit (
id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -92,3 +108,13 @@ CREATE TABLE clock (
t_ns INTEGER NOT NULL CHECK (t_ns >= 0),
wall_unix_ns INTEGER NOT NULL
);
+
+-- Alerts raised where no Alerter exists yet (Open), kept until delivered.
+-- Delivery is at least once; the id is the alert's stable event ID.
+CREATE TABLE alert_outbox (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ kind TEXT NOT NULL,
+ detail TEXT NOT NULL,
+ at_t INTEGER NOT NULL,
+ delivered INTEGER NOT NULL DEFAULT 0 CHECK (delivered IN (0, 1))
+);
diff --git a/internal/hostedctl/store.go b/internal/hostedctl/store.go
index bae61f9a..6deacb74 100644
--- a/internal/hostedctl/store.go
+++ b/internal/hostedctl/store.go
@@ -9,12 +9,15 @@ import (
"embed"
"errors"
"fmt"
+ "math"
"net/url"
+ "os"
"sync"
"time"
"amadan.net/oficina/equipo/internal/hostedwire"
"amadan.net/oficina/equipo/internal/isolatedjob"
+ "golang.org/x/sys/unix"
_ "modernc.org/sqlite"
)
@@ -23,6 +26,16 @@ import (
// refuses it rather than guess what the newer columns mean.
var ErrSchemaNewer = errors.New("hostedctl: database schema is newer than this controller")
+// ErrStoreInUse: another Store, in this process or another, has the
+// database open. One controller owns a database at a time.
+var ErrStoreInUse = errors.New("hostedctl: database is open in another controller")
+
+// ErrNoncePruned: the nonce's validity window reaches back into a window
+// whose nonces were already pruned, which happens when the wall clock went
+// back. A replay there could not be told from a new request, so Remember
+// denies it.
+var ErrNoncePruned = errors.New("hostedctl: nonce window already pruned (wall clock went back)")
+
// AlertClockRollback is the alert kind, and the audit action, raised when
// Open finds the wall clock behind the last checkpoint.
const AlertClockRollback = "clock_rollback"
@@ -40,13 +53,20 @@ func schemaVersion() int { return len(migrations) }
// Store is the controller's SQLite database and its controller time.
type Store struct {
db *sql.DB
+ lock *os.File // holds the exclusive owner lock until release
host isolatedjob.Clock
clock *CtlClock
restarted bool
- mu sync.Mutex
- alerts []Alert // raised by Open, before any Alerter exists
- delivered int // how many of alerts have reached an Alerter
+ mu sync.Mutex
+ pending []outboxAlert // undelivered rows of alert_outbox, oldest first
+ closed bool
+}
+
+// outboxAlert is one undelivered alert_outbox row.
+type outboxAlert struct {
+ id int64
+ alert Alert
}
// Audit is one audit row. Actor is the verified key that asked, or empty for
@@ -60,44 +80,72 @@ type Audit struct {
// Open opens or creates the store at path, applies any missing schema
// migrations, and restores controller time from the last checkpoint.
//
+// Open takes an exclusive lock on path+".lock" first, so a second Open of the
+// same database fails at once with ErrStoreInUse until the first is closed.
+//
// On a fresh database controller time starts at 0 and Restarted is false.
// Otherwise T starts at the checkpoint's T plus the wall time since the
// checkpoint, or the checkpoint's T alone when the wall clock is behind it;
// Restarted is true; and a wall clock behind the checkpoint is audited and
-// kept as a clock_rollback startup alert for New to deliver. Either way Open
-// writes a fresh checkpoint, so the next restart does not count the same
-// wall time twice.
+// queued in alert_outbox, in the same transaction, for New to deliver.
+// Either way Open writes a fresh checkpoint, so T never falls below a T
+// already restored, and loads every undelivered alert.
func Open(ctx context.Context, path string, c isolatedjob.Clock) (*Store, error) {
if path == "" {
return nil, errors.New("hostedctl: store path is empty")
}
- if c == nil {
+ if isNil(c) {
return nil, errors.New("hostedctl: store needs a clock")
}
+ lock, err := lockOwner(path)
+ if err != nil {
+ return nil, err
+ }
// _txlock=immediate makes every transaction BEGIN IMMEDIATE: it takes the
// write lock up front, so a read-check-write sequence is never
- // interleaved with another writer.
+ // interleaved with another writer. recursive_triggers makes the implicit
+ // delete of INSERT OR REPLACE fire jobs_never_deleted.
dsn := (&url.URL{Scheme: "file", Path: path}).String() +
- "?_pragma=busy_timeout(5000)&_pragma=journal_mode(WAL)&_pragma=synchronous(FULL)&_pragma=foreign_keys(1)&_txlock=immediate"
+ "?_pragma=busy_timeout(5000)&_pragma=journal_mode(WAL)&_pragma=synchronous(FULL)" +
+ "&_pragma=foreign_keys(1)&_pragma=recursive_triggers(1)&_txlock=immediate"
db, err := sql.Open("sqlite", dsn)
if err != nil {
+ _ = lock.Close()
return nil, fmt.Errorf("hostedctl: open store: %w", err)
}
// One connection: transactions in this process queue for it instead of
// meeting SQLITE_BUSY.
db.SetMaxOpenConns(1)
- s := &Store{db: db, host: c}
+ s := &Store{db: db, lock: lock, host: c}
if err := s.migrate(ctx); err != nil {
- _ = db.Close()
+ _ = s.release()
return nil, err
}
if err := s.restoreClock(ctx); err != nil {
- _ = db.Close()
+ _ = s.release()
return nil, err
}
return s, nil
}
+// lockOwner takes a non-blocking exclusive flock on path+".lock". The lock
+// belongs to the open file, so it ends when the file is closed or the
+// process dies. The lock file itself is left in place.
+func lockOwner(path string) (*os.File, error) {
+ f, err := os.OpenFile(path+".lock", os.O_RDWR|os.O_CREATE, 0o600)
+ if err != nil {
+ return nil, fmt.Errorf("hostedctl: open store lock: %w", err)
+ }
+ if err := unix.Flock(int(f.Fd()), unix.LOCK_EX|unix.LOCK_NB); err != nil {
+ _ = f.Close()
+ if errors.Is(err, unix.EWOULDBLOCK) {
+ return nil, fmt.Errorf("%w: %s", ErrStoreInUse, path)
+ }
+ return nil, fmt.Errorf("hostedctl: lock store: %w", err)
+ }
+ return f, nil
+}
+
// migrate applies the missing migrations in one transaction. The version is
// read inside the transaction, so two Opens racing apply each one once.
func (s *Store) migrate(ctx context.Context) error {
@@ -161,62 +209,120 @@ func (s *Store) restoreClock(ctx context.Context) error {
}
}
- var alert *Alert
if rollback > 0 {
- alert = &Alert{
- Kind: AlertClockRollback,
- Detail: fmt.Sprintf("wall clock %v behind the last checkpoint at start; controller time kept at %v", rollback, time.Duration(base)),
- At: base,
- }
- if err := appendAudit(tx, Audit{Action: AlertClockRollback, Reason: alert.Detail, At: base}); err != nil {
+ detail := fmt.Sprintf("wall clock %v behind the last checkpoint at start; controller time kept at %v", rollback, time.Duration(base))
+ if err := appendAudit(tx, Audit{Action: AlertClockRollback, Reason: detail, At: base}); err != nil {
return err
}
+ if _, err := tx.ExecContext(ctx, `INSERT INTO alert_outbox (kind, detail, at_t) VALUES (?, ?, ?)`,
+ AlertClockRollback, detail, int64(base)); err != nil {
+ return fmt.Errorf("hostedctl: queue %s alert: %w", AlertClockRollback, err)
+ }
}
if _, err := tx.ExecContext(ctx, `INSERT INTO clock (id, t_ns, wall_unix_ns) VALUES (1, ?, ?)
ON CONFLICT (id) DO UPDATE SET t_ns = excluded.t_ns, wall_unix_ns = excluded.wall_unix_ns`,
int64(base), wallNow); err != nil {
return fmt.Errorf("hostedctl: write clock checkpoint: %w", err)
}
+ pending, err := undeliveredAlerts(ctx, tx)
+ if err != nil {
+ return err
+ }
if err := tx.Commit(); err != nil {
return fmt.Errorf("hostedctl: restore clock: %w", err)
}
s.clock = &CtlClock{base: base, monoAtOpen: monoNow, c: s.host}
s.restarted = restarted
- if alert != nil {
- s.alerts = append(s.alerts, *alert)
- }
+ s.pending = pending
return nil
}
-// Close closes the database.
-func (s *Store) Close() error { return s.db.Close() }
+// undeliveredAlerts reads alert_outbox rows not yet delivered, oldest first.
+// Each alert's detail starts with its stable event ID, "alert <id>: ".
+func undeliveredAlerts(ctx context.Context, tx *sql.Tx) ([]outboxAlert, error) {
+ rows, err := tx.QueryContext(ctx, `SELECT id, kind, detail, at_t FROM alert_outbox WHERE delivered = 0 ORDER BY id`)
+ if err != nil {
+ return nil, fmt.Errorf("hostedctl: read alert outbox: %w", err)
+ }
+ defer rows.Close()
+ var out []outboxAlert
+ for rows.Next() {
+ var o outboxAlert
+ var detail string
+ var at int64
+ if err := rows.Scan(&o.id, &o.alert.Kind, &detail, &at); err != nil {
+ return nil, fmt.Errorf("hostedctl: read alert outbox: %w", err)
+ }
+ o.alert.Detail = fmt.Sprintf("alert %d: %s", o.id, detail)
+ o.alert.At = T(at)
+ out = append(out, o)
+ }
+ if err := rows.Err(); err != nil {
+ return nil, fmt.Errorf("hostedctl: read alert outbox: %w", err)
+ }
+ return out, nil
+}
+
+// Close checkpoints controller time, closes the database and releases the
+// owner lock. A second Close does nothing.
+func (s *Store) Close() error {
+ s.mu.Lock()
+ if s.closed {
+ s.mu.Unlock()
+ return nil
+ }
+ s.closed = true
+ s.mu.Unlock()
+ return errors.Join(s.Checkpoint(context.Background()), s.release())
+}
+
+// release closes the database and then the lock file, which drops the lock.
+func (s *Store) release() error {
+ return errors.Join(s.db.Close(), s.lock.Close())
+}
// Clock returns the store's controller clock.
func (s *Store) Clock() *CtlClock { return s.clock }
// Restarted reports whether Open found state from an earlier run. When it
-// is true, the time that passed while the controller was down is unknown:
-// the wall delta Open added to T is a lower bound at best, never proof of
-// how long a job has lived.
+// is true, the time that passed while the controller was down is unknown.
+// The wall delta Open added to T is untrusted in either direction: the
+// downtime may be longer or shorter, so it is never proof of how long a job
+// has lived.
func (s *Store) Restarted() bool { return s.restarted }
-// StartupAlerts returns the alerts Open raised, delivered or not.
+// StartupAlerts returns the undelivered alerts from alert_outbox, as loaded
+// by Open and not yet delivered by New, oldest first.
func (s *Store) StartupAlerts() []Alert {
s.mu.Lock()
defer s.mu.Unlock()
- return append([]Alert(nil), s.alerts...)
+ out := make([]Alert, 0, len(s.pending))
+ for _, p := range s.pending {
+ out = append(out, p.alert)
+ }
+ return out
}
-// deliverStartupAlerts sends each startup alert not yet delivered, in order,
-// and stops at the first that fails; that one is tried again next time.
+// deliverStartupAlerts sends each undelivered alert, in order, and marks its
+// outbox row delivered. It stops at the first failure; that alert stays
+// queued, in memory and in the database, and is tried again by the next New
+// or after a restart. Delivery is at least once: a crash, or a failed mark,
+// after the Alerter accepted an alert sends it again with the same ID.
func (s *Store) deliverStartupAlerts(ctx context.Context, a Alerter) error {
s.mu.Lock()
defer s.mu.Unlock()
- for s.delivered < len(s.alerts) {
- if err := a.Alert(ctx, s.alerts[s.delivered]); err != nil {
- return fmt.Errorf("hostedctl: deliver %s alert: %w", s.alerts[s.delivered].Kind, err)
+ for len(s.pending) > 0 {
+ p := s.pending[0]
+ if err := a.Alert(ctx, p.alert); err != nil {
+ return fmt.Errorf("hostedctl: deliver %s alert %d: %w", p.alert.Kind, p.id, err)
}
- s.delivered++
+ if err := s.Tx(ctx, func(tx *sql.Tx) error {
+ _, err := tx.ExecContext(ctx, `UPDATE alert_outbox SET delivered = 1 WHERE id = ?`, p.id)
+ return err
+ }); err != nil {
+ return fmt.Errorf("hostedctl: mark alert %d delivered: %w", p.id, err)
+ }
+ s.pending = s.pending[1:]
}
return nil
}
@@ -228,9 +334,11 @@ func (s *Store) deliverStartupAlerts(ctx context.Context, a Alerter) error {
// Checkpoint or Remember from inside fn: the store has one connection, so
// the inner call would wait for it forever. Do provider calls outside fn.
//
-// The checkpoint in every commit means no committed row holds a T later than
-// the checkpoint, so T after a restart is at least every stored T even when
-// the wall clock went back.
+// The checkpoint is sampled after fn returns, so it is at least every T fn
+// read or wrote, and it commits with fn's writes: no committed row holds a T
+// later than the checkpoint, so T after any restart is at least every
+// stored T even when the wall clock went back. A T only read and never
+// stored may appear to step back after a crash (ruling R10).
func (s *Store) Tx(ctx context.Context, fn func(*sql.Tx) error) error {
tx, err := s.db.BeginTx(ctx, nil)
if err != nil {
@@ -276,19 +384,46 @@ func (s *Store) checkpoint(ctx context.Context, tx *sql.Tx) error {
// Remember implements hostedwire.NonceStore. It records (id, nonce) until the
// given wall time and reports false when the pair is already held and has not
// expired. Expired nonces, by this host's wall clock, are pruned in the same
-// transaction. Any database error returns false with the error, so the
-// request is denied.
+// transaction, and the latest expiry pruned is kept as a durable mark. A
+// nonce whose window reaches back into the pruned span (until <= mark plus
+// twice hostedwire.MaxSkew) is denied with ErrNoncePruned: the wall clock went
+// back, and a replay of a forgotten nonce could pass the skew check there.
+// The margin covers a replay sent up to 2 MaxSkew later than the original.
+// Any database error returns false with the error, so the request is denied.
func (s *Store) Remember(ctx context.Context, id hostedwire.KeyID, nonce string, until time.Time) (bool, error) {
if id == "" || nonce == "" {
return false, errors.New("hostedctl: nonce needs a key ID and a value")
}
+ untilNs := until.UnixNano()
fresh := false
err := s.Tx(ctx, func(tx *sql.Tx) error {
- if _, err := tx.ExecContext(ctx, `DELETE FROM nonces WHERE until_unix_ns < ?`, s.host.Wall().UnixNano()); err != nil {
- return fmt.Errorf("hostedctl: prune nonces: %w", err)
+ var through int64
+ err := tx.QueryRowContext(ctx, `SELECT through_unix_ns FROM nonce_pruned WHERE id = 1`).Scan(&through)
+ switch {
+ case errors.Is(err, sql.ErrNoRows): // nothing pruned yet
+ case err != nil:
+ return fmt.Errorf("hostedctl: read nonce prune mark: %w", err)
+ default:
+ if through > math.MaxInt64-int64(2*hostedwire.MaxSkew) || untilNs <= through+int64(2*hostedwire.MaxSkew) {
+ return fmt.Errorf("%w: until %d, pruned through %d", ErrNoncePruned, untilNs, through)
+ }
+ }
+ wallNow := s.host.Wall().UnixNano()
+ var pruned sql.NullInt64
+ if err := tx.QueryRowContext(ctx, `SELECT max(until_unix_ns) FROM nonces WHERE until_unix_ns < ?`, wallNow).Scan(&pruned); err != nil {
+ return fmt.Errorf("hostedctl: find expired nonces: %w", err)
+ }
+ if pruned.Valid {
+ if _, err := tx.ExecContext(ctx, `DELETE FROM nonces WHERE until_unix_ns < ?`, wallNow); err != nil {
+ return fmt.Errorf("hostedctl: prune nonces: %w", err)
+ }
+ if _, err := tx.ExecContext(ctx, `INSERT INTO nonce_pruned (id, through_unix_ns) VALUES (1, ?)
+ ON CONFLICT (id) DO UPDATE SET through_unix_ns = max(through_unix_ns, excluded.through_unix_ns)`, pruned.Int64); err != nil {
+ return fmt.Errorf("hostedctl: record nonce prune mark: %w", err)
+ }
}
res, err := tx.ExecContext(ctx, `INSERT INTO nonces (key_id, nonce, until_unix_ns) VALUES (?, ?, ?)
- ON CONFLICT (key_id, nonce) DO NOTHING`, string(id), nonce, until.UnixNano())
+ ON CONFLICT (key_id, nonce) DO NOTHING`, string(id), nonce, untilNs)
if err != nil {
return fmt.Errorf("hostedctl: remember nonce: %w", err)
}
diff --git a/internal/hostedctl/store_test.go b/internal/hostedctl/store_test.go
index b4bd875e..27a88916 100644
--- a/internal/hostedctl/store_test.go
+++ b/internal/hostedctl/store_test.go
@@ -229,6 +229,112 @@ func TestSpecImmutable(t *testing.T) {
}
}
+// TestJobsNeverReplaced: no statement removes a jobs row, so neither its spec
+// nor its resume history can be swapped out by a replace.
+func TestJobsNeverReplaced(t *testing.T) {
+ ctx := context.Background()
+ s := openStore(t, filepath.Join(t.TempDir(), "hosted.db"), isolatedjobtest.NewFakeClock(testWall))
+ if err := s.Tx(ctx, func(tx *sql.Tx) error {
+ if err := insertJob(ctx, tx, "att-1"); err != nil {
+ return err
+ }
+ _, err := tx.ExecContext(ctx, `INSERT INTO resume_ops (attempt_id, operation_id, status, prepared_epoch, result_epoch, prepared_t, completed_t)
+ VALUES ('att-1', 'op-1', 'done', 1, 1, 10, 20)`)
+ return err
+ }); err != nil {
+ t.Fatal(err)
+ }
+ cols := `(attempt_id, launch_id, task_id, account_id, actor_key, purpose, spec_json, spec_sha256, state, launched_t, deadline_t, drain_t, stop_t)`
+ for _, change := range []struct{ name, sql, want string }{
+ {"replace on the attempt ID", `INSERT OR REPLACE INTO jobs ` + cols + ` VALUES ('att-1', 'launch-att-1', 't', 'a', 'k', 'task', '{"image":"b"}', 'bbbb', 'waiting', 0, 1, 1, 1)`, "jobs are never deleted"},
+ {"replace on the launch ID", `REPLACE INTO jobs ` + cols + ` VALUES ('att-2', 'launch-att-1', 't', 'a', 'k', 'task', '{"image":"b"}', 'bbbb', 'waiting', 0, 1, 1, 1)`, "jobs are never deleted"},
+ {"upsert of the spec", `INSERT INTO jobs ` + cols + ` VALUES ('att-1', 'launch-att-1', 't', 'a', 'k', 'task', '{"image":"b"}', 'bbbb', 'waiting', 0, 1, 1, 1)
+ ON CONFLICT (attempt_id) DO UPDATE SET spec_json = excluded.spec_json, spec_sha256 = excluded.spec_sha256`, "spec is immutable"},
+ {"delete", `DELETE FROM jobs WHERE attempt_id = 'att-1'`, "jobs are never deleted"},
+ } {
+ err := s.Tx(ctx, func(tx *sql.Tx) error {
+ _, err := tx.ExecContext(ctx, change.sql)
+ return err
+ })
+ if err == nil || !strings.Contains(err.Error(), change.want) {
+ t.Errorf("%s = %v, want %q", change.name, err, change.want)
+ }
+ }
+ var spec, sum, status string
+ var ops int
+ if err := s.Tx(ctx, func(tx *sql.Tx) error {
+ if err := tx.QueryRowContext(ctx, `SELECT spec_json, spec_sha256 FROM jobs WHERE attempt_id = 'att-1'`).Scan(&spec, &sum); err != nil {
+ return err
+ }
+ return tx.QueryRowContext(ctx, `SELECT count(*), max(status) FROM resume_ops WHERE attempt_id = 'att-1'`).Scan(&ops, &status)
+ }); err != nil {
+ t.Fatal(err)
+ }
+ if spec != `{"image":"a"}` || sum != "aaaa" || ops != 1 || status != "done" {
+ t.Fatalf("after refused replaces: spec %q %q, %d resume rows (%s); want the original spec and its one done row", spec, sum, ops, status)
+ }
+}
+
+func TestStoreOneOwner(t *testing.T) {
+ ctx := context.Background()
+ path := filepath.Join(t.TempDir(), "hosted.db")
+ first, err := Open(ctx, path, isolatedjobtest.NewFakeClock(testWall))
+ if err != nil {
+ t.Fatal(err)
+ }
+ start := time.Now()
+ second, err := Open(ctx, path, isolatedjobtest.NewFakeClock(testWall))
+ if err == nil {
+ _ = second.Close()
+ _ = first.Close()
+ t.Fatal("second Open while the first is open = nil error, want ErrStoreInUse")
+ }
+ if !errors.Is(err, ErrStoreInUse) {
+ t.Fatalf("second Open while the first is open = %v, want ErrStoreInUse", err)
+ }
+ if took := time.Since(start); took > time.Second {
+ t.Fatalf("second Open took %v to fail, want under 1s", took)
+ }
+ if err := first.Close(); err != nil {
+ t.Fatal(err)
+ }
+ openStore(t, path, isolatedjobtest.NewFakeClock(testWall))
+}
+
+func TestStoreDeniesNonceAfterPruneAndRollback(t *testing.T) {
+ ctx := context.Background()
+ clk := isolatedjobtest.NewFakeClock(testWall) // 12:00
+ path := filepath.Join(t.TempDir(), "hosted.db")
+ s := openStore(t, path, clk)
+ until := testWall.Add(hostedwire.NonceTTL) // 12:10
+ if ok, err := s.Remember(ctx, "inst-1", "orig", until); err != nil || !ok {
+ t.Fatalf("first Remember = (%v, %v), want (true, nil)", ok, err)
+ }
+ clk.SetWall(until.Add(time.Minute)) // 12:11: another request prunes "orig"
+ if ok, err := s.Remember(ctx, "inst-1", "other", until.Add(11*time.Minute)); err != nil || !ok {
+ t.Fatalf("Remember at 12:11 = (%v, %v), want (true, nil)", ok, err)
+ }
+ clk.SetWall(testWall) // back to 12:00: the replay would pass the skew check
+ if ok, err := s.Remember(ctx, "inst-1", "orig", until); err == nil || ok {
+ t.Fatalf("replay of a pruned nonce after the wall clock went back = (%v, %v), want (false, an error)", ok, err)
+ }
+ // A replay 90 s after the original still passes a 60 s skew check
+ // against its own timestamp, and its window ends 90 s later.
+ clk.SetWall(testWall.Add(90 * time.Second))
+ if ok, err := s.Remember(ctx, "inst-1", "orig", until.Add(90*time.Second)); !errors.Is(err, ErrNoncePruned) || ok {
+ t.Fatalf("replay 90s after the original = (%v, %v), want (false, ErrNoncePruned)", ok, err)
+ }
+ _ = s.Close()
+ s = openStore(t, path, clk)
+ if ok, err := s.Remember(ctx, "inst-1", "orig", until); err == nil || ok {
+ t.Fatalf("replay of a pruned nonce after a restart = (%v, %v), want (false, an error)", ok, err)
+ }
+ clk.SetWall(until.Add(time.Second)) // past the pruned window: new nonces are fine again
+ if ok, err := s.Remember(ctx, "inst-1", "fresh", until.Add(hostedwire.NonceTTL)); err != nil || !ok {
+ t.Fatalf("Remember once the wall clock is past the pruned window = (%v, %v), want (true, nil)", ok, err)
+ }
+}
+
func TestStoreRemembersNonces(t *testing.T) {
ctx := context.Background()
clk := isolatedjobtest.NewFakeClock(testWall)
@@ -315,17 +421,49 @@ func TestNewRefusesNilDependency(t *testing.T) {
if _, err := New(Config{}, full); err != nil {
t.Fatalf("New with every dependency = %v, want nil", err)
}
- for name, d := range map[string]Deps{
- "store": {Runner: full.Runner, Auditor: full.Auditor, Alerter: full.Alerter},
- "runner": {Store: s, Auditor: full.Auditor, Alerter: full.Alerter},
- "auditor": {Store: s, Runner: full.Runner, Alerter: full.Alerter},
- "alerter": {Store: s, Runner: full.Runner, Auditor: full.Auditor},
+ for _, c := range []struct {
+ name, want string
+ d Deps
+ }{
+ {"no store", "store", Deps{Runner: full.Runner, Auditor: full.Auditor, Alerter: full.Alerter}},
+ {"no runner", "runner", Deps{Store: s, Auditor: full.Auditor, Alerter: full.Alerter}},
+ {"no auditor", "auditor", Deps{Store: s, Runner: full.Runner, Alerter: full.Alerter}},
+ {"no alerter", "alerter", Deps{Store: s, Runner: full.Runner, Auditor: full.Auditor}},
+ {"typed nil runner", "runner", Deps{Store: s, Runner: (*nopRunner)(nil), Auditor: full.Auditor, Alerter: full.Alerter}},
+ {"typed nil auditor", "auditor", Deps{Store: s, Runner: full.Runner, Auditor: (*nopAuditor)(nil), Alerter: full.Alerter}},
+ {"typed nil alerter", "alerter", Deps{Store: s, Runner: full.Runner, Auditor: full.Auditor, Alerter: (*recordingAlerter)(nil)}},
} {
- c, err := New(Config{}, d)
- if err == nil || c != nil {
- t.Errorf("New without the %s = (%v, %v), want (nil, an error)", name, c, err)
- } else if !strings.Contains(err.Error(), name) {
- t.Errorf("New without the %s = %v, want the error to name it", name, err)
+ got, err := New(Config{}, c.d)
+ if err == nil || got != nil {
+ t.Errorf("New with %s = (%v, %v), want (nil, an error)", c.name, got, err)
+ } else if !strings.Contains(err.Error(), c.want) {
+ t.Errorf("New with %s = %v, want the error to name the %s", c.name, err, c.want)
+ }
+ }
+}
+
+func TestStoreRefusesNilClock(t *testing.T) {
+ ctx := context.Background()
+ for name, c := range map[string]isolatedjob.Clock{
+ "nil clock": nil,
+ "typed nil clock": (*isolatedjobtest.FakeClock)(nil),
+ } {
+ var s *Store
+ var err error
+ func() {
+ defer func() {
+ if r := recover(); r != nil {
+ err = nil
+ t.Errorf("Open with a %s panicked (%v), want an error", name, r)
+ }
+ }()
+ s, err = Open(ctx, filepath.Join(t.TempDir(), "hosted.db"), c)
+ }()
+ if err == nil || s != nil {
+ if s != nil {
+ _ = s.Close()
+ }
+ t.Errorf("Open with a %s = (%v, %v), want (nil, an error)", name, s, err)
}
}
}