oficina / equipo Public

Finish the cutover on the kept database; upgrade refuses a bad replica

On CARLOS the activator passes the app an absolute --db, so
EQUIPO_DATABASE is ignored: the cutover's deploy migrated the old
production database in place, and that data is kept.

scripts/cutover-finish-thin.sh finishes cutover steps 6 onward for it
without the replica. Identity comes from the instance's public
/install.sh, which names its origin, version and the instance id it reads
from its own database; it must name the recorded old id on both routes.
It unsets EQUIPO_DATABASE, installs the staged runner (hashes from the
staged record) with the public origin and the same id, enrols it, and
verifies by version, identity, the running binary's hash and the
instance's welcome in the runner's journal. Steps go to cutover.state,
so upgrade-thin.sh accepts the result. Its rollback restores the runner
files and offers no earlier version.

cutover-thin.sh rollback now refuses after the deploy: the previous
version cannot read the migrated schema.

upgrade-thin.sh preflight refuses when the replica cannot be read,
naming PRAGMA integrity_check through carlos db query as the check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 093ca5931e9dceee83af736960bfde8ad2aacda9 parent 363da89
7 files changed, +728 −33
  • internal/release/cutover_finish_test.go +272 −0
  • internal/release/cutover_test.go +26 −12
  • internal/release/upgrade_test.go +13 −5
  • scripts/cutover-finish-thin.sh +215 −0
  • scripts/cutover-thin.sh +5 −0
  • scripts/runner-reference-allowlist.json +175 −0
  • scripts/upgrade-thin.sh +22 −16

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/upgrade-thin: Type  Size Avail | ext4   96G   86G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   86G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.9s
ci-box: codex: fetched and verified in 4.7s
ci-box: codex-code-mode-host: fetched and verified in 2.0s
ci-box: libwrap: fetched and verified in 0.4s
ci-box: socat: fetched and verified in 0.7s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 10.0s
ci-box: pi: installed and verified in 7.4s
ci-box: opencode: installed and verified in 1.9s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 11.1s
ci-box: clone deepened in 3.1s
ci-box: file times set from content: 2720 files, 174 directories
ci-box: ready in 17.5s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipotest	0.247s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  1.1s
+ go list -export -test -tags testbuild -f  ./...
  0.8s
+ go list -export -test -tags browser,testbuild -f  ./internal/equipo ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
  0.3s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-11 02:51:11 +0000 UTC

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

receipt: test step 1m20.906s 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.417s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m19.42s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 40.24, cpu waiting 21.93%, memory waiting 0.00%, io waiting 0.62%
--- shard 1 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-review: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$' ./internal/headless
cache miss: amadan.net/oficina/equipo/internal/headless: its inputs changed

receipt: test step 1m22.277s 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.624s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m20.62s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 38.30, cpu waiting 21.93%, memory waiting 0.00%, io waiting 0.62%
--- 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 1m23.677s 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.573s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m11.22s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.71s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.64s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 38.30, cpu waiting 21.47%, memory waiting 0.00%, io waiting 0.60%
--- 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.006s 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.448s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.78s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 19.96s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.29s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 9.42s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 40.24, cpu waiting 22.33%, memory waiting 0.00%, io waiting 0.64%
--- 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 1m35.296s 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 1m33.714s amadan.net/oficina/equipo/internal/headless
receipt: slow test 58.69s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 10.83s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 9.86s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 8.55s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 5.78s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 34.55, cpu waiting 18.03%, memory waiting 0.00%, io waiting 0.49%
--- 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 3m16.333s 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 3m14.35s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m43.99s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 24.01s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 20.54s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 8.1s amadan.net/oficina/equipo/internal/headless TestHeadlessClaudeSignIn
receipt: slow test 7.32s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 8.14, cpu waiting 3.42%, memory waiting 0.00%, io waiting 0.08%
--- 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 309ms 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 2m0.883s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 7.82s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.8s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 4.38s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 3.88s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 2.42s amadan.net/oficina/equipo/internal/thintest TestResearchDoneFallsBack
machine: 32 CPUs, load 1.48, cpu waiting 0.00%, memory waiting 0.00%, io waiting 2.33%
--- 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 297ms 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 1m22.798s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.09s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5.23s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.41s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.37s amadan.net/oficina/equipo/internal/thintest TestContractPublishNameTaken
receipt: slow test 2.35s amadan.net/oficina/equipo/internal/thintest TestContractPreview
machine: 32 CPUs, load 1.48, cpu waiting 0.00%, memory waiting 0.00%, io waiting 2.33%
--- 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 4m31.66s, over the 45s its record on line 44 allows; reported only, timing fails on CI

receipt: test step 4m44.602s 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 4m31.66s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 36.99s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.93s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.81s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.49s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 7.17s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 2.40, cpu waiting 0.76%, 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.786s 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.686s amadan.net/oficina/equipo/internal/runner
receipt: slow test 26.66s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 46.16, cpu waiting 22.05%, memory waiting 0.00%, io waiting 1.10%
--- shard 10 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-plans: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

receipt: test step 48.515s 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.6s amadan.net/oficina/equipo/internal/runner
receipt: slow test 36.6s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 32.65s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.37s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 46.16, cpu waiting 22.41%, memory waiting 0.00%, io waiting 1.07%
--- shard 11 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-rest: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$|^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner
cache miss: amadan.net/oficina/equipo/internal/runner: its inputs changed

receipt: test step 34.954s 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.1s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.13s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.35s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.12s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.09s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.6s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 30.70, cpu waiting 15.13%, memory waiting 0.00%, io waiting 1.35%
--- 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.5%, load 23.45
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.7s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m3.948s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 27.86s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 27.84s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 25.82s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 23.07s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 22.98s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelDuplicates
machine: 32 CPUs, load 34.55, cpu waiting 18.03%, memory waiting 0.00%, io waiting 0.49%
--- 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.5%, load 23.45
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 389ms 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 1m14.081s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 19.43s amadan.net/oficina/equipo/internal/equipotest TestProjectsSharedAndGrouped
receipt: slow test 19.43s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
receipt: slow test 19.41s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 19.38s amadan.net/oficina/equipo/internal/equipotest TestProjectOwnersAreMembers
receipt: slow test 19.3s amadan.net/oficina/equipo/internal/equipotest TestProjectKindsAndDefaultBranch
machine: 32 CPUs, load 23.45, cpu waiting 11.15%, memory waiting 0.00%, io waiting 1.49%
--- 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.5%, load 23.45
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest
cache miss: amadan.net/oficina/equipo/internal/equipotest: its inputs changed

receipt: test step 1m14.999s 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.513s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 14.29s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 12.99s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 9.94s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 9.92s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 6.88s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 29.77, cpu waiting 15.27%, memory waiting 0.00%, io waiting 0.41%
--- 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.5%, load 23.45
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 388ms 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 1m6.433s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 25.51s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 24.68s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 24.62s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 22.72s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedOnce
receipt: slow test 22.66s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsRollbackAndUnavailable
machine: 32 CPUs, load 23.45, cpu waiting 11.15%, memory waiting 0.00%, io waiting 1.49%
--- 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.5%, load 23.45
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 545ms 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 47.181s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.5s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.44s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.42s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.32s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.18s amadan.net/oficina/equipo/internal/plan3test TestPlanMigrationUpgrade
machine: 32 CPUs, load 23.45, cpu waiting 12.29%, memory waiting 0.00%, io waiting 1.44%
--- 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.5%, load 23.45
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/cmd/equipo-runner: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/codex: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/checks: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/containment: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
budget note: internal/equipo took 25.955s, 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 13.726s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/equipo/setup took 10.311s, 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 47.583s, 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 11.996s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/containment took 40.458s, over the 15s its record on line 40 allows; reported only, timing fails on CI

receipt: test step 2m16.756s against a 60s target (the gate's other steps are not in this figure)
receipt: 14 packages ran, 46 cached, 18 without tests, 0 failed
receipt: slow package 54.708s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 52.935s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 47.583s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 40.458s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow package 38.032s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow test 21.77s amadan.net/oficina/equipo/internal/runner/provider/opencode TestOpenCodeAcceptanceHostileRepository
receipt: slow test 15.95s amadan.net/oficina/equipo/internal/idtest TestIDCallbackGuardAndPendingNonce
receipt: slow test 15.38s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringOfflineGo
receipt: slow test 9.73s amadan.net/oficina/equipo/internal/runner/containment TestEngineeringMissingModuleCache
receipt: slow test 8.81s amadan.net/oficina/equipo/internal/runner/checks TestCheckNamespaceGoRootInsideModuleCache
machine: 32 CPUs, load 11.53, cpu waiting 5.46%, memory waiting 0.00%, io waiting 0.14%
--- 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.969s 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.479s amadan.net/oficina/equipo/internal/headless
receipt: slow test 37.48s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 15.15s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.47s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.77s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.16s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 38.30, cpu waiting 21.47%, memory waiting 0.00%, io waiting 0.60%
--- 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 1m31.807s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m30.207s amadan.net/oficina/equipo/internal/headless
receipt: slow test 26.31s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 22.19s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 14.05s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 10.13s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 7.78s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 34.55, cpu waiting 18.61%, memory waiting 0.00%, io waiting 0.51%
--- 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.868s 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 1m39.323s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.26s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.37s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 13.12s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 10.21s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.06s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 29.77, cpu waiting 16.32%, memory waiting 0.00%, io waiting 0.44%
--- 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-19T21:27:11.006Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-19T21:27:11.007Z level=INFO msg="startup phase done" phase=state_lock took=67µs
time=2026-11-19T21:27:11.007Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-19T21:27:11.007Z level=INFO msg="startup phase done" phase=claim_roots took=82µs
time=2026-11-19T21:27:11.007Z level=INFO msg="startup phase" phase=sweep
time=2026-11-19T21:27:11.038Z level=INFO msg="startup phase done" phase=sweep took=31.211ms
time=2026-11-19T21:27:11.038Z level=INFO msg="startup phase" phase=credentials
time=2026-11-19T21:27:11.038Z level=INFO msg="startup phase done" phase=credentials took=106µs
time=2026-11-19T21:27:11.038Z level=INFO msg="startup phase" phase=open_state
time=2026-11-19T21:27:11.087Z level=INFO msg="startup phase done" phase=open_state took=49.01ms
time=2026-11-19T21:27:11.088Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-19T21:27:11.089Z level=INFO msg=connecting host=127.0.0.1:35507 protocol=28
time=2026-11-19T21:27:11.091Z level=INFO msg=connected host=127.0.0.1:35507 took=1.079ms
time=2026-11-19T21:27:11.091Z level=INFO msg="capabilities gathering"
time=2026-11-19T21:27:11.092Z level=INFO msg="capabilities gathered" took=816µs tags=linux,claude,go
time=2026-11-19T21:27:11.093Z level=INFO msg="hello sent" protocol=28
time=2026-11-19T21:27:11.097Z 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.89s)

--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserEmptyExplore
=== RUN   TestBrowserEmptyExplore
time=2026-11-19T21:27:42.663Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-19T21:27:42.663Z level=INFO msg="startup phase done" phase=state_lock took=166µs
time=2026-11-19T21:27:42.663Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-19T21:27:42.663Z level=INFO msg="startup phase done" phase=claim_roots took=171µs
time=2026-11-19T21:27:42.663Z level=INFO msg="startup phase" phase=sweep
time=2026-11-19T21:27:42.691Z level=INFO msg="startup phase done" phase=sweep took=28.165ms
time=2026-11-19T21:27:42.691Z level=INFO msg="startup phase" phase=credentials
time=2026-11-19T21:27:42.691Z level=INFO msg="startup phase done" phase=credentials took=167µs
time=2026-11-19T21:27:42.691Z level=INFO msg="startup phase" phase=open_state
time=2026-11-19T21:27:42.733Z level=INFO msg="startup phase done" phase=open_state took=41.626ms
time=2026-11-19T21:27:42.734Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-19T21:27:42.735Z level=INFO msg=connecting host=127.0.0.1:43193 protocol=28
time=2026-11-19T21:27:42.736Z level=INFO msg=connected host=127.0.0.1:43193 took=1.036ms
time=2026-11-19T21:27:42.736Z level=INFO msg="capabilities gathering"
time=2026-11-19T21:27:42.737Z level=INFO msg="capabilities gathered" took=440µs tags=linux,claude,go
time=2026-11-19T21:27:42.738Z level=INFO msg="hello sent" protocol=28
time=2026-11-19T21:27:42.743Z level=INFO msg=welcome protocol=28 role=primary generation=1
time=2026-11-19T21:27:43.760Z level=INFO msg="connection checked" connection=claude-1 state=healthy
    browser_receipts_test.go:169: waiting for [...document.querySelectorAll('[equipo-markdown]:not([data-stream-text])')].some(e=>e.textContent.includes("I'm your coordinator")): context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserEmptyExplore (5.77s)

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


receipt: test step 1m28.535s 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.119s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.13s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 10.9s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.46s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 10.39s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
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 093ca5931e9dceee83af736960bfde8ad2aacda9 1.89s 36.51
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
##############################################################################
FLAKE ./internal/headless:TestBrowserEmptyExplore browser-headless-rest 093ca5931e9dceee83af736960bfde8ad2aacda9 5.77s 36.51
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 32.18, cpu waiting 16.87%, memory waiting 0.00%, io waiting 0.46%
--- 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 317ms 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 701ms amadan.net/oficina/equipo/internal/equipo
receipt: slow test 700ms 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 292ms 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.631s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 1.63s 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 314ms 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.794s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 1.79s 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|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackStarCentre)$' ./internal/thintest

receipt: test step 278ms 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 3m4.809s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 17.42s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.34s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 10.61s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.34s amadan.net/oficina/equipo/internal/thintest TestBrowserInnerScreens
receipt: slow test 9.15s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
machine: 32 CPUs, load 7.12, cpu waiting 0.71%, memory waiting 0.00%, io waiting 2.39%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless   (53s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 5.20s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.43s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 9.53s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.86s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 24.96s
+ 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   (55s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 14.59s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 12.81s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 11.45s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 13.92s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (22s)
ok ./internal/headless TestMixedVersions 20.24s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.81s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (1s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 44.54, cpu waiting 22.98%, memory waiting 0.00%, io waiting 0.97%
--- 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.213s 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.101s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 188ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 80ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 0s amadan.net/oficina/equipo/internal/runner/provider/gotoolchain
receipt: slow test 5.09s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.63s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 290ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 180ms 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 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.093s 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.779s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 260ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 190ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceOpenCodeBinaryAfterAttestation
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryReusedPID
machine: 32 CPUs, load 12.92, cpu waiting 4.54%, memory waiting 0.00%, io waiting 2.02%
--- 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.5%, load 23.45
shard 25: make runner-dead-references lanes-check build vet fmt-check budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2434 text files, 2811 matches, 0 failures
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 87 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipo	2.455s
machine: 32 CPUs, load 46.16, cpu waiting 22.05%, memory waiting 0.00%, io waiting 1.10%
--- 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.5%, load 23.45
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 30.70, cpu waiting 13.95%, memory waiting 0.00%, io waiting 1.40%
--- 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.5%, load 23.45
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 33.45, cpu waiting 16.44%, memory waiting 0.00%, io waiting 1.31%
--- 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.5%, load 23.45
shard 28: make gitleaks
9:27PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
9:27PM INF 1020 commits scanned.
9:27PM INF scanned ~59901938 bytes (59.90 MB) in 14.1s
9:27PM INF no leaks found
machine: 32 CPUs, load 41.82, cpu waiting 20.58%, memory waiting 0.00%, io waiting 1.18%
=== 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.168ms, worst 1.302ms, budget 150ms
perf: GET /api/runner/protocol: median 68µs, worst 109µs, budget 150ms
perf: GET /api/v1/account-setups/{id}: median 652µs, worst 692µs, budget 150ms
perf: GET /api/v1/accounts: median 445µs, worst 464µs, budget 150ms
perf: GET /api/v1/auth/devices: median 463µs, worst 503µs, budget 150ms
perf: GET /api/v1/budgets: median 523µs, worst 561µs, budget 150ms
perf: GET /api/v1/capabilities: median 259µs, worst 266µs, budget 150ms
perf: GET /api/v1/cards/{id}: median 1.489ms, worst 1.593ms, budget 150ms
perf: GET /api/v1/connections: median 621µs, worst 635µs, budget 150ms
perf: GET /api/v1/connections/{id}: median 579µs, worst 626µs, budget 150ms
perf: GET /api/v1/conversation: median 983µs, worst 1.071ms, budget 150ms
perf: GET /api/v1/conversation/cards: median 1.639ms, worst 1.711ms, budget 150ms
perf: GET /api/v1/coordinator: median 1.935ms, worst 2.048ms, budget 150ms
perf: GET /api/v1/invites/{id}: median 492µs, worst 528µs, budget 150ms
perf: GET /api/v1/journey: median 9.884ms, worst 12.931ms, budget 150ms
perf: GET /api/v1/me: median 547µs, worst 605µs, budget 150ms
perf: GET /api/v1/me/settings: median 637µs, worst 670µs, budget 150ms
perf: GET /api/v1/needs-you: median 9.393ms, worst 9.62ms, budget 150ms
perf: GET /api/v1/notifications: median 1.838ms, worst 1.979ms, budget 150ms
perf: GET /api/v1/onboarding: median 406µs, worst 441µs, budget 150ms
perf: GET /api/v1/people: median 471µs, worst 539µs, budget 150ms
perf: GET /api/v1/playbooks: median 604µs, worst 620µs, budget 150ms
perf: GET /api/v1/playbooks/{id}: median 557µs, worst 576µs, budget 150ms
perf: GET /api/v1/playbooks/{id}/template-diff: median 883µs, worst 927µs, budget 150ms
perf: GET /api/v1/preferences: median 777µs, worst 837µs, budget 150ms
perf: GET /api/v1/projects/{id}: median 474µs, worst 534µs, budget 150ms
perf: GET /api/v1/projects/{id}/settings: median 625µs, worst 664µs, budget 150ms
perf: GET /api/v1/roster: median 488µs, worst 512µs, budget 150ms
perf: GET /api/v1/runners/{id}: median 513µs, worst 551µs, budget 150ms
perf: GET /api/v1/specialists: median 8.554ms, worst 8.676ms, budget 150ms
perf: GET /api/v1/specialists/{id}: median 8.359ms, worst 8.468ms, budget 150ms
perf: GET /api/v1/specialists/{id}/template-diff: median 901µs, worst 957µs, budget 150ms
perf: GET /api/v1/tasks/{id}/plan: median 1.282ms, worst 1.309ms, budget 150ms
perf: GET /api/v1/tasks/{id}/thread: median 762µs, worst 802µs, budget 150ms
perf: GET /api/v1/teams: median 429µs, worst 498µs, budget 150ms
perf: GET /api/v1/templates: median 616µs, worst 664µs, budget 150ms
perf: GET /api/v1/templates/{id}: median 467µs, worst 506µs, budget 150ms
perf: GET /auth/callback: median 81µs, worst 112µs, budget 150ms
perf: GET /auth/devices/{id}: median 3.545ms, worst 3.795ms, budget 150ms
perf: GET /auth/verify: median 81µs, worst 112µs, budget 150ms
perf: GET /connections: median 3.861ms, worst 3.933ms, budget 150ms
perf: GET /conversation: median 8.033ms, worst 8.233ms, budget 150ms
perf: GET /conversation/connections: median 258µs, worst 301µs, budget 150ms
perf: GET /conversation/notebook: median 250µs, worst 292µs, budget 150ms
perf: GET /conversation/settings: median 4.412ms, worst 4.764ms, budget 150ms
perf: GET /conversation/settings/autonomy: median 3.925ms, worst 4.001ms, budget 150ms
perf: GET /conversation/settings/connections: median 6.746ms, worst 6.882ms, budget 150ms
perf: GET /conversation/settings/connections/add: median 6.885ms, worst 7.109ms, budget 150ms
perf: GET /conversation/settings/copy: median 3.807ms, worst 3.888ms, budget 150ms
perf: GET /conversation/settings/housekeeping: median 4.437ms, worst 4.596ms, budget 150ms
perf: GET /conversation/settings/machines: median 4.785ms, worst 4.963ms, budget 150ms
perf: GET /conversation/settings/machines/add: median 4.786ms, worst 5.007ms, budget 150ms
perf: GET /conversation/settings/notebook: median 3.761ms, worst 6.407ms, budget 150ms
perf: GET /conversation/settings/thinking: median 4.297ms, worst 4.48ms, budget 150ms
perf: GET /housekeeping: median 3.95ms, worst 4.233ms, budget 150ms
perf: GET /invites/new: median 602µs, worst 640µs, budget 150ms
perf: GET /invites/{id}: median 660µs, worst 670µs, budget 150ms
perf: GET /jobs: median 3.51ms, worst 3.685ms, budget 150ms
perf: GET /jobs/{id}: median 4.86ms, worst 4.952ms, budget 150ms
perf: GET /journey: median 10.787ms, worst 11.142ms, budget 150ms
perf: GET /nav/rail: median 3.112ms, worst 3.215ms, budget 150ms
perf: GET /needs-you: median 10.586ms, worst 10.802ms, budget 150ms
perf: GET /onboarding: median 4.351ms, worst 5.834ms, budget 150ms
perf: GET /people: median 3.696ms, worst 3.885ms, budget 150ms
perf: GET /playbook-suggestions/{suggestion}: median 4.926ms, worst 5.06ms, budget 150ms
perf: GET /playbooks: median 4.329ms, worst 4.402ms, budget 150ms
perf: GET /playbooks/new: median 4.563ms, worst 4.765ms, budget 150ms
perf: GET /playbooks/{id}: median 4.86ms, worst 5.144ms, budget 150ms
perf: GET /playbooks/{id}/edit: median 4.916ms, worst 5.129ms, budget 150ms
perf: GET /playbooks/{id}/template-diff: median 4.12ms, worst 4.271ms, budget 150ms
perf: GET /preferences: median 4.456ms, worst 4.618ms, budget 150ms
perf: GET /preferences/sources/{source}: median 4.238ms, worst 4.486ms, budget 150ms
perf: GET /projects: median 5.468ms, worst 5.912ms, budget 150ms
perf: GET /projects/accounts: median 3.98ms, worst 5.55ms, budget 150ms
perf: GET /projects/new: median 3.933ms, worst 4.019ms, budget 150ms
perf: GET /projects/{id}: median 10.83ms, worst 11.057ms, budget 150ms
perf: GET /projects/{id}/edit: median 3.872ms, worst 4.078ms, budget 150ms
perf: GET /runners/enrol: median 4.799ms, worst 4.9ms, budget 150ms
perf: GET /settings: median 3.59ms, worst 3.721ms, budget 150ms
perf: GET /settings/coordinator: median 5.826ms, worst 6.009ms, budget 150ms
perf: GET /settings/devices: median 3.433ms, worst 3.565ms, budget 150ms
perf: GET /settings/recovery: median 3.648ms, worst 3.731ms, budget 150ms
perf: GET /settings/recovery/release: median 3.718ms, worst 3.769ms, budget 150ms
perf: GET /settings/thinking: median 249µs, worst 279µs, budget 150ms
perf: GET /signin: median 312µs, worst 367µs, budget 150ms
perf: GET /specialists/new: median 3.733ms, worst 3.913ms, budget 150ms
perf: GET /specialists/{key}: median 13.634ms, worst 13.942ms, budget 150ms
perf: GET /specialists/{key}/edit: median 4.297ms, worst 4.436ms, budget 150ms
perf: GET /specialists/{key}/template-diff: median 4.4ms, worst 4.629ms, budget 150ms
perf: GET /tasks: median 6.011ms, worst 6.415ms, budget 150ms
perf: GET /tasks/new: median 3.715ms, worst 3.789ms, budget 150ms
perf: GET /tasks/{id}: median 6.671ms, worst 6.764ms, budget 150ms
perf: GET /tasks/{id}/merge: median 5.768ms, worst 5.985ms, budget 150ms
perf: GET /tasks/{id}/move: median 5.32ms, worst 7.804ms, budget 150ms
perf: GET /tasks/{id}/plan: median 6.24ms, worst 6.442ms, budget 150ms
perf: GET /tasks/{id}/preview: median 1.58ms, worst 1.643ms, budget 150ms
perf: GET /tasks/{id}/questions/{question}: median 5.467ms, worst 5.576ms, budget 150ms
perf: GET /tasks/{id}/rendered-change: median 5.029ms, worst 5.324ms, budget 150ms
perf: GET /tasks/{id}/rendered-change/{hash}.png: median 4.547ms, worst 4.716ms, budget 150ms
perf: GET /tasks/{id}/thread: median 8.446ms, worst 8.72ms, budget 150ms
perf: GET /team/{specialist}: median 4.501ms, worst 4.612ms, budget 150ms
perf: GET /teams: median 12.42ms, worst 12.966ms, budget 150ms
perf: GET /templates: median 4.007ms, worst 5.301ms, budget 150ms
perf: GET /usage: median 4.915ms, worst 5.139ms, budget 150ms
perf: GET /work: median 3.605ms, worst 3.86ms, budget 150ms
perf: cold boot: median 263ms of [261.222639ms 262.825543ms 264.548781ms], budget 500ms

receipt: test step 31.361s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 83 without tests, 0 failed
receipt: slow package 9.237s 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.4s 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: 2.90 GiB in 21024 files
ci-box: module cache /home/ci/work/repos/oficina__equipo/cache/go-mod: 0.84 GiB in 27329 files
diff --git a/internal/release/cutover_finish_test.go b/internal/release/cutover_finish_test.go
new file mode 100644
index 00000000..c7e3c1dc
--- /dev/null
+++ b/internal/release/cutover_finish_test.go
@@ -0,0 +1,272 @@
+package release
+
+import (
+ "crypto/sha256"
+ "encoding/hex"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "strings"
+ "testing"
+)
+
+const (
+ finishVersion = "abc1234"
+ keptID = "KEPTINSTANCE00000000000000"
+)
+
+// finishRig is production as the 2026-11-19 cutover left it: steps 1 to 5
+// recorded, the instance serving finishVersion on the kept database, the
+// old runner stopped with its old origin and files. scripts/cutover-finish-thin.sh
+// runs against stub carlos, systemctl, journalctl and curl on a temporary
+// HOME; carlos db (the replica) fails if anything calls it.
+type finishRig struct {
+ t *testing.T
+ root, home, runner string
+ repo, log string
+ serviceEnv, unit string
+}
+
+func newFinishRig(t *testing.T) *finishRig {
+ t.Helper()
+ root := t.TempDir()
+ r := &finishRig{t: t, root: root, home: filepath.Join(root, "home"), log: filepath.Join(root, "calls.log"), repo: filepath.Join(root, "repo")}
+ r.runner = filepath.Join(r.home, ".local/share/equipo-runner")
+ for _, name := range []string{"cutover-finish-thin.sh", "cutover-thin.sh", "upgrade-thin.sh"} {
+ src, err := os.ReadFile("../../scripts/" + name)
+ r.must(err)
+ r.write(filepath.Join(r.repo, "scripts", name), string(src), 0700)
+ }
+ release := filepath.Join(r.repo, "releases", "equipo-runner-linux-amd64-"+finishVersion)
+ runner := "#!/bin/sh\nif [ \"$1\" = verify-installed ]; then echo \"equipo-runner verify-installed $EQUIPO_TOOL_PROXY_PATH\" >> " + r.log + "; exit; fi\necho \"equipo-runner $1 $EQUIPO_INSTANCE_ID $EQUIPO_ORIGIN\" >> " + r.log + "\necho new > \"$EQUIPO_RUNNER_STATE_DIR/credentials.json\"\n"
+ r.write(filepath.Join(release, "equipo-runner"), runner, 0700)
+ r.write(filepath.Join(release, "equipo-tool-proxy"), "proxy", 0700)
+ sum := func(s string) string { h := sha256.Sum256([]byte(s)); return hex.EncodeToString(h[:]) }
+ r.write(filepath.Join(r.repo, "releases", "staged", finishVersion+".json"), `{"staging": "PASS", "sha256": {"runner": "`+sum(runner)+`", "tool_proxy": "`+sum("proxy")+`"}}`, 0600)
+ r.serviceEnv = "EQUIPO_ORIGIN=\"https://equipo.bds.oncarlos.com\"\nEQUIPO_INSTANCE_ID=\"" + keptID + "\"\nEQUIPO_TOOL_PROXY_PATH=\"/old/equipo-tool-proxy\"\nEQUIPO_RUNNER_STATE_DIR=\"" + filepath.Join(r.runner, "state") + "\"\n"
+ r.unit = "[Service]\nEnvironmentFile=" + filepath.Join(r.runner, "service.env") + "\nExecStart=/old/equipo-runner run\nRestart=on-failure\nRestartSec=5\n"
+ r.write(filepath.Join(r.runner, "service.env"), r.serviceEnv, 0600)
+ r.write(filepath.Join(r.runner, "equipo-runner.service"), r.unit, 0600)
+ r.write(filepath.Join(r.runner, "state", "credentials.json"), "old", 0600)
+ backups := filepath.Join(r.home, ".local/share/equipo-cutover")
+ r.write(filepath.Join(backups, "cutover.state"), "version="+finishVersion+"\nstamp=20261119T140850Z\nprev_version=prev999\nprev_always_on=1\nprev_database=-unset-\nprev_origin=https://equipo.bds.oncarlos.com\nold_instance_id="+keptID+"\ndone_preflight=1\ndone_export=1\ndone_config=1\ndone_deploy=1\n", 0600)
+ r.write(filepath.Join(backups, "prior", "service.env"), r.serviceEnv, 0600)
+ r.write(filepath.Join(backups, "prior", "equipo-runner.service"), r.unit, 0600)
+ r.write(filepath.Join(root, "served"), finishVersion+"\n", 0600)
+ r.setInstall("https://equipo.oficina.works", finishVersion, keptID)
+ r.must(os.MkdirAll(filepath.Join(root, "proc", "4242"), 0700))
+ r.must(os.Symlink(filepath.Join(r.runner, "releases", finishVersion, "equipo-runner"), filepath.Join(root, "proc", "4242", "exe")))
+ r.write(filepath.Join(root, "journal"), "msg=welcome protocol=28 role=primary generation=1\n", 0600)
+ bin := filepath.Join(root, "bin")
+ log := "echo \"$(basename $0) $*\" >> " + r.log + "\n"
+ r.write(filepath.Join(bin, "curl"), "#!/bin/sh\n"+log+`case "$*" in
+*/install.sh) cat `+filepath.Join(root, "install.sh")+` ;;
+*) cat `+filepath.Join(root, "served")+` ;;
+esac
+`, 0700)
+ r.write(filepath.Join(bin, "systemctl"), "#!/bin/sh\n"+log+"case \"$*\" in *MainPID*) echo 4242 ;; esac\n", 0700)
+ r.write(filepath.Join(bin, "journalctl"), "#!/bin/sh\n"+log+"cat "+filepath.Join(root, "journal")+"\n", 0700)
+ r.write(filepath.Join(bin, "carlos"), "#!/bin/sh\n"+log+`case "$1 $2" in
+"env list") printf 'using console\nKEY VALUE\nEQUIPO_DATABASE equipo-v1.db\nEQUIPO_ORIGIN https://equipo.oficina.works\n' ;;
+db*) echo "the copy failed its integrity check" >&2; exit 1 ;;
+esac
+`, 0700)
+ return r
+}
+
+// setInstall is what the instance's /install.sh says.
+func (r *finishRig) setInstall(origin, version, instance string) {
+ r.write(filepath.Join(r.root, "install.sh"), "#!/bin/sh\nset -eu\ncurl --fail '"+origin+"/releases/"+version+"/install-v1.sh' | sh -s -- '"+origin+"' '"+version+"' '"+instance+"'\n", 0600)
+}
+
+func (r *finishRig) must(err error) {
+ r.t.Helper()
+ if err != nil {
+ r.t.Fatal(err)
+ }
+}
+
+func (r *finishRig) write(path, body string, mode os.FileMode) {
+ r.t.Helper()
+ r.must(os.MkdirAll(filepath.Dir(path), 0700))
+ r.must(os.WriteFile(path, []byte(body), mode))
+}
+
+func (r *finishRig) read(path string) string {
+ raw, _ := os.ReadFile(path)
+ return string(raw)
+}
+
+func (r *finishRig) run(script string, args ...string) (string, error) {
+ cmd := exec.Command("bash", append([]string{filepath.Join(r.repo, "scripts", script)}, args...)...)
+ cmd.Env = []string{"HOME=" + r.home, "PATH=" + filepath.Join(r.root, "bin") + ":/usr/bin:/bin", "CUTOVER_YES=1", "CUTOVER_TRIES=2", "CUTOVER_WAIT=0", "CUTOVER_PROC=" + filepath.Join(r.root, "proc"), "LANG=C.UTF-8"}
+ out, err := cmd.CombinedOutput()
+ return string(out), err
+}
+
+func (r *finishRig) state() string {
+ return r.read(filepath.Join(r.home, ".local/share/equipo-cutover/cutover.state"))
+}
+
+// The plan changes nothing, never reads the replica, and lists the steps.
+func TestCutoverFinishPlanChangesNothing(t *testing.T) {
+ r := newFinishRig(t)
+ state := r.state()
+ out, err := r.run("cutover-finish-thin.sh")
+ if err != nil {
+ t.Fatalf("plan: %v\n%s", err, out)
+ }
+ inOrder(t, out, "instance "+keptID, "== 6 identity", "sh -s -- 'https://equipo.oficina.works' '"+finishVersion+"' '"+keptID+"'",
+ "== 7 config", "env unset --app equipo --account oficina --console https://console.carloku.com EQUIPO_DATABASE",
+ "== 8 install", "EQUIPO_INSTANCE_ID=\""+keptID+"\"", "EQUIPO_ORIGIN=\"https://equipo.oficina.works\"", "state.pre-thin-20261119T140850Z",
+ "== 9 enrol", "verify-installed", "enrol", "systemctl --user start", "== 10 verify", "msg=welcome", "Plan only.")
+ if strings.Contains(out, "would refuse") || strings.Contains(out, "carlos db") {
+ t.Fatalf("plan refuses or reads the replica:\n%s", out)
+ }
+ if r.read(r.log) != "" || r.state() != state || r.read(filepath.Join(r.runner, "service.env")) != r.serviceEnv {
+ t.Fatalf("the plan changed something:\n%s", r.read(r.log))
+ }
+}
+
+// The finish moves the runner to the public origin with the kept instance
+// id, enrols it, verifies through the instance alone, and records the
+// steps so the upgrade accepts the cutover as finished.
+func TestCutoverFinishOnTheKeptDatabase(t *testing.T) {
+ r := newFinishRig(t)
+ out, err := r.run("cutover-finish-thin.sh", "--execute")
+ if err != nil {
+ t.Fatalf("finish: %v\n%s", err, out)
+ }
+ calls := r.read(r.log)
+ inOrder(t, calls, "install.sh", "env unset --app equipo --account oficina --console https://console.carloku.com EQUIPO_DATABASE", "install.sh",
+ "daemon-reload", "equipo-runner verify-installed "+filepath.Join(r.runner, "releases", finishVersion, "equipo-tool-proxy"),
+ "equipo-runner enrol "+keptID+" https://equipo.oficina.works", "systemctl --user start", "install.sh", "journalctl --user _PID=4242")
+ for _, never := range []string{"carlos db", "promote", "deploy", "env set"} {
+ if strings.Contains(calls, never) {
+ t.Fatalf("finish ran %q:\n%s", never, calls)
+ }
+ }
+ env := r.read(filepath.Join(r.runner, "service.env"))
+ if !strings.Contains(env, "EQUIPO_ORIGIN=\"https://equipo.oficina.works\"") || !strings.Contains(env, "EQUIPO_INSTANCE_ID=\""+keptID+"\"") {
+ t.Fatalf("runner config not moved:\n%s", env)
+ }
+ if r.read(filepath.Join(r.runner, "state.pre-thin-20261119T140850Z", "credentials.json")) != "old" {
+ t.Fatal("old runner state not kept aside")
+ }
+ st := r.state()
+ for _, want := range []string{"kept_database=1", "new_instance_id=" + keptID, "done_identity=1", "done_unset=1", "done_runner=1", "done_enrol=1", "done_verify=1"} {
+ if !strings.Contains(st, want) {
+ t.Fatalf("cutover.state lacks %q:\n%s", want, st)
+ }
+ }
+ if out, err = r.run("upgrade-thin.sh", "bbb2222"); err != nil || strings.Contains(out, "would refuse") {
+ t.Fatalf("upgrade does not accept the finished cutover: %v\n%s", err, out)
+ }
+ if out, err = r.run("cutover-finish-thin.sh", "--execute"); err == nil || !strings.Contains(out, "complete") {
+ t.Fatalf("second finish allowed: %v\n%s", err, out)
+ }
+}
+
+// Anything that does not show the kept database, or a cutover not at its
+// deploy, stops the finish before it changes anything.
+func TestCutoverFinishRefusesBeforeChangingAnything(t *testing.T) {
+ for name, set := range map[string]func(r *finishRig){
+ "another instance id": func(r *finishRig) {
+ r.setInstall("https://equipo.oficina.works", finishVersion, "FRESHINSTANCE0000000000000")
+ },
+ "the old origin": func(r *finishRig) { r.setInstall("https://equipo.bds.oncarlos.com", finishVersion, keptID) },
+ "another version": func(r *finishRig) { r.write(filepath.Join(r.root, "served"), "ccc3333\n", 0600) },
+ "other runner bytes": func(r *finishRig) {
+ r.write(filepath.Join(r.repo, "releases", "equipo-runner-linux-amd64-"+finishVersion, "equipo-runner"), "#!/bin/sh\n", 0700)
+ },
+ "unstaged version": func(r *finishRig) {
+ r.write(filepath.Join(r.repo, "releases", "staged", finishVersion+".json"), `{"staging": "FAIL"}`, 0600)
+ },
+ "no deploy": func(r *finishRig) {
+ r.write(filepath.Join(r.home, ".local/share/equipo-cutover/cutover.state"), strings.Replace(r.state(), "done_deploy=1\n", "", 1), 0600)
+ },
+ } {
+ t.Run(name, func(t *testing.T) {
+ r := newFinishRig(t)
+ r.t = t
+ set(r)
+ state := r.state()
+ out, err := r.run("cutover-finish-thin.sh", "--execute")
+ if err == nil || !strings.Contains(out, "refused") {
+ t.Fatalf("not refused: %v\n%s", err, out)
+ }
+ for _, change := range []string{"env unset", "systemctl", "enrol"} {
+ if strings.Contains(r.read(r.log), change) {
+ t.Fatalf("changed something (%s) before refusing:\n%s", change, r.read(r.log))
+ }
+ }
+ if r.state() != state || r.read(filepath.Join(r.runner, "service.env")) != r.serviceEnv || r.read(filepath.Join(r.runner, "state", "credentials.json")) != "old" {
+ t.Fatal("state or runner changed before refusing")
+ }
+ })
+ }
+}
+
+// Verify needs the staged bytes running and the instance's welcome to that
+// process in its log; once both hold, the same run resumes and finishes.
+func TestCutoverFinishVerifiesThroughTheInstance(t *testing.T) {
+ r := newFinishRig(t)
+ r.write(filepath.Join(r.root, "journal"), "msg=\"runner stream\" err=unauthorized\n", 0600)
+ if out, err := r.run("cutover-finish-thin.sh", "--execute"); err == nil || !strings.Contains(out, "no welcome") {
+ t.Fatalf("verified without a welcome: %v\n%s", err, out)
+ }
+ r.write(filepath.Join(r.root, "journal"), "msg=welcome generation=2\n", 0600)
+ exe := filepath.Join(r.root, "proc", "4242", "exe")
+ r.must(os.Remove(exe))
+ r.must(os.Symlink("/bin/sh", exe))
+ if out, err := r.run("cutover-finish-thin.sh", "--execute"); err == nil || !strings.Contains(out, "not the staged") {
+ t.Fatalf("accepted another running binary: %v\n%s", err, out)
+ }
+ if strings.Contains(r.state(), "done_verify=1") {
+ t.Fatal("verify recorded after a failed check")
+ }
+ r.must(os.Remove(exe))
+ r.must(os.Symlink(filepath.Join(r.runner, "releases", finishVersion, "equipo-runner"), exe))
+ if out, err := r.run("cutover-finish-thin.sh", "--execute"); err != nil || strings.Count(r.read(r.log), "equipo-runner enrol") != 1 {
+ t.Fatalf("did not resume past finished steps: %v\n%s\n%s", err, out, r.read(r.log))
+ }
+}
+
+// Rollback puts the runner back as the cutover left it, stopped, offers
+// no earlier version, and the upgrade and the cutover's own rollback then
+// refuse.
+func TestCutoverFinishRollbackOffersNoEarlierVersion(t *testing.T) {
+ r := newFinishRig(t)
+ if out, err := r.run("cutover-finish-thin.sh", "--execute"); err != nil {
+ t.Fatalf("finish: %v\n%s", err, out)
+ }
+ before := r.read(r.log)
+ out, err := r.run("cutover-finish-thin.sh", "rollback", "--execute")
+ if err != nil {
+ t.Fatalf("rollback: %v\n%s", err, out)
+ }
+ if r.read(filepath.Join(r.runner, "service.env")) != r.serviceEnv || r.read(filepath.Join(r.runner, "equipo-runner.service")) != r.unit || r.read(filepath.Join(r.runner, "state", "credentials.json")) != "old" {
+ t.Fatal("runner not put back exactly")
+ }
+ calls := strings.TrimPrefix(r.read(r.log), before)
+ for _, never := range []string{"promote", "deploy", "env set", "systemctl --user start"} {
+ if strings.Contains(calls, never) {
+ t.Fatalf("rollback ran %q:\n%s", never, calls)
+ }
+ }
+ if !strings.Contains(out, "prev999 is not offered") || !strings.Contains(out, "cannot read the migrated schema") {
+ t.Fatalf("rollback does not say why the earlier version is not offered:\n%s", out)
+ }
+ if out, err = r.run("upgrade-thin.sh", "bbb2222"); err != nil || !strings.Contains(out, "would refuse: the cutover has not finished") {
+ t.Fatalf("upgrade accepts a rolled-back finish: %v\n%s", err, out)
+ }
+ if out, err = r.run("cutover-thin.sh", "rollback", "--execute"); err == nil || !strings.Contains(out, "prev999 cannot read it") {
+ t.Fatalf("the cutover's rollback offers prev999: %v\n%s", err, out)
+ }
+ if out, err = r.run("cutover-finish-thin.sh", "rollback", "--execute"); err == nil {
+ t.Fatalf("second rollback allowed: %s", out)
+ }
+ if out, err = r.run("cutover-finish-thin.sh", "--execute"); err != nil {
+ t.Fatalf("finish again after rollback: %v\n%s", err, out)
+ }
+}
diff --git a/internal/release/cutover_test.go b/internal/release/cutover_test.go
index cba89cf0..bcc80ed6 100644
--- a/internal/release/cutover_test.go
+++ b/internal/release/cutover_test.go
@@ -57,7 +57,7 @@ func newCutoverRig(t *testing.T) *cutoverRig {
"env list") [ -e `+filepath.Join(root, "envfail")+` ] && exit 1; printf 'using console\nKEY VALUE\nEQUIPO_ALWAYS_ON 1\nEQUIPO_ORIGIN https://equipo.bds.oncarlos.com\n' ;;
"db pull") for a; do case $prev in --out) python3 -c "import sqlite3,sys; c=sqlite3.connect(sys.argv[1]); [c.execute('create table '+t+'(x)') for t in ('members','tasks','conversation_messages','runners')]; c.commit()" "$a" ;; esac; prev=$a; done ;;
"db query") printf 'id\n%s\n' "$(cat `+filepath.Join(root, "teamid")+`)" ;;
-deploy*) for a; do case $prev in --version) echo "$a" > `+filepath.Join(root, "served")+` ;; esac; prev=$a; done ;;
+deploy*) [ -e `+filepath.Join(root, "deployfail")+` ] && exit 1; for a; do case $prev in --version) echo "$a" > `+filepath.Join(root, "served")+` ;; esac; prev=$a; done ;;
promote*) shift; for a; do last2=$last; last=$a; done; echo "$last2" > `+filepath.Join(root, "served")+` ;;
esac
`, 0700)
@@ -131,12 +131,15 @@ func TestCutoverRefusesWithoutANewInstanceID(t *testing.T) {
}
}
-// Rollback restores the complete prior configuration and keeps the new
-// runner state under a timestamped name.
-func TestCutoverRollbackRestoresEverything(t *testing.T) {
+// Before its deploy, rollback restores the complete prior configuration.
+// After it, rollback is refused: on CARLOS the activator passes the app an
+// absolute --db, so the deployed version migrated the old database in
+// place and the previous version cannot read it.
+func TestCutoverRollbackRestoresEverythingBeforeTheDeploy(t *testing.T) {
r := newCutoverRig(t)
- if out, err := r.run(cutoverVersion, "--execute"); err != nil {
- t.Fatalf("cutover: %v\n%s", err, out)
+ r.write(filepath.Join(r.root, "deployfail"), "", 0600)
+ if out, err := r.run(cutoverVersion, "--execute"); err == nil {
+ t.Fatalf("cutover went on after a failed deploy:\n%s", out)
}
out, err := r.run("rollback", "--execute")
if err != nil {
@@ -146,14 +149,10 @@ func TestCutoverRollbackRestoresEverything(t *testing.T) {
t.Fatal("runner configuration not restored exactly")
}
if r.read(filepath.Join(r.runner, "state", "credentials.json")) != "old" {
- t.Fatal("old runner state not restored")
- }
- moved, _ := filepath.Glob(filepath.Join(r.runner, "state.thin-rolled-back-*"))
- if len(moved) != 1 || r.read(filepath.Join(moved[0], "credentials.json")) != "new\n" {
- t.Fatalf("new state not kept aside: %v", moved)
+ t.Fatal("old runner state not kept")
}
calls := r.read(r.log)
- for _, want := range []string{"env unset --app equipo --account oficina --console https://console.carloku.com EQUIPO_DATABASE", "env set --app equipo --account oficina --console https://console.carloku.com --no-prompt EQUIPO_ALWAYS_ON=1", "promote --app equipo --account oficina --console https://console.carloku.com prev999 edge"} {
+ for _, want := range []string{"env unset --app equipo --account oficina --console https://console.carloku.com EQUIPO_DATABASE", "env set --app equipo --account oficina --console https://console.carloku.com --no-prompt EQUIPO_ALWAYS_ON=1", "promote --app equipo --account oficina --console https://console.carloku.com prev999 edge", "systemctl --user start"} {
if !strings.Contains(calls, want) {
t.Fatalf("missing call %q:\n%s", want, calls)
}
@@ -166,6 +165,21 @@ func TestCutoverRollbackRestoresEverything(t *testing.T) {
}
}
+func TestCutoverRollbackRefusedAfterTheDeploy(t *testing.T) {
+ r := newCutoverRig(t)
+ if out, err := r.run(cutoverVersion, "--execute"); err != nil {
+ t.Fatalf("cutover: %v\n%s", err, out)
+ }
+ before := r.read(r.log)
+ out, err := r.run("rollback", "--execute")
+ if err == nil || !strings.Contains(out, "prev999 cannot read it") || !strings.Contains(out, "cutover-finish-thin.sh") {
+ t.Fatalf("rollback to a version that cannot read the migrated database: %v\n%s", err, out)
+ }
+ if r.read(r.log) != before {
+ t.Fatalf("a refused rollback changed something:\n%s", strings.TrimPrefix(r.read(r.log), before))
+ }
+}
+
// A snapshot read that fails stops the cutover before any change, so a
// later rollback never unsets a value it could not read.
func TestCutoverStopsWhenASnapshotReadFails(t *testing.T) {
diff --git a/internal/release/upgrade_test.go b/internal/release/upgrade_test.go
index 6f11c1b4..6cbea943 100644
--- a/internal/release/upgrade_test.go
+++ b/internal/release/upgrade_test.go
@@ -66,9 +66,9 @@ func newUpgradeRig(t *testing.T) *upgradeRig {
esac
`, 0700)
r.write(filepath.Join(bin, "carlos"), "#!/bin/sh\n"+log+`case "$1 $2" in
-"env list") printf 'using console\nKEY VALUE\nEQUIPO_DATABASE equipo-v1.db\n' ;;
-"db pull") for a; do case $prev in --out) python3 -c "import sqlite3,sys; c=sqlite3.connect(sys.argv[1]); [c.execute('create table '+t+'(x)') for t in ('teams','chat_tasks','chat_steps','chat_turns','runners')]; c.commit()" "$a" ;; esac; prev=$a; done ;;
-"db query") case "$*" in *runner_sessions*) printf 'n\n1\n' ;; *) printf 'x\n%s\n' "$(cat `+filepath.Join(root, "inflight")+`)" ;; esac ;;
+"db "*) [ -e `+filepath.Join(root, "replicabroken")+` ] && { echo "the copy failed its integrity check" >&2; exit 1; }
+ case "$2 $*" in pull*) for a; do case $prev in --out) python3 -c "import sqlite3,sys; c=sqlite3.connect(sys.argv[1]); [c.execute('create table '+t+'(x)') for t in ('teams','chat_tasks','chat_steps','chat_turns','runners')]; c.commit()" "$a" ;; esac; prev=$a; done ;;
+ *integrity_check*) printf 'integrity_check\nok\n' ;; *runner_sessions*) printf 'n\n1\n' ;; *) printf 'x\n%s\n' "$(cat `+filepath.Join(root, "inflight")+`)" ;; esac ;;
deploy*) for a; do case $prev in --version) echo "$a" > `+filepath.Join(root, "served")+` ;; esac; prev=$a; done ;;
promote*) shift; for a; do last2=$last; last=$a; done; echo "$last2" > `+filepath.Join(root, "served")+` ;;
esac
@@ -164,7 +164,7 @@ func TestUpgradeSwitchesRunnerThenInstanceOnTheSameDatabase(t *testing.T) {
t.Fatal("runner enrolment changed")
}
st := r.state()
- for _, want := range []string{"prev_version=" + upgradeFrom, "database=equipo-v1.db", "backup_sha256=", "done_verify=1"} {
+ for _, want := range []string{"prev_version=" + upgradeFrom, "backup_sha256=", "done_verify=1"} {
if !strings.Contains(st, want) {
t.Fatalf("state lacks %q:\n%s", want, st)
}
@@ -191,6 +191,7 @@ func TestUpgradeRefusesBeforeChangingAnything(t *testing.T) {
"runner on the old origin": func(r *upgradeRig) {
r.write(filepath.Join(r.runner, "service.env"), strings.Replace(r.serviceEnv, "equipo.oficina.works", "equipo.bds.oncarlos.com", 1), 0600)
},
+ "replica unreadable": func(r *upgradeRig) { r.write(filepath.Join(r.root, "replicabroken"), "", 0600) },
"another upgrade unfinished": func(r *upgradeRig) {
r.write(filepath.Join(r.home, ".local/share/equipo-cutover/upgrade.state"), "version=ddd4444\nprev_version="+upgradeFrom+"\ndone_preflight=1\n", 0600)
},
@@ -215,8 +216,15 @@ func TestUpgradeRefusesBeforeChangingAnything(t *testing.T) {
}
})
}
- // The plan still prints, and says what it would refuse.
+ // An unreadable replica is named, with the check to run, and no way around it.
r := newUpgradeRig(t)
+ r.write(filepath.Join(r.root, "replicabroken"), "", 0600)
+ out, _ := r.run(upgradeTo, "--execute")
+ if !strings.Contains(out, "replica of equipo's database cannot be read") || !strings.Contains(out, "--sql 'PRAGMA integrity_check' (it must print ok)") {
+ t.Fatalf("unclear refusal for an unreadable replica:\n%s", out)
+ }
+ // The plan still prints, and says what it would refuse.
+ r = newUpgradeRig(t)
r.write(filepath.Join(r.home, ".local/share/equipo-cutover/cutover.state"), "version="+upgradeFrom+"\ndone_deploy=1\n", 0600)
if out, err := r.run(upgradeTo); err != nil || !strings.Contains(out, "would refuse: the cutover has not finished") || !strings.Contains(out, "== 5 verify") {
t.Fatalf("plan: %v\n%s", err, out)
diff --git a/scripts/cutover-finish-thin.sh b/scripts/cutover-finish-thin.sh
new file mode 100644
index 00000000..5636097d
--- /dev/null
+++ b/scripts/cutover-finish-thin.sh
@@ -0,0 +1,215 @@
+#!/usr/bin/env bash
+# Finish the thin v1 production cutover on the database production kept.
+#
+# scripts/cutover-finish-thin.sh # print the plan only (default)
+# scripts/cutover-finish-thin.sh --execute # a person runs it, step by step
+# scripts/cutover-finish-thin.sh rollback [--execute] # the runner as the cutover left it
+#
+# The 2026-11-19 cutover (scripts/cutover-thin.sh) stopped after step 5,
+# and its fresh database never happened: on CARLOS the activator passes the
+# app an absolute --db, so EQUIPO_DATABASE is ignored, and the new version
+# migrated the old database in place. That data is kept. This finishes
+# cutover steps 6 onward for it without the platform replica: every check
+# reads the instance itself. Agents must not run --execute. Steps done are
+# recorded in cutover.state (done_identity ... done_verify), so a finished
+# run is a finished cutover to scripts/upgrade-thin.sh. It is resumable.
+#
+# 6 identity /install.sh, which the instance builds from its own database
+# (its team), names the recorded old instance id, the version
+# cutover.state records and the public origin, on both routes
+# 7 config EQUIPO_DATABASE unset, so the configuration says what runs;
+# then the instance serves that version and the same id again
+# 8 runner the staged runner of that version beside the old one (bytes
+# checked against releases/staged), public origin, same
+# instance id; the old runner's state moved aside
+# 9 enrol verify-installed, enrol (the owner approves the link), start
+# 10 verify version and identity again; the unit runs the staged runner;
+# its log shows the instance's welcome to that process
+#
+# Rollback puts the runner's state, service.env and unit back as the
+# cutover left them and leaves the runner stopped. It never offers the
+# version before the cutover: that version cannot read the migrated schema.
+set -euo pipefail
+
+APP=equipo
+ACCOUNT=oficina
+CONSOLE=https://console.carloku.com
+HOST=equipo.bds.oncarlos.com
+ORIGIN=https://$HOST
+PUBLIC_ORIGIN=${EQUIPO_PUBLIC_ORIGIN:-https://equipo.oficina.works}
+UNIT=equipo-runner.service
+RUNNER_ROOT=$HOME/.local/share/equipo-runner
+BACKUPS=$HOME/.local/share/equipo-cutover
+STATE=$BACKUPS/cutover.state
+REPO=$(cd "$(dirname "$0")/.." && pwd)
+RELEASES=${EQUIPO_RELEASE_REPO:-$REPO}/releases
+PROC=${CUTOVER_PROC:-/proc}
+carlos_app=(--app "$APP" --account "$ACCOUNT" --console "$CONSOLE")
+
+mode=finish
+execute=0
+case "${1:-} ${2:-}" in
+" ") ;;
+"--execute ") execute=1 ;;
+"rollback ") mode=rollback ;;
+"rollback --execute") mode=rollback execute=1 ;;
+*) sed -n '2,31p' "$0"; exit 2 ;;
+esac
+
+die() { echo "refused: $*" >&2; exit 1; }
+# A refusal read from the records stops --execute; the plan notes it and goes on.
+refuse() {
+ if ((execute)); then die "$*"; fi
+ echo " ! would refuse: $*"
+}
+step() {
+ printf '\n== %s\n' "$1"
+ if ((execute)) && [[ ${CUTOVER_YES:-} != 1 ]]; then
+ read -r -p "Run this step? Type yes: " answer
+ [[ $answer == yes ]] || { echo "stopped before: $1"; exit 1; }
+ fi
+}
+run() {
+ printf ' $ %s\n' "$*"
+ if ((execute)); then "$@"; fi
+}
+# Recorded facts and finished steps, one KEY=value per line; the last wins.
+get() { [[ -f $STATE ]] && sed -n "s/^$1=//p" "$STATE" | tail -1 || true; }
+put() { ((execute)) && printf '%s=%s\n' "$1" "$2" >>"$STATE" || true; }
+done_step() { [[ $(get "done_$1") == 1 ]]; }
+finish() { put "done_$1" 1; }
+env_value() { awk -v k="$1" '$1 == k { print $2; found = 1 } END { if (!found) print "-unset-" }'; }
+wait_serving() { run bash -c "for i in \$(seq 60); do [ \"\$(curl -fsS $ORIGIN/api/version)\" = $1 ] && exit 0; sleep 2; done; exit 1"; }
+
+version=$(get version)
+old_id=$(get old_instance_id)
+stamp=$(get stamp)
+snap=$BACKUPS/finish-$stamp
+
+# The instance's own word, not the replica's: /install.sh ends with the
+# origin, version and instance id (its team's id, read from the database
+# it serves), on the platform route and on the public address.
+identity() {
+ local origin said
+ for origin in "$ORIGIN" "$PUBLIC_ORIGIN"; do
+ said=$(curl -fsS "$origin/install.sh") || die "could not read $origin/install.sh"
+ [[ $said == *"sh -s -- '$PUBLIC_ORIGIN' '$version' '$old_id'" ]] ||
+ die "$origin/install.sh does not name $PUBLIC_ORIGIN, $version and instance $old_id (it says: ${said##*sh -s -- })"
+ done
+}
+
+# A hash from the green staging record of $version (empty if there is none).
+staged_sha() { python3 -c 'import json,sys; d=json.load(open(sys.argv[1])); print(d["sha256"][sys.argv[2]] if d.get("staging") == "PASS" else "")' "$RELEASES/staged/$version.json" "$1" 2>/dev/null || true; }
+
+if [[ $mode == rollback ]]; then
+ [[ $(get kept_database) == 1 ]] || die "no finish of the cutover on the kept database is recorded ($STATE)"
+ [[ -f $snap/service.env && -f $snap/equipo-runner.service ]] || die "the runner files from before the finish were not recorded"
+ step "rollback 1 stop the runner"
+ run systemctl --user stop "$UNIT"
+ step "rollback 2 the runner's state, service.env and unit as the cutover left them"
+ if [[ -e $RUNNER_ROOT/state.pre-thin-$stamp ]]; then
+ if [[ -e $RUNNER_ROOT/state ]]; then
+ run mv "$RUNNER_ROOT/state" "$RUNNER_ROOT/state.finish-rolled-back-$(date -u +%Y%m%dT%H%M%SZ)"
+ fi
+ run mv "$RUNNER_ROOT/state.pre-thin-$stamp" "$RUNNER_ROOT/state"
+ fi
+ run cp -p "$snap/service.env" "$RUNNER_ROOT/service.env"
+ run cp -p "$snap/equipo-runner.service" "$RUNNER_ROOT/equipo-runner.service"
+ run systemctl --user daemon-reload
+ for s in identity unset runner enrol verify; do put "done_$s" 0; done
+ put kept_database 0
+ echo " The runner stays stopped and the instance stays on $version: nothing is promoted."
+ echo " $(get prev_version) is not offered: $version migrated the kept database in place, and"
+ echo " $(get prev_version) cannot read the migrated schema. EQUIPO_DATABASE is not set again: it was never used."
+ echo " To finish again: scripts/cutover-finish-thin.sh --execute"
+ ((execute)) || echo $'\nPlan only. A person runs it with --execute.'
+ exit 0
+fi
+
+[[ -f $STATE ]] || refuse "no cutover was recorded ($STATE)"
+[[ $(get rolled_back) != 1 ]] || refuse "the cutover was rolled back"
+done_step deploy || refuse "the cutover has not deployed its version yet; use scripts/cutover-thin.sh"
+if done_step verify; then die "the cutover to $version is complete"; fi
+[[ $old_id =~ ^[A-Z0-9]{26}$ ]] || refuse "cutover.state records no old instance id"
+runner_release=$RELEASES/equipo-runner-linux-amd64-$version
+echo "Finish the cutover to ${version:--unknown-} on the kept database, instance ${old_id:--unknown-}."
+
+step "6 identity: the instance names the kept database's id (no replica)"
+run curl -fsS "$ORIGIN/api/version"
+echo " $ORIGIN/install.sh and $PUBLIC_ORIGIN/install.sh must end: sh -s -- '$PUBLIC_ORIGIN' '$version' '$old_id'"
+echo " the staged runner and tool proxy must have the hashes in $RELEASES/staged/$version.json"
+if ((execute)) && ! done_step identity; then
+ [[ $(curl -fsS "$ORIGIN/api/version") == "$version" ]] || die "production does not serve $version"
+ identity
+ [[ $(sha256sum "$runner_release/equipo-runner" | cut -d ' ' -f 1) == "$(staged_sha runner)" ]] || die "equipo-runner is not the one staging passed for $version"
+ [[ $(sha256sum "$runner_release/equipo-tool-proxy" | cut -d ' ' -f 1) == "$(staged_sha tool_proxy)" ]] || die "equipo-tool-proxy is not the one staging passed for $version"
+ put new_instance_id "$old_id"
+ put kept_database 1
+ finish identity
+fi
+
+step "7 config: unset EQUIPO_DATABASE (the activator's --db wins, so it was never used)"
+if ! done_step unset; then
+ if ((execute)); then
+ listing=$(carlos env list "${carlos_app[@]}") || die "could not read the instance configuration"
+ grep -q '^KEY' <<<"$listing" || die "unexpected configuration listing"
+ [[ $(env_value EQUIPO_DATABASE <<<"$listing") == -unset- ]] || run carlos env unset "${carlos_app[@]}" EQUIPO_DATABASE
+ else
+ run carlos env unset "${carlos_app[@]}" EQUIPO_DATABASE
+ fi
+ echo " the instance may restart for this; then it serves $version and names $old_id again"
+ wait_serving "$version"
+ if ((execute)); then identity; fi
+ finish unset
+fi
+
+step "8 install the staged runner beside the old one"
+new=$RUNNER_ROOT/releases/$version
+if ! done_step runner; then
+ if ((execute)); then
+ [[ -e $RUNNER_ROOT/state.pre-thin-$stamp ]] && die "state.pre-thin-$stamp already exists"
+ install -d -m 0700 "$snap"
+ cp -p "$RUNNER_ROOT/service.env" "$RUNNER_ROOT/equipo-runner.service" "$snap/"
+ fi
+ run install -d -m 0700 "$new"
+ run install -m 0700 "$runner_release/equipo-runner" "$runner_release/equipo-tool-proxy" "$new/"
+ run sed -i -e "s|^EQUIPO_TOOL_PROXY_PATH=.*|EQUIPO_TOOL_PROXY_PATH=\"$new/equipo-tool-proxy\"|" -e "s|^EQUIPO_INSTANCE_ID=.*|EQUIPO_INSTANCE_ID=\"$old_id\"|" -e "s|^EQUIPO_ORIGIN=.*|EQUIPO_ORIGIN=\"$PUBLIC_ORIGIN\"|" "$RUNNER_ROOT/service.env"
+ run sed -i -e "s|^ExecStart=.*|ExecStart=$new/equipo-runner run|" -e '/^RestartPreventExitStatus=/d' -e '/^RestartSec=/a RestartPreventExitStatus=3' "$RUNNER_ROOT/equipo-runner.service"
+ # The old state was written by the old runner for the old origin; kept for rollback.
+ run mv "$RUNNER_ROOT/state" "$RUNNER_ROOT/state.pre-thin-$stamp"
+ run install -d -m 0700 "$RUNNER_ROOT/state"
+ run systemctl --user daemon-reload
+ finish runner
+fi
+
+step "9 enrol the runner: open the printed link as the owner and approve it"
+if ! done_step enrol; then
+ run bash -c "set -a; . '$RUNNER_ROOT/service.env'; set +a; '$new/equipo-runner' verify-installed"
+ run bash -c "set -a; . '$RUNNER_ROOT/service.env'; set +a; '$new/equipo-runner' enrol"
+ run systemctl --user start "$UNIT"
+ finish enrol
+fi
+
+step "10 verify (no replica)"
+run curl -fsS "$ORIGIN/api/version"
+run systemctl --user is-active "$UNIT"
+echo " install.sh names $old_id again; sha256 of $PROC/<MainPID>/exe is the staged runner's"
+echo " $ journalctl --user _PID=<MainPID> -o cat --no-pager # a msg=welcome line: the instance took the connection"
+if ((execute)) && ! done_step verify; then
+ [[ $(curl -fsS "$ORIGIN/api/version") == "$version" ]] || die "production does not serve $version"
+ identity
+ pid=$(systemctl --user show -p MainPID --value "$UNIT")
+ [[ $pid =~ ^[1-9][0-9]*$ ]] || die "$UNIT is not running"
+ [[ $(sha256sum "$PROC/$pid/exe" | cut -d ' ' -f 1) == "$(staged_sha runner)" ]] || die "the running runner is not the staged $version runner"
+ welcomed=0
+ for _ in $(seq "${CUTOVER_TRIES:-30}"); do
+ if journalctl --user _PID="$pid" -o cat --no-pager | grep -q 'msg=welcome'; then welcomed=1; break; fi
+ sleep "${CUTOVER_WAIT:-5}"
+ done
+ ((welcomed)) || die "the runner has no welcome from the instance; see journalctl --user -u $UNIT"
+ finish verify
+fi
+echo " Then, as the owner: sign in at $PUBLIC_ORIGIN/conversation, check the offline line"
+echo " is gone, say hello and see the reply stream. If Machines lists the old runner, remove it."
+echo " To undo the runner change: scripts/cutover-finish-thin.sh rollback --execute"
+((execute)) || echo $'\nPlan only. A person runs it with --execute.'
diff --git a/scripts/cutover-thin.sh b/scripts/cutover-thin.sh
index dba4bc63..23328ac9 100755
--- a/scripts/cutover-thin.sh
+++ b/scripts/cutover-thin.sh
@@ -91,6 +91,11 @@ overlaps() { case "$1/" in "$2"/*) return 0 ;; esac; case "$2/" in "$1"/*) retur
if [[ $mode == rollback ]]; then
[[ -f $STATE ]] || die "no cutover was recorded ($STATE)"
[[ $(get rolled_back) != 1 ]] || die "already rolled back"
+ # On CARLOS the activator passes the app an absolute --db, so EQUIPO_DATABASE
+ # chose no fresh file: the deployed version migrated the old database in place.
+ if done_step deploy; then
+ die "$(get version) migrated the production database in place (EQUIPO_DATABASE is ignored on CARLOS), and $(get prev_version) cannot read it. Finish on the kept database: scripts/cutover-finish-thin.sh"
+ fi
stamp=$(get stamp)
[[ -n $stamp && -f $SNAP/service.env && -f $SNAP/equipo-runner.service ]] || die "the prior configuration was not recorded"
step "rollback 1 stop the runner"
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json
index 6be25b92..d6e149e3 100644
--- a/scripts/runner-reference-allowlist.json
+++ b/scripts/runner-reference-allowlist.json
@@ -16070,5 +16070,180 @@
"match": "equipo-runner",
"count": 1,
"reason": "Test of the production upgrade script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "scripts/cutover-finish-thin.sh",
+ "line_sha256": "cc9a4f1d39cf13a08b04ddbe4607bfffc0d907fa96a07ded61506fc199e3a83b",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Thin v1 production cutover finish on the kept database (not run by agents): installs and enrols the staged runner, switches its unit and rolls it back."
+ },
+ {
+ "path": "scripts/cutover-finish-thin.sh",
+ "line_sha256": "5387904268932982e0c79cca82a7935df90015ba54ea545f95a1943589bc13d1",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Thin v1 production cutover finish on the kept database (not run by agents): installs and enrols the staged runner, switches its unit and rolls it back."
+ },
+ {
+ "path": "scripts/cutover-finish-thin.sh",
+ "line_sha256": "95f7dd5e6d8dccf9adce4ee99a15c5c02ab43c11a29efaa3016b30f745a079bb",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Thin v1 production cutover finish on the kept database (not run by agents): installs and enrols the staged runner, switches its unit and rolls it back."
+ },
+ {
+ "path": "scripts/cutover-finish-thin.sh",
+ "line_sha256": "726e45e1b3fee0327a9cae24c19ae5161a0a7431aabbc9b5f81943f2174c65ea",
+ "match": "equipo-runner",
+ "count": 2,
+ "reason": "Thin v1 production cutover finish on the kept database (not run by agents): installs and enrols the staged runner, switches its unit and rolls it back."
+ },
+ {
+ "path": "scripts/cutover-finish-thin.sh",
+ "line_sha256": "f3516baa7ba6cfe082af6c44eacc6a69cd683a370dd9f3d0a0e171396d337b9a",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Thin v1 production cutover finish on the kept database (not run by agents): installs and enrols the staged runner, switches its unit and rolls it back."
+ },
+ {
+ "path": "scripts/cutover-finish-thin.sh",
+ "line_sha256": "67b3316b103986ea19bd7a0c7427e4f3e75760d72711b2d623439f7554863b6d",
+ "match": "equipo-runner",
+ "count": 2,
+ "reason": "Thin v1 production cutover finish on the kept database (not run by agents): installs and enrols the staged runner, switches its unit and rolls it back."
+ },
+ {
+ "path": "scripts/cutover-finish-thin.sh",
+ "line_sha256": "8849d248c7527e322c2d8fe7300fda47e2c659e887e771a057ec80dabb8b3862",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Thin v1 production cutover finish on the kept database (not run by agents): installs and enrols the staged runner, switches its unit and rolls it back."
+ },
+ {
+ "path": "scripts/cutover-finish-thin.sh",
+ "line_sha256": "ac3606fcb3f775c9331866cb07186b1d07dba5956b6536db392b27cc7330e1af",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Thin v1 production cutover finish on the kept database (not run by agents): installs and enrols the staged runner, switches its unit and rolls it back."
+ },
+ {
+ "path": "scripts/cutover-finish-thin.sh",
+ "line_sha256": "7d5294cc821bb98fdf681b63042326ef90ccb5deefee5bc9eb497052023d1335",
+ "match": "equipo-runner",
+ "count": 2,
+ "reason": "Thin v1 production cutover finish on the kept database (not run by agents): installs and enrols the staged runner, switches its unit and rolls it back."
+ },
+ {
+ "path": "scripts/cutover-finish-thin.sh",
+ "line_sha256": "2e931fedc6dc8ea790e88e2017240063cb4fd702ccfa53edc0aa073566a4d59e",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Thin v1 production cutover finish on the kept database (not run by agents): installs and enrols the staged runner, switches its unit and rolls it back."
+ },
+ {
+ "path": "scripts/cutover-finish-thin.sh",
+ "line_sha256": "bdf6a5c5cd9cb8574f59c99e799dd44556619a7f8f85606ff41f6a5c11a4f834",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Thin v1 production cutover finish on the kept database (not run by agents): installs and enrols the staged runner, switches its unit and rolls it back."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "b315acb3fe1248523bd1cba13f0e9419a3f1fed852d52a6e88bb2665c1fc50bb",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "60a3d9430038ca22f024c3a491a0021eb689ac3e1722b619a76cfe3470f8427d",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "707b5aaedf104217e953b4083e18b6627436993960a9bad37df7c799c70aa4c2",
+ "match": "equipo-runner",
+ "count": 2,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "72fb0dd00b8df6bb5ccba76d7a2fb0b41077bf7d2b655a70e6bf3a1fdf204283",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "5e560fc45e4c710658a74b3b2a6f2927aff817cd7671e3160efc271be4d89f57",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "c9c06860121022396f126390b0ca200fa1b807969febc08a6ddb5abca248e0d9",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "d27ef4c746c4edb2660ab80f5695ffc19368288b948105bccb0bc979f0fff143",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "b0bf3c7b4a5c9687d50d5ea70d17fd21ac211a2adf1e7a689b1f25d78f72bb55",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "8d36abb113f2fd8041b041b07c79a670d832081f95e8d7412bfd232471ff8829",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "eca17b6c8ebf4a8082f6bbafa25957672a57bb3b00a99d2d7732f7ba8d0e60dd",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "6a307e61a9c219df3411456ec34eb42cb3151dfab3850e0b7aafc8af60602bdd",
+ "match": "equipo-runner",
+ "count": 2,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "c4fb003c9d0a05da6cb58134cd2c22f532af4ecbbfb0effd2fe510a26db26431",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "9e2410bd1041e36dec92ebadf32046d0546aae50f9c74ea2bc90765eb69ff636",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
+ },
+ {
+ "path": "internal/release/cutover_finish_test.go",
+ "line_sha256": "38f1162b40561ebbc3b2755a57d881df993c35d5da1e7465fb2eb50f9a986511",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Test of the cutover finish script: a stub runner release, runner unit and runner paths under a temporary HOME."
}
]
diff --git a/scripts/upgrade-thin.sh b/scripts/upgrade-thin.sh
index 1da9d0a6..c62d725e 100644
--- a/scripts/upgrade-thin.sh
+++ b/scripts/upgrade-thin.sh
@@ -19,11 +19,11 @@
# 1 preflight staged-check, artifacts, CARLOS sign-in; the cutover (or the
# last upgrade) finished and production serves its version,
# which <version> descends from; the runner unit and roots are
-# production's, not staging's; nothing in flight; records the
-# prior state (served version, EQUIPO_DATABASE, runner
-# service.env and unit)
+# production's, not staging's; the replica reads clean (PRAGMA
+# integrity_check) and nothing is in flight; records the prior
+# state (served version, runner service.env and unit)
# 2 backup carlos db pull, integrity-checked, counted, hashed, read-only.
-# The upgrade keeps EQUIPO_DATABASE: never a fresh database.
+# The upgrade changes no configuration: the same database.
# 3 runner the staged runner beside the current one, checked by
# verify-installed; nothing in flight, then the unit switches
# and restarts, keeping its state and enrolment
@@ -92,7 +92,6 @@ put() { ((execute)) && printf '%s=%s\n' "$1" "$2" >>"$STATE" || true; }
history=0
done_step() { ((!history)) && [[ $(get "done_$1") == 1 ]]; }
finish() { put "done_$1" 1; }
-env_value() { awk -v k="$1" '$1 == k { print $2; found = 1 } END { if (!found) print "-unset-" }'; }
file_value() { sed -n "s/^$1=\"\{0,1\}\([^\"]*\)\"\{0,1\}$/\1/p" "$2"; }
overlaps() { case "$1/" in "$2"/*) return 0 ;; esac; case "$2/" in "$1"/*) return 0 ;; esac; return 1; }
wait_serving() { run bash -c "for i in \$(seq 60); do [ \"\$(curl -fsS $ORIGIN/api/version)\" = $1 ] && exit 0; sleep 2; done; exit 1"; }
@@ -100,17 +99,25 @@ wait_serving() { run bash -c "for i in \$(seq 60); do [ \"\$(curl -fsS $ORIGIN/a
# running step, and a merge needs the runner it started with.
idle() {
local out
- out=$(carlos db query "${carlos_app[@]}" --sql "$IN_FLIGHT" | tail -1) || die "could not read the steps in flight"
- [[ $out =~ ^[0-9]+/[0-9]+$ ]] || die "could not read the steps in flight"
+ out=$(carlos db query "${carlos_app[@]}" --sql "$IN_FLIGHT" | tail -1) || die "could not read the steps in flight. $REPLICA"
+ [[ $out =~ ^[0-9]+/[0-9]+$ ]] || die "could not read the steps in flight. $REPLICA"
[[ $out == 0/0 ]] || die "in flight (steps/merges): $out; run again when nothing runs"
}
+# The in-flight check and the backup both read the platform's replica of
+# the database (carlos db restores a copy); an unreadable one stops here.
+REPLICA="Check the platform's replica with: carlos db query ${carlos_app[*]} --sql 'PRAGMA integrity_check' (it must print ok)"
+replica() {
+ local said
+ said=$(carlos db query "${carlos_app[@]}" --sql 'PRAGMA integrity_check' 2>/dev/null | tail -1) || said=
+ [[ $said == ok ]] || die "the platform's replica of $APP's database cannot be read, and the in-flight check and the backup both need it. $REPLICA"
+}
database_note() {
echo " The database is not rolled back. If $(get version) started, its migrations may have run,"
echo " and $(get prev_version) now runs on the migrated database. The copy from before the upgrade:"
echo " $(get backup) (sha256 $(get backup_sha256))"
echo " No carlos verb writes a database back to an instance (carlos db only reads a copy)."
- echo " To restore it, a platform operator replaces $(get database) of $HOST with that file,"
- echo " with the instance stopped. Check it first:"
+ echo " To restore it, a platform operator replaces the database of $HOST (the file the activator"
+ echo " passes as --db) with that file, with the instance stopped. Check it first:"
echo " python3 -c \"import sqlite3; print(sqlite3.connect('file:$(get backup)?mode=ro', uri=True).execute('pragma integrity_check').fetchone()[0])\""
}
@@ -169,7 +176,9 @@ run test -f "$RUNNER_ROOT/service.env"
run carlos apps list --account "$ACCOUNT" --console "$CONSOLE"
echo " production serves ${base:--unknown-} ($ORIGIN/api/version), and $version descends from it (git merge-base)"
echo " $UNIT is $RUNNER_ROOT/equipo-runner.service, enrolled, talking to $PUBLIC_ORIGIN, roots not shared with $STAGING_ROOT"
-echo " EQUIPO_DATABASE is set and recorded (carlos env list); nothing in flight:"
+echo " the replica reads clean (the in-flight check and the backup need it):"
+printf ' $ carlos db query %s --sql "PRAGMA integrity_check" # must be ok\n' "${carlos_app[*]}"
+echo " nothing in flight:"
printf ' $ carlos db query %s --sql "%s" # must be 0/0\n' "${carlos_app[*]}" "$IN_FLIGHT"
if ((execute)) && ! done_step preflight; then
served=$(curl -fsS "$ORIGIN/api/version") || die "could not read the served version"
@@ -190,10 +199,7 @@ if ((execute)) && ! done_step preflight; then
fi
done
fi
- listing=$(carlos env list "${carlos_app[@]}") || die "could not read the instance configuration"
- grep -q '^KEY' <<<"$listing" || die "unexpected configuration listing"
- database=$(env_value EQUIPO_DATABASE <<<"$listing")
- [[ $database =~ ^[A-Za-z0-9._-]{1,128}$ && $database != -unset- ]] || die "EQUIPO_DATABASE is not set"
+ replica
idle
install -d -m 0700 "$BACKUPS"
if ((history)); then mv "$STATE" "$BACKUPS/upgrade-$(get version)-$(get stamp).state"; history=0; fi
@@ -203,15 +209,15 @@ if ((execute)) && ! done_step preflight; then
put version "$version"
put stamp "$stamp"
put prev_version "$served"
- put database "$database"
finish preflight
fi
stamp=PLAN
((history)) || stamp=$(get stamp)
stamp=${stamp:-PLAN}
-step "2 backup: the current database (the upgrade keeps EQUIPO_DATABASE)"
+step "2 backup: the current database (the upgrade keeps it: no configuration changes)"
if ! done_step backup; then
+ if ((execute)); then replica; fi
backup=$BACKUPS/equipo-upgrade-$stamp.db
run carlos db pull "${carlos_app[@]}" --out "$backup"
run python3 -c "import sqlite3,sys; c=sqlite3.connect('file:$backup?mode=ro', uri=True); r=c.execute('pragma integrity_check').fetchone()[0]; print('integrity', r); [print(t, c.execute('select count(*) from '+t).fetchone()[0]) for t in ('teams','chat_tasks','chat_steps','chat_turns','runners')]; sys.exit(r!='ok')"