realcli: pinned Claude CLI regression for the step approval path
Astra review of f03d79bb (minor): make the fake-API experiment behind
the StepPermission fix a repeatable test.
TestStepApprovalInThePinnedCLI runs the real pinned 2.1.312 binary
(digest-checked; gated like TestClaudeEmptyHomeReplay: testci.Tools
try-bin and bwrap, testci.Absent when the binary is missing, which fails
where EQUIPO_TEST_TOOLS_REQUIRED=1) in bubblewrap under the settings
claude.PolicyInputs builds for Engineering, against a fake Messages API
on loopback. Every permission request is answered by
claude.StepPermission over the CLI's stdio control channel (production
carries the same request over MCP). Two modes:
- token: CLAUDE_CODE_OAUTH_TOKEN plus CLAUDE_CODE_SUBPROCESS_ENV_SCRUB,
the production failure; an ordinary "cd internal && ls" must reach
the callback and run.
- subscription: a login in ~/.claude/.credentials.json, no scrub.
Probes whose paths the CLI cannot check (command substitution), so
only the sandbox stands in the way, each approved through the callback
in token mode: reading /config (the policy), /home/runner and its
login, the credential home; env and /proc/{self,1}/environ (the token);
writes to /config, the credential home and /home/runner; a TCP
connection to the fake API on host loopback; a background sleep, which
must run during the session and be gone after it. A workspace write
must land. About 3 s for both modes, inside the default package time.
In its own package, so the claude package keeps its 45 s budget.
Mutation checks (go test ./internal/runner/provider/claude/realcli/),
each failed, then restored:
- StepPermission refuses all shell (the old behaviour): token mode fails
- launcher drops both the sandbox denyRead/denyWrite and the Read()
deny rules: "cat .../equipo-settings.json" prints the policy, the
credential's canary is read, writes land in the credential home and
/home/runner
(Dropping only the sandbox lists is caught by neither: the CLI folds
the Read() deny rules into its sandbox too, so containment holds.)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+386
−0
internal/runner/provider/claude/realcli/approval_test.go+386 −0
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/eng-bash-and-checks-go: Type Size Avail | ext4 96G 86G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type Size Avail | ext4 96G 86G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 2.7s
ci-box: codex: fetched and verified in 3.4s
ci-box: codex-code-mode-host: fetched and verified in 1.3s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.8s
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.8s
ci-box: clone deepened in 3.5s
ci-box: file times set from content: 2878 files, 188 directories
ci-box: ready in 16.6s
=== 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.144s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
3.2s
+ go list -export -test -tags testbuild -f ./...
4.2s
+ go list -export -test -tags browser,testbuild -f ./internal/equipo ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
3.2s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-11 02:51:11 +0000 UTC
go run github.com/zricethezav/gitleaks/v8@v8.30.1 version
version is set by build process
=== check ===
--- shard 0 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-work: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$' ./internal/headless
receipt: test step 1m14.102s 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.419s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m12.42s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 61.44, cpu waiting 34.47%, memory waiting 0.00%, io waiting 0.54%
--- 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 1m13.589s 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.869s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m11.87s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 61.44, cpu waiting 34.47%, memory waiting 0.00%, io waiting 0.54%
--- 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.803s 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.979s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m3.15s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 4.67s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.16s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 61.44, cpu waiting 34.47%, memory waiting 0.00%, io waiting 0.54%
--- 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 1m11.807s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m10.106s amadan.net/oficina/equipo/internal/headless
receipt: slow test 34.43s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 18.21s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 8.96s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
receipt: slow test 8.51s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
machine: 32 CPUs, load 61.44, cpu waiting 34.65%, memory waiting 0.00%, io waiting 0.56%
--- shard 4 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-guards: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
receipt: test step 1m25.112s 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.365s amadan.net/oficina/equipo/internal/headless
receipt: slow test 54.78s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.03s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 7.95s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.6s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 65.18, cpu waiting 34.80%, memory waiting 0.00%, io waiting 0.44%
--- shard 5 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-rest: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$|^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$|^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$|^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$|^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
receipt: test step 2m48.284s 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 2m46.519s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m32.82s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 18.17s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 17.57s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 6.54s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
receipt: slow test 6.42s amadan.net/oficina/equipo/internal/headless TestHeadlessBatchAfterRefusedReply
machine: 32 CPUs, load 21.91, cpu waiting 10.31%, memory waiting 0.00%, io waiting 0.10%
--- shard 6 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest
receipt: test step 2m4.176s 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 2m2.326s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.05s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.74s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 3.7s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 3.55s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 2.41s amadan.net/oficina/equipo/internal/thintest TestResearchDoneFallsBack
machine: 32 CPUs, load 41.65, cpu waiting 21.27%, memory waiting 0.00%, io waiting 0.23%
--- 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 1m27.917s 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 1m26.276s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.1s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 4.99s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.49s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.35s amadan.net/oficina/equipo/internal/thintest TestContractPreview
receipt: slow test 2.33s amadan.net/oficina/equipo/internal/thintest TestContractPublishNameTaken
machine: 32 CPUs, load 64.60, cpu waiting 34.71%, memory waiting 0.00%, io waiting 0.43%
--- 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 4m39.843s, over the 45s its record on line 44 allows; reported only, timing fails on CI
receipt: test step 4m45.433s 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 4m39.843s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 36.96s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.9s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.8s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.49s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.93s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 4.11, cpu waiting 1.44%, 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 50.804s 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 49.927s amadan.net/oficina/equipo/internal/runner
receipt: slow test 29.89s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 56.14, cpu waiting 31.21%, memory waiting 0.00%, io waiting 0.81%
--- 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 58.592s 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 57.386s amadan.net/oficina/equipo/internal/runner
receipt: slow test 47.36s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 41.26s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.41s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.6s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 64.54, cpu waiting 34.70%, memory waiting 0.00%, io waiting 0.71%
--- 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 35.527s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 34.713s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.13s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.34s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.13s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.36s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.62s amadan.net/oficina/equipo/internal/runner TestCoordinatorTransientRefusalKeepsServing
machine: 32 CPUs, load 37.27, cpu waiting 21.27%, memory waiting 0.00%, io waiting 1.03%
--- 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 39.8%, load 29.20
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
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/equipotest TestDirectDeadReferencesRepository
=== RUN TestDirectDeadReferencesRepository
direct_cutover_test.go:221: repository reference inventory: exit status 1
internal/runner/checks/network.go:72:46: unclassified node
internal/runner/checks/network.go:104:60: unclassified node
internal/runner/checks/network_test.go:131:92: unclassified node
reference scan: 2591 text files, 2865 matches, 3 failures
--- FAIL: TestDirectDeadReferencesRepository (1.91s)
--- FAIL amadan.net/oficina/equipo/internal/equipotest (package output)
FAIL
rastrillo-budget/v1 ran 1m5.247s
FAIL amadan.net/oficina/equipo/internal/equipotest 65.608s
receipt: test step 1m7.115s 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 1m5.247s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 27.72s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 27.66s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 25.57s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 22.85s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 22.67s amadan.net/oficina/equipo/internal/equipotest TestAuthorityGrantReferences
exit status 1
+ go test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' -v -run '^TestDirectDeadReferencesRepository$' -count=1 ./internal/equipotest (retry, once)
FAILED TWICE ./internal/equipotest:TestDirectDeadReferencesRepository equipotest-a
=== RUN TestDirectDeadReferencesRepository
direct_cutover_test.go:221: repository reference inventory: exit status 1
internal/runner/checks/network.go:72:46: unclassified node
internal/runner/checks/network.go:104:60: unclassified node
internal/runner/checks/network_test.go:131:92: unclassified node
reference scan: 2591 text files, 2865 matches, 3 failures
--- FAIL: TestDirectDeadReferencesRepository (1.84s)
FAIL
rastrillo-budget/v1 ran 1.837s
FAIL amadan.net/oficina/equipo/internal/equipotest 2.000s
FAIL
machine: 32 CPUs, load 58.37, cpu waiting 31.08%, memory waiting 0.00%, io waiting 0.35%
make: *** [Makefile:113: ci-shard] Error 1
amadan: step check shard 12 of 29 failed: exit status 2
--- 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 39.8%, load 29.20
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 1m15.774s 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 1m14.056s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 18.89s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 18.88s amadan.net/oficina/equipo/internal/equipotest TestProjectRequestActorAndUpdate
receipt: slow test 18.87s amadan.net/oficina/equipo/internal/equipotest TestProjectRetryAndRevision
receipt: slow test 18.86s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 18.84s amadan.net/oficina/equipo/internal/equipotest TestProjectConcurrentRetry
machine: 32 CPUs, load 55.30, cpu waiting 28.28%, memory waiting 0.00%, io waiting 0.31%
--- 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 39.8%, load 29.20
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
receipt: test step 1m12.052s 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 1m6.974s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 14.55s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.02s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.01s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 6.92s amadan.net/oficina/equipo/internal/equipotest TestRosterAuditFailureRollsBack
machine: 32 CPUs, load 55.30, cpu waiting 30.16%, memory waiting 0.00%, io waiting 0.34%
--- 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 39.8%, load 29.20
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 1m7.79s 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 1m5.838s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 24.93s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 24.15s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 24.12s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 22.49s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsCurrentOwner
receipt: slow test 22.45s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedOnce
machine: 32 CPUs, load 58.37, cpu waiting 31.96%, memory waiting 0.00%, io waiting 0.36%
--- 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 39.8%, load 29.20
test lane plan3test: ./internal/plan3test
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/plan3test
receipt: test step 52.928s 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 51.046s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.67s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.54s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.53s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.47s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.25s amadan.net/oficina/equipo/internal/plan3test TestInviteMigration
machine: 32 CPUs, load 65.18, cpu waiting 35.10%, memory waiting 0.00%, io waiting 0.47%
--- 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 39.8%, load 29.20
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/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/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/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/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
--- FAIL amadan.net/oficina/equipo/internal/testci TestBudgetRecordsAreShort
=== RUN TestBudgetRecordsAreShort
budgets_file_test.go:37: .rastrillo/budgets.txt:41: reason is 231 bytes, over 200
--- FAIL: TestBudgetRecordsAreShort (0.00s)
--- FAIL amadan.net/oficina/equipo/internal/testci (package output)
FAIL
rastrillo-budget/v1 ran 1.375s
FAIL amadan.net/oficina/equipo/internal/testci 1.381s
budget: amadan.net/oficina/equipo/internal/runner/provider/claude/realcli ran tests but printed no time: add func TestMain(m *testing.M) { os.Exit(budget.Main(m)) }
budget note: internal/equipo took 44.642s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 18.599s, 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.658s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 36.042s, 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 54.897s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 20.351s, over the 20s its record on line 35 allows; reported only, timing fails on CI
receipt: test step 2m25.352s against a 60s target (the gate's other steps are not in this figure)
receipt: 20 packages ran, 42 cached, 18 without tests, 1 failed
receipt: slow package 1m46.658s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m7.349s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 54.897s amadan.net/oficina/equipo/internal/runner/containment
rastrillo: budget test: go test failed
receipt: slow package 52.892s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 49.701s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow test 52.69s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 44.72s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 44.57s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
receipt: slow test 44.31s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
receipt: slow test 44.25s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestBudgetRecordsAreShort$' -count=1 ./internal/testci (retry, once)
FAILED TWICE ./internal/testci:TestBudgetRecordsAreShort rest
=== RUN TestBudgetRecordsAreShort
budgets_file_test.go:37: .rastrillo/budgets.txt:41: reason is 231 bytes, over 200
--- FAIL: TestBudgetRecordsAreShort (0.00s)
FAIL
rastrillo-budget/v1 ran 0s
FAIL amadan.net/oficina/equipo/internal/testci 0.003s
FAIL
machine: 32 CPUs, load 20.40, cpu waiting 9.03%, memory waiting 0.00%, io waiting 0.09%
make: *** [Makefile:113: ci-shard] Error 1
amadan: step check shard 17 of 29 failed: exit status 2
--- 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.448s 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.989s amadan.net/oficina/equipo/internal/headless
receipt: slow test 38.1s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.58s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.19s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.12s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.16s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 65.18, cpu waiting 34.80%, memory waiting 0.00%, io waiting 0.44%
--- 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.788s 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 1m24.102s amadan.net/oficina/equipo/internal/headless
receipt: slow test 26.43s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 19.34s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 12.8s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 8.89s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 8.16s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 64.60, cpu waiting 34.71%, memory waiting 0.00%, io waiting 0.43%
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
receipt: test step 1m40.015s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m38.337s amadan.net/oficina/equipo/internal/headless
receipt: slow test 13.55s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.35s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.02s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 10.9s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
receipt: slow test 10.58s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsOpenCodeGoLimitRequired
machine: 32 CPUs, load 58.37, cpu waiting 31.08%, memory waiting 0.00%, io waiting 0.35%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN TestBrowserCopyContinue
time=2026-11-23T10:29:11.352Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-23T10:29:11.352Z level=INFO msg="startup phase done" phase=state_lock took=232µs
time=2026-11-23T10:29:11.352Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-23T10:29:11.353Z level=INFO msg="startup phase done" phase=claim_roots took=980µs
time=2026-11-23T10:29:11.353Z level=INFO msg="startup phase" phase=sweep
time=2026-11-23T10:29:11.409Z level=INFO msg="startup phase done" phase=sweep took=55.776ms
time=2026-11-23T10:29:11.409Z level=INFO msg="startup phase" phase=credentials
time=2026-11-23T10:29:11.409Z level=INFO msg="startup phase done" phase=credentials took=219µs
time=2026-11-23T10:29:11.410Z level=INFO msg="startup phase" phase=open_state
time=2026-11-23T10:29:11.463Z level=INFO msg="startup phase done" phase=open_state took=53.74ms
time=2026-11-23T10:29:11.464Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-23T10:29:11.466Z level=INFO msg=connecting host=127.0.0.1:38949 protocol=28
time=2026-11-23T10:29:11.468Z level=INFO msg=connected host=127.0.0.1:38949 took=960µs
time=2026-11-23T10:29:11.469Z level=INFO msg="capabilities gathering"
time=2026-11-23T10:29:11.469Z level=INFO msg="capabilities gathered" took=772µs tags=linux,claude,go
time=2026-11-23T10:29:11.472Z level=INFO msg="hello sent" protocol=28
time=2026-11-23T10:29:11.474Z level=INFO msg=welcome protocol=28 role=primary generation=1
browser_copy_test.go:90: waiting for !document.querySelector('[data-copy-continue]'): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserCopyContinue (6.37s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m29.31s
FAIL amadan.net/oficina/equipo/internal/headless 89.519s
receipt: test step 1m30.931s 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 1m29.31s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.74s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.07s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.27s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 9.24s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.41s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
rastrillo: budget test: go test failed
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' -v -run '^TestBrowserCopyContinue$' -count=1 ./internal/headless (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest 148458f8959d379299c8a85546cfda46af8c4259 6.37s 62.23
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 62.23, cpu waiting 32.90%, memory waiting 0.00%, io waiting 0.37%
--- shard 22 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-rest: ./internal/equipo
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserPreviewBlocksNavigation)$' ./internal/equipo
receipt: test step 2.278s 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 650ms amadan.net/oficina/equipo/internal/equipo
receipt: slow test 650ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor|TestBrowserSmartDoor)$' ./internal/idtest
budget note: internal/idtest took 10.774s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 12.038s 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 10.774s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 8.67s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.11s 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.58s 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.122s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.12s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|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 3m28.711s 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 3m27.1s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 21.96s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.38s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 11.99s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.55s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 9.35, cpu waiting 3.80%, memory waiting 0.00%, io waiting 0.03%
--- 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.61s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.24s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 7.93s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 8.36s
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 (60s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 13.57s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 11.33s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 19.24s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 13.62s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (20s)
ok ./internal/headless TestMixedVersions 17.85s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.78s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin (2s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 64.54, cpu waiting 34.91%, memory waiting 0.00%, io waiting 0.66%
--- 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 13.277s 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.95s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 173ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 129ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow test 5.79s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.71s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 330ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 170ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 130ms 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 4.286s 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 3.239s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 310ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 200ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceStartingThreadExit
machine: 32 CPUs, load 24.49, cpu waiting 10.48%, memory waiting 0.00%, io waiting 1.39%
--- 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 39.8%, load 29.20
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
internal/runner/checks/network.go:72:46: unclassified node
internal/runner/checks/network.go:104:60: unclassified node
internal/runner/checks/network_test.go:131:92: unclassified node
reference scan: 2591 text files, 2865 matches, 3 failures
make[1]: *** [Makefile:238: runner-dead-references] Error 1
machine: 32 CPUs, load 37.27, cpu waiting 17.53%, memory waiting 0.00%, io waiting 1.10%
make: *** [Makefile:113: ci-shard] Error 2
amadan: step check shard 25 of 29 failed: exit status 2
--- 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 39.8%, load 29.20
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 48.49, cpu waiting 28.68%, memory waiting 0.00%, io waiting 0.87%
--- 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 39.8%, load 29.20
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===
No vulnerabilities found.
Your code is affected by 0 vulnerabilities.
This scan also found 0 vulnerabilities in packages you import and 3
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 41.65, cpu waiting 21.27%, memory waiting 0.00%, io waiting 1.03%
--- 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 39.8%, load 29.20
shard 28: make gitleaks
[90m10:29AM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m10:29AM[0m [32mINF[0m [1m1103 commits scanned.[0m
[90m10:29AM[0m [32mINF[0m [1mscanned ~61636826 bytes (61.64 MB) in 20.2s[0m
[90m10:29AM[0m [32mINF[0m [1mno leaks found[0m
machine: 32 CPUs, load 56.14, cpu waiting 31.21%, memory waiting 0.00%, io waiting 0.81%
amadan: job failed at step check shards 12, 17, 25 of 29 — its output is above, not at the tail of this log
diff --git a/internal/runner/provider/claude/realcli/approval_test.go b/internal/runner/provider/claude/realcli/approval_test.go| new file mode 100644 |
| index 00000000..83437ff9 |
| --- /dev/null |
| +++ b/internal/runner/provider/claude/realcli/approval_test.go |
| @@ -0,0 +1,386 @@ |
| +// Package realcli runs the pinned Claude CLI itself, in bubblewrap, |
| +// against a fake Messages API on loopback. |
| +package realcli |
| + |
| +import ( |
| + "bufio" |
| + "crypto/sha256" |
| + "encoding/hex" |
| + "encoding/json" |
| + "fmt" |
| + "io" |
| + "net" |
| + "net/http" |
| + "net/http/httptest" |
| + "os" |
| + "os/exec" |
| + "path/filepath" |
| + "runtime" |
| + "slices" |
| + "strconv" |
| + "strings" |
| + "sync" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/provider" |
| + "amadan.net/oficina/equipo/internal/runner/provider/claude" |
| + "amadan.net/oficina/equipo/internal/testci" |
| +) |
| + |
| +const canary = "sk-ant-oat01-equipo-canary-0f3a9c" |
| + |
| +// TestStepApprovalInThePinnedCLI: production 2026-11-22. A token |
| +// connection sets CLAUDE_CODE_SUBPROCESS_ENV_SCRUB, which turns the |
| +// pinned CLI's sandbox auto-approval off, so Engineering's ordinary shell |
| +// commands reached the step's permission callback and were refused. This |
| +// runs the real CLI under Equipo's Engineering settings, answers every |
| +// permission request with claude.StepPermission (over the CLI's stdio |
| +// control channel; production carries the same request over MCP), and |
| +// holds the approved commands to the sandbox: they run, but read no |
| +// protected file, see no credential, reach no network, write nothing |
| +// outside the workspace, and leave no process behind. |
| +func TestStepApprovalInThePinnedCLI(t *testing.T) { |
| + testci.Tools(t, "try-bin", "bwrap") |
| + binary := pinnedCLI(t) |
| + for _, mode := range []string{"token", "subscription"} { |
| + t.Run(mode, func(t *testing.T) { approvalRun(t, binary, mode) }) |
| + } |
| +} |
| + |
| +func pinnedCLI(t *testing.T) string { |
| + home, err := os.UserHomeDir() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + binary := filepath.Join(home, ".local/share/equipo/try/bin/claude") |
| + f, err := os.Open(binary) |
| + if os.IsNotExist(err) { |
| + testci.Absent(t, "pinned Claude 2.1.312 binary absent; the approval regression runs the local pinned installation") |
| + } |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + sum := sha256.New() |
| + _, err = io.Copy(sum, f) |
| + f.Close() |
| + pin, ok := claude.ReleasePin(runtime.GOARCH) |
| + if err != nil || !ok || hex.EncodeToString(sum.Sum(nil)) != pin { |
| + t.Fatal("pinned Claude digest differs") |
| + } |
| + return binary |
| +} |
| + |
| +func approvalRun(t *testing.T, binary, mode string) { |
| + root := t.TempDir() |
| + work, runnerHome, cred, cfg := filepath.Join(root, "workspace"), filepath.Join(root, "home"), filepath.Join(root, "cred"), filepath.Join(root, "config") |
| + for _, d := range []string{filepath.Join(work, "internal"), runnerHome, cred, cfg} { |
| + if err := os.MkdirAll(d, 0o700); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + os.WriteFile(filepath.Join(work, "internal", "door.go"), []byte("package internal\n"), 0o600) |
| + os.WriteFile(filepath.Join(cred, ".credentials.json"), []byte(`{"canary":"`+canary+`"}`), 0o600) |
| + env := []string{} |
| + if mode == "token" { |
| + env = append(env, provider.OAuthTokenEnv+"="+canary, provider.ScrubEnv+"=1") |
| + } else { |
| + os.MkdirAll(filepath.Join(runnerHome, ".claude"), 0o700) |
| + os.WriteFile(filepath.Join(runnerHome, ".claude", ".credentials.json"), []byte(`{"claudeAiOauth":{"accessToken":"`+canary+`","refreshToken":"`+canary+`-refresh","expiresAt":4102444800000,"scopes":["user:inference","user:profile"],"subscriptionType":"max"}}`), 0o600) |
| + } |
| + b := provider.Binding{ID: "binding", Provider: "claude", Home: runnerHome, CredentialHome: cred, RuntimeRoot: filepath.Join(root, "runtime")} |
| + profile, _ := provider.Profile("implement") |
| + in, err := claude.PolicyInputs(b, provider.PolicyInputs{Action: "implement", Tools: profile.MCPTools()}, profile.Specialist, "claude-opus-5-5") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + // StepPermission reads the policy's manifest: its settings and tools. |
| + manifest, _ := json.Marshal(map[string]any{"Settings": in.Settings, "Tools": in.Tools, "DeniedPaths": in.DeniedPaths}) |
| + policy := provider.Policy{Manifest: manifest} |
| + os.WriteFile(filepath.Join(cfg, "equipo-settings.json"), in.Settings, 0o600) |
| + os.WriteFile(filepath.Join(cfg, "equipo-mcp.json"), []byte(`{"mcpServers":{}}`), 0o600) |
| + |
| + marker := "3" + strconv.Itoa(1000+os.Getpid()%8000) |
| + api := fakeAPI(t) |
| + port := api.URL[strings.LastIndex(api.URL, ":")+1:] |
| + // The protected paths come from command substitution, so the CLI |
| + // cannot check them itself: only the sandbox stands between the |
| + // command and the file. |
| + hidden := []string{ |
| + `c=$(printf /config); cat $c/equipo-settings.json 2>&1; echo read-rc=$?`, |
| + `h=$(printf /home/runner); ls -A $h $h/.claude 2>&1; cat $h/.claude/.credentials.json 2>&1; echo listed`, |
| + `k=$(printf ` + cred + `); cat $k/.credentials.json 2>&1; echo cred-rc=$?`, |
| + `p=$(printf /proc); env; tr '\0' '\n' < $p/self/environ 2>&1; tr '\0' '\n' < $p/1/environ 2>&1; echo env-done`, |
| + `for d in $(printf '/config ` + cred + ` /home/runner'); do echo probe > $d/written 2>&1; done; echo wrote`, |
| + `timeout 3 bash -c 'echo > /dev/tcp/127.0.0.1/` + port + `' 2>&1 && echo connected || echo refused`, |
| + } |
| + script := []tool{bash(`cd internal && ls`), bash(`echo ok > /workspace/written && echo ws-ok`)} |
| + for _, c := range hidden { |
| + script = append(script, bash(c)) |
| + } |
| + api.script(append(script, tool{"Bash", map[string]any{"command": "sleep " + marker, "run_in_background": true}})) |
| + // The argv Equipo launches, with the permission callback on the CLI's |
| + // stdio channel and no MCP servers (this test answers in-process). |
| + argv := slices.Clone(in.Argv) |
| + for i := range argv { |
| + switch argv[i] { |
| + case "mcp__equipo__permission": |
| + argv[i] = "stdio" |
| + } |
| + } |
| + args := []string{"--unshare-user", "--unshare-pid", "--unshare-ipc", "--unshare-uts", "--die-with-parent", "--new-session", |
| + "--ro-bind", "/usr", "/usr", "--symlink", "usr/bin", "/bin", "--symlink", "usr/lib", "/lib", "--symlink", "usr/lib64", "/lib64", |
| + "--ro-bind", "/etc", "/etc", "--proc", "/proc", "--dev", "/dev", "--tmpfs", "/tmp", |
| + "--bind", runnerHome, "/home/runner", "--bind", work, "/workspace", "--bind", cred, cred, "--bind", cfg, "/config", |
| + "--ro-bind", binary, "/opt/claude", "--chdir", "/workspace", "--clearenv", |
| + "--setenv", "HOME", "/home/runner", "--setenv", "TMPDIR", "/tmp", "--setenv", "PATH", "/usr/bin:/bin:/opt", "--setenv", "CLAUDE_CODE_TMPDIR", "/tmp", |
| + "--setenv", "ANTHROPIC_BASE_URL", api.URL, "--setenv", "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC", "1", "--setenv", "DISABLE_AUTOUPDATER", "1"} |
| + for _, kv := range env { |
| + k, v, _ := strings.Cut(kv, "=") |
| + args = append(args, "--setenv", k, v) |
| + } |
| + cmd := exec.Command("bwrap", append(args, argv...)...) |
| + stdin, _ := cmd.StdinPipe() |
| + stdout, _ := cmd.StdoutPipe() |
| + var stderr strings.Builder |
| + cmd.Stderr = &stderr |
| + if err := cmd.Start(); err != nil { |
| + t.Fatal(err) |
| + } |
| + done := make(chan struct{}) |
| + t.Cleanup(func() { _ = cmd.Process.Kill(); <-done }) |
| + go func() { _ = cmd.Wait(); close(done) }() |
| + send := func(v any) { raw, _ := json.Marshal(v); stdin.Write(append(raw, '\n')) } |
| + send(map[string]any{"type": "user", "message": map[string]any{"role": "user", "content": "go"}}) |
| + |
| + results, asked := map[string]string{}, map[string]string{} |
| + uses := map[string]string{} |
| + lines := make(chan []byte) |
| + go func() { |
| + sc := bufio.NewScanner(stdout) |
| + sc.Buffer(make([]byte, 1<<20), 16<<20) |
| + for sc.Scan() { |
| + lines <- slices.Clone(sc.Bytes()) |
| + } |
| + close(lines) |
| + }() |
| + deadline := time.After(150 * time.Second) |
| +read: |
| + for { |
| + select { |
| + case <-deadline: |
| + t.Fatalf("no result in time; stderr: %s", stderr.String()) |
| + case line, ok := <-lines: |
| + if !ok { |
| + break read |
| + } |
| + var m struct { |
| + RequestID string `json:"request_id"` |
| + Kind string `json:"type"` |
| + Request struct { |
| + Subtype string |
| + ToolName string `json:"tool_name"` |
| + Input json.RawMessage `json:"input"` |
| + ToolUseID string `json:"tool_use_id"` |
| + } |
| + Message struct{ Content []json.RawMessage } |
| + } |
| + if json.Unmarshal(line, &m) != nil { |
| + continue |
| + } |
| + switch m.Kind { |
| + case "control_request": |
| + if m.Request.Subtype != "can_use_tool" { |
| + continue |
| + } |
| + raw, _ := json.Marshal(map[string]any{"tool_name": m.Request.ToolName, "tool_use_id": m.Request.ToolUseID, "input": m.Request.Input}) |
| + answer := claude.StepPermission(raw, policy) |
| + var in struct{ Command string } |
| + _ = json.Unmarshal(m.Request.Input, &in) |
| + asked[in.Command] = string(answer) |
| + send(map[string]any{"type": "control_response", "response": map[string]any{"subtype": "success", "request_id": m.RequestID, "response": json.RawMessage(answer)}}) |
| + case "assistant", "user": |
| + for _, c := range m.Message.Content { |
| + var b struct { |
| + Type, ID, Name string |
| + ToolUseID string `json:"tool_use_id"` |
| + Input map[string]any |
| + Content json.RawMessage |
| + IsError bool `json:"is_error"` |
| + } |
| + if json.Unmarshal(c, &b) != nil { |
| + continue |
| + } |
| + if b.Type == "tool_use" { |
| + uses[b.ID], _ = b.Input["command"].(string) |
| + } |
| + if b.Type == "tool_result" { |
| + var text string |
| + if json.Unmarshal(b.Content, &text) != nil { |
| + text = string(b.Content) |
| + } |
| + results[uses[b.ToolUseID]] = fmt.Sprintf("error=%v %s", b.IsError, text) |
| + } |
| + } |
| + case "result": |
| + break read |
| + } |
| + } |
| + } |
| + running := false |
| + for i := 0; i < 30 && !running; i++ { |
| + running = sleeping(marker) |
| + time.Sleep(100 * time.Millisecond) |
| + } |
| + _ = cmd.Process.Kill() |
| + <-done |
| + if !running { |
| + t.Error("the background command never ran") |
| + } |
| + all := "" |
| + for _, r := range results { |
| + all += r + "\n" |
| + } |
| + t.Logf("%s mode: %d tool results, %d asked", mode, len(results), len(asked)) |
| + expect := func(command, want string) { |
| + t.Helper() |
| + got, ok := results[command] |
| + if !ok || !strings.Contains(got, want) { |
| + t.Errorf("%s: %q, want %q (stderr %s)", command, got, want, stderr.String()) |
| + } |
| + } |
| + expect(`cd internal && ls`, "door.go") |
| + expect(`echo ok > /workspace/written && echo ws-ok`, "ws-ok") |
| + for _, c := range hidden { |
| + // Scrub mode has no automatic approval: each reaches the step. |
| + if mode == "token" && !strings.Contains(asked[c], `"allow"`) { |
| + t.Errorf("%s: not approved through the step's callback: %q", c, asked[c]) |
| + } |
| + } |
| + expect(hidden[0], "read-rc=1") |
| + expect(hidden[1], "listed") |
| + expect(hidden[2], "cred-rc=1") |
| + expect(hidden[3], "env-done") |
| + expect(hidden[4], "wrote") |
| + expect(hidden[5], "refused") |
| + if strings.Contains(all, canary) || strings.Contains(all, `"enabled":true`) || strings.Contains(all, ".credentials.json\n") { |
| + t.Errorf("a sandboxed command read a credential or the policy:\n%s", all) |
| + } |
| + for _, name := range []string{filepath.Join(cfg, "written"), filepath.Join(cred, "written"), filepath.Join(runnerHome, "written")} { |
| + if _, err := os.Stat(name); err == nil { |
| + t.Errorf("a sandboxed command wrote %s", name) |
| + } |
| + } |
| + if _, err := os.Stat(filepath.Join(work, "written")); err != nil { |
| + t.Error("the workspace write did not land") |
| + } |
| + if _, ok := asked[`cd internal && ls`]; mode == "token" && !ok { |
| + t.Error("in scrub mode an ordinary command did not reach the step's callback") |
| + } |
| + if api.calls() < len(script)+1 { |
| + t.Errorf("the scripted turn did not finish: %d API calls", api.calls()) |
| + } |
| + for i := 0; i < 50 && sleeping(marker); i++ { |
| + time.Sleep(100 * time.Millisecond) |
| + } |
| + if sleeping(marker) { |
| + t.Errorf("background command outlived the session: sleep %s", marker) |
| + } |
| +} |
| + |
| +// sleeping reports a host process running `sleep marker`. |
| +func sleeping(marker string) bool { |
| + entries, _ := os.ReadDir("/proc") |
| + for _, e := range entries { |
| + raw, err := os.ReadFile(filepath.Join("/proc", e.Name(), "cmdline")) |
| + if err == nil && strings.Contains(string(raw), "sleep\x00"+marker) { |
| + return true |
| + } |
| + } |
| + return false |
| +} |
| + |
| +type tool struct { |
| + name string |
| + input map[string]any |
| +} |
| + |
| +func bash(command string) tool { return tool{"Bash", map[string]any{"command": command}} } |
| + |
| +type api struct { |
| + *httptest.Server |
| + mu sync.Mutex |
| + tools []tool |
| + next int |
| + n int |
| +} |
| + |
| +func (a *api) script(tools []tool) { a.mu.Lock(); a.tools = tools; a.mu.Unlock() } |
| +func (a *api) calls() int { a.mu.Lock(); defer a.mu.Unlock(); return a.n } |
| + |
| +// fakeAPI answers the Messages API on loopback: each request offering |
| +// the Bash tool gets the next scripted tool call, then a closing text. |
| +func fakeAPI(t *testing.T) *api { |
| + a := &api{} |
| + l, err := net.Listen("tcp", "127.0.0.1:0") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + a.Server = httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| + var body struct { |
| + Model string |
| + Stream bool |
| + Tools []struct{ Name string } |
| + } |
| + _ = json.NewDecoder(r.Body).Decode(&body) |
| + if !strings.HasSuffix(r.URL.Path, "/v1/messages") { |
| + if strings.HasSuffix(r.URL.Path, "/count_tokens") { |
| + w.Write([]byte(`{"input_tokens":10}`)) |
| + return |
| + } |
| + http.NotFound(w, r) |
| + return |
| + } |
| + block := map[string]any{"type": "text", "text": "done"} |
| + stop := "end_turn" |
| + if slices.ContainsFunc(body.Tools, func(x struct{ Name string }) bool { return x.Name == "Bash" }) { |
| + a.mu.Lock() |
| + a.n++ |
| + if a.next < len(a.tools) { |
| + tl := a.tools[a.next] |
| + block = map[string]any{"type": "tool_use", "id": fmt.Sprintf("toolu_%03d", a.next), "name": tl.name, "input": tl.input} |
| + stop = "tool_use" |
| + a.next++ |
| + } |
| + a.mu.Unlock() |
| + } |
| + msg := map[string]any{"id": "msg_x", "type": "message", "role": "assistant", "model": body.Model, "content": []any{}, "stop_reason": nil, "stop_sequence": nil, "usage": map[string]int{"input_tokens": 1, "output_tokens": 1}} |
| + if !body.Stream { |
| + msg["content"], msg["stop_reason"] = []any{block}, stop |
| + json.NewEncoder(w).Encode(msg) |
| + return |
| + } |
| + w.Header().Set("content-type", "text/event-stream") |
| + ev := func(name string, v any) { |
| + raw, _ := json.Marshal(v) |
| + fmt.Fprintf(w, "event: %s\ndata: %s\n\n", name, raw) |
| + } |
| + ev("message_start", map[string]any{"type": "message_start", "message": msg}) |
| + if block["type"] == "tool_use" { |
| + input, _ := json.Marshal(block["input"]) |
| + ev("content_block_start", map[string]any{"type": "content_block_start", "index": 0, "content_block": map[string]any{"type": "tool_use", "id": block["id"], "name": block["name"], "input": map[string]any{}}}) |
| + ev("content_block_delta", map[string]any{"type": "content_block_delta", "index": 0, "delta": map[string]any{"type": "input_json_delta", "partial_json": string(input)}}) |
| + } else { |
| + ev("content_block_start", map[string]any{"type": "content_block_start", "index": 0, "content_block": map[string]any{"type": "text", "text": ""}}) |
| + ev("content_block_delta", map[string]any{"type": "content_block_delta", "index": 0, "delta": map[string]any{"type": "text_delta", "text": "done"}}) |
| + } |
| + ev("content_block_stop", map[string]any{"type": "content_block_stop", "index": 0}) |
| + ev("message_delta", map[string]any{"type": "message_delta", "delta": map[string]any{"stop_reason": stop, "stop_sequence": nil}, "usage": map[string]int{"output_tokens": 1}}) |
| + ev("message_stop", map[string]any{"type": "message_stop"}) |
| + })) |
| + a.Server.Listener.Close() |
| + a.Server.Listener = l |
| + a.Start() |
| + t.Cleanup(a.Close) |
| + return a |
| +} |