oficina / equipo Public

installer: refuse unreadable state, one install at a time, Ctrl-C safe

Astra round 1 on mac-install-safe (9 findings, all fixed):

- An enrolment state that cannot be read (malformed or unreadable
  credentials) is refused before anything is stopped or written
  (runner.enrol.failed with its detail), on Mac and Linux.
- The other Equipo's address is printed only when it is a plain https
  origin (release.InstallOrigin); anything else, with a password or a
  sign-in link in it, says runner.enrol.identity instead.
- One install at a time: state/install.lock (its own file, apart from
  the runner's lock) is held from the precheck until enrolled or put
  back; a second install says runner.install.busy and changes nothing.
- Enrol writes the role before the credential, so the credential is
  the last write: a failed enrolment never leaves a new credential
  beside the configuration the installer puts back.
- Linux: the backup is made on a new root too (the lock makes it), so
  a first install that fails removes the unit and runner.env it wrote;
  a unit or runner.env not as the installer wrote it
  (runnersetup.InstallerOwns, the writeOwned check) is refused before
  being moved aside; both prompts end on Ctrl-C and put back.
- Mac: run from the installed runner, the new copy comes from where it
  was moved aside; the bootout is not cut short by Ctrl-C and a bootout
  that errs with the agent gone counts as taken down (given back on
  failure); a failed give-back says runner.mac.not_restored.

Tests first (red before the fix): TestEnrolCommitsTheCredentialLast,
TestInstallMacRefusesAnotherEquipo (credential unreadable, origin not
an address), TestInstallLinuxRefusesAnotherEquipo (credential
unreadable), TestInstallLinuxFirstFailureLeavesNoConfig,
TestInstallLinuxKeepsAnEditedFile, TestInstallLinuxCtrlCAtAPrompt,
TestInstallLinuxOneAtATime, TestInstallMacOneAtATime,
TestInstallMacFromTheInstalledRunner,
TestInstallMacStopThatTookTheAgentDown.

Mutation checks (each broke one guard, ran the test, restored):
N1 inspection error proceeds: ...RefusesAnotherEquipo/credential FAIL
N2 any origin printed: TestInstallMacRefusesAnotherEquipo FAIL
N3 credential before role: TestEnrolCommitsTheCredentialLast FAIL
N4 Linux lock elsewhere: TestInstallLinuxOneAtATime FAIL
N5 Mac lock elsewhere: TestInstallMacOneAtATime FAIL
N6 no ownership check: TestInstallLinuxKeepsAnEditedFile FAIL
N7 absent paths not noted: both FirstFailureLeavesNoConfig FAIL
N8 prompt ignores ctx: TestInstallLinuxCtrlCAtAPrompt FAIL
N9 copy from h.self: TestInstallMacFromTheInstalledRunner FAIL
N10 bootout error = not taken down: ...StopThatTookTheAgentDown FAIL
N11 give-back error ignored: ...StopThatTookTheAgentDown FAIL

Local: go test -race ./cmd/equipo-runner ok; ./internal/runner/setup
ok; ./internal/runner -run Enrol|Budget ok; darwin/arm64 vet ok;
staticcheck clean; budget size, fmt-check, lanes-check,
runner-dead-references ok. Budget: internal/runner 9972/9323.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev d55c2fb14e1ff54528836ae83cf84c41aa131875 parent 8187acb
13 files changed, +558 −86
  • .rastrillo/budgets.txt +1 −1
  • cmd/equipo-runner/enrol_report.go +16 −6
  • cmd/equipo-runner/install.go +34 −23
  • cmd/equipo-runner/install_backup.go +91 −0
  • cmd/equipo-runner/install_linux_safe_test.go +135 −11
  • cmd/equipo-runner/install_mac.go +36 −4
  • cmd/equipo-runner/install_mac_test.go +13 −2
  • cmd/equipo-runner/install_safe_test.go +97 −4
  • cmd/equipo-runner/onboarding_test.go +1 −2
  • internal/runner/enrol.go +8 −5
  • internal/runner/enrol_worker_test.go +40 −0
  • internal/runner/setup/install.go +37 −14
  • scripts/runner-reference-allowlist.json +49 −14

CI failed — 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/mac-install-safe: Type  Size Avail | ext4   96G   84G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   84G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 2.0s
ci-box: codex: fetched and verified in 3.5s
ci-box: codex-code-mode-host: fetched and verified in 1.2s
ci-box: libwrap: fetched and verified in 0.2s
ci-box: socat: fetched and verified in 0.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.9s
ci-box: pi: installed and verified in 7.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 8.7s
ci-box: clone deepened in 4.4s
ci-box: file times set from content: 3286 files, 213 directories
ci-box: ready in 17.7s
=== 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.152s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  3.5s
+ go list -export -test -tags testbuild -f  ./...
  4.7s
+ go list -export -test -tags browser,testbuild -f  ./internal/equipo ./internal/equipotest ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
  3.6s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-24 15:56:00 +0000 UTC

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

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

receipt: test step 1m14.387s 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 1m12.398s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m12.4s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 53.91, cpu waiting 30.61%, memory waiting 0.00%, io waiting 0.47%
--- 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

receipt: test step 1m13.686s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m11.618s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m3.02s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 4.77s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 3.82s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 53.91, cpu waiting 30.61%, memory waiting 0.00%, io waiting 0.47%
--- 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

receipt: test step 1m12.159s 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 1m10.147s amadan.net/oficina/equipo/internal/headless
receipt: slow test 34.15s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 18.24s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 8.94s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
receipt: slow test 8.82s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
machine: 32 CPUs, load 53.91, cpu waiting 30.76%, memory waiting 0.00%, io waiting 0.48%
--- shard 4 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-guards: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless

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

receipt: test step 2m59.046s 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 2m56.657s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m32.78s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 19.79s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 18s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 7.06s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistantAttachments
receipt: slow test 6.67s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 16.69, cpu waiting 6.84%, memory waiting 0.00%, io waiting 0.07%
--- shard 6 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest

receipt: test step 1.797s 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 2m14.601s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 10.93s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.74s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 4.16s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 3.77s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 2.68s amadan.net/oficina/equipo/internal/thintest TestContractTeamUpdatePersonNeeds
machine: 32 CPUs, load 8.36, cpu waiting 1.64%, memory waiting 0.00%, io waiting 1.58%
--- shard 7 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest-contract: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest

receipt: test step 1.876s 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 1m56.319s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.57s amadan.net/oficina/equipo/internal/thintest TestContractRetryPreviewUnverifiedMerge
receipt: slow test 9.13s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 4.95s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.66s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 3.01s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
machine: 32 CPUs, load 8.36, cpu waiting 1.64%, memory waiting 0.00%, io waiting 1.58%
--- 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
budget note: internal/runner/thin took 5m7.25s, over the 45s its record on line 44 allows; reported only, timing fails on CI

receipt: test step 5m13.171s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 5m7.25s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 36.99s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.83s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.82s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.49s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 9.87s amadan.net/oficina/equipo/internal/runner/thin TestTimeoutKeepsNothingForAnOlderInstance
machine: 32 CPUs, load 2.48, cpu waiting 0.70%, memory waiting 0.00%, io waiting 0.00%
--- 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

receipt: test step 48.616s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 47.647s amadan.net/oficina/equipo/internal/runner
receipt: slow test 27.62s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.02s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 51.71, cpu waiting 26.71%, memory waiting 0.00%, io waiting 0.73%
--- 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

receipt: test step 52.18s 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 50.886s amadan.net/oficina/equipo/internal/runner
receipt: slow test 40.77s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 35.2s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.42s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.68s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 54.22, cpu waiting 29.04%, memory waiting 0.00%, io waiting 0.68%
--- 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

receipt: test step 41.561s 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 40.65s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.17s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 5.01s amadan.net/oficina/equipo/internal/runner TestEnrolCommitsTheCredentialLast
receipt: slow test 3.6s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.12s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.91s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
machine: 32 CPUs, load 48.03, cpu waiting 22.71%, memory waiting 0.00%, io waiting 0.80%
--- shard 12 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-a started 30s late; cpu waiting 32.6%, load 27.78
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 1m9.301s 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 1m7.317s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 29.86s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 29.78s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 27.54s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 24.77s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 24.56s amadan.net/oficina/equipo/internal/equipotest TestAuthorityUsesLiveRoster
machine: 32 CPUs, load 45.25, cpu waiting 24.61%, memory waiting 0.00%, io waiting 0.30%
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-e started 30s late; cpu waiting 32.6%, load 27.78
test lane equipotest-e: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[E-P]' ./internal/equipotest

receipt: test step 1.558s 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 2m12.416s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 20.99s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 20.97s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 20.96s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 20.94s amadan.net/oficina/equipo/internal/equipotest TestProjectsSharedAndGrouped
receipt: slow test 20.94s amadan.net/oficina/equipo/internal/equipotest TestProjectBindingUniqueness
machine: 32 CPUs, load 34.85, cpu waiting 14.98%, memory waiting 0.00%, io waiting 0.95%
--- shard 14 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-r started 30s late; cpu waiting 32.6%, load 27.78
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 1m18.327s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m8.566s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 15.5s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.42s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.41s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.39s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.31s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 39.45, cpu waiting 21.64%, memory waiting 0.00%, io waiting 0.26%
--- shard 15 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-rest started 30s late; cpu waiting 32.6%, load 27.78
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 1.698s 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.898s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 26.16s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 25.28s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 25.25s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 23.3s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsCurrentOwner
receipt: slow test 23.26s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
machine: 32 CPUs, load 34.85, cpu waiting 14.98%, memory waiting 0.00%, io waiting 0.95%
--- shard 16 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: plan3test started 30s late; cpu waiting 32.6%, load 27.78
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
--- FAIL amadan.net/oficina/equipo/internal/plan3test TestPlan3ReleaseBoundaries
=== RUN   TestPlan3ReleaseBoundaries
--- FAIL: TestPlan3ReleaseBoundaries (0.32s)

--- FAIL amadan.net/oficina/equipo/internal/plan3test TestPlan3ReleaseBoundaries/inventory
=== RUN   TestPlan3ReleaseBoundaries/inventory
    plan3_release_test.go:22: entry has no copy review status or applicable acceptance runner.mac.other_instance
--- FAIL: TestPlan3ReleaseBoundaries/inventory (0.01s)

--- FAIL amadan.net/oficina/equipo/internal/plan3test (package output)
FAIL
rastrillo-budget/v1 ran 51.572s
FAIL	amadan.net/oficina/equipo/internal/plan3test	51.884s


receipt: test step 53.487s 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 51.572s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.87s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.44s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.56s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.47s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.3s amadan.net/oficina/equipo/internal/plan3test TestPlanMigrationUpgrade
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestPlan3ReleaseBoundaries$/^inventory$' -count=1 ./internal/plan3test   (retry, once)
FAILED TWICE ./internal/plan3test:TestPlan3ReleaseBoundaries/inventory plan3test
=== RUN   TestPlan3ReleaseBoundaries
=== RUN   TestPlan3ReleaseBoundaries/inventory
    plan3_release_test.go:22: entry has no copy review status or applicable acceptance runner.mac.other_instance
--- FAIL: TestPlan3ReleaseBoundaries (0.02s)
    --- FAIL: TestPlan3ReleaseBoundaries/inventory (0.02s)
FAIL
rastrillo-budget/v1 ran 16ms
FAIL	amadan.net/oficina/equipo/internal/plan3test	0.195s
FAIL
machine: 32 CPUs, load 53.31, cpu waiting 29.72%, memory waiting 0.00%, io waiting 0.39%
make: *** [Makefile:113: ci-shard] Error 1

amadan: step check shard 16 of 29 failed: exit status 2
--- shard 17 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: rest started 30s late; cpu waiting 32.6%, load 27.78
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/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/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/claude/realcli ./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/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/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/claude/realcli ./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/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude/realcli: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
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/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/testci: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/idtest: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo: 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/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/provider/pi: its inputs changed
budget note: internal/equipo took 2m14.818s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 29.303s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/equipo/github took 40.581s, 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.401s, 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 1m46.886s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 24.619s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/runner/containment took 41.725s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 10.465s, over the 10s the default allows; reported only, timing fails on CI

receipt: test step 2m24.71s against a 60s target (the gate's other steps are not in this figure)
receipt: 18 packages ran, 51 cached, 16 without tests, 0 failed
receipt: slow package 2m14.818s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 1m46.886s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 59.381s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 51.855s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 45.265s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow test 54.06s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 47.14s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 47.08s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
receipt: slow test 46.79s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
receipt: slow test 46.34s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
machine: 32 CPUs, load 18.06, cpu waiting 7.07%, memory waiting 0.00%, io waiting 0.08%
--- 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

receipt: test step 1m23.085s 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.089s amadan.net/oficina/equipo/internal/headless
receipt: slow test 38.02s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.56s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 9.96s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.31s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.21s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 53.31, cpu waiting 29.72%, memory waiting 0.00%, io waiting 0.39%
--- 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

receipt: test step 1m25.24s 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 1m23.595s amadan.net/oficina/equipo/internal/headless
receipt: slow test 25.7s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 19.78s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 12.74s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 8.81s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 7.81s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 51.04, cpu waiting 28.81%, memory waiting 0.00%, io waiting 0.37%
--- 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

receipt: test step 1m49.309s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m47.372s amadan.net/oficina/equipo/internal/headless
receipt: slow test 13.32s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.55s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 12.06s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.2s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
receipt: slow test 10.75s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
machine: 32 CPUs, load 36.77, cpu waiting 20.99%, memory waiting 0.00%, io waiting 0.25%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN   TestBrowserCopyContinue
time=2026-11-28T17:33:26.147Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T17:33:26.147Z level=INFO msg="startup phase done" phase=state_lock took=85µs
time=2026-11-28T17:33:26.147Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-28T17:33:26.147Z level=INFO msg="startup phase done" phase=claim_roots took=97µs
time=2026-11-28T17:33:26.147Z level=INFO msg="startup phase" phase=sweep
time=2026-11-28T17:33:26.206Z level=INFO msg="startup phase done" phase=sweep took=58.48ms
time=2026-11-28T17:33:26.206Z level=INFO msg="startup phase" phase=credentials
time=2026-11-28T17:33:26.206Z level=INFO msg="startup phase done" phase=credentials took=203µs
time=2026-11-28T17:33:26.206Z level=INFO msg="startup phase" phase=open_state
time=2026-11-28T17:33:26.258Z level=INFO msg="startup phase done" phase=open_state took=51.8ms
time=2026-11-28T17:33:26.258Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-28T17:33:26.260Z level=INFO msg=connecting host=127.0.0.1:40015 protocol=35
time=2026-11-28T17:33:26.263Z level=INFO msg=connected host=127.0.0.1:40015 took=2.279ms
time=2026-11-28T17:33:26.263Z level=INFO msg="capabilities gathering"
time=2026-11-28T17:33:26.263Z level=INFO msg="capabilities gathered" took=378µs tags=linux,claude,go
time=2026-11-28T17:33:26.267Z level=INFO msg="hello sent" protocol=35
time=2026-11-28T17:33:26.270Z level=INFO msg=welcome protocol=35 role=primary generation=1
    browser_copy_test.go:90: waiting for !document.querySelector('[data-copy-continue]'): context deadline exceeded (last evaluation: <nil>)
--- FAIL: TestBrowserCopyContinue (6.37s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m35.36s
FAIL	amadan.net/oficina/equipo/internal/headless	95.559s


receipt: test step 1m37.234s 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 1m35.36s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.71s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 12.34s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.01s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 9.03s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.25s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' -v -run '^TestBrowserCopyContinue$' -count=1 ./internal/headless   (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest d55c2fb14e1ff54528836ae83cf84c41aa131875 6.37s 45.25
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 42.19, cpu waiting 23.84%, memory waiting 0.00%, io waiting 0.29%
--- shard 22 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-rest: ./internal/equipo
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserPreviewBlocksNavigation|TestBrowserPreviewPassExchange)$' ./internal/equipo

receipt: test step 1.7s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 2.416s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 1.76s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 650ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/equipotest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserGitHubManifestCSP)$' ./internal/equipotest

receipt: test step 1.366s against a 60s target (the gate's other steps are not in this figure)
receipt: 0 packages ran, 1 cached, 0 without tests, 0 failed
receipt: slow package 6.368s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 6.37s amadan.net/oficina/equipo/internal/equipotest TestBrowserGitHubManifestCSP
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor|TestBrowserSmartDoor)$' ./internal/idtest
budget note: internal/idtest took 10.816s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI

receipt: test step 1.237s 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 10.816s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 8.53s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.29s 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 3.466s 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.002s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPausedWork|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRhythm|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingSteady|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackPulse|TestBrowserTrackStarCentre|TestBrowserTryAgain)$' ./internal/thintest

receipt: test step 1.526s 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 3m32.68s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 25.91s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.4s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.09s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.62s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.24s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 14.64, cpu waiting 6.46%, memory waiting 0.00%, io waiting 1.33%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless   (50s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.60s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.26s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 8.35s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 7.84s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 25.79s
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^C5_review_auth$|^TestHeadlessConnections$/^C5_review_failover$|^TestHeadlessConnections$/^C5_review_on_codex$|^TestHeadlessConnections$/^C5_review_other_family_first$' ./internal/headless   (66s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 12.60s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 19.97s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 19.22s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 11.86s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (20s)
ok ./internal/headless TestMixedVersions 17.46s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.79s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin   (2s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.09s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 52.85, cpu waiting 31.25%, memory waiting 0.00%, io waiting 0.52%
--- 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 12.647s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 4 without tests, 0 failed
receipt: slow package 7.41s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 196ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 161ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 3ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 0s amadan.net/oficina/equipo/internal/runner/provider/claude/realcli
receipt: slow test 5.2s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.73s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 380ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 190ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 160ms 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.129s 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.765s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 280ms 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 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
receipt: slow test 100ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryMalformedRecord
machine: 32 CPUs, load 21.88, cpu waiting 8.13%, memory waiting 0.00%, io waiting 1.25%
--- shard 25 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: runner-dead-references started 30s late; cpu waiting 32.6%, load 27.78
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2998 text files, 3277 matches, 0 failures
python3 native/scripts/check-share.py
Share packaging, keychain-only boundary and reviewed copy verified
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 tool fiesta spacing -skip tokens.css internal/equipo/static
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 94 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok  	amadan.net/oficina/equipo/internal/equipo	2.492s
machine: 32 CPUs, load 54.49, cpu waiting 31.50%, memory waiting 0.00%, io waiting 0.54%
--- shard 26 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: staticcheck started 30s late; cpu waiting 32.6%, load 27.78
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 48.03, cpu waiting 24.39%, memory waiting 0.00%, io waiting 0.78%
--- shard 27 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: govulncheck started 30s late; cpu waiting 32.6%, load 27.78
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===

No vulnerabilities found.

Your code is affected by 0 vulnerabilities.
This scan also found 1 vulnerability in packages you import and 10
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
machine: 32 CPUs, load 54.22, cpu waiting 29.04%, memory waiting 0.00%, io waiting 0.68%
--- shard 28 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: gitleaks started 30s late; cpu waiting 32.6%, load 27.78
shard 28: make gitleaks
5:33PM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
5:33PM INF 1266 commits scanned.
5:33PM INF scanned ~68836698 bytes (68.84 MB) in 19.4s
5:33PM INF no leaks found
machine: 32 CPUs, load 51.71, cpu waiting 28.16%, memory waiting 0.00%, io waiting 0.70%

amadan: job failed at step check shard 16 of 29 — its output is above, not at the tail of this log
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index b00f33bc..0720e48b 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -21,7 +21,7 @@ time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded);
time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s).
perf GET /api/runner/v2/artifacts/{assignment}/{artifact} skip Authenticated runner artifact download, not a browser GET screen. Runner long-poll and blob downloads use POST and are outside the screen inventory.
-size internal/runner 9969 9283 Injection defences, current authority and provenance guards, installer enrolment check; measured 9969/9283.
+size internal/runner 9972 9323 Injection defences, current authority and provenance guards, installer enrolment check, credential written last; measured 9972/9323.
time internal/runner/provider/claude 45s Task 5 measured 32.430s for fake CLI sessions and fsynced account, policy, capture and refresh checks; 45s gives 38 percent headroom on the shared runner.
time internal/runner/provider/codex 35s Plan 3 CI repair measured 24.464s for the full package (controller CI 27.908s).
time internal/runner/provider/pi 60s The real pinned Pi in bubblewrap against a fake TensorX: probes P1 to P5 (a hundred RPC turns), the hostile repository, and the pinned tree checked whole (about 160 MB); measured 22s locally.
diff --git a/cmd/equipo-runner/enrol_report.go b/cmd/equipo-runner/enrol_report.go
index f678d3f9..cd24f137 100644
--- a/cmd/equipo-runner/enrol_report.go
+++ b/cmd/equipo-runner/enrol_report.go
@@ -8,6 +8,7 @@ import (
"time"
"amadan.net/oficina/equipo/internal/equipo"
+ "amadan.net/oficina/equipo/internal/release"
"amadan.net/oficina/equipo/internal/runner"
"amadan.net/oficina/equipo/internal/runner/provider"
)
@@ -81,16 +82,25 @@ func (r enrolReport) failed(err error) {
}
}
-// enrolledElsewhere is the line (otherKey with the other Equipo's
-// address, or runner.enrol.identity when the state does not say which)
-// for a runner state enrolled with another Equipo than origin and
-// instance; "" when it is not, or cannot be read (Enrol then says why).
+// enrolledElsewhere is the line for a runner state the installer must
+// not touch: otherKey with the other Equipo's address when it is enrolled
+// with another Equipo than origin and instance, runner.enrol.identity
+// when the state does not say which (or says it in something other than
+// a plain web address, which is never printed), and runner.enrol.failed
+// when the state cannot be read, so whose it is is not known. "" when
+// the install can go ahead.
func enrolledElsewhere(state, origin, instance, otherKey string) (string, []any) {
other, elsewhere, err := runner.EnrolledElsewhere(state, origin, instance)
switch {
- case err != nil || !elsewhere:
+ case err != nil:
+ detail := runner.EnrolDetail(err)
+ if detail == "" {
+ detail = "unknown"
+ }
+ return "runner.enrol.failed", []any{detail}
+ case !elsewhere:
return "", nil
- case other == "":
+ case other == "" || !release.InstallOrigin(other):
return "runner.enrol.identity", nil
}
return otherKey, []any{other}
diff --git a/cmd/equipo-runner/install.go b/cmd/equipo-runner/install.go
index d95cac5f..d31cc477 100644
--- a/cmd/equipo-runner/install.go
+++ b/cmd/equipo-runner/install.go
@@ -3,7 +3,6 @@ package main
import (
"amadan.net/oficina/equipo/internal/runner/provider/opencode"
"amadan.net/oficina/equipo/internal/runner/provider/pi"
- "bufio"
"context"
"encoding/json"
"errors"
@@ -31,6 +30,9 @@ type linuxInstallHost struct {
verify func(runner.Config) error
enrol func(context.Context, runner.Config, io.Writer) error
checkEnv func(root, origin, state string) error
+ // owned is whether the installer may replace a file it wrote before
+ // (runnersetup.InstallerOwns): never one edited by hand.
+ owned func(path string) bool
}
func installRunner(ctx context.Context, args []string, input io.Reader, out, errout io.Writer, getenv func(string) string) int {
@@ -41,6 +43,7 @@ func installRunner(ctx context.Context, args []string, input io.Reader, out, err
verify: func(cfg runner.Config) error { return verifyInstalled(release.BuildManifest(), cfg) },
enrol: runner.Enrol,
checkEnv: runnersetup.CheckServiceEnvironment,
+ owned: runnersetup.InstallerOwns,
})
}
@@ -70,26 +73,34 @@ func installLinux(ctx context.Context, args []string, input io.Reader, out, erro
if h.chdir(home) != nil {
return fail("runner.install.destination")
}
+ // One install at a time, from this check until it is enrolled or put
+ // back: a second one is refused, not let put back over the first.
+ lock, e := installLock(filepath.Join(*root, "state"))
+ if e != nil {
+ return fail(lockKey(e))
+ }
+ defer lock.Close()
if key, a := enrolledElsewhere(filepath.Join(*root, "state"), *origin, *instance, "runner.install.other_instance"); key != "" {
fmt.Fprintf(errout, equipo.RunnerSetupCopy(key)+"\n", a...)
return 1
}
- // A root installed before: its unit and environment file are kept
- // aside until the enrolment is done. A new root has neither.
- var backup *installBackup
- if info, e := os.Lstat(*root); e == nil && info.IsDir() {
- if backup, e = newInstallBackup(*root); e != nil {
- return fail("runner.install.destination")
- }
- if e = backup.keep(filepath.Join(*root, "runner.env"), filepath.Join(*root, "equipo-runner.service")); e != nil {
- backup.restore()
- return fail("runner.install.destination")
- }
+ // The unit and environment file are kept aside until the enrolment
+ // is done; on a new root they do not exist yet, and a failed install
+ // removes what it wrote there. One edited by hand is never replaced.
+ envFile, unit := filepath.Join(*root, "runner.env"), filepath.Join(*root, "equipo-runner.service")
+ if !h.owned(envFile) || !h.owned(unit) {
+ return fail("runner.install.destination")
+ }
+ backup, e := newInstallBackup(*root)
+ if e != nil {
+ return fail("runner.install.destination")
+ }
+ if e = backup.keep(envFile, unit); e != nil {
+ backup.restore()
+ return fail("runner.install.destination")
}
putBack := func() int {
- if backup != nil {
- backup.restore()
- }
+ backup.restore()
return 1
}
abort := func(key string) int { fail(key); return putBack() }
@@ -100,13 +111,15 @@ func installLinux(ctx context.Context, args []string, input io.Reader, out, erro
}
return putBack()
}
- reader := bufio.NewReader(input)
- label, e := promptMachineLabel(reader, out, *root, *origin, *instance)
+ // Ctrl-C at either prompt ends the install and puts back what was
+ // kept aside, as it does while waiting for the link.
+ lines := newPromptLines(input)
+ label, e := promptMachineLabel(ctx, lines, out, *root, *origin, *instance)
if e != nil {
return abort("runner.install.unavailable")
}
fmt.Fprint(out, equipo.RunnerSetupCopy("runner.install.enrol"))
- confirm, e := reader.ReadString('\n')
+ confirm, e := lines.read(ctx)
if e != nil || strings.TrimSpace(confirm) != "yes" {
return abort("runner.install.unavailable")
}
@@ -135,9 +148,7 @@ func installLinux(ctx context.Context, args []string, input io.Reader, out, erro
}
// Enrolled: the state now holds the credential this configuration
// goes with, so the earlier one is not put back any more.
- if backup != nil {
- backup.drop()
- }
+ backup.drop()
// Use the already configured environment file. Never copy the invoking
// process's environment (which may contain credentials) into service metadata.
if e = h.checkEnv(*root, cfg.Origin, cfg.StateDir); e != nil {
@@ -203,13 +214,13 @@ func installManifest(args []string, out io.Writer) int {
return 0
}
-func promptMachineLabel(reader *bufio.Reader, out io.Writer, root, origin, instance string) (string, error) {
+func promptMachineLabel(ctx context.Context, lines *promptLines, out io.Writer, root, origin, instance string) (string, error) {
label, e := runner.DefaultMachineLabel(filepath.Join(root, "state"), origin, instance)
if e != nil {
return "", e
}
fmt.Fprintf(out, equipo.RunnerSetupCopy("runner.install.label"), label)
- edited, e := reader.ReadString('\n')
+ edited, e := lines.read(ctx)
if e != nil {
return "", e
}
diff --git a/cmd/equipo-runner/install_backup.go b/cmd/equipo-runner/install_backup.go
index 8ef82439..8709407c 100644
--- a/cmd/equipo-runner/install_backup.go
+++ b/cmd/equipo-runner/install_backup.go
@@ -1,9 +1,15 @@
package main
import (
+ "bufio"
+ "context"
+ "errors"
+ "io"
"os"
"path/filepath"
"strconv"
+
+ "golang.org/x/sys/unix"
)
// installBackup keeps what an install replaces until the install is done:
@@ -84,3 +90,88 @@ func (b *installBackup) drop() {
_ = os.RemoveAll(b.dir)
b.moved = nil
}
+
+// asideOf is where path was moved aside, "" when it was not.
+func (b *installBackup) asideOf(path string) string {
+ for _, m := range b.moved {
+ if m.path == path && m.existed {
+ return m.aside
+ }
+ }
+ return ""
+}
+
+// errInstallBusy: another install holds the install lock.
+var errInstallBusy = errors.New("another install is running")
+
+// installLock is held for a whole install, from the check that the
+// runner works for no other Equipo until it is enrolled or put back, so
+// a second install of the same runner is refused (runner.install.busy)
+// rather than putting its backup back over what the first installed.
+// It is its own file in the state directory, apart from the runner's
+// lock, which the running runner holds and the enrolment takes.
+func installLock(state string) (*os.File, error) {
+ if err := os.MkdirAll(state, 0700); err != nil {
+ return nil, err
+ }
+ f, err := os.OpenFile(filepath.Join(state, "install.lock"), os.O_CREATE|os.O_RDWR|unix.O_NOFOLLOW|unix.O_CLOEXEC, 0600)
+ if err != nil {
+ return nil, err
+ }
+ if err := unix.Flock(int(f.Fd()), unix.LOCK_EX|unix.LOCK_NB); err != nil {
+ f.Close()
+ if errors.Is(err, unix.EWOULDBLOCK) {
+ return nil, errInstallBusy
+ }
+ return nil, err
+ }
+ return f, nil
+}
+
+// lockKey is the line for an install lock that could not be taken.
+func lockKey(err error) string {
+ if errors.Is(err, errInstallBusy) {
+ return "runner.install.busy"
+ }
+ return "runner.install.destination"
+}
+
+// promptLines reads the person's answers a line at a time. A read waits
+// for the line or for ctx to end (Ctrl-C ends it), whichever is first,
+// so a prompt never holds an install that has something moved aside.
+type promptLines struct {
+ lines chan promptLine
+}
+
+type promptLine struct {
+ text string
+ err error
+}
+
+func newPromptLines(input io.Reader) *promptLines {
+ p := &promptLines{lines: make(chan promptLine)}
+ go func() {
+ r := bufio.NewReader(input)
+ for {
+ text, err := r.ReadString('\n')
+ p.lines <- promptLine{text, err}
+ if err != nil {
+ close(p.lines)
+ return
+ }
+ }
+ }()
+ return p
+}
+
+func (p *promptLines) read(ctx context.Context) (string, error) {
+ select {
+ case <-ctx.Done():
+ return "", ctx.Err()
+ case l, ok := <-p.lines:
+ if !ok {
+ return "", io.EOF
+ }
+ return l.text, l.err
+ }
+}
diff --git a/cmd/equipo-runner/install_linux_safe_test.go b/cmd/equipo-runner/install_linux_safe_test.go
index ad3b45fd..8c4286ba 100644
--- a/cmd/equipo-runner/install_linux_safe_test.go
+++ b/cmd/equipo-runner/install_linux_safe_test.go
@@ -10,6 +10,7 @@ import (
"strconv"
"strings"
"testing"
+ "time"
"amadan.net/oficina/equipo/internal/equipo"
"amadan.net/oficina/equipo/internal/runner"
@@ -58,10 +59,114 @@ func newLinuxRig(t *testing.T) *linuxRig {
verify: func(runner.Config) error { return nil },
enrol: func(context.Context, runner.Config, io.Writer) error { x.enrolled = true; return nil },
checkEnv: func(string, string, string) error { return nil },
+ // The installer's own files, except one a person edited.
+ owned: func(path string) bool {
+ raw, _ := os.ReadFile(path)
+ return !strings.Contains(string(raw), "edited by hand")
+ },
}
return x
}
+func (x *linuxRig) installWith(ctx context.Context, origin string, input io.Reader) (int, string) {
+ var out, errout bytes.Buffer
+ code := installLinux(ctx, []string{"--release", "abc1234", "--origin", origin, "--instance", "team1"}, input, &out, &errout, func(string) string { return "" }, x.h)
+ return code, errout.String()
+}
+
+// A first install (no root yet) that stops before the enrolment leaves
+// no unit or environment file behind: nothing would start a runner that
+// was never added (Astra, mac-install-safe).
+func TestInstallLinuxFirstFailureLeavesNoConfig(t *testing.T) {
+ x := newLinuxRig(t)
+ x.h.enrol = func(context.Context, runner.Config, io.Writer) error { return runner.ErrEnrolmentExpired }
+ if code, errout := x.install("https://equipo.example", "yes"); code != 1 {
+ t.Fatalf("%d %q", code, errout)
+ }
+ if got := x.files(t); len(got) != 0 {
+ t.Fatalf("left behind %v", got)
+ }
+}
+
+// A unit or environment file someone edited by hand is not moved aside
+// or replaced: the install stops before changing anything.
+func TestInstallLinuxKeepsAnEditedFile(t *testing.T) {
+ for _, name := range []string{"runner.env", "equipo-runner.service"} {
+ t.Run(name, func(t *testing.T) {
+ x := newLinuxRig(t)
+ x.before(t, "https://equipo.example")
+ if err := os.WriteFile(filepath.Join(x.root, name), []byte("edited by hand"), 0600); err != nil {
+ t.Fatal(err)
+ }
+ before := x.files(t)
+ code, errout := x.install("https://equipo-next.example", "yes")
+ if code != 1 || !strings.Contains(errout, equipo.RunnerSetupCopy("runner.install.destination")) {
+ t.Fatalf("%d %q", code, errout)
+ }
+ if x.installs != 0 || x.enrolled || !mapsEqual(before, x.files(t)) {
+ t.Fatalf("changed something: %d %v %v", x.installs, x.enrolled, x.files(t))
+ }
+ })
+ }
+}
+
+// Ctrl-C at a prompt (the input stays open, no line comes) ends the
+// install and puts the earlier configuration back at once.
+func TestInstallLinuxCtrlCAtAPrompt(t *testing.T) {
+ for _, answered := range []string{"", "\n"} {
+ x := newLinuxRig(t)
+ before := x.before(t, "https://equipo.example")
+ r, w := io.Pipe()
+ defer w.Close()
+ installed := make(chan struct{})
+ install := x.h.install
+ x.h.install = func(ctx context.Context, o runnersetup.InstallOptions) (runnersetup.InstallResult, error) {
+ defer close(installed)
+ return install(ctx, o)
+ }
+ ctx, cancel := context.WithCancel(context.Background())
+ done := make(chan int)
+ go func() { code, _ := x.installWith(ctx, "https://equipo-next.example", r); done <- code }()
+ <-installed
+ if answered != "" {
+ // The label is answered; Ctrl-C comes at the yes prompt.
+ _, _ = io.WriteString(w, answered)
+ }
+ time.Sleep(50 * time.Millisecond)
+ cancel()
+ select {
+ case code := <-done:
+ if code != 1 {
+ t.Fatalf("exit %d", code)
+ }
+ case <-time.After(5 * time.Second):
+ t.Fatal("Ctrl-C at the prompt did not end the install")
+ }
+ if got := x.files(t); !mapsEqual(before, got) || x.enrolled {
+ t.Fatalf("not put back: %v", got)
+ }
+ }
+}
+
+// A second install of the same runner while one is running is refused
+// and changes nothing: it cannot put its backup back over the first.
+func TestInstallLinuxOneAtATime(t *testing.T) {
+ x := newLinuxRig(t)
+ before := x.before(t, "https://equipo.example")
+ lock, err := installLock(filepath.Join(x.root, "state"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer lock.Close()
+ code, errout := x.install("https://equipo-next.example", "yes")
+ if code != 1 || !strings.Contains(errout, equipo.RunnerSetupCopy("runner.install.busy")) {
+ t.Fatalf("%d %q", code, errout)
+ }
+ if x.installs != 0 || x.enrolled || !mapsEqual(before, x.files(t)) {
+ t.Fatalf("changed something: %d %v %v", x.installs, x.enrolled, x.files(t))
+ }
+}
+
func (x *linuxRig) install(origin, answer string) (int, string) {
var out, errout bytes.Buffer
code := installLinux(context.Background(), []string{"--release", "abc1234", "--origin", origin, "--instance", "team1"}, strings.NewReader("\n"+answer+"\n"), &out, &errout, func(string) string { return "" }, x.h)
@@ -104,15 +209,31 @@ func (x *linuxRig) files(t *testing.T) map[string]string {
// The Linux installer asks first too: a runner enrolled with another
// Equipo is told so and nothing is installed, written or enrolled.
func TestInstallLinuxRefusesAnotherEquipo(t *testing.T) {
- x := newLinuxRig(t)
- before := x.before(t, stagingOrigin)
- liveEnrolment(t, filepath.Join(x.root, "state"), stagingOrigin, "team1")
- code, errout := x.install("https://equipo.example", "yes")
- if code != 1 || !strings.Contains(errout, fmt.Sprintf(equipo.RunnerSetupCopy("runner.install.other_instance"), stagingOrigin)) {
- t.Fatalf("%d %q", code, errout)
- }
- if x.installs != 0 || x.enrolled || !mapsEqual(before, x.files(t)) {
- t.Fatalf("changed something: %d %v %v", x.installs, x.enrolled, x.files(t))
+ for name, c := range map[string]struct {
+ unreadable bool
+ want string
+ }{
+ "another origin": {want: fmt.Sprintf(equipo.RunnerSetupCopy("runner.install.other_instance"), stagingOrigin)},
+ "credential unreadable": {unreadable: true, want: strings.TrimSuffix(equipo.RunnerSetupCopy("runner.enrol.failed"), "%s")},
+ } {
+ t.Run(name, func(t *testing.T) {
+ x := newLinuxRig(t)
+ before := x.before(t, stagingOrigin)
+ state := filepath.Join(x.root, "state")
+ liveEnrolment(t, state, stagingOrigin, "team1")
+ if c.unreadable {
+ if err := os.WriteFile(filepath.Join(state, "credentials.json"), []byte("{"), 0600); err != nil {
+ t.Fatal(err)
+ }
+ }
+ code, errout := x.install("https://equipo.example", "yes")
+ if code != 1 || !strings.Contains(errout, c.want) {
+ t.Fatalf("%d %q", code, errout)
+ }
+ if x.installs != 0 || x.enrolled || !mapsEqual(before, x.files(t)) {
+ t.Fatalf("changed something: %d %v %v", x.installs, x.enrolled, x.files(t))
+ }
+ })
}
}
@@ -143,7 +264,9 @@ func TestInstallLinuxPutsBackItsConfig(t *testing.T) {
if got := len(x.files(t)); got != 2 {
t.Fatalf("left behind %v", x.files(t))
}
- if entries, _ := os.ReadDir(x.root); len(entries) > 3 {
+ // The unit, the environment file, the install log and the
+ // state directory with its install lock: no backup left.
+ if entries, _ := os.ReadDir(x.root); len(entries) > 4 {
t.Fatalf("left behind %v", entries)
}
})
@@ -156,7 +279,8 @@ func TestInstallLinuxPutsBackItsConfig(t *testing.T) {
if got := x.files(t); got["runner.env"] != "EQUIPO_ORIGIN=\"https://equipo-next.example\"\n" || got["equipo-runner.service"] != "unit for https://equipo-next.example" {
t.Fatalf("new config %v", got)
}
- if entries, _ := os.ReadDir(x.root); len(entries) != 2 {
+ // The unit, the environment file and the state directory.
+ if entries, _ := os.ReadDir(x.root); len(entries) != 3 {
t.Fatalf("left behind %v", entries)
}
}
diff --git a/cmd/equipo-runner/install_mac.go b/cmd/equipo-runner/install_mac.go
index 291ce1cc..fed1514e 100644
--- a/cmd/equipo-runner/install_mac.go
+++ b/cmd/equipo-runner/install_mac.go
@@ -185,6 +185,13 @@ func installMac(ctx context.Context, args []string, h macInstallHost, out, errou
// Paths are this user's, whichever Equipo it works for: a runner
// enrolled with another one is said so before anything is stopped or
// rewritten (the Studio's staging runner, 2026-11-28, was left down).
+ // One install at a time, from this check until it is enrolled or put
+ // back: a second one is refused, not let put back over the first.
+ lock, err := installLock(filepath.Join(share, "state"))
+ if err != nil {
+ return fail(lockKey(err))
+ }
+ defer lock.Close()
if key, a := enrolledElsewhere(filepath.Join(share, "state"), *origin, *instance, "runner.mac.other_instance"); key != "" {
return fail(key, a...)
}
@@ -197,8 +204,11 @@ func installMac(ctx context.Context, args []string, h macInstallHost, out, errou
if !stopped {
if tookDown {
// Taken out of launchd but still holding its lock: launchd
- // gets it back as it was.
- _ = h.launchctl(context.WithoutCancel(ctx), "bootstrap", domain, plist)
+ // gets it back as it was, or the person is told it is not.
+ if h.launchctl(context.WithoutCancel(ctx), "bootstrap", domain, plist) != nil {
+ say("runner.mac.still_running")
+ return fail("runner.mac.not_restored")
+ }
}
return fail("runner.mac.still_running")
}
@@ -240,10 +250,17 @@ func installMac(ctx context.Context, args []string, h macInstallHost, out, errou
if err != nil {
return abort("runner.install.destination")
}
+ // Run from the runner installed here (its own install command), the
+ // new copy comes from where that binary was moved aside.
+ source := h.self
+ fromInstalled := sameFile(h.self, binary)
if err := backup.keep(binary, scannerPath, filepath.Join(lib, "srt"), envFile); err != nil {
return abort("runner.install.destination")
}
- if err := copyPrivate(h.self, binary, 0700); err != nil {
+ if fromInstalled {
+ source = backup.asideOf(binary)
+ }
+ if err := copyPrivate(source, binary, 0700); err != nil {
return abort("runner.install.destination")
}
scanner, err := h.fetch(ctx, *origin+"/releases/"+*version+"/darwin-arm64/gitleaks", 128<<20)
@@ -412,12 +429,27 @@ func stopRunner(ctx context.Context, h macInstallHost, service, state string) (s
// hand holds it too.
return lockFree(state), false
}
- if h.launchctl(ctx, "bootout", service) != nil {
+ // The bootout is not cut short by Ctrl-C: launchd may have taken the
+ // agent out before it answers, and whether it did is checked below.
+ stop, cancel := context.WithTimeout(context.WithoutCancel(ctx), time.Minute)
+ defer cancel()
+ if h.launchctl(stop, "bootout", service) != nil && h.launchctl(stop, "print", service) == nil {
+ // Refused, and the agent is still there: nothing was taken down.
return false, false
}
return waitStopped(ctx, h, service, state), true
}
+// sameFile reports whether a and b are the same existing file.
+func sameFile(a, b string) bool {
+ ai, err := os.Stat(a)
+ if err != nil {
+ return false
+ }
+ bi, err := os.Stat(b)
+ return err == nil && os.SameFile(ai, bi)
+}
+
// waitStopped waits for a booted-out runner to be gone and its lock free.
func waitStopped(ctx context.Context, h macInstallHost, service, state string) bool {
wait := h.stopWait
diff --git a/cmd/equipo-runner/install_mac_test.go b/cmd/equipo-runner/install_mac_test.go
index 3e03f5b9..2e62e9ba 100644
--- a/cmd/equipo-runner/install_mac_test.go
+++ b/cmd/equipo-runner/install_mac_test.go
@@ -39,6 +39,10 @@ type macRig struct {
// through a bootout; bootoutErr is what bootout answers.
loaded, stuck bool
bootoutErr error
+ // bootoutTakesDown is a bootout that answers bootoutErr after it
+ // took the agent out; bootstrapErr is what bootstrap answers.
+ bootoutTakesDown bool
+ bootstrapErr error
// dsclHome is the home the user directory records ("" for none);
// loggedOut is the user having no login session; childHomes the
// homes npm and xcodebuild were run with.
@@ -130,10 +134,16 @@ func newMacRig(t *testing.T) *macRig {
}
case "bootout":
if x.bootoutErr != nil {
+ if x.bootoutTakesDown {
+ x.loaded = false
+ }
return x.bootoutErr
}
x.loaded = x.stuck
case "bootstrap":
+ if x.bootstrapErr != nil {
+ return x.bootstrapErr
+ }
x.loaded = true
}
return nil
@@ -422,8 +432,9 @@ func TestInstallMacWhenTheRunnerWillNotStop(t *testing.T) {
if x.loaded != (name != "held, not loaded") {
t.Fatalf("%s: left unloaded: %v", name, x.calls)
}
- // A refused bootout is the answer: no waiting on it.
- if name == "bootout fails" && x.calls[len(x.calls)-1] != "launchctl bootout gui/502/io.amadan.equipo-runner" {
+ // A refused bootout, the agent still there, is the answer: no
+ // waiting on it.
+ if name == "bootout fails" && strings.Join(x.calls[len(x.calls)-2:], ",") != "launchctl bootout gui/502/io.amadan.equipo-runner,launchctl print gui/502/io.amadan.equipo-runner" {
t.Fatalf("waited after a failed bootout: %v", x.calls)
}
}
diff --git a/cmd/equipo-runner/install_safe_test.go b/cmd/equipo-runner/install_safe_test.go
index f4ba8b80..a5ea46ba 100644
--- a/cmd/equipo-runner/install_safe_test.go
+++ b/cmd/equipo-runner/install_safe_test.go
@@ -3,6 +3,7 @@ package main
import (
"bytes"
"context"
+ "errors"
"fmt"
"io"
"os"
@@ -88,21 +89,36 @@ func TestInstallMacRefusesAnotherEquipo(t *testing.T) {
for name, c := range map[string]struct {
record string
want string
+ // unreadable is a credential that cannot be read: whose it is
+ // is not known, so nothing is stopped or changed either.
+ unreadable bool
}{
- "another origin": {stagingOrigin, fmt.Sprintf(equipo.RunnerSetupCopy("runner.mac.other_instance"), stagingOrigin)},
- "origin not known": {"", equipo.RunnerSetupCopy("runner.enrol.identity")},
+ "another origin": {record: stagingOrigin, want: fmt.Sprintf(equipo.RunnerSetupCopy("runner.mac.other_instance"), stagingOrigin)},
+ "origin not known": {want: equipo.RunnerSetupCopy("runner.enrol.identity")},
+ // A saved origin that is not a plain web address (here with a
+ // password and a sign-in link in it) is never printed.
+ "origin not an address": {record: "https://paul:hunter2@equipo-staging.example/signin?token=s3cret", want: equipo.RunnerSetupCopy("runner.enrol.identity")},
+ "credential unreadable": {record: stagingOrigin, want: strings.TrimSuffix(equipo.RunnerSetupCopy("runner.enrol.failed"), "%s"), unreadable: true},
} {
t.Run(name, func(t *testing.T) {
x := installedBefore(t, stagingOrigin)
state := filepath.Join(x.home, ".local/share/equipo-runner/state")
- if c.record == "" {
+ switch {
+ case c.record == "":
if err := os.Remove(filepath.Join(state, "enrolment.json")); err != nil {
t.Fatal(err)
}
+ case c.record != stagingOrigin:
+ liveEnrolment(t, state, c.record, "team1")
+ }
+ if c.unreadable {
+ if err := os.WriteFile(filepath.Join(state, "credentials.json"), []byte("{"), 0600); err != nil {
+ t.Fatal(err)
+ }
}
before := x.snapshot(t)
code, errout := x.installAt(context.Background(), "https://equipo.example", "team1")
- if code != 1 || !strings.Contains(errout, c.want) || strings.Contains(errout, string(provider.ErrIdentity)) {
+ if code != 1 || !strings.Contains(errout, c.want) || strings.Contains(errout, string(provider.ErrIdentity)) || strings.Contains(errout, "hunter2") || strings.Contains(errout, "s3cret") {
t.Fatalf("%d %q", code, errout)
}
if len(x.calls) != 0 || !x.loaded || x.enrolled != nil || len(x.fetched) != 0 || len(x.childHomes) != 0 {
@@ -268,3 +284,80 @@ func TestInstallMacIdentityInWords(t *testing.T) {
t.Fatalf("%d %q", code, errout)
}
}
+
+// A second install for the same Mac user while one is running is refused
+// and changes nothing (Astra, mac-install-safe): it cannot put its backup
+// back over what the first one installed.
+func TestInstallMacOneAtATime(t *testing.T) {
+ x := installedBefore(t, "https://equipo.example")
+ lock, err := installLock(filepath.Join(x.home, ".local/share/equipo-runner/state"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer lock.Close()
+ before := x.snapshot(t)
+ code, errout := x.installAt(context.Background(), "https://equipo.example", "team1")
+ if code != 1 || !strings.Contains(errout, equipo.RunnerSetupCopy("runner.install.busy")) {
+ t.Fatalf("%d %q", code, errout)
+ }
+ if len(x.calls) != 0 || !x.loaded || x.enrolled != nil || len(x.fetched) != 0 {
+ t.Fatalf("changed something: %v", x.calls)
+ }
+ if after := x.snapshot(t); !mapsEqual(before, after) {
+ t.Fatalf("files changed:\n%v\n%v", before, after)
+ }
+}
+
+// The install command run from the runner installed here copies that
+// runner from where it was moved aside: it installs, and a failure puts
+// it back as it was.
+func TestInstallMacFromTheInstalledRunner(t *testing.T) {
+ for _, fails := range []bool{false, true} {
+ x := installedBefore(t, "https://equipo.example")
+ binary := filepath.Join(x.home, ".local/lib/equipo-runner/equipo-runner")
+ x.h.self = binary
+ before := x.snapshot(t)
+ if fails {
+ x.h.enrol = func(context.Context, runner.Config, io.Writer) error { return runner.ErrEnrolmentExpired }
+ }
+ code, errout := x.installAt(context.Background(), "https://equipo.example", "team1")
+ if fails {
+ if code != 1 || !strings.Contains(errout, equipo.RunnerSetupCopy("runner.mac.restored")) || !mapsEqual(before, x.snapshot(t)) {
+ t.Fatalf("not put back: %d %q", code, errout)
+ }
+ continue
+ }
+ if code != 0 {
+ t.Fatalf("%d %q", code, errout)
+ }
+ if raw, _ := os.ReadFile(binary); string(raw) != before[".local/lib/equipo-runner/equipo-runner"] {
+ t.Fatalf("installed %q", raw)
+ }
+ }
+}
+
+// A bootout that took the agent out but answered an error (launchctl
+// ended part way) is a stopped runner, not one left running: launchd
+// gets it back when the install does not go ahead. A give-back that
+// fails is said, not passed over.
+func TestInstallMacStopThatTookTheAgentDown(t *testing.T) {
+ x := installedBefore(t, "https://equipo.example")
+ x.bootoutErr, x.bootoutTakesDown = errors.New("Boot-out failed: 5"), true
+ x.h.enrol = func(context.Context, runner.Config, io.Writer) error { return runner.ErrEnrolmentExpired }
+ code, errout := x.installAt(context.Background(), "https://equipo.example", "team1")
+ if code != 1 || !x.loaded || !strings.Contains(errout, equipo.RunnerSetupCopy("runner.mac.restored")) {
+ t.Fatalf("left down: %d %q %v", code, errout, x.calls)
+ }
+
+ x = newMacRig(t)
+ x.loaded, x.bootstrapErr = true, errors.New("Bootstrap failed: 5")
+ lock, err := runner.LockState(filepath.Join(x.home, ".local/share/equipo-runner/state"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer lock.Close()
+ code, _, errout = x.install()
+ if code != 1 || !strings.Contains(errout, equipo.RunnerSetupCopy("runner.mac.still_running")) || !strings.Contains(errout, equipo.RunnerSetupCopy("runner.mac.not_restored")) {
+ t.Fatalf("a failed give-back not said: %d %q", code, errout)
+ }
+}
diff --git a/cmd/equipo-runner/onboarding_test.go b/cmd/equipo-runner/onboarding_test.go
index 70c18349..3e3a84e2 100644
--- a/cmd/equipo-runner/onboarding_test.go
+++ b/cmd/equipo-runner/onboarding_test.go
@@ -1,7 +1,6 @@
package main
import (
- "bufio"
"bytes"
"context"
"encoding/json"
@@ -112,7 +111,7 @@ func TestOnboardingInstallLabelPrompt(t *testing.T) {
}
for _, input := range []string{"\n", "New desk\n"} {
var out bytes.Buffer
- label, e := promptMachineLabel(bufio.NewReader(strings.NewReader(input)), &out, root, "https://equipo.example", "team")
+ label, e := promptMachineLabel(context.Background(), newPromptLines(strings.NewReader(input)), &out, root, "https://equipo.example", "team")
want := "Edited desk"
if input != "\n" {
want = "New desk"
diff --git a/internal/runner/enrol.go b/internal/runner/enrol.go
index 71e88339..b88a3761 100644
--- a/internal/runner/enrol.go
+++ b/internal/runner/enrol.go
@@ -218,18 +218,21 @@ func Enrol(ctx context.Context, c Config, output io.Writer) (resultErr error) {
// ever runs as a worker, so it keeps nothing and says why.
return ErrEnrolledAsPrimary
}
- if err := runnerproto.JournalCredentials(credentialPath, runnerproto.CredentialRotation{Bearer: cred}); err != nil {
- return err
- }
// The role is kept before the runner ever connects (a worker never
// serves as a primary), beside the credential so an older runner
// binary still reads that. No role is a primary's credential, or an
- // older instance's, which has only primaries.
+ // older instance's, which has only primaries. It is written before
+ // the credential, which is the last write: an enrolment that fails
+ // leaves no new credential (only an expired or absent one reaches
+ // here), so an installer can put its earlier configuration back.
role := wire.RolePrimary
if cred.Role == wire.RoleWorker {
role = wire.RoleWorker
}
- return WriteRole(c.StateDir, role)
+ if err := WriteRole(c.StateDir, role); err != nil {
+ return err
+ }
+ return runnerproto.JournalCredentials(credentialPath, runnerproto.CredentialRotation{Bearer: cred})
}
if last != nil {
// Still failing when the code ran out: that, not the expiry, is
diff --git a/internal/runner/enrol_worker_test.go b/internal/runner/enrol_worker_test.go
index a9eada27..c02edf58 100644
--- a/internal/runner/enrol_worker_test.go
+++ b/internal/runner/enrol_worker_test.go
@@ -133,3 +133,43 @@ func TestEnrolKeepsTheRole(t *testing.T) {
}
}
}
+
+// The credential is the last thing an enrolment writes: when keeping the
+// role fails, no new credential is left beside the installer's earlier
+// configuration, which it then puts back (Astra, mac-install-safe).
+func TestEnrolCommitsTheCredentialLast(t *testing.T) {
+ l, err := net.Listen("tcp", "127.0.0.1:0")
+ if err != nil {
+ t.Fatal(err)
+ }
+ srv := &http.Server{Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ switch r.URL.Path {
+ case wire.RunnerProtocolPath:
+ _, _ = w.Write([]byte(`{"protocol":2}`))
+ case "/api/enrolments":
+ _, _ = fmt.Fprintf(w, `{"version":1,"enrolment_id":"e1","instance_id":"inst","device_secret":"s","user_code":"ABCD-EFGH","challenge":"c","verification_uri":"http://%s/runners/enrol","expires_at":%q,"poll_interval_seconds":5}`, r.Host, time.Now().Add(time.Minute).UTC().Format(time.RFC3339))
+ case "/api/enrolments/token":
+ _, _ = fmt.Fprintf(w, `{"version":1,"token":"t","token_type":"Bearer","runner_id":"R2","credential_id":"C2","person":"p@x","expires_at":%q,"role":"worker"}`, time.Now().Add(time.Hour).UTC().Format(time.RFC3339))
+ default:
+ http.Error(w, "no", 404)
+ }
+ })}
+ go srv.Serve(l)
+ defer srv.Close()
+ state := filepath.Join(t.TempDir(), "state")
+ // The role cannot be written: a directory with something in it is
+ // where the role file goes.
+ if err := os.MkdirAll(filepath.Join(state, RoleFile, "x"), 0700); err != nil {
+ t.Fatal(err)
+ }
+ if err := os.Chmod(state, 0700); err != nil {
+ t.Fatal(err)
+ }
+ c := Config{Origin: "http://" + l.Addr().String(), InstanceID: "inst", StateDir: state, MachineLabel: "Tito Studio", WorkerOnly: true}
+ if err := Enrol(context.Background(), c, io.Discard); err == nil {
+ t.Fatal("enrolled without its role")
+ }
+ if _, err := os.Lstat(filepath.Join(state, "credentials.json")); !os.IsNotExist(err) {
+ t.Fatalf("a credential was kept without its role: %v", err)
+ }
+}
diff --git a/internal/runner/setup/install.go b/internal/runner/setup/install.go
index d23a294a..b5ac75e6 100644
--- a/internal/runner/setup/install.go
+++ b/internal/runner/setup/install.go
@@ -207,26 +207,49 @@ func privateDirectory(path string) bool {
const installOwnership = "user.equipo.installer.sha256"
+// InstallerOwns reports whether the installer may replace path: it does
+// not exist, or it is this user's regular file, exactly as the installer
+// last wrote it (its ownership marker matches). A file edited by hand,
+// or not the installer's, is never replaced.
+func InstallerOwns(path string) bool {
+ _, err := ownedContent(path)
+ return err == nil || os.IsNotExist(err)
+}
+
+// ownedContent is the content of a file the installer wrote and still
+// owns; an error (errUnavailable when it is not the installer's) else.
+func ownedContent(path string) ([]byte, error) {
+ i, e := os.Lstat(path)
+ if e != nil {
+ return nil, e
+ }
+ if !i.Mode().IsRegular() {
+ return nil, errUnavailable
+ }
+ var stat unix.Stat_t
+ if unix.Lstat(path, &stat) != nil || stat.Uid != uint32(os.Geteuid()) {
+ return nil, errUnavailable
+ }
+ old, e := os.ReadFile(path)
+ if e != nil {
+ return nil, e
+ }
+ marker := make([]byte, 64)
+ n, e := unix.Getxattr(path, installOwnership, marker)
+ sum := sha256.Sum256(old)
+ if e != nil || n != 64 || string(marker) != hex.EncodeToString(sum[:]) {
+ return nil, errUnavailable
+ }
+ return old, nil
+}
+
func writeOwned(path string, data []byte, mode os.FileMode) error {
replace := false
if i, e := os.Lstat(path); e == nil {
- if !i.Mode().IsRegular() {
- return errUnavailable
- }
- var stat unix.Stat_t
- if unix.Lstat(path, &stat) != nil || stat.Uid != uint32(os.Geteuid()) {
- return errUnavailable
- }
- old, e := os.ReadFile(path)
+ old, e := ownedContent(path)
if e != nil {
return e
}
- marker := make([]byte, 64)
- n, e := unix.Getxattr(path, installOwnership, marker)
- sum := sha256.Sum256(old)
- if e != nil || n != 64 || string(marker) != hex.EncodeToString(sum[:]) {
- return errUnavailable
- }
if string(old) == string(data) && i.Mode().Perm() == mode {
return nil
}
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json
index aef64624..e4722cc8 100644
--- a/scripts/runner-reference-allowlist.json
+++ b/scripts/runner-reference-allowlist.json
@@ -6362,13 +6362,6 @@
"count": 1,
"reason": "Runner executable/package or user-service identifier, retained for direct-launch installation and fixture verification."
},
- {
- "path": "cmd/equipo-runner/install.go",
- "line_sha256": "3e563be1a13bda2f2bc1ec6fcfb17e447cac0dd7c094ac03ee4afe403bf2c4e7",
- "match": "equipo-runner",
- "count": 1,
- "reason": "Runner executable/package or user-service identifier, retained for direct-launch installation and fixture verification."
- },
{
"path": "cmd/equipo-runner/install.go",
"line_sha256": "53aed153ffaa020eb2d545011fbe36325022231cccdaa997a36e3d0a78a8afeb",
@@ -9596,13 +9589,6 @@
"count": 2,
"reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs."
},
- {
- "path": "cmd/equipo-runner/install_mac_test.go",
- "line_sha256": "1f92c80bbad30ab0b1a3d652465db27d0d67a794d4bf960d70f133bd314f7cad",
- "match": "equipo-runner",
- "count": 1,
- "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs."
- },
{
"path": "cmd/equipo-runner/install_mac_test.go",
"line_sha256": "b109fd95422cec355402a34627a39a29da94760e45a06ced0ddc2ac8692f51e7",
@@ -18590,5 +18576,54 @@
"match": "equipo-runner",
"count": 1,
"reason": "Installer safety (2026-11-28): the runner's install paths and the pinned srt npm install, kept aside and put back, and their tests."
+ },
+ {
+ "path": "cmd/equipo-runner/install.go",
+ "line_sha256": "b035ede178e64e21849fbc3516f28664906a80dad2f5072c3344d4e42d961589",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Installer safety (2026-11-28): the runner's install paths and the pinned srt npm install, kept aside and put back, and their tests."
+ },
+ {
+ "path": "cmd/equipo-runner/install_linux_safe_test.go",
+ "line_sha256": "d450fc1074739a13f159cd213e078e0ef1572d297d7180e0216be4af86f27c06",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Installer safety (2026-11-28): the runner's install paths and the pinned srt npm install, kept aside and put back, and their tests."
+ },
+ {
+ "path": "cmd/equipo-runner/install_mac_test.go",
+ "line_sha256": "5f25d1ec8b65cb3a943cc04ed256b40f04a93a8ddbcab7d4d7a26f1749baadc7",
+ "match": "equipo-runner",
+ "count": 2,
+ "reason": "Installer safety (2026-11-28): the runner's install paths and the pinned srt npm install, kept aside and put back, and their tests."
+ },
+ {
+ "path": "cmd/equipo-runner/install_safe_test.go",
+ "line_sha256": "63faeb9fd25f30eeb59cd3e5b5c6dddbe9057dd4ee110c29f6993614f338b0a7",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Installer safety (2026-11-28): the runner's install paths and the pinned srt npm install, kept aside and put back, and their tests."
+ },
+ {
+ "path": "cmd/equipo-runner/install_safe_test.go",
+ "line_sha256": "d8047f19e376ac2153a10ed1b4492a6fcd08a321912d16acfdf8012376201500",
+ "match": "equipo-runner",
+ "count": 2,
+ "reason": "Installer safety (2026-11-28): the runner's install paths and the pinned srt npm install, kept aside and put back, and their tests."
+ },
+ {
+ "path": "cmd/equipo-runner/install_safe_test.go",
+ "line_sha256": "aebbc893ab92168206658699868af530cb03427f60b68b88b70c5d97c3bc484f",
+ "match": "equipo-runner",
+ "count": 2,
+ "reason": "Installer safety (2026-11-28): the runner's install paths and the pinned srt npm install, kept aside and put back, and their tests."
+ },
+ {
+ "path": "cmd/equipo-runner/install_safe_test.go",
+ "line_sha256": "0fdbab5c928198c4f2b1c889e23e6a399a3fa6160956b3689357ab3631d71ea3",
+ "match": "equipo-runner",
+ "count": 1,
+ "reason": "Installer safety (2026-11-28): the runner's install paths and the pinned srt npm install, kept aside and put back, and their tests."
}
]