oficina / equipo Public

hostedctl: lock the database file, check nonces before pruning

Review round 2. The owner lock was a flock on path.lock, so a symlink
or hard link to the database got a lock of its own. The Store now holds
SQLite's own exclusive lock on the file (locking_mode EXCLUSIVE,
busy_timeout 0), which follows the file under any name; a second Open
fails at once with ErrStoreInUse. A flock on the database file itself
would clash with SQLite's fcntl locks on BSD and NFS.

Remember now treats any held row for the pair as a replay before it
prunes, and denies a nonce whose window ends within 2 MaxSkew of the
larger of the pruned-through mark and what this call prunes, so a wall
jump between Verify and Remember cannot reaccept a pruned nonce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 94122cdca8e3fa7046aa3327479c6eea7e87fbb9 parent 60eeb37
3 files changed, +154 −52
  • docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md +19 −0
  • internal/hostedctl/store.go +58 −49
  • internal/hostedctl/store_test.go +77 −3

CI passed — run details

CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/hosted-runners-1a: Type  Size Avail | ext4   96G   85G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   85G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.5s
ci-box: codex: fetched and verified in 3.5s
ci-box: codex-code-mode-host: fetched and verified in 1.7s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.4s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.8s
ci-box: pi: installed and verified in 7.3s
ci-box: opencode: installed and verified in 2.0s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 9.3s
ci-box: clone deepened in 3.7s
ci-box: file times set from content: 2868 files, 192 directories
ci-box: ready in 17.0s
=== 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.247s
=== 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.846s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m20.148s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m20.15s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 36.73, cpu waiting 21.00%, memory waiting 0.00%, io waiting 0.53%
--- 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.091s 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.3s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m21.3s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 35.07, cpu waiting 21.00%, memory waiting 0.00%, io waiting 0.53%
--- 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.599s 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.374s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m11.83s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.81s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.74s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 35.07, cpu waiting 20.55%, memory waiting 0.00%, io waiting 0.52%
--- 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.538s 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.94s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.4s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 20.41s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.54s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.59s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 36.73, cpu waiting 21.38%, memory waiting 0.00%, io waiting 0.55%
--- 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.781s 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.031s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m0.13s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.16s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 10s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 8.88s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 5.86s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 29.45, cpu waiting 16.62%, memory waiting 0.00%, io waiting 0.41%
--- 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.035s 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 3m7.863s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m45.01s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 24.39s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 11.64s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 8.15s amadan.net/oficina/equipo/internal/headless TestHeadlessClaudeSignIn
receipt: slow test 7.36s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 8.37, cpu waiting 3.61%, memory waiting 0.00%, io waiting 0.10%
--- shard 6 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest

receipt: test step 1.134s 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 1.28, cpu waiting 0.00%, memory waiting 0.00%, io waiting 2.05%
--- 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.174s 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 1.28, cpu waiting 0.00%, memory waiting 0.00%, io waiting 2.05%
--- 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 4m29.819s, over the 45s its record on line 44 allows; reported only, timing fails on CI

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

receipt: test step 47.068s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 46.009s amadan.net/oficina/equipo/internal/runner
receipt: slow test 25.98s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 34.74, cpu waiting 20.34%, memory waiting 0.00%, io waiting 0.95%
--- 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.074s 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.063s amadan.net/oficina/equipo/internal/runner
receipt: slow test 35.1s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 31.43s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.38s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.57s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 34.74, cpu waiting 20.09%, memory waiting 0.00%, io waiting 0.98%
--- 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.162s 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.257s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.69s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.11s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.13s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 27.13, cpu waiting 13.86%, memory waiting 0.00%, io waiting 1.20%
--- shard 12 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-a started 30s late; cpu waiting 27.2%, load 18.61
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest
cache miss: amadan.net/oficina/equipo/internal/equipotest: its inputs changed

receipt: test step 1m3.958s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m2.239s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 26.28s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 26.22s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 24.24s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 21.77s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 21.76s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelDuplicates
machine: 32 CPUs, load 31.67, cpu waiting 17.73%, memory waiting 0.00%, io waiting 0.43%
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-e started 30s late; cpu waiting 27.2%, load 18.61
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.243s 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 18.61, cpu waiting 11.09%, memory waiting 0.00%, io waiting 1.28%
--- shard 14 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-r started 30s late; cpu waiting 27.2%, load 18.61
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.022s 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.335s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 14.28s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 12.81s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 9.75s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 9.74s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 6.69s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 27.41, cpu waiting 15.07%, memory waiting 0.00%, io waiting 0.37%
--- shard 15 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-rest started 30s late; cpu waiting 27.2%, load 18.61
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 457ms 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 18.61, cpu waiting 11.09%, memory waiting 0.00%, io waiting 1.28%
--- shard 16 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: plan3test started 30s late; cpu waiting 27.2%, load 18.61
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 571ms 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 18.61, cpu waiting 11.09%, memory waiting 0.00%, io waiting 1.28%
--- 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 27.2%, load 18.61
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/forge: 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/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/workspace: 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.643s, over the 15s its record on line 40 allows; reported only, timing fails on CI

receipt: test step 2m15.773s against a 60s target (the gate's other steps are not in this figure)
receipt: 13 packages ran, 52 cached, 20 without tests, 0 failed
receipt: slow package 52.754s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 51.917s 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.643s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 21.79s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeAcceptanceHostileRepository
receipt: slow test 15.42s 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.27s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringMissingModuleCache
machine: 32 CPUs, load 12.25, cpu waiting 5.39%, memory waiting 0.00%, io waiting 0.12%
--- 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.688s 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.091s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.46s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 15.08s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.41s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.77s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 5.94s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 35.07, cpu waiting 21.00%, memory waiting 0.00%, io waiting 0.53%
--- shard 19 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-work: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

receipt: test step 1m32.91s 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.181s amadan.net/oficina/equipo/internal/headless
receipt: slow test 26.22s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 22.75s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 14.23s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 10.2s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 7.92s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 31.67, cpu waiting 17.73%, memory waiting 0.00%, io waiting 0.43%
--- 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.398s 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.817s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.19s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.07s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 12.92s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 10.35s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.26s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 29.45, cpu waiting 16.07%, memory waiting 0.00%, io waiting 0.39%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN   TestBrowserCopyContinue
time=2026-11-22T17:02:50.523Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T17:02:50.523Z level=INFO msg="startup phase done" phase=state_lock took=179µs
time=2026-11-22T17:02:50.523Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T17:02:50.523Z level=INFO msg="startup phase done" phase=claim_roots took=129µs
time=2026-11-22T17:02:50.523Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T17:02:50.560Z level=INFO msg="startup phase done" phase=sweep took=36.203ms
time=2026-11-22T17:02:50.560Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T17:02:50.561Z level=INFO msg="startup phase done" phase=credentials took=259µs
time=2026-11-22T17:02:50.561Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T17:02:50.612Z level=INFO msg="startup phase done" phase=open_state took=51.027ms
time=2026-11-22T17:02:50.613Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T17:02:50.614Z level=INFO msg=connecting host=127.0.0.1:34271 protocol=28
time=2026-11-22T17:02:50.616Z level=INFO msg=connected host=127.0.0.1:34271 took=1.802ms
time=2026-11-22T17:02:50.617Z level=INFO msg="capabilities gathering"
time=2026-11-22T17:02:50.617Z level=INFO msg="capabilities gathered" took=811µs tags=linux,claude,go
time=2026-11-22T17:02:50.618Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T17:02:50.622Z 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.85s)

--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN   TestBrowserEmptyExplore
time=2026-11-22T17:03:21.430Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-22T17:03:21.430Z level=INFO msg="startup phase done" phase=state_lock took=80µs
time=2026-11-22T17:03:21.430Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-22T17:03:21.431Z level=INFO msg="startup phase done" phase=claim_roots took=87µs
time=2026-11-22T17:03:21.431Z level=INFO msg="startup phase" phase=sweep
time=2026-11-22T17:03:21.463Z level=INFO msg="startup phase done" phase=sweep took=32.633ms
time=2026-11-22T17:03:21.463Z level=INFO msg="startup phase" phase=credentials
time=2026-11-22T17:03:21.463Z level=INFO msg="startup phase done" phase=credentials took=103µs
time=2026-11-22T17:03:21.463Z level=INFO msg="startup phase" phase=open_state
time=2026-11-22T17:03:21.507Z level=INFO msg="startup phase done" phase=open_state took=43.933ms
time=2026-11-22T17:03:21.508Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-22T17:03:21.509Z level=INFO msg=connecting host=127.0.0.1:37071 protocol=28
time=2026-11-22T17:03:21.510Z level=INFO msg=connected host=127.0.0.1:37071 took=859µs
time=2026-11-22T17:03:21.510Z level=INFO msg="capabilities gathering"
time=2026-11-22T17:03:21.510Z level=INFO msg="capabilities gathered" took=449µs tags=linux,claude,go
time=2026-11-22T17:03:21.511Z level=INFO msg="hello sent" protocol=28
time=2026-11-22T17:03:21.516Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-22T17:03:22.547Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_receipts_test.go:169: waiting for [...document.querySelectorAll('[equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes("I'm your coordinator")): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserEmptyExplore (5.82s)

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


receipt: test step 1m28.699s 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.328s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.3s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.52s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.49s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 10.39s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 7.93s 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 94122cdca8e3fa7046aa3327479c6eea7e87fbb9 1.85s 33.38
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserEmptyExplore browser-headless-rest 94122cdca8e3fa7046aa3327479c6eea7e87fbb9 5.82s 33.38
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 29.45, cpu waiting 16.07%, memory waiting 0.00%, io waiting 0.39%
--- 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 996ms 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 835ms 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 222ms 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.133s 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 3.18, cpu waiting 1.62%, memory waiting 0.00%, io waiting 1.98%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless   (52s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 5.29s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.35s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.33s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.93s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 24.79s
+ 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.85s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 13.94s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 20.52s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 13.21s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (21s)
ok ./internal/headless TestMixedVersions 19.97s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (1s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.76s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (0s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 37.03, cpu waiting 21.83%, memory waiting 0.00%, io waiting 0.72%
--- 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.375s 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.182s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 172ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 75ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 2ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow test 5.13s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.67s 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/checks TestCheckSandboxToolchain
CGO_ENABLED=0 EQUIPO_REQUIRE_USER_SESSION=1 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment

receipt: test step 3.135s 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.82s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 270ms 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 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceExitStatus
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryMalformedRecord
machine: 32 CPUs, load 7.81, cpu waiting 4.66%, memory waiting 0.00%, io waiting 1.74%
--- shard 25 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: runner-dead-references started 30s late; cpu waiting 27.2%, load 18.61
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.539s
machine: 32 CPUs, load 34.74, cpu waiting 19.55%, memory waiting 0.00%, io waiting 1.01%
--- 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 27.2%, load 18.61
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 18.61, cpu waiting 12.47%, memory waiting 0.00%, io waiting 1.24%
--- shard 27 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: govulncheck started 30s late; cpu waiting 27.2%, load 18.61
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 27.13, cpu waiting 16.47%, memory waiting 0.00%, io waiting 1.12%
--- shard 28 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: gitleaks started 30s late; cpu waiting 27.2%, load 18.61
shard 28: make gitleaks
5:02PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
5:02PM INF 1115 commits scanned.
5:02PM INF scanned ~61539727 bytes (61.54 MB) in 12.9s
5:02PM INF no leaks found
machine: 32 CPUs, load 31.76, cpu waiting 18.79%, memory waiting 0.00%, io waiting 1.05%
=== 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.072ms, worst 1.126ms, budget 150ms
perf: GET /api/runner/protocol: median 77µs, worst 94µs, budget 150ms
perf: GET /api/v1/account-setups/{id}: median 598µs, worst 683µs, budget 150ms
perf: GET /api/v1/accounts: median 431µs, worst 472µs, budget 150ms
perf: GET /api/v1/auth/devices: median 448µs, worst 490µs, budget 150ms
perf: GET /api/v1/budgets: median 518µs, worst 535µs, budget 150ms
perf: GET /api/v1/capabilities: median 245µs, worst 260µs, budget 150ms
perf: GET /api/v1/cards/{id}: median 1.212ms, worst 1.337ms, budget 150ms
perf: GET /api/v1/connections: median 621µs, worst 674µs, budget 150ms
perf: GET /api/v1/connections/{id}: median 597µs, worst 613µs, budget 150ms
perf: GET /api/v1/conversation: median 939µs, worst 1.006ms, budget 150ms
perf: GET /api/v1/conversation/cards: median 1.554ms, worst 1.673ms, budget 150ms
perf: GET /api/v1/coordinator: median 1.897ms, worst 1.949ms, budget 150ms
perf: GET /api/v1/invites/{id}: median 446µs, worst 474µs, budget 150ms
perf: GET /api/v1/journey: median 7.557ms, worst 8.101ms, budget 150ms
perf: GET /api/v1/me: median 410µs, worst 457µs, budget 150ms
perf: GET /api/v1/me/settings: median 506µs, worst 527µs, budget 150ms
perf: GET /api/v1/needs-you: median 7.213ms, worst 7.313ms, budget 150ms
perf: GET /api/v1/notifications: median 1.688ms, worst 1.723ms, budget 150ms
perf: GET /api/v1/onboarding: median 399µs, worst 445µs, budget 150ms
perf: GET /api/v1/people: median 450µs, worst 473µs, budget 150ms
perf: GET /api/v1/playbooks: median 590µs, worst 627µs, budget 150ms
perf: GET /api/v1/playbooks/{id}: median 524µs, worst 551µs, budget 150ms
perf: GET /api/v1/playbooks/{id}/template-diff: median 870µs, worst 998µs, budget 150ms
perf: GET /api/v1/preferences: median 752µs, worst 820µs, budget 150ms
perf: GET /api/v1/projects/{id}: median 454µs, worst 534µs, budget 150ms
perf: GET /api/v1/projects/{id}/settings: median 582µs, worst 605µs, budget 150ms
perf: GET /api/v1/roster: median 468µs, worst 517µs, budget 150ms
perf: GET /api/v1/runners/{id}: median 432µs, worst 445µs, budget 150ms
perf: GET /api/v1/specialists: median 8.153ms, worst 8.285ms, budget 150ms
perf: GET /api/v1/specialists/{id}: median 7.92ms, worst 7.977ms, budget 150ms
perf: GET /api/v1/specialists/{id}/template-diff: median 855µs, worst 878µs, budget 150ms
perf: GET /api/v1/tasks/{id}/plan: median 1.099ms, worst 1.173ms, budget 150ms
perf: GET /api/v1/tasks/{id}/thread: median 728µs, worst 776µs, budget 150ms
perf: GET /api/v1/teams: median 413µs, worst 449µs, budget 150ms
perf: GET /api/v1/templates: median 586µs, worst 625µs, budget 150ms
perf: GET /api/v1/templates/{id}: median 447µs, worst 490µs, budget 150ms
perf: GET /auth/callback: median 83µs, worst 104µs, budget 150ms
perf: GET /auth/devices/{id}: median 3.413ms, worst 3.584ms, budget 150ms
perf: GET /auth/verify: median 87µs, worst 105µs, budget 150ms
perf: GET /connections: median 3.8ms, worst 5.752ms, budget 150ms
perf: GET /conversation: median 7.442ms, worst 8.151ms, budget 150ms
perf: GET /conversation/connections: median 232µs, worst 272µs, budget 150ms
perf: GET /conversation/notebook: median 250µs, worst 267µs, budget 150ms
perf: GET /conversation/settings: median 3.915ms, worst 4.015ms, budget 150ms
perf: GET /conversation/settings/autonomy: median 3.62ms, worst 3.81ms, budget 150ms
perf: GET /conversation/settings/connections: median 6.179ms, worst 6.458ms, budget 150ms
perf: GET /conversation/settings/connections/add: median 6.287ms, worst 6.622ms, budget 150ms
perf: GET /conversation/settings/copy: median 3.627ms, worst 3.747ms, budget 150ms
perf: GET /conversation/settings/housekeeping: median 4.294ms, worst 6.627ms, budget 150ms
perf: GET /conversation/settings/machines: median 4.556ms, worst 4.61ms, budget 150ms
perf: GET /conversation/settings/machines/add: median 4.425ms, worst 4.611ms, budget 150ms
perf: GET /conversation/settings/notebook: median 3.315ms, worst 3.435ms, budget 150ms
perf: GET /conversation/settings/thinking: median 3.875ms, worst 4.018ms, budget 150ms
perf: GET /housekeeping: median 3.74ms, worst 3.814ms, budget 150ms
perf: GET /invites/new: median 573µs, worst 623µs, budget 150ms
perf: GET /invites/{id}: median 615µs, worst 635µs, budget 150ms
perf: GET /jobs: median 3.227ms, worst 3.309ms, budget 150ms
perf: GET /jobs/{id}: median 4.318ms, worst 4.434ms, budget 150ms
perf: GET /journey: median 12.163ms, worst 12.659ms, budget 150ms
perf: GET /nav/rail: median 3.232ms, worst 5.585ms, budget 150ms
perf: GET /needs-you: median 12.321ms, worst 12.539ms, budget 150ms
perf: GET /onboarding: median 4.324ms, worst 4.346ms, budget 150ms
perf: GET /people: median 3.582ms, worst 3.751ms, budget 150ms
perf: GET /playbook-suggestions/{suggestion}: median 5.249ms, worst 5.444ms, budget 150ms
perf: GET /playbooks: median 4.726ms, worst 4.842ms, budget 150ms
perf: GET /playbooks/new: median 4.862ms, worst 5.05ms, budget 150ms
perf: GET /playbooks/{id}: median 4.508ms, worst 4.788ms, budget 150ms
perf: GET /playbooks/{id}/edit: median 4.515ms, worst 4.691ms, budget 150ms
perf: GET /playbooks/{id}/template-diff: median 3.826ms, worst 4.038ms, budget 150ms
perf: GET /preferences: median 4.291ms, worst 6.261ms, budget 150ms
perf: GET /preferences/sources/{source}: median 4.223ms, worst 4.254ms, budget 150ms
perf: GET /projects: median 5.195ms, worst 5.353ms, budget 150ms
perf: GET /projects/accounts: median 3.614ms, worst 3.668ms, budget 150ms
perf: GET /projects/new: median 3.548ms, worst 3.585ms, budget 150ms
perf: GET /projects/{id}: median 10.363ms, worst 10.578ms, budget 150ms
perf: GET /projects/{id}/edit: median 3.661ms, worst 3.792ms, budget 150ms
perf: GET /runners/enrol: median 4.528ms, worst 4.648ms, budget 150ms
perf: GET /settings: median 3.323ms, worst 3.426ms, budget 150ms
perf: GET /settings/coordinator: median 5.584ms, worst 5.894ms, budget 150ms
perf: GET /settings/devices: median 3.241ms, worst 3.428ms, budget 150ms
perf: GET /settings/recovery: median 3.475ms, worst 3.522ms, budget 150ms
perf: GET /settings/recovery/release: median 3.477ms, worst 3.615ms, budget 150ms
perf: GET /settings/thinking: median 235µs, worst 283µs, budget 150ms
perf: GET /signin: median 315µs, worst 386µs, budget 150ms
perf: GET /specialists/new: median 3.351ms, worst 3.409ms, budget 150ms
perf: GET /specialists/{key}: median 10.647ms, worst 10.923ms, budget 150ms
perf: GET /specialists/{key}/edit: median 3.606ms, worst 3.734ms, budget 150ms
perf: GET /specialists/{key}/template-diff: median 3.682ms, worst 3.719ms, budget 150ms
perf: GET /tasks: median 5.123ms, worst 5.175ms, budget 150ms
perf: GET /tasks/new: median 3.198ms, worst 3.228ms, budget 150ms
perf: GET /tasks/{id}: median 5.752ms, worst 8.084ms, budget 150ms
perf: GET /tasks/{id}/merge: median 4.995ms, worst 5.06ms, budget 150ms
perf: GET /tasks/{id}/move: median 4.644ms, worst 4.789ms, budget 150ms
perf: GET /tasks/{id}/plan: median 5.645ms, worst 5.899ms, budget 150ms
perf: GET /tasks/{id}/preview: median 1.53ms, worst 1.641ms, budget 150ms
perf: GET /tasks/{id}/questions/{question}: median 5.125ms, worst 5.246ms, budget 150ms
perf: GET /tasks/{id}/rendered-change: median 4.787ms, worst 4.962ms, budget 150ms
perf: GET /tasks/{id}/rendered-change/{hash}.png: median 4.35ms, worst 4.401ms, budget 150ms
perf: GET /tasks/{id}/thread: median 7.908ms, worst 8.038ms, budget 150ms
perf: GET /team/{specialist}: median 4.4ms, worst 4.475ms, budget 150ms
perf: GET /teams: median 10.54ms, worst 12.7ms, budget 150ms
perf: GET /templates: median 3.464ms, worst 3.512ms, budget 150ms
perf: GET /usage: median 4.28ms, worst 4.333ms, budget 150ms
perf: GET /work: median 2.995ms, worst 3.063ms, budget 150ms
perf: cold boot: median 265ms of [264.367375ms 265.384501ms 265.431631ms], budget 500ms

receipt: test step 31.831s 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.937s 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.09s amadan.net/oficina/equipo/internal/equipotest TestPerfScreens
receipt: slow test 850ms amadan.net/oficina/equipo/internal/equipotest TestPerfBoot
=== cache ===
ci-box: build cache /home/ci/work/repos/oficina__equipo/cache/go-build: 3.73 GiB in 24504 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 b221b6b3..74510006 100644
--- a/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md
+++ b/docs/superpowers/plans/HOSTED-SLICE1-PROGRESS.md
@@ -264,3 +264,22 @@ GREEN: `go test ./internal/hostedctl -count=1` ok, 0.8-1.2 s. Line numbers in th
| 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 |
+
+Fix round 2 (review r2, findings 3 and 5).
+
+- **One owner per database file.** The `flock` on `path.lock` locked a name, so a symlink got a second lock. It is replaced by SQLite's own lock on the file: `locking_mode(EXCLUSIVE)` with `busy_timeout(0)`. The connection keeps the lock from Open's first write until Close, for every name of the file, symlinks and hard links included. A second Open gets SQLITE_BUSY at once, which maps to `ErrStoreInUse`.
+ - This replaces option (a), a `flock` on the database file. On BSD/macOS, and on Linux NFS, `flock` and SQLite's `fcntl` locks share one lock table, so an exclusive `flock` on the file would block SQLite's own locks.
+ - modernc runs `busy_timeout` first and the other pragmas in name order. So the connection enters WAL first and then switches to EXCLUSIVE, which SQLite allows.
+- **Nonce checks before pruning.**
+ - A held row for `(key_id, nonce)` is a replay whatever its expiry, checked before anything is pruned.
+ - The bound is now the larger of the durable mark and the latest expiry this call is about to prune, plus 2 MaxSkew.
+ - `TestStoreRemembersNonces` changed for this: an expired but still-held nonce is now a replay.
+
+RED: `store_test.go:326: Open through current.db while controller.db is open = nil error, want ErrStoreInUse`; `store_test.go:354: replay with until 12:10 at 12:11 = (true, <nil>), want (false, nil)`. GREEN: `go test ./internal/hostedctl -count=1` ok, 1.2 s.
+
+| Mutation | Command | Observed failure | Restored |
+| --- | --- | --- | --- |
+| R3c `_pragma=locking_mode(NORMAL)` in the DSN | `go test ./internal/hostedctl -run '^TestStoreOneOwner' -count=1` | `store_test.go:290: second Open while the first is open = nil error, want ErrStoreInUse`; `store_test.go:326: Open through current.db while controller.db is open = nil error, want ErrStoreInUse`; `store_test.go:330: Open through linked.db ... = hostedctl: migrate: disk I/O error (522), want ErrStoreInUse` | yes, passes |
+| R7a round-1 order (no held-row check, bound from the old mark only) | `go test ./internal/hostedctl -run '^TestStoreNonceReplayAcrossWallJump$' -count=1` | `store_test.go:354: replay with until 12:10 at 12:11 = (true, <nil>), want (false, nil): a held row is a replay whatever its expiry` | yes, passes |
+| R7b no held-row check | same | `store_test.go:354: replay with until 12:10 at 12:11 = (false, hostedctl: nonce window already pruned ...), want (false, nil)` | yes, passes |
+| R7c bound ignores this call's prune | same | `store_test.go:360: new nonce with until 12:10 at 12:11, pruning until 12:10 = (true, <nil>), want (false, ErrNoncePruned)` | yes, passes |
diff --git a/internal/hostedctl/store.go b/internal/hostedctl/store.go
index 6deacb74..0b1d3a87 100644
--- a/internal/hostedctl/store.go
+++ b/internal/hostedctl/store.go
@@ -11,15 +11,13 @@ import (
"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"
+ "modernc.org/sqlite"
)
// ErrSchemaNewer: the database was written by a newer controller. Open
@@ -53,7 +51,6 @@ 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
@@ -80,8 +77,10 @@ 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.
+// Open holds SQLite's exclusive lock on the database file for the Store's
+// whole life, so a second Open of the same file, by any name (a symlink or
+// a hard link included), 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
@@ -97,29 +96,33 @@ func Open(ctx context.Context, path string, c isolatedjob.Clock) (*Store, error)
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. recursive_triggers makes the implicit
// delete of INSERT OR REPLACE fire jobs_never_deleted.
+ //
+ // locking_mode(EXCLUSIVE) makes the connection keep SQLite's lock on the
+ // database file, taken at Open's first write, until it closes. The lock
+ // follows the file, not the name, and is SQLite's own, so it cannot clash
+ // with SQLite's locking the way a separate flock on the file can (BSD,
+ // NFS). No other connection may touch the database while a Store holds
+ // it, so busy_timeout is 0: a second Open fails at once instead of
+ // waiting. (modernc runs busy_timeout first and the other pragmas in name
+ // order, so WAL is entered before EXCLUSIVE; SQLite allows that switch.)
dsn := (&url.URL{Scheme: "file", Path: path}).String() +
- "?_pragma=busy_timeout(5000)&_pragma=journal_mode(WAL)&_pragma=synchronous(FULL)" +
- "&_pragma=foreign_keys(1)&_pragma=recursive_triggers(1)&_txlock=immediate"
+ "?_pragma=busy_timeout(0)&_pragma=journal_mode(WAL)&_pragma=locking_mode(EXCLUSIVE)" +
+ "&_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, lock: lock, host: c}
+ s := &Store{db: db, host: c}
if err := s.migrate(ctx); err != nil {
_ = s.release()
- return nil, err
+ return nil, inUse(err, path)
}
if err := s.restoreClock(ctx); err != nil {
_ = s.release()
@@ -128,22 +131,17 @@ func Open(ctx context.Context, path string, c isolatedjob.Clock) (*Store, error)
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)
+// inUse turns SQLite's "busy" or "locked" at Open into ErrStoreInUse:
+// another connection holds the database.
+func inUse(err error, path string) error {
+ var e *sqlite.Error
+ if errors.As(err, &e) {
+ switch e.Code() & 0xff {
+ case 5, 6: // SQLITE_BUSY, SQLITE_LOCKED
+ return fmt.Errorf("%w: %s: %w", ErrStoreInUse, path, err)
}
- return nil, fmt.Errorf("hostedctl: lock store: %w", err)
}
- return f, nil
+ return err
}
// migrate applies the missing migrations in one transaction. The version is
@@ -264,7 +262,7 @@ func undeliveredAlerts(ctx context.Context, tx *sql.Tx) ([]outboxAlert, error) {
}
// Close checkpoints controller time, closes the database and releases the
-// owner lock. A second Close does nothing.
+// exclusive lock. A second Close does nothing.
func (s *Store) Close() error {
s.mu.Lock()
if s.closed {
@@ -276,10 +274,8 @@ func (s *Store) Close() error {
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())
-}
+// release closes the database, which drops the exclusive lock.
+func (s *Store) release() error { return s.db.Close() }
// Clock returns the store's controller clock.
func (s *Store) Clock() *CtlClock { return s.clock }
@@ -382,13 +378,18 @@ 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, 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.
+// given wall time. In one transaction it:
+// 1. reports false (a replay) when a row for the pair exists, whatever its
+// expiry, before anything is pruned;
+// 2. finds the bound: the larger of the durable pruned-through mark and the
+// latest expiry this call is about to prune (by this host's wall clock);
+// 3. denies with ErrNoncePruned when until <= bound + 2*hostedwire.MaxSkew.
+// The wall clock moved past this window, forward between Verify and
+// Remember or back after a prune, and a forgotten nonce's replay could
+// pass the skew check there. The margin covers a replay sent up to
+// 2 MaxSkew later than the original;
+// 4. prunes the expired rows, raises the mark, and inserts the nonce.
+//
// 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 == "" {
@@ -397,22 +398,30 @@ func (s *Store) Remember(ctx context.Context, id hostedwire.KeyID, nonce string,
untilNs := until.UnixNano()
fresh := false
err := s.Tx(ctx, func(tx *sql.Tx) error {
- var through int64
+ var held int
+ if err := tx.QueryRowContext(ctx, `SELECT count(*) FROM nonces WHERE key_id = ? AND nonce = ?`, string(id), nonce).Scan(&held); err != nil {
+ return fmt.Errorf("hostedctl: look up nonce: %w", err)
+ }
+ if held > 0 {
+ return nil // a replay
+ }
+ var through sql.NullInt64
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:
+ if err != nil && !errors.Is(err, sql.ErrNoRows) {
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)
}
+ bound := through
+ if pruned.Valid && (!bound.Valid || pruned.Int64 > bound.Int64) {
+ bound = pruned
+ }
+ if bound.Valid && (bound.Int64 > math.MaxInt64-int64(2*hostedwire.MaxSkew) || untilNs <= bound.Int64+int64(2*hostedwire.MaxSkew)) {
+ return fmt.Errorf("%w: until %d, pruned through %d", ErrNoncePruned, untilNs, bound.Int64)
+ }
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)
diff --git a/internal/hostedctl/store_test.go b/internal/hostedctl/store_test.go
index 27a88916..9a434095 100644
--- a/internal/hostedctl/store_test.go
+++ b/internal/hostedctl/store_test.go
@@ -301,6 +301,78 @@ func TestStoreOneOwner(t *testing.T) {
openStore(t, path, isolatedjobtest.NewFakeClock(testWall))
}
+// TestStoreOneOwnerThroughLinks: the lock belongs to the database file, not
+// the name it was opened by.
+func TestStoreOneOwnerThroughLinks(t *testing.T) {
+ ctx := context.Background()
+ dir := t.TempDir()
+ path := filepath.Join(dir, "controller.db")
+ first, err := Open(ctx, path, isolatedjobtest.NewFakeClock(testWall))
+ if err != nil {
+ t.Fatal(err)
+ }
+ symlink, hardlink := filepath.Join(dir, "current.db"), filepath.Join(dir, "linked.db")
+ if err := os.Symlink(path, symlink); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.Link(path, hardlink); err != nil {
+ t.Fatal(err)
+ }
+ for _, other := range []string{symlink, hardlink} {
+ start := time.Now()
+ second, err := Open(ctx, other, isolatedjobtest.NewFakeClock(testWall))
+ if err == nil {
+ _ = second.Close()
+ t.Errorf("Open through %s while %s is open = nil error, want ErrStoreInUse", filepath.Base(other), filepath.Base(path))
+ continue
+ }
+ if !errors.Is(err, ErrStoreInUse) {
+ t.Errorf("Open through %s while %s is open = %v, want ErrStoreInUse", filepath.Base(other), filepath.Base(path), err)
+ }
+ if took := time.Since(start); took > time.Second {
+ t.Errorf("Open through %s took %v to fail, want under 1s", filepath.Base(other), took)
+ }
+ // Not only Open: any connection, by any name, is kept out while the
+ // Store holds the file.
+ reader, err := sql.Open("sqlite", (&url.URL{Scheme: "file", Path: other}).String()+"?_pragma=busy_timeout(100)")
+ if err != nil {
+ t.Fatal(err)
+ }
+ var n int
+ err = reader.QueryRow(`SELECT count(*) FROM jobs`).Scan(&n)
+ _ = reader.Close()
+ if err == nil {
+ t.Errorf("plain read through %s while the Store is open = nil error, want the database locked", filepath.Base(other))
+ }
+ }
+ if err := first.Close(); err != nil {
+ t.Fatal(err)
+ }
+ openStore(t, symlink, isolatedjobtest.NewFakeClock(testWall))
+}
+
+// TestStoreNonceReplayAcrossWallJump: the wall clock jumps forward between
+// Verify (which set until) and Remember (which prunes by the wall clock).
+func TestStoreNonceReplayAcrossWallJump(t *testing.T) {
+ ctx := context.Background()
+ clk := isolatedjobtest.NewFakeClock(testWall) // 12:00
+ s := openStore(t, filepath.Join(t.TempDir(), "hosted.db"), 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, before the replay reaches Remember
+ if ok, err := s.Remember(ctx, "inst-1", "orig", until); ok || err != nil {
+ t.Fatalf("replay with until 12:10 at 12:11 = (%v, %v), want (false, nil): a held row is a replay whatever its expiry", ok, err)
+ }
+ // A new nonce whose window ends no later than the nonces this call
+ // prunes (plus the skew margin) is denied too: the wall clock moved past
+ // it.
+ if ok, err := s.Remember(ctx, "inst-1", "new", until); ok || !errors.Is(err, ErrNoncePruned) {
+ t.Fatalf("new nonce with until 12:10 at 12:11, pruning until 12:10 = (%v, %v), want (false, ErrNoncePruned)", ok, err)
+ }
+}
+
func TestStoreDeniesNonceAfterPruneAndRollback(t *testing.T) {
ctx := context.Background()
clk := isolatedjobtest.NewFakeClock(testWall) // 12:00
@@ -356,7 +428,9 @@ func TestStoreRemembersNonces(t *testing.T) {
clk.SetWall(until.Add(time.Second))
until = until.Add(time.Hour)
- check("inst-1", "n1", true) // expired, so remembered afresh
+ check("inst-1", "n1", false) // expired but still held: a replay, and nothing pruned
+ check("inst-1", "n3", true) // prunes the three expired rows
+ check("inst-1", "n1", true) // forgotten once pruned, and outside the pruned window
check("inst-1", "n1", false)
var left int
@@ -365,8 +439,8 @@ func TestStoreRemembersNonces(t *testing.T) {
}); err != nil {
t.Fatal(err)
}
- if left != 1 {
- t.Fatalf("nonces held after expiry = %d, want 1: expired rows are pruned", left)
+ if left != 2 {
+ t.Fatalf("nonces held after expiry = %d, want 2 (n3 and the new n1): expired rows are pruned", left)
}
// Of concurrent calls with one pair, exactly one gets true.