Merge review fixes: unresolved requests, preflight, write scope
Astra's review of e67dd891 (NOT READY), four findings.
1 (high) A local refusal after an unresolved request ended definite.
MergeBranch now treats a NotSentError as definite only when no earlier
request is unresolved (record not requested); otherwise it reconciles
from the default branch and stays uncertain, record kept requested.
2 (medium) The real path inspects before the request, and inspection
needs the credential, so a missing credential ended merge_failed.
BranchMerge.Preflight runs the runner's own checks before Inspect:
the merge step wires it to the forge (Forges.MergePreflight ->
fileForge.writeCredential). Definite merge_credential when no request
was ever sent; uncertain when a requested record exists.
3 (medium) Cached or stale scope could authorise a fallback write.
writeCredential (merge and push): a repository's own entry, else the
agent-wide credential only if the hub, asked now (conditional GET),
lists it in a list fetched with that same credential. list() binds
its cache and validator to the credential (sha256 of agent+bearer,
never the bearer) and drops both when the credential changes; a
failed refresh leaves the list unconfirmed, so writes fail closed.
created-repos.json alone no longer admits a write. Reads, CI reads
and the start check keep the credential-only lookup.
4 (low) Legacy files used the first sorted entry. Agent() keeps the
explicit api; in a legacy file it is the one bearer every usable
entry shares (one git password), else none. The hub's list, fetched
with that bearer, must still name the repository (3). The start check
logs one fixed warning for a legacy file.
TestRouterWithProductionFileForge's pinned hub calls gain the two
per-write list requests. thin size budget raised to 28642/23074.
Fail first (stubs for Preflight, Legacy and the warning so the tests
compiled; then go test -run on the new tests):
forge TestMergeBranchLocalRefusalAfterAnUnresolvedRequest FAIL
(definite "no usable forge credential" after an unresolved request)
forge TestMergeBranchPreflight FAIL (1 inspection, 1 confirm, 1 request)
forge TestForgeCredentialLegacyAgentRule FAIL (provider_identity_mismatch)
thin TestMergeFallbackNeedsCurrentWriteScope FAIL: revoked, list fails,
credential replaced, renamed each merged (1 request)
thin TestMergeStepCredentialIntegrated FAIL: missing file and unusable
entry each ended merge_failed, "merge outcome unknown: reading the
repository"
thin TestCheckCredentialsWarnsOnLegacyFiles FAIL (no warning)
Mutation checks (python script: one edit, go test -run, restore):
N1 NotSent definite after an unresolved request ->
TestMergeBranchLocalRefusalAfterAnUnresolvedRequest FAIL
N2 preflight definite after an unresolved request -> same test FAIL
N3 preflight never called -> TestMergeBranchPreflight FAIL
N4 merge step sets no preflight -> TestMergeStepCredentialIntegrated FAIL
N5 list kept across a credential change (only listKey updated) ->
TestMergeFallbackNeedsCurrentWriteScope/credential_replaced_behind_a_
validator FAIL (first attempt, listKey frozen, was not observable:
replaced by this one and the validator subtest)
N6 write trusts the cached list -> .../revoked FAIL
N7 failed refresh keeps the old list -> .../list_fails FAIL
N8 no hub scope for the fallback -> .../renamed FAIL
N9 legacy file keeps the first bearer -> TestForgeCredentialLegacyAgentRule FAIL
N10 no legacy warning -> TestCheckCredentialsWarnsOnLegacyFiles FAIL
Local: go test ./internal/runner/forge ./internal/wire (ok);
./internal/runner/thin -run 'Merge|Forge|Access|Remote|Push|CIHosted|
CIStatus|Create|Adopt|Startup|Clone|Catalog|Index|Reach|Credential' (ok);
./internal/thintest -run 'Merge|Review|Create|Push' (ok); gofmt, vet,
make staticcheck, make budget, testci TestBudgetRecordsAreShort clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 files changed,
+488
−62
.rastrillo/budgets.txt+1 −1internal/runner/forge/credential_file.go+40 −5internal/runner/forge/credential_file_test.go+27 −0internal/runner/forge/merge.go+23 −5internal/runner/forge/merge_notsent_test.go+74 −0internal/runner/forge/repositories.go+4 −0internal/runner/thin/forge.go+110 −33internal/runner/thin/forges.go+19 −0internal/runner/thin/forges_review_test.go+3 −1internal/runner/thin/merge_credential_test.go+182 −17internal/runner/thin/mergestep.go+5 −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/merge-credential-fallback: 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.4s
ci-box: claude: fetched and verified in 1.3s
ci-box: codex: fetched and verified in 3.5s
ci-box: codex-code-mode-host: fetched and verified in 1.4s
ci-box: libwrap: fetched and verified in 0.4s
ci-box: socat: fetched and verified in 0.4s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 10.0s
ci-box: pi: installed and verified in 7.2s
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 9.5s
ci-box: clone deepened in 4.2s
ci-box: file times set from content: 2989 files, 193 directories
ci-box: ready in 17.3s
=== 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.146s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
3.3s
+ go list -export -test -tags testbuild -f ./...
4.4s
+ go list -export -test -tags browser,testbuild -f ./internal/equipo ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
3.1s
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 1m15.833s 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.124s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m14.12s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 69.84, cpu waiting 37.01%, 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.86s 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 1m13.199s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m13.2s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 69.84, cpu waiting 37.01%, 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 1m15.881s 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 1m13.983s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m4.73s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 4.98s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.27s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 69.84, cpu waiting 37.24%, memory waiting 0.00%, io waiting 0.46%
--- 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 1m13.835s 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.193s amadan.net/oficina/equipo/internal/headless
receipt: slow test 35.45s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 19.22s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.04s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
receipt: slow test 8.47s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
machine: 32 CPUs, load 69.84, cpu waiting 37.01%, memory waiting 0.00%, io waiting 0.47%
--- 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 1m31.436s 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 1m29.646s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m0.65s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.26s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.07s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.67s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 64.87, cpu waiting 36.98%, 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 2m41.888s 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 2m39.999s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m34.28s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 18.56s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 8.63s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 6.57s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
receipt: slow test 6.37s amadan.net/oficina/equipo/internal/headless TestHeadlessBatchAfterRefusedReply
machine: 32 CPUs, load 26.47, cpu waiting 12.50%, 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 2m8.44s 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 2m6.735s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 8.22s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.71s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 3.74s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 3.64s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 2.43s amadan.net/oficina/equipo/internal/thintest TestResearchDoneFallsBack
machine: 32 CPUs, load 39.30, cpu waiting 21.88%, memory waiting 0.00%, io waiting 0.19%
--- 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 1m30.103s 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 1m28.466s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.09s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.46s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.35s amadan.net/oficina/equipo/internal/thintest TestContractPublishNameTaken
receipt: slow test 2.34s amadan.net/oficina/equipo/internal/thintest TestContractPreview
machine: 32 CPUs, load 64.87, cpu waiting 36.98%, memory waiting 0.00%, io waiting 0.36%
--- 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 4m45.905s, over the 45s its record on line 44 allows; reported only, timing fails on CI
receipt: test step 4m51.556s 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 4m45.905s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 37.06s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 37.02s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.84s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.47s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.95s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 3.84, cpu waiting 1.48%, 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.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 49.544s amadan.net/oficina/equipo/internal/runner
receipt: slow test 29.51s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 58.70, cpu waiting 32.10%, memory waiting 0.00%, io waiting 0.71%
--- 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 59.678s 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 58.426s amadan.net/oficina/equipo/internal/runner
receipt: slow test 48.39s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 43.39s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.41s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 69.36, cpu waiting 36.03%, memory waiting 0.00%, io waiting 0.62%
--- 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.835s 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.998s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.14s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.51s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.13s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.55s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 36.55, cpu waiting 21.78%, memory waiting 0.00%, io waiting 0.90%
--- 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 38.2%, load 29.46
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
receipt: test step 1m8.114s 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.233s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 27.86s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 27.68s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 25.62s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 22.81s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 22.7s amadan.net/oficina/equipo/internal/equipotest TestAccountConcurrentDuplicate
machine: 32 CPUs, load 59.43, cpu waiting 34.92%, memory waiting 0.00%, io waiting 0.31%
--- 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 38.2%, load 29.46
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 1m17.947s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m16.017s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 20.32s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 20.31s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
receipt: slow test 20.31s amadan.net/oficina/equipo/internal/equipotest TestProjectsSharedAndGrouped
receipt: slow test 20.3s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 20.14s amadan.net/oficina/equipo/internal/equipotest TestProjectBindingUniqueness
machine: 32 CPUs, load 51.97, cpu waiting 30.02%, memory waiting 0.00%, io waiting 0.26%
--- 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 38.2%, load 29.46
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 1m13.994s 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.816s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 15.46s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.23s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.3s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.28s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.21s amadan.net/oficina/equipo/internal/equipotest TestRosterProtectsLastOwner
machine: 32 CPUs, load 55.71, cpu waiting 31.92%, memory waiting 0.00%, io waiting 0.28%
--- 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 38.2%, load 29.46
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 1m9.065s 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.157s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 25.87s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 25.57s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 25.49s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 23.79s amadan.net/oficina/equipo/internal/equipotest TestSigninBackgroundSweep
receipt: slow test 23.79s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsConcurrentRevision
machine: 32 CPUs, load 59.43, cpu waiting 33.91%, memory waiting 0.00%, io waiting 0.30%
--- 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 38.2%, load 29.46
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
rastrillo: budget test: go test failed
--- 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 work.reason.merge_credential
--- FAIL: TestPlan3ReleaseBoundaries/inventory (0.02s)
--- FAIL amadan.net/oficina/equipo/internal/plan3test (package output)
FAIL
rastrillo-budget/v1 ran 51.75s
FAIL amadan.net/oficina/equipo/internal/plan3test 52.050s
receipt: test step 53.578s 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.75s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.75s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.49s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.68s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.59s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.29s amadan.net/oficina/equipo/internal/plan3test TestPlanMigrationUpgrade
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 work.reason.merge_credential
--- FAIL: TestPlan3ReleaseBoundaries (0.02s)
--- FAIL: TestPlan3ReleaseBoundaries/inventory (0.02s)
FAIL
rastrillo-budget/v1 ran 18ms
FAIL amadan.net/oficina/equipo/internal/plan3test 0.232s
FAIL
machine: 32 CPUs, load 66.34, cpu waiting 37.23%, memory waiting 0.00%, io waiting 0.40%
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 38.2%, load 29.46
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/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/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/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/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/testci: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/containment: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
--- FAIL amadan.net/oficina/equipo/internal/runner/checks TestDependencyStage
=== RUN TestDependencyStage
testing.go:1464: TempDir RemoveAll cleanup: unlinkat /tmp/TestDependencyStage3209543377: directory not empty
--- FAIL: TestDependencyStage (0.05s)
--- FAIL amadan.net/oficina/equipo/internal/runner/checks (package output)
FAIL
rastrillo-budget/v1 ran 52.553s
FAIL amadan.net/oficina/equipo/internal/runner/checks 52.659s
budget note: internal/equipo took 52.133s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 20.241s, 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.375s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 1m48.066s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 37.921s, 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 47.75s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 12.617s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 2m28.983s against a 60s target (the gate's other steps are not in this figure)
receipt: 21 packages ran, 44 cached, 17 without tests, 1 failed
receipt: slow package 1m48.066s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m6.381s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 52.833s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 52.553s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 52.133s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 53.01s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 44.99s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 44.48s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
receipt: slow test 43.86s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
receipt: slow test 43.19s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestDependencyStage$' -count=1 ./internal/runner/checks (retry, once)
FAILED TWICE ./internal/runner/checks:TestDependencyStage rest
=== RUN TestDependencyStage
testing.go:1464: TempDir RemoveAll cleanup: unlinkat /tmp/TestDependencyStage1484129642: directory not empty
--- FAIL: TestDependencyStage (0.03s)
FAIL
rastrillo-budget/v1 ran 34ms
FAIL amadan.net/oficina/equipo/internal/runner/checks 0.039s
FAIL
machine: 32 CPUs, load 19.71, cpu waiting 9.26%, memory waiting 0.00%, io waiting 0.07%
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 1m24.532s 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.04s amadan.net/oficina/equipo/internal/headless
receipt: slow test 38.43s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.76s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.57s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.14s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.38s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 66.34, cpu waiting 37.22%, 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 1m28.558s 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.013s amadan.net/oficina/equipo/internal/headless
receipt: slow test 26.73s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 20.28s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13.14s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 9.27s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 9.09s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 64.87, cpu waiting 36.98%, memory waiting 0.00%, io waiting 0.36%
--- 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 1m52.165s 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 1m50.488s amadan.net/oficina/equipo/internal/headless
receipt: slow test 13.73s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.31s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 11.88s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.35s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
receipt: slow test 11.31s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
machine: 32 CPUs, load 48.37, cpu waiting 28.15%, 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|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-25T20:46:04.884Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-25T20:46:04.884Z level=INFO msg="startup phase done" phase=state_lock took=226µs
time=2026-11-25T20:46:04.884Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-25T20:46:04.884Z level=INFO msg="startup phase done" phase=claim_roots took=113µs
time=2026-11-25T20:46:04.884Z level=INFO msg="startup phase" phase=sweep
time=2026-11-25T20:46:04.922Z level=INFO msg="startup phase done" phase=sweep took=38.081ms
time=2026-11-25T20:46:04.922Z level=INFO msg="startup phase" phase=credentials
time=2026-11-25T20:46:04.922Z level=INFO msg="startup phase done" phase=credentials took=111µs
time=2026-11-25T20:46:04.922Z level=INFO msg="startup phase" phase=open_state
time=2026-11-25T20:46:04.978Z level=INFO msg="startup phase done" phase=open_state took=55.919ms
time=2026-11-25T20:46:04.979Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-25T20:46:04.981Z level=INFO msg=connecting host=127.0.0.1:37955 protocol=29
time=2026-11-25T20:46:04.983Z level=INFO msg=connected host=127.0.0.1:37955 took=2.103ms
time=2026-11-25T20:46:04.983Z level=INFO msg="capabilities gathering"
time=2026-11-25T20:46:04.983Z level=INFO msg="capabilities gathered" took=425µs tags=linux,claude,go
time=2026-11-25T20:46:04.986Z level=INFO msg="hello sent" protocol=29
time=2026-11-25T20:46:04.989Z level=INFO msg=welcome protocol=29 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.31s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m31.762s
FAIL amadan.net/oficina/equipo/internal/headless 92.049s
receipt: test step 1m33.442s 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 1m31.762s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.11s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.01s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 10.25s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 9.59s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.46s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|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 d7db326e053223c7b10c2f5f191053404a835fe6 6.31s 63.04
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 59.43, cpu waiting 34.92%, memory waiting 0.00%, io waiting 0.31%
--- 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.321s 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 627ms amadan.net/oficina/equipo/internal/equipo
receipt: slow test 630ms 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.504s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 11.673s 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.504s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 8.32s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.19s 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.694s 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.132s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.13s 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 3m36.605s 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 3m35.057s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 21.97s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.42s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.09s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.65s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.14s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 8.97, cpu waiting 3.77%, memory waiting 0.00%, io waiting 0.02%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless (52s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.58s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.28s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 8.74s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 8.37s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 26.81s
+ 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 (61s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 13.57s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 20.26s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 9.90s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 15.20s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (20s)
ok ./internal/headless TestMixedVersions 18.58s
+ 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.06s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 70.37, cpu waiting 36.80%, memory waiting 0.00%, io waiting 0.58%
--- 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.321s 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 8.073s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 275ms 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/pi
receipt: slow test 5.75s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.75s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 410ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 270ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 140ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxToolchain
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.706s 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.229s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 330ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 250ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReapsOrphans
machine: 32 CPUs, load 23.91, cpu waiting 11.28%, memory waiting 0.00%, io waiting 1.22%
--- 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 38.2%, load 29.46
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2702 text files, 3210 matches, 0 failures
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go tool fiesta spacing -skip tokens.css internal/equipo/static
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 92 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok amadan.net/oficina/equipo/internal/equipo 2.530s
machine: 32 CPUs, load 69.22, cpu waiting 36.91%, memory waiting 0.00%, io waiting 0.53%
--- 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 38.2%, load 29.46
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 58.70, cpu waiting 28.87%, memory waiting 0.00%, io waiting 0.76%
--- 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 38.2%, load 29.46
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 44.52, cpu waiting 23.22%, memory waiting 0.00%, io waiting 0.87%
--- 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 38.2%, load 29.46
shard 28: make gitleaks
[90m8:45PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m8:46PM[0m [32mINF[0m [1m1155 commits scanned.[0m
[90m8:46PM[0m [32mINF[0m [1mscanned ~65836432 bytes (65.84 MB) in 22.8s[0m
[90m8:46PM[0m [32mINF[0m [1mno leaks found[0m
machine: 32 CPUs, load 65.13, cpu waiting 33.37%, memory waiting 0.00%, io waiting 0.69%
amadan: job failed at step check shards 16, 17 of 29 — its output is above, not at the tail of this log
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 2ee2da92..c649b7d9 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -38,7 +38,7 @@ time internal/runner/provider 15s Plan 3 CI repair measured 10.346s for the full |
| perf GET /releases/* skip Verified runner release file downloads, not browser GET screens. |
| perf GET /install.sh skip Mac runners: the one-line bootstrap a terminal pipes to sh, not a browser screen. |
| time internal/runner/containment 15s Plan 3 loaded CI measured 10.817s; |
| -size internal/runner/thin 28541 22907 Forge fixes and protocol 29 (2026-11-24), merge credential fallback and local refusals (2026-11-25); measured 28541/22907. |
| +size internal/runner/thin 28642 23074 Forge fixes and protocol 29 (2026-11-24), merge credential fallback and write scope (2026-11-25); measured 28642/23074. |
| time internal/thintest 240s Thin contract and page tests, the Assistant's and the models' included, share one harness. Measured 202s on a shared 16 CPU box (2026-11-13); CI runs two lanes. |
| time internal/runner/mac 30s Mac runners (Darwin worker): real process groups killed after a grace and proven gone (SIGTERM, SIGKILL, the marker sweep), and the probes run end to end with fake srt and xcodebuild, P6 killing. |
| time internal/runner/thin 45s Thin v1 slice 4 review: real git repositories for the merge and squash checks, a stalled fetch, and a 16 MiB candidate streamed through the review diff and the checks pack (about 5s). |
diff --git a/internal/runner/forge/credential_file.go b/internal/runner/forge/credential_file.go| index 309eff08..66a01621 100644 |
| --- a/internal/runner/forge/credential_file.go |
| +++ b/internal/runner/forge/credential_file.go |
| @@ -23,9 +23,12 @@ type forgeCredentialFile struct { |
| Repositories map[string]json.RawMessage `json:"repositories"` |
| } |
| -// Agent is the agent-wide credential: the file's own api and git, or, |
| -// in a file with per-repository entries only, the first of them (one |
| -// agent account serves them all). |
| +// Agent is the agent-wide credential: the file's own api and git. In a |
| +// legacy file, with per-repository entries only, one agent account serves |
| +// them all, so it is the one bearer every usable entry shares (with the |
| +// one git password they give); entries that disagree name no agent |
| +// credential, never whichever sorts first. A fallback write with it still |
| +// needs the hub's list, fetched with that bearer, to name the repository. |
| func (f FileCredentials) Agent(ctx context.Context) (Credential, error) { |
| var file forgeCredentialFile |
| if err := readCredentialFile(f.Path, &file); err != nil { |
| @@ -34,11 +37,37 @@ func (f FileCredentials) Agent(ctx context.Context) (Credential, error) { |
| if file.API != "" { |
| return agentCredential(file, "", file.API, file.Git) |
| } |
| - names, err := f.RepositoryNames() |
| + names, err := repositoryNames(file) |
| if err != nil || len(names) == 0 { |
| return Credential{}, provider.ErrIdentity |
| } |
| - return f.Credential(ctx, names[0]) |
| + var out Credential |
| + for _, name := range names { |
| + c, err := entryCredential(file, name) |
| + switch { |
| + case err != nil: |
| + case out.Bearer == "": |
| + out = c |
| + case c.Bearer != out.Bearer: |
| + return Credential{}, provider.ErrIdentity |
| + case c.GitPassword != "" && out.GitPassword == "": |
| + out.GitPassword = c.GitPassword |
| + case c.GitPassword != "" && c.GitPassword != out.GitPassword: |
| + return Credential{}, provider.ErrIdentity |
| + } |
| + } |
| + if out.Bearer == "" { |
| + return Credential{}, provider.ErrIdentity |
| + } |
| + out.Remote = "" |
| + return out, nil |
| +} |
| + |
| +// Legacy reports a file with per-repository entries and no agent-wide |
| +// api: its agent credential comes from Agent's legacy rule. |
| +func (f FileCredentials) Legacy() bool { |
| + var file forgeCredentialFile |
| + return readCredentialFile(f.Path, &file) == nil && file.API == "" && len(file.Repositories) > 0 |
| } |
| func agentCredential(file forgeCredentialFile, repo, api, git string) (Credential, error) { |
| @@ -57,6 +86,12 @@ func (f FileCredentials) Credential(_ context.Context, repo string) (Credential, |
| if err := readCredentialFile(f.Path, &file); err != nil { |
| return Credential{}, err |
| } |
| + return entryCredential(file, repo) |
| +} |
| + |
| +// entryCredential is repo's credential in a read file: its own entry, or |
| +// the agent-wide api when the file has one. |
| +func entryCredential(file forgeCredentialFile, repo string) (Credential, error) { |
| var entry struct { |
| API string `json:"api"` |
| Git string `json:"git"` |
diff --git a/internal/runner/forge/credential_file_test.go b/internal/runner/forge/credential_file_test.go| index 59e6edc6..6b5fdcb4 100644 |
| --- a/internal/runner/forge/credential_file_test.go |
| +++ b/internal/runner/forge/credential_file_test.go |
| @@ -112,3 +112,30 @@ func TestForgeCredentialAgentWide(t *testing.T) { |
| t.Fatal("a per-repository file crossed repositories") |
| } |
| } |
| + |
| +// TestForgeCredentialLegacyAgentRule: in a file without an agent-wide api |
| +// the agent credential is the one bearer all usable entries share, never |
| +// whichever entry sorts first; entries with different bearers give none. |
| +func TestForgeCredentialLegacyAgentRule(t *testing.T) { |
| + ctx := context.Background() |
| + write := func(raw string) FileCredentials { |
| + path := filepath.Join(t.TempDir(), "amadan.json") |
| + must(t, os.WriteFile(path, []byte(raw), 0600)) |
| + return FileCredentials{Path: path} |
| + } |
| + shared := write(`{"agent":"equipo~owner@example.test","repositories":{"amadan.net/ns/a":{"git":"git-broken"},"amadan.net/ns/b":{"api":"api-one","git":"git-one"},"amadan.net/ns/c":"api-one"}}`) |
| + if c, err := shared.Agent(ctx); err != nil || c.Bearer != "api-one" || c.GitPassword != "git-one" || c.Remote != "" { |
| + t.Fatalf("shared legacy %+v %v", c.Remote, err) |
| + } |
| + if !shared.Legacy() { |
| + t.Fatal("legacy file not reported") |
| + } |
| + mixed := write(`{"agent":"equipo~owner@example.test","repositories":{"amadan.net/ns/a":{"api":"api-a","git":"git-a"},"amadan.net/ns/b":{"api":"api-b","git":"git-b"}}}`) |
| + if c, err := mixed.Agent(ctx); err == nil { |
| + t.Fatalf("ambiguous legacy file chose %q", c.Bearer) |
| + } |
| + wide := write(`{"agent":"equipo~owner@example.test","api":"api-agent","git":"git-agent","repositories":{"amadan.net/ns/a":{"api":"api-a","git":"git-a"}}}`) |
| + if c, err := wide.Agent(ctx); err != nil || c.Bearer != "api-agent" || wide.Legacy() { |
| + t.Fatalf("agent-wide %+v %v", c.Remote, err) |
| + } |
| +} |
diff --git a/internal/runner/forge/merge.go b/internal/runner/forge/merge.go| index a4280c87..239ca94a 100644 |
| --- a/internal/runner/forge/merge.go |
| +++ b/internal/runner/forge/merge.go |
| @@ -263,6 +263,10 @@ type BranchMerge struct { |
| Request func(context.Context, MergeRequest) (MergeResult, error) |
| // Confirm checks the execution lease right before the request. |
| Confirm func(context.Context) error |
| + // Preflight, if set, makes the runner's own checks that need no |
| + // remote (the credential the inspection and the request use) before |
| + // the remote is read. It returns a NotSentError to refuse. |
| + Preflight func(context.Context) error |
| // beforeRequest runs right before the request (tests move the branch). |
| beforeRequest func() |
| } |
| @@ -413,6 +417,19 @@ func MergeBranch(ctx context.Context, m BranchMerge) (MergeOutcome, error) { |
| if found && rec.Phase == mergeMerged { |
| return MergeOutcome{SHA: rec.SHA, Into: rec.Into, Strategy: rec.Strategy, Source: SourceCached}, nil |
| } |
| + if m.Preflight != nil { |
| + // The runner's own refusals come before the remote is read (that |
| + // read needs the same credential). Definite only when no request |
| + // was ever sent: an earlier one may still land, and only the |
| + // default branch, unreadable now, can settle it. |
| + if err := m.Preflight(ctx); err != nil { |
| + var ns *NotSentError |
| + if found && rec.Phase == mergeRequested || !errors.As(err, &ns) { |
| + return MergeOutcome{}, uncertain(MergeResult{}, err) |
| + } |
| + return MergeOutcome{}, err |
| + } |
| + } |
| if !found { |
| rec = mergeRecord{Task: m.Task, Repo: m.Repo, Branch: m.Branch, Commit: m.Commit, Phase: mergePrepared, Strategy: m.Strategy} |
| } |
| @@ -452,11 +469,12 @@ func MergeBranch(ctx context.Context, m BranchMerge) (MergeOutcome, error) { |
| } |
| res, rerr := m.Request(ctx, MergeRequest{ExpectSHA: m.Commit, Message: m.Message, Strategy: m.Strategy, Agent: m.Agent}) |
| var notSent *NotSentError |
| - if errors.As(rerr, ¬Sent) { |
| - // Refused here before anything left for the hub: definite, and |
| - // nothing to reconcile. The record goes back to where it was |
| - // (prepared, unless an earlier request may be with the hub), so a |
| - // later Merge asks as usual. |
| + if errors.As(rerr, ¬Sent) && before != mergeRequested { |
| + // Refused here before anything left for the hub, and no earlier |
| + // request is unresolved: definite, nothing to reconcile. The |
| + // record goes back to prepared, so a later Merge asks as usual. |
| + // After an unresolved request it is no answer at all: the default |
| + // branch decides below, and the record stays requested. |
| rec.Phase = before |
| if err := m.save(rec); err != nil { |
| return MergeOutcome{}, ErrMergeUncertain |
diff --git a/internal/runner/forge/merge_notsent_test.go b/internal/runner/forge/merge_notsent_test.go| index b452f1bc..b82df158 100644 |
| --- a/internal/runner/forge/merge_notsent_test.go |
| +++ b/internal/runner/forge/merge_notsent_test.go |
| @@ -82,3 +82,77 @@ func TestHubMergeRefusesLocallyBeforeSending(t *testing.T) { |
| t.Fatalf("the hub was contacted %d times", hits.Load()) |
| } |
| } |
| + |
| +// TestMergeBranchLocalRefusalAfterAnUnresolvedRequest: a first request |
| +// whose answer was lost (it may still land) leaves the record requested. |
| +// A later local refusal must not end that as definite: it stays uncertain, |
| +// the remote is read again, and once the earlier request lands a restart |
| +// settles it from the default branch with no new request. |
| +func TestMergeBranchLocalRefusalAfterAnUnresolvedRequest(t *testing.T) { |
| + h := &fakeHub{head: strings.Repeat("a", 40), answer: mergeNow} |
| + m := newMerge(t, h) |
| + var delayed MergeRequest |
| + lost := m |
| + lost.Request = func(_ context.Context, req MergeRequest) (MergeResult, error) { |
| + delayed = req // the hub has it, and has not acted yet |
| + return MergeResult{}, errors.New("answer lost") |
| + } |
| + if _, err := MergeBranch(context.Background(), lost); !errors.Is(err, ErrMergeUncertain) { |
| + t.Fatalf("lost answer: %v", err) |
| + } |
| + var inspects atomic.Int32 |
| + refusing := m |
| + refusing.Inspect = func(ctx context.Context) (RemoteState, error) { inspects.Add(1); return h.inspect(ctx) } |
| + refusing.Request = func(context.Context, MergeRequest) (MergeResult, error) { |
| + return MergeResult{}, NotSent(m.Repo, ErrMergeNoCredential) |
| + } |
| + _, err := MergeBranch(context.Background(), refusing) |
| + if !errors.Is(err, ErrMergeUncertain) || errors.Is(err, ErrMergeNoCredential) { |
| + t.Fatalf("local refusal after an unresolved request: %v", err) |
| + } |
| + if inspects.Load() != 2 { |
| + t.Fatalf("not reconciled: %d inspections", inspects.Load()) |
| + } |
| + if rec, ok, _ := m.load(); !ok || rec.Phase != mergeRequested { |
| + t.Fatalf("record %+v", rec) |
| + } |
| + // A preflight refusal with the request still unresolved is uncertain too. |
| + preflight := m |
| + preflight.Preflight = func(context.Context) error { return NotSent(m.Repo, ErrMergeNoCredential) } |
| + if _, err := MergeBranch(context.Background(), preflight); !errors.Is(err, ErrMergeUncertain) { |
| + t.Fatalf("preflight after an unresolved request: %v", err) |
| + } |
| + // The delayed request lands; a restart settles it, asking nothing. |
| + h.mu.Lock() |
| + mergeNow(h, delayed) |
| + h.mu.Unlock() |
| + out, err := MergeBranch(context.Background(), m) |
| + if err != nil || !out.Reconciled || out.SHA != strings.Repeat("8", 40) || len(h.requests) != 0 { |
| + t.Fatalf("settled %+v %v (%d requests)", out, err, len(h.requests)) |
| + } |
| + if rec, ok, _ := m.load(); !ok || rec.Phase != mergeMerged { |
| + t.Fatalf("record after settling %+v", rec) |
| + } |
| +} |
| + |
| +// TestMergeBranchPreflight: a local refusal found before the remote is |
| +// read (the inspection itself needs the credential) is definite when no |
| +// request was ever sent: nothing is inspected, confirmed or requested. |
| +func TestMergeBranchPreflight(t *testing.T) { |
| + h := &fakeHub{head: strings.Repeat("a", 40), answer: mergeNow} |
| + m := newMerge(t, h) |
| + var inspects, confirms atomic.Int32 |
| + m.Inspect = func(ctx context.Context) (RemoteState, error) { inspects.Add(1); return h.inspect(ctx) } |
| + m.Confirm = func(context.Context) error { confirms.Add(1); return nil } |
| + refused := m |
| + refused.Preflight = func(context.Context) error { return NotSent(m.Repo, ErrMergeNoCredential) } |
| + _, err := MergeBranch(context.Background(), refused) |
| + if !errors.Is(err, ErrMergeNoCredential) || errors.Is(err, ErrMergeUncertain) || inspects.Load() != 0 || confirms.Load() != 0 || len(h.requests) != 0 { |
| + t.Fatalf("preflight: %v (%d inspections, %d confirms, %d requests)", err, inspects.Load(), confirms.Load(), len(h.requests)) |
| + } |
| + // Passing, it merges as usual. |
| + m.Preflight = func(context.Context) error { return nil } |
| + if out, err := MergeBranch(context.Background(), m); err != nil || out.Source != SourceHub { |
| + t.Fatalf("after %+v %v", out, err) |
| + } |
| +} |
diff --git a/internal/runner/forge/repositories.go b/internal/runner/forge/repositories.go| index 13a10e5d..eb50af18 100644 |
| --- a/internal/runner/forge/repositories.go |
| +++ b/internal/runner/forge/repositories.go |
| @@ -11,6 +11,10 @@ func (f FileCredentials) RepositoryNames() ([]string, error) { |
| if err := readCredentialFile(f.Path, &file); err != nil { |
| return nil, err |
| } |
| + return repositoryNames(file) |
| +} |
| + |
| +func repositoryNames(file forgeCredentialFile) ([]string, error) { |
| if len(file.Repositories) > 256 { |
| return nil, provider.ErrPolicy |
| } |
diff --git a/internal/runner/thin/forge.go b/internal/runner/thin/forge.go| index 59de50c7..bf9b4ff2 100644 |
| --- a/internal/runner/thin/forge.go |
| +++ b/internal/runner/thin/forge.go |
| @@ -95,6 +95,8 @@ type fileForge struct { |
| // etag is the hub's validator for the last list, so a check that |
| // finds nothing new costs a 304. |
| etag string |
| + // listKey is scopeKey of the credential the list was fetched with. |
| + listKey string |
| } |
| // reachEvery is how long the hub's list of what the agent reaches is |
| @@ -161,11 +163,16 @@ func (f *fileForge) Remote(ctx context.Context, repo string, use Use) (workspace |
| } |
| return f.remoteCredential(ctx, repo) |
| } |
| - f.list(ctx) |
| - if !slices.Contains(f.Repos(), repo) { |
| + // A push: the repository's own entry, or the fallback with the hub's |
| + // current word (writeCredential). |
| + if names, _ := f.creds.RepositoryNames(); slices.Contains(names, repo) { |
| + return f.creds.Resolve(ctx, repo) |
| + } |
| + c, err := f.writeCredential(ctx, repo) |
| + if err != nil || c.GitPassword == "" { |
| return workspace.Remote{}, workspace.ErrGitPassword |
| } |
| - return f.remoteCredential(ctx, repo) |
| + return workspace.Remote{URL: "https://" + repo, GitPassword: c.GitPassword}, nil |
| } |
| func (f *fileForge) remoteCredential(ctx context.Context, repo string) (workspace.Remote, error) { |
| @@ -182,13 +189,11 @@ func (f *fileForge) remoteCredential(ctx context.Context, repo string) (workspac |
| } |
| // credential is the forge credential for repo, which the caller has |
| -// already found in scope (Repos for writes, Reachable for reads): its own |
| -// entry in the credential file, or else, for a repository the runner |
| -// created or the agent reaches through a grant, the agent-wide credential |
| -// (the one Create and the hub's list use, so it adds no reach). A |
| +// already found in scope (Reachable for reads, Repos for CI reads): its own |
| +// entry in the credential file, or else the agent-wide credential. A |
| // repository with its own entry never falls back: an unusable entry is |
| -// refused, not replaced. Push, merge, CI reads and the start check all |
| -// use this one lookup. |
| +// refused, not replaced. Writes go through writeCredential, which also |
| +// needs the hub's current word for a fallback. |
| func (f *fileForge) credential(ctx context.Context, repo string) (forge.Credential, error) { |
| names, err := f.creds.RepositoryNames() |
| if err != nil { |
| @@ -208,16 +213,87 @@ func (f *fileForge) credential(ctx context.Context, repo string) (forge.Credenti |
| return c, nil |
| } |
| -// createdNoCredential is the start check's warning for a repository the |
| -// runner created that has no usable credential (its merges are refused). |
| -const createdNoCredential = "created repository has no usable forge credential; merges there will be refused" |
| +// writeCredential is the credential a merge or a push to repo uses, or a |
| +// forge.NotSentError: the repository's own entry, else the agent-wide |
| +// credential, but only for a repository the hub lists now as writable, |
| +// in a list fetched with that same credential (writable). A repository |
| +// the runner created is no exception: a revoked grant, a rename or a |
| +// replaced credential ends its fallback. No usable credential is |
| +// ErrMergeNoCredential; no current write scope is a policy refusal. |
| +func (f *fileForge) writeCredential(ctx context.Context, repo string) (forge.Credential, error) { |
| + names, err := f.creds.RepositoryNames() |
| + if err != nil { |
| + return forge.Credential{}, forge.NotSent(repo, forge.ErrMergeNoCredential) |
| + } |
| + if slices.Contains(names, repo) { |
| + c, err := f.creds.Credential(ctx, repo) |
| + if err != nil { |
| + return forge.Credential{}, forge.NotSent(repo, forge.ErrMergeNoCredential) |
| + } |
| + return c, nil |
| + } |
| + if !forgekey.ValidHub(repo) { |
| + return forge.Credential{}, forge.NotSent(repo, errOutOfScope) |
| + } |
| + c, err := f.creds.Agent(ctx) |
| + if err != nil { |
| + return forge.Credential{}, forge.NotSent(repo, forge.ErrMergeNoCredential) |
| + } |
| + if !f.writable(ctx, repo, scopeKey(c)) { |
| + return forge.Credential{}, forge.NotSent(repo, errOutOfScope) |
| + } |
| + c.Remote = "https://" + repo |
| + return c, nil |
| +} |
| + |
| +// scopeKey names a credential without holding it: what the hub's list |
| +// was fetched with. |
| +func scopeKey(c forge.Credential) string { |
| + sum := sha256.Sum256([]byte(c.Agent + "\x00" + c.Bearer)) |
| + return hex.EncodeToString(sum[:]) |
| +} |
| + |
| +// writable is whether the hub, asked now, lists repo as writable with the |
| +// credential key names. A write is rare, so it never trusts the cached |
| +// list: the request is conditional (a 304 when nothing changed), and a |
| +// failed one leaves the list unconfirmed, so it fails closed. |
| +func (f *fileForge) writable(ctx context.Context, repo, key string) bool { |
| + f.mu.Lock() |
| + f.nsAt = time.Time{} |
| + f.mu.Unlock() |
| + f.list(ctx) |
| + f.mu.Lock() |
| + defer f.mu.Unlock() |
| + return f.listKey == key && !f.nsAt.IsZero() && slices.Contains(f.listed, repo) |
| +} |
| -// checkCreated warns, once per repository, about each repository this |
| -// runner created that the merge lookup finds no usable credential for. |
| -// Only with repository creation on; it reads the files, never the hub, |
| -// and logs the repository, never a credential. |
| +// MergePreflight refuses, before anything is read or sent, a merge this |
| +// runner has no credential or no current write scope for. |
| +func (f *fileForge) MergePreflight(ctx context.Context, repo string) error { |
| + _, err := f.writeCredential(ctx, repo) |
| + return err |
| +} |
| + |
| +// The start check's warnings: a repository the runner created that has no |
| +// usable credential (its merges are refused), and a legacy credential |
| +// file whose per-repository bearer serves as the agent's. |
| +const ( |
| + createdNoCredential = "created repository has no usable forge credential; merges there will be refused" |
| + legacyAgentCredential = "forge credential file has no agent-wide entry; its shared per-repository credential serves as the agent's" |
| +) |
| + |
| +// checkCreated warns once if the credential file is a legacy one, and, |
| +// with repository creation on, once per repository this runner created |
| +// that has no usable credential. It reads the files, never the hub, and |
| +// logs repositories, never a credential. |
| func (f *fileForge) checkCreated(ctx context.Context, log *slog.Logger) { |
| - if !f.enabled || log == nil { |
| + if log == nil { |
| + return |
| + } |
| + if f.creds.Legacy() { |
| + log.Warn(legacyAgentCredential) |
| + } |
| + if !f.enabled { |
| return |
| } |
| for _, repo := range f.createdRepos() { |
| @@ -233,13 +309,19 @@ func (f *fileForge) checkCreated(ctx context.Context, log *slog.Logger) { |
| func (f *fileForge) list(ctx context.Context) ([]string, []string) { |
| f.mu.Lock() |
| defer f.mu.Unlock() |
| - if time.Since(f.nsAt) < reachEvery && f.ns != nil { |
| - return slices.Clone(f.ns), slices.Clone(f.listed) |
| - } |
| c, err := f.agent(ctx) |
| if err != nil { |
| + f.listKey = "" |
| return []string{}, []string{} |
| } |
| + if key := scopeKey(c); key != f.listKey { |
| + // Another credential: what the hub said for the last one says |
| + // nothing about this one. |
| + f.ns, f.listed, f.nsAt, f.etag, f.listKey = nil, nil, time.Time{}, "", key |
| + } |
| + if time.Since(f.nsAt) < reachEvery && f.ns != nil { |
| + return slices.Clone(f.ns), slices.Clone(f.listed) |
| + } |
| req, _ := http.NewRequestWithContext(ctx, "GET", f.hub+"/api/v1/repos", nil) |
| req.Header.Set("Authorization", "Bearer "+c.Bearer) |
| if f.etag != "" && f.ns != nil { |
| @@ -361,22 +443,17 @@ func (f *fileForge) adopt(repo string) error { |
| return ErrAdopted |
| } |
| -// errOutOfScope: the repository is not in the credential file, not one |
| -// the runner created and not one the hub lists as the agent's (a read |
| -// grant, say). A policy refusal: no credential may be used for it. |
| -var errOutOfScope = fmt.Errorf("%w: not a repository this runner's agent may write", forge.ErrMergeRefused) |
| +// errOutOfScope: the repository has no entry of its own in the credential |
| +// file and the hub does not list it now as the agent's to write (a read |
| +// grant, a revoked grant, a rename). A policy refusal. |
| +var errOutOfScope = fmt.Errorf("%w: not a repository this runner's agent may write now", forge.ErrMergeRefused) |
| -// Merge sends the hub the merge request with the agent's credential for |
| -// repo (its own entry, or the agent-wide one, as push uses). Without one |
| -// it refuses before contacting the hub (forge.NotSent). |
| +// Merge sends the hub the merge request with writeCredential's credential. |
| +// Without one it refuses before contacting the hub (forge.NotSent). |
| func (f *fileForge) Merge(ctx context.Context, repo, branch string, req forge.MergeRequest) (forge.MergeResult, error) { |
| - f.list(ctx) |
| - if !slices.Contains(f.Repos(), repo) { |
| - return forge.MergeResult{}, forge.NotSent(repo, errOutOfScope) |
| - } |
| - c, err := f.credential(ctx, repo) |
| + c, err := f.writeCredential(ctx, repo) |
| if err != nil { |
| - return forge.MergeResult{}, forge.NotSent(repo, forge.ErrMergeNoCredential) |
| + return forge.MergeResult{}, err |
| } |
| return forge.HubMerge(ctx, f.client, f.hub, c, repo, branch, req) |
| } |
diff --git a/internal/runner/thin/forges.go b/internal/runner/thin/forges.go| index fc3b7cda..0914e356 100644 |
| --- a/internal/runner/thin/forges.go |
| +++ b/internal/runner/thin/forges.go |
| @@ -100,6 +100,25 @@ func (f *Forges) Merge(ctx context.Context, repo, branch string, req forge.Merge |
| } |
| return fg.Merge(ctx, key, branch, req) |
| } |
| + |
| +// mergePreflighter is a forge that can refuse a merge on the runner |
| +// before the remote is read (forge.BranchMerge.Preflight). |
| +type mergePreflighter interface { |
| + MergePreflight(ctx context.Context, repo string) error |
| +} |
| + |
| +// MergePreflight routes to the repository's forge, when it has one. |
| +func (f *Forges) MergePreflight(ctx context.Context, repo string) error { |
| + fg, key, err := f.route(repo) |
| + if err != nil { |
| + return forge.NotSent(repo, errors.Join(forge.ErrMergeRefused, err)) |
| + } |
| + if p, ok := fg.(mergePreflighter); ok { |
| + return p.MergePreflight(ctx, key) |
| + } |
| + return nil |
| +} |
| + |
| func (f *Forges) catalog(list func(Forge) []string) []string { |
| var out []string |
| for host, fg := range f.byHost { |
diff --git a/internal/runner/thin/forges_review_test.go b/internal/runner/thin/forges_review_test.go| index 57c1860d..8d8f53cf 100644 |
| --- a/internal/runner/thin/forges_review_test.go |
| +++ b/internal/runner/thin/forges_review_test.go |
| @@ -107,7 +107,9 @@ func TestRouterWithProductionFileForge(t *testing.T) { |
| if rep, err := f.PollAccess(ctx, "ar_one", c); err != nil || rep.State != "approved" { |
| t.Fatal("poll", rep, err) |
| } |
| - want := []string{"GET /api/v1/repos", "POST /api/v1/repos/carlos/platform/branches/" + branch + "/merge", "GET /api/v1/repos/carlos/platform/ci/hosted", "GET /api/v1/repos/carlos/platform/ci/status", "POST /api/v1/agents/access-requests", "GET /api/v1/agents/access-requests/ar_one"} |
| + // The read lists once; the push and the merge, writes with the |
| + // agent-wide credential, each ask the hub afresh (writable). |
| + want := []string{"GET /api/v1/repos", "GET /api/v1/repos", "GET /api/v1/repos", "POST /api/v1/repos/carlos/platform/branches/" + branch + "/merge", "GET /api/v1/repos/carlos/platform/ci/hosted", "GET /api/v1/repos/carlos/platform/ci/status", "POST /api/v1/agents/access-requests", "GET /api/v1/agents/access-requests/ar_one"} |
| if !reflect.DeepEqual(calls, want) { |
| t.Fatalf("hub calls: %v", calls) |
| } |
diff --git a/internal/runner/thin/merge_credential_test.go b/internal/runner/thin/merge_credential_test.go| index fb548054..03111c3f 100644 |
| --- a/internal/runner/thin/merge_credential_test.go |
| +++ b/internal/runner/thin/merge_credential_test.go |
| @@ -21,21 +21,41 @@ import ( |
| // mergeCredRig is a runner forge whose credential file has per-repository |
| // entries only (no agent-wide api), as on the runner of tkbstr6cjl7h, and |
| -// whose state lists created as a repository it made. The hub lists listed |
| -// as writable and records every merge request's path and bearer. |
| +// whose state lists created as a repository it made. The hub answers the |
| +// repository list per bearer (lists), or with listStatus when set, and |
| +// records every merge request's path and bearer. |
| type mergeCredRig struct { |
| - f *fileForge |
| - mu sync.Mutex |
| - merges []string |
| + f *fileForge |
| + path string |
| + mu sync.Mutex |
| + merges []string |
| + lists map[string][]string |
| + listStatus int |
| + // etag, when set, is a validator that ignores the caller (a cache |
| + // keyed by URL): a request carrying it is answered 304. |
| + etag string |
| } |
| func newMergeCredRig(t *testing.T, file string, created, listed []string) *mergeCredRig { |
| t.Helper() |
| - rig := &mergeCredRig{} |
| + rig := &mergeCredRig{lists: map[string][]string{"api-first": listed}} |
| srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| + rig.mu.Lock() |
| + defer rig.mu.Unlock() |
| if r.Method == http.MethodGet && r.URL.Path == "/api/v1/repos" { |
| + if rig.listStatus != 0 { |
| + w.WriteHeader(rig.listStatus) |
| + return |
| + } |
| + if rig.etag != "" { |
| + if r.Header.Get("If-None-Match") == rig.etag { |
| + w.WriteHeader(http.StatusNotModified) |
| + return |
| + } |
| + w.Header().Set("ETag", rig.etag) |
| + } |
| var parts []string |
| - for _, repo := range listed { |
| + for _, repo := range rig.lists[strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer ")] { |
| p := strings.Split(strings.TrimPrefix(repo, "amadan.net/"), "/") |
| parts = append(parts, fmt.Sprintf(`{"ns":%q,"name":%q}`, p[0], p[1])) |
| } |
| @@ -43,9 +63,7 @@ func newMergeCredRig(t *testing.T, file string, created, listed []string) *merge |
| return |
| } |
| if r.Method == http.MethodPost && strings.HasSuffix(r.URL.Path, "/merge") { |
| - rig.mu.Lock() |
| rig.merges = append(rig.merges, r.URL.EscapedPath()+" "+r.Header.Get("Authorization")) |
| - rig.mu.Unlock() |
| fmt.Fprintf(w, `{"merged":true,"sha":%q,"into":"main","branch_closed":true}`, strings.Repeat("8", 40)) |
| return |
| } |
| @@ -53,11 +71,13 @@ func newMergeCredRig(t *testing.T, file string, created, listed []string) *merge |
| })) |
| t.Cleanup(srv.Close) |
| dir := t.TempDir() |
| - p := filepath.Join(dir, "amadan.json") |
| - if err := os.WriteFile(p, []byte(file), 0600); err != nil { |
| - t.Fatal(err) |
| + rig.path = filepath.Join(dir, "amadan.json") |
| + if file != "" { |
| + if err := os.WriteFile(rig.path, []byte(file), 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| } |
| - rig.f = NewFileForge(p, dir, true).(*fileForge) |
| + rig.f = NewFileForge(rig.path, dir, true).(*fileForge) |
| rig.f.hub, rig.f.client = srv.URL, srv.Client() |
| for _, repo := range created { |
| if err := rig.f.record(repo); err != nil { |
| @@ -73,15 +93,22 @@ func (rig *mergeCredRig) requests() []string { |
| return append([]string(nil), rig.merges...) |
| } |
| +func (rig *mergeCredRig) set(fn func()) { |
| + rig.mu.Lock() |
| + defer rig.mu.Unlock() |
| + fn() |
| +} |
| + |
| const perRepoOnly = `{"agent":"equipo~owner@example.com","repositories":{"amadan.net/paulca/first":{"api":"api-first","git":"git-first"},"amadan.net/paulca/stale":{"git":"git-stale"}}}` |
| var mergeReq = forge.MergeRequest{ExpectSHA: strings.Repeat("a", 40), Strategy: "merge", Agent: forge.AgentMeta{Session: "equipo-tk1", Harness: "equipo", Host: "test"}} |
| // TestMergeCredentialFallsBackForCreatedRepos: a repository the runner |
| -// created, absent from the credential file, merges with the agent-wide |
| -// credential, the one push and Create use for it. |
| +// created, absent from the credential file and listed by the hub for the |
| +// agent's bearer, merges with the agent-wide credential, the one push and |
| +// Create use for it. |
| func TestMergeCredentialFallsBackForCreatedRepos(t *testing.T) { |
| - rig := newMergeCredRig(t, perRepoOnly, []string{"amadan.net/paulca/nearys"}, nil) |
| + rig := newMergeCredRig(t, perRepoOnly, []string{"amadan.net/paulca/nearys"}, []string{"amadan.net/paulca/nearys"}) |
| res, err := rig.f.Merge(context.Background(), "amadan.net/paulca/nearys", "equipo/tk1-x", mergeReq) |
| if err != nil || !res.Merged { |
| t.Fatalf("created repository: %+v %v", res, err) |
| @@ -172,7 +199,7 @@ func TestCheckCreatedCredentials(t *testing.T) { |
| log := slog.New(slog.NewTextHandler(&buf, nil)) |
| rig := newMergeCredRig(t, perRepoOnly, []string{"amadan.net/paulca/nearys"}, nil) |
| rig.f.checkCreated(context.Background(), log) |
| - if buf.Len() != 0 { |
| + if strings.Contains(buf.String(), createdNoCredential) { |
| t.Fatalf("warned with a usable credential: %s", buf.String()) |
| } |
| rig = newMergeCredRig(t, `{"agent":"equipo~owner@example.com","repositories":{}}`, []string{"amadan.net/paulca/nearys", "amadan.net/paulca/other"}, nil) |
| @@ -192,3 +219,141 @@ func TestCheckCreatedCredentials(t *testing.T) { |
| t.Fatalf("checked with creation off: %s", buf.String()) |
| } |
| } |
| + |
| +// TestMergeFallbackNeedsCurrentWriteScope: the agent-wide fallback writes |
| +// only to a repository the hub lists now, for the credential in the file |
| +// now. A grant revoked (no longer listed), a list the hub fails to give, |
| +// a replaced credential and a repository renamed after the runner created |
| +// it all refuse the merge and the push before any merge request. |
| +func TestMergeFallbackNeedsCurrentWriteScope(t *testing.T) { |
| + ctx := context.Background() |
| + repo := "amadan.net/paulca/nearys" |
| + refused := func(t *testing.T, rig *mergeCredRig, what string) { |
| + t.Helper() |
| + before := len(rig.requests()) |
| + _, err := rig.f.Merge(ctx, repo, "equipo/tk1-x", mergeReq) |
| + var ns *forge.NotSentError |
| + if !errors.Is(err, forge.ErrMergeRefused) || !errors.As(err, &ns) || len(rig.requests()) != before { |
| + t.Fatalf("%s: merge %v (%d requests)", what, err, len(rig.requests())-before) |
| + } |
| + if _, err := rig.f.Remote(ctx, repo, Push); err == nil { |
| + t.Fatalf("%s: push credential", what) |
| + } |
| + } |
| + t.Run("revoked", func(t *testing.T) { |
| + rig := newMergeCredRig(t, perRepoOnly, []string{repo}, []string{repo}) |
| + if _, err := rig.f.Merge(ctx, repo, "equipo/tk1-x", mergeReq); err != nil { |
| + t.Fatal(err) |
| + } |
| + rig.set(func() { rig.lists["api-first"] = nil }) |
| + refused(t, rig, "grant revoked") |
| + }) |
| + t.Run("list fails", func(t *testing.T) { |
| + rig := newMergeCredRig(t, perRepoOnly, []string{repo}, []string{repo}) |
| + if _, err := rig.f.Merge(ctx, repo, "equipo/tk1-x", mergeReq); err != nil { |
| + t.Fatal(err) |
| + } |
| + // The cached list expires; the refresh fails: the cache no longer |
| + // authorises a fallback write. |
| + rig.f.mu.Lock() |
| + rig.f.nsAt = time.Now().Add(-2 * reachEvery) |
| + rig.f.mu.Unlock() |
| + for _, status := range []int{http.StatusInternalServerError, http.StatusUnauthorized} { |
| + rig.set(func() { rig.listStatus = status }) |
| + refused(t, rig, fmt.Sprint("list ", status)) |
| + } |
| + }) |
| + t.Run("credential replaced", func(t *testing.T) { |
| + rig := newMergeCredRig(t, perRepoOnly, []string{repo}, []string{repo}) |
| + if _, err := rig.f.Merge(ctx, repo, "equipo/tk1-x", mergeReq); err != nil { |
| + t.Fatal(err) |
| + } |
| + // Within the minute the list is cached, another agent's credential |
| + // replaces the file; the hub lists nothing for it. |
| + replaced := `{"agent":"other~owner@example.com","repositories":{"amadan.net/paulca/first":{"api":"api-other","git":"git-other"}}}` |
| + if err := os.WriteFile(rig.path, []byte(replaced), 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + refused(t, rig, "credential replaced") |
| + }) |
| + t.Run("credential replaced behind a validator", func(t *testing.T) { |
| + // The list's validator ignores who asks: the old credential's |
| + // validator must not confirm its list for the new one. |
| + rig := newMergeCredRig(t, perRepoOnly, []string{repo}, []string{repo}) |
| + rig.set(func() { rig.etag = `"v1"` }) |
| + if _, err := rig.f.Merge(ctx, repo, "equipo/tk1-x", mergeReq); err != nil { |
| + t.Fatal(err) |
| + } |
| + replaced := `{"agent":"other~owner@example.com","repositories":{"amadan.net/paulca/first":{"api":"api-other","git":"git-other"}}}` |
| + if err := os.WriteFile(rig.path, []byte(replaced), 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + refused(t, rig, "credential replaced behind a validator") |
| + }) |
| + t.Run("renamed", func(t *testing.T) { |
| + rig := newMergeCredRig(t, perRepoOnly, []string{repo}, []string{"amadan.net/paulca/nearys-site"}) |
| + refused(t, rig, "created, then renamed on the hub") |
| + }) |
| + // Created a moment ago, not yet in the cached list: the write asks |
| + // the hub afresh, which lists it. |
| + rig := newMergeCredRig(t, perRepoOnly, nil, nil) |
| + rig.f.list(ctx) |
| + rig.set(func() { rig.lists["api-first"] = []string{repo} }) |
| + if err := rig.f.record(repo); err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := rig.f.Merge(ctx, repo, "equipo/tk1-x", mergeReq); err != nil || len(rig.requests()) != 1 { |
| + t.Fatalf("just created: %v %q", err, rig.requests()) |
| + } |
| +} |
| + |
| +// TestMergeStepCredentialIntegrated: through the runner's real forge (the |
| +// inspection needs the credential too), a missing credential file and an |
| +// unusable entry for the repository each end the step merge_credential at |
| +// once, naming the repository, with no merge request and no retries. |
| +func TestMergeStepCredentialIntegrated(t *testing.T) { |
| + old := mergeBackoff |
| + mergeBackoff = time.Millisecond |
| + t.Cleanup(func() { mergeBackoff = old }) |
| + for name, file := range map[string]string{ |
| + "missing file": "", |
| + "unusable entry": `{"agent":"equipo~owner@example.com","repositories":{"amadan.net/oficina/sample":{"git":"git-only"}}}`, |
| + } { |
| + t.Run(name, func(t *testing.T) { |
| + e, _, r, _ := hubRig(t) |
| + rig := newMergeCredRig(t, file, []string{r.Repo}, []string{r.Repo}) |
| + fg, err := NewForges(rig.f) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + e.Forge, e.Clones.Forge = fg, fg |
| + rep := e.Exec(context.Background(), r, func(wire.StepReport) {}) |
| + if rep.State != wire.StepFailed || rep.Reason != wire.ReasonMergeCredential || !rep.Termination { |
| + t.Fatalf("report %+v", rep) |
| + } |
| + if !strings.Contains(rep.LogTail, r.Repo) || strings.Contains(rep.LogTail, "outcome unknown") || strings.Contains(rep.LogTail, "git-only") { |
| + t.Fatalf("log tail %q", rep.LogTail) |
| + } |
| + if got := rig.requests(); len(got) != 0 { |
| + t.Fatalf("merge requests %q", got) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +// TestCheckCredentialsWarnsOnLegacyFiles: at start a credential file with |
| +// no agent-wide entry gets one fixed warning that its per-repository |
| +// credential serves as the agent's; one with an agent-wide entry none. |
| +func TestCheckCredentialsWarnsOnLegacyFiles(t *testing.T) { |
| + var buf bytes.Buffer |
| + log := slog.New(slog.NewTextHandler(&buf, nil)) |
| + newMergeCredRig(t, perRepoOnly, nil, nil).f.checkCreated(context.Background(), log) |
| + if strings.Count(buf.String(), legacyAgentCredential) != 1 || strings.Contains(buf.String(), "api-first") { |
| + t.Fatalf("legacy warning %s", buf.String()) |
| + } |
| + buf.Reset() |
| + newMergeCredRig(t, `{"agent":"equipo~owner@example.com","api":"api-first","git":"git-first"}`, nil, nil).f.checkCreated(context.Background(), log) |
| + if buf.Len() != 0 { |
| + t.Fatalf("warned with an agent-wide entry: %s", buf.String()) |
| + } |
| +} |
diff --git a/internal/runner/thin/mergestep.go b/internal/runner/thin/mergestep.go| index eb3d184d..98af62a0 100644 |
| --- a/internal/runner/thin/mergestep.go |
| +++ b/internal/runner/thin/mergestep.go |
| @@ -93,6 +93,11 @@ func (e *Engineer) mergeStep(ctx context.Context, r stepRow, progress func(wire. |
| return e.Forge.Merge(ctx, r.Repo, r.Branch, req) |
| }, |
| Confirm: confirmMerge} |
| + if p, ok := e.Forge.(mergePreflighter); ok { |
| + // No credential for the repository (the inspection needs it too): |
| + // refused here, before anything is read or sent. |
| + m.Preflight = func(ctx context.Context) error { return p.MergePreflight(ctx, r.Repo) } |
| + } |
| // Once the request may be with the hub, a cancel never stops the |
| // merge from being settled: the forge calls outlive the step's context |
| // (the instance refuses cancels while merging; shutdown keeps the |