oficina / equipo Public

forge: merge with the agent credential; say why a merge stopped

Merges for repos the runner created failed four times on task
tkbstr6cjl7h as "merge outcome unknown" though the hub was never
contacted: the credential lookup had no agent-wide fallback. Merge, CI
reads and push now share one lookup; fallback writes need current hub
membership fetched with that credential. A refusal made before any
request is definite (merge_credential); an unreachable hub retries,
then stops as amadan_unreachable; an earlier unanswered request is
reconciled by reading the branch before any new write check. Legacy
credential files no longer fall back by sort order.

Astra: NOT READY, NOT APPROVED, APPROVED on round 3. Copy approved by
Paul (2026-11-25, unchanged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from merge-credential-fallback into main.
claude agent, operated by paul@keymail.dev 364560b100086f58ad0e7230c489901fda82a835 parent c74fd0a
18 files changed, +1,065 −42
  • .rastrillo/budgets.txt +4 −4
  • docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md +2 −0
  • internal/equipo/copy.go +2 −0
  • internal/plan3test/plan3_release_test.go +3 −1
  • internal/runner/forge/branch.go +4 −0
  • internal/runner/forge/credential_file.go +40 −5
  • internal/runner/forge/credential_file_test.go +27 −0
  • internal/runner/forge/merge.go +84 −5
  • internal/runner/forge/merge_notsent_test.go +208 −0
  • internal/runner/forge/repositories.go +4 −0
  • internal/runner/thin/forge.go +168 −24
  • internal/runner/thin/forges.go +20 −1
  • internal/runner/thin/forges_review_test.go +3 −1
  • internal/runner/thin/merge_credential_test.go +440 −0
  • internal/runner/thin/mergestep.go +29 −1
  • internal/runner/thin/run.go +3 −0
  • internal/runner/workspace/workspace.go +5 −0
  • internal/wire/tasks.go +19 −0

CI passed — run details

CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/main: Type  Size Avail | ext4   96G   85G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type  Size Avail | ext4   96G   85G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 2.2s
ci-box: codex: fetched and verified in 3.3s
ci-box: codex-code-mode-host: fetched and verified in 1.2s
ci-box: libwrap: fetched and verified in 0.2s
ci-box: socat: fetched and verified in 0.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 10.0s
ci-box: pi: installed and verified in 7.5s
ci-box: opencode: installed and verified in 2.3s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.8s
ci-box: clone deepened in 4.4s
ci-box: file times set from content: 3068 files, 197 directories
ci-box: ready in 17.9s
=== 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.147s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
  4.3s
+ go list -export -test -tags testbuild -f  ./...
  4.8s
+ go list -export -test -tags browser,testbuild -f  ./internal/equipo ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
  3.3s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-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 1m18.644s 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.31s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m16.31s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 68.44, cpu waiting 40.83%, memory waiting 0.00%, io waiting 0.51%
--- 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 1m17.634s 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 1m15.534s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m15.53s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 68.44, cpu waiting 41.00%, memory waiting 0.00%, io waiting 0.52%
--- 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 1m19.208s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m17.196s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m7.65s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.07s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.48s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 68.44, cpu waiting 40.83%, memory waiting 0.00%, io waiting 0.51%
--- 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 1m14.419s 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.711s amadan.net/oficina/equipo/internal/headless
receipt: slow test 35.92s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 19.43s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 8.87s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
receipt: slow test 8.48s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
machine: 32 CPUs, load 68.44, cpu waiting 40.69%, memory waiting 0.00%, io waiting 0.54%
--- 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 1m34.012s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m31.989s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m3.24s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.08s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.01s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.65s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 67.36, cpu waiting 40.04%, memory waiting 0.00%, io waiting 0.39%
--- 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 2m45.132s 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 2m43.25s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m37.61s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 18.6s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 8.53s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 6.61s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
receipt: slow test 6.51s amadan.net/oficina/equipo/internal/headless TestHeadlessBatchAfterRefusedReply
machine: 32 CPUs, load 24.68, cpu waiting 13.22%, memory waiting 0.00%, io waiting 0.11%
--- 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 2m11.396s 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 2m8.98s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.3s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.79s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 3.91s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 3.73s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 2.46s amadan.net/oficina/equipo/internal/thintest TestResearchDoneFallsBack
machine: 32 CPUs, load 41.45, cpu waiting 23.85%, memory waiting 0.00%, io waiting 0.21%
--- 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 1m39.931s 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 1m37.519s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.17s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5.02s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.54s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 3.01s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
receipt: slow test 2.4s amadan.net/oficina/equipo/internal/thintest TestContractRetryFailedPreviewAfterMerge
machine: 32 CPUs, load 61.20, cpu waiting 38.75%, 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 4m49.339s, over the 45s its record on line 44 allows; reported only, timing fails on CI

receipt: test step 4m55.117s 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 4m49.339s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 37.04s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 37.01s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.83s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.49s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.92s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 3.54, cpu waiting 1.56%, 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.182s 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.177s amadan.net/oficina/equipo/internal/runner
receipt: slow test 29.14s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 63.22, cpu waiting 33.00%, memory waiting 0.00%, io waiting 0.81%
--- shard 10 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-plans: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestPlanWorkflowCandidateOrder$|^TestPlanWorkflowFeature$|^TestCoordinatorRecoveryCallRefusalKeepsServing$|^TestCoordinatorRefusalMatrix$' ./internal/runner

receipt: test step 1m0.116s 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.724s amadan.net/oficina/equipo/internal/runner
receipt: slow test 48.69s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 45.36s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.39s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.64s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 70.78, cpu waiting 38.57%, memory waiting 0.00%, io waiting 0.69%
--- 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 36.454s 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 35.501s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.68s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.13s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.6s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestCoordinatorTransientRefusalKeepsServing
machine: 32 CPUs, load 38.65, cpu waiting 21.92%, memory waiting 0.00%, io waiting 1.03%
--- shard 12 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-a started 30s late; cpu waiting 40.4%, load 30.61
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest

receipt: test step 1m9.518s 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.797s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 28.86s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 28.74s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 26.43s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 23.6s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 23.49s amadan.net/oficina/equipo/internal/equipotest TestAuthorityProjectKinds
machine: 32 CPUs, load 61.20, cpu waiting 38.75%, memory waiting 0.00%, io waiting 0.36%
--- 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 40.4%, load 30.61
test lane equipotest-e: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[E-P]' ./internal/equipotest

receipt: test step 1m18.876s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m17.094s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 20.55s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 20.53s amadan.net/oficina/equipo/internal/equipotest TestProjectRetryAndRevision
receipt: slow test 20.51s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 20.49s amadan.net/oficina/equipo/internal/equipotest TestProjectsAccountRevisionAndValidation
receipt: slow test 20.46s amadan.net/oficina/equipo/internal/equipotest TestProjectBindingUniqueness
machine: 32 CPUs, load 57.74, cpu waiting 33.87%, memory waiting 0.00%, io waiting 0.30%
--- 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 40.4%, load 30.61
test lane equipotest-r: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestR' ./internal/equipotest

receipt: test step 1m16.299s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m11.084s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 15.98s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.79s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.81s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 10.8s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 7.72s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 57.74, cpu waiting 34.98%, memory waiting 0.00%, io waiting 0.31%
--- 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 40.1%, load 30.61
test lane equipotest-rest: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test[A-D]|^TestQ|^Test[E-P]|^TestR' ./internal/equipotest

receipt: test step 1m9.433s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m7.601s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 26.58s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 25.59s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 25.57s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 23.75s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
receipt: slow test 23.7s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsCurrentOwner
machine: 32 CPUs, load 61.20, cpu waiting 38.75%, memory waiting 0.00%, io waiting 0.36%
--- shard 16 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: plan3test started 30s late; cpu waiting 40.1%, load 30.61
test lane plan3test: ./internal/plan3test
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/plan3test

receipt: test step 54.653s 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 52.463s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.75s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.48s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.63s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.6s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.29s amadan.net/oficina/equipo/internal/plan3test TestInviteMigration
machine: 32 CPUs, load 66.87, cpu waiting 39.95%, memory waiting 0.00%, io waiting 0.46%
--- 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 40.1%, load 30.61
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/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/chatmarkdown: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/claude/realcli: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/webread: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/containment: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/opencode: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/testci: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/wire/wireschema: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/provider/pi: its inputs changed
budget note: internal/equipo took 56.039s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 19.811s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/setup took 11.241s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 1m54.414s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 23.057s, 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 49.354s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 20.85s, over the 20s its record on line 35 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 14.599s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/workspace took 13.505s, over the 10s the default allows; reported only, timing fails on CI

receipt: test step 2m15.254s against a 60s target (the gate's other steps are not in this figure)
receipt: 26 packages ran, 40 cached, 17 without tests, 0 failed
receipt: slow package 1m54.414s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m9.609s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 58.444s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 56.609s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 56.039s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 55.96s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 47.95s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 47.69s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
receipt: slow test 46.44s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
receipt: slow test 46.05s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
machine: 32 CPUs, load 24.68, cpu waiting 13.22%, memory waiting 0.00%, io waiting 0.11%
--- 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.599s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m22.881s amadan.net/oficina/equipo/internal/headless
receipt: slow test 39.04s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.76s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.22s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.41s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.25s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 66.87, cpu waiting 39.75%, memory waiting 0.00%, io waiting 0.44%
--- shard 19 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-work: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$' ./internal/headless

receipt: test step 1m31.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 1m29.85s amadan.net/oficina/equipo/internal/headless
receipt: slow test 28.49s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 21.46s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 12.88s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 9.46s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 9.11s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 67.36, cpu waiting 40.28%, memory waiting 0.00%, io waiting 0.40%
--- 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 1m53.358s 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 1m51.57s amadan.net/oficina/equipo/internal/headless
receipt: slow test 13.49s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.36s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.61s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.34s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
receipt: slow test 11.2s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
machine: 32 CPUs, load 50.16, cpu waiting 30.78%, memory waiting 0.00%, io waiting 0.27%
--- 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-26T09:48:04.131Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-26T09:48:04.131Z level=INFO msg="startup phase done" phase=state_lock took=233µs
time=2026-11-26T09:48:04.131Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-26T09:48:04.132Z level=INFO msg="startup phase done" phase=claim_roots took=227µs
time=2026-11-26T09:48:04.132Z level=INFO msg="startup phase" phase=sweep
time=2026-11-26T09:48:04.182Z level=INFO msg="startup phase done" phase=sweep took=50.633ms
time=2026-11-26T09:48:04.182Z level=INFO msg="startup phase" phase=credentials
time=2026-11-26T09:48:04.182Z level=INFO msg="startup phase done" phase=credentials took=109µs
time=2026-11-26T09:48:04.182Z level=INFO msg="startup phase" phase=open_state
time=2026-11-26T09:48:04.237Z level=INFO msg="startup phase done" phase=open_state took=54.531ms
time=2026-11-26T09:48:04.238Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-26T09:48:04.238Z level=INFO msg=connecting host=127.0.0.1:41757 protocol=30
time=2026-11-26T09:48:04.244Z level=INFO msg=connected host=127.0.0.1:41757 took=5.167ms
time=2026-11-26T09:48:04.244Z level=INFO msg="capabilities gathering"
time=2026-11-26T09:48:04.246Z level=INFO msg="capabilities gathered" took=2.214ms tags=linux,claude,go
time=2026-11-26T09:48:04.247Z level=INFO msg="hello sent" protocol=30
time=2026-11-26T09:48:04.252Z level=INFO msg=welcome protocol=30 role=primary generation=1
    browser_copy_test.go:90: waiting for !document.querySelector('[data-copy-continue]'): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserCopyContinue (6.60s)

--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m33.086s
FAIL	amadan.net/oficina/equipo/internal/headless	93.306s


receipt: test step 1m34.734s 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 1m33.086s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.74s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.32s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 10.25s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 9.54s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.5s amadan.net/oficina/equipo/internal/headless TestBrowserNotebookLook
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 364560b100086f58ad0e7230c489901fda82a835 6.60s 64.61
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 61.20, cpu waiting 38.13%, memory waiting 0.00%, io waiting 0.35%
--- 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.563s 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 749ms amadan.net/oficina/equipo/internal/equipo
receipt: slow test 750ms 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.427s, over the 10s the default allows; reported only, timing fails on CI

receipt: test step 11.681s 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.427s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 8.48s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 1.95s 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.665s 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.206s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.21s 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 3m39.04s 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 3m37.488s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 22.76s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.43s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.04s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.62s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.19s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 8.76, cpu waiting 3.98%, 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   (51s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.59s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.18s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 8.47s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 8.27s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 26.46s
+ 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   (70s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 15.50s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 20.37s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 19.09s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 12.81s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless   (20s)
ok ./internal/headless TestMixedVersions 17.96s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks   (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.77s
+ 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 68.82, cpu waiting 40.43%, 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.122s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 4 without tests, 0 failed
receipt: slow package 7.62s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 186ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 68ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 0s amadan.net/oficina/equipo/internal/runner/provider/claude/realcli
receipt: slow test 5.37s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.73s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 360ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 190ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 130ms 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.478s 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.067s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 350ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 190ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryMalformedRecord
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryReusedPID
machine: 32 CPUs, load 18.53, cpu waiting 10.01%, memory waiting 0.00%, io waiting 1.44%
--- 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 40.1%, load 30.61
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2780 text files, 3228 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.496s
machine: 32 CPUs, load 68.44, cpu waiting 40.69%, memory waiting 0.00%, io waiting 0.54%
--- shard 26 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: staticcheck started 30s late; cpu waiting 40.4%, load 30.61
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 63.22, cpu waiting 36.06%, 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 40.1%, load 30.61
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===

No vulnerabilities found.

Your code is affected by 0 vulnerabilities.
This scan also found 0 vulnerabilities in packages you import and 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 38.65, cpu waiting 23.65%, memory waiting 0.00%, io waiting 1.00%
--- 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 40.4%, load 28.40
shard 28: make gitleaks
9:47AM INF Unknown SCM platform. Use --platform to include links in findings. host=amadan.net
9:48AM INF 1173 commits scanned.
9:48AM INF scanned ~66577550 bytes (66.58 MB) in 24.4s
9:48AM INF no leaks found
machine: 32 CPUs, load 63.22, cpu waiting 36.06%, memory waiting 0.00%, io waiting 0.76%
=== perf ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -require TestPerfScreens,TestPerfBoot -tags perf -count=1 -p 1 -parallel 1 -run '^TestPerf' ./...
perf: GET /: median 1.065ms, worst 1.155ms, budget 150ms
perf: GET /api/runner/protocol: median 75µs, worst 99µs, budget 150ms
perf: GET /api/v1/account-setups/{id}: median 605µs, worst 646µs, budget 150ms
perf: GET /api/v1/accounts: median 427µs, worst 465µs, budget 150ms
perf: GET /api/v1/auth/devices: median 429µs, worst 461µs, budget 150ms
perf: GET /api/v1/budgets: median 493µs, worst 530µs, budget 150ms
perf: GET /api/v1/capabilities: median 255µs, worst 272µs, budget 150ms
perf: GET /api/v1/cards/{id}: median 1.163ms, worst 1.19ms, budget 150ms
perf: GET /api/v1/connections: median 552µs, worst 616µs, budget 150ms
perf: GET /api/v1/connections/{id}: median 514µs, worst 544µs, budget 150ms
perf: GET /api/v1/conversation: median 866µs, worst 919µs, budget 150ms
perf: GET /api/v1/conversation/cards: median 1.395ms, worst 1.493ms, budget 150ms
perf: GET /api/v1/coordinator: median 1.707ms, worst 1.859ms, budget 150ms
perf: GET /api/v1/invites/{id}: median 453µs, worst 477µs, budget 150ms
perf: GET /api/v1/journey: median 7.426ms, worst 7.758ms, budget 150ms
perf: GET /api/v1/me: median 429µs, worst 459µs, budget 150ms
perf: GET /api/v1/me/settings: median 521µs, worst 672µs, budget 150ms
perf: GET /api/v1/needs-you: median 7.3ms, worst 7.366ms, budget 150ms
perf: GET /api/v1/notifications: median 1.742ms, worst 1.791ms, budget 150ms
perf: GET /api/v1/onboarding: median 418µs, worst 461µs, budget 150ms
perf: GET /api/v1/people: median 457µs, worst 494µs, budget 150ms
perf: GET /api/v1/playbooks: median 601µs, worst 651µs, budget 150ms
perf: GET /api/v1/playbooks/{id}: median 562µs, worst 611µs, budget 150ms
perf: GET /api/v1/playbooks/{id}/template-diff: median 880µs, worst 980µs, budget 150ms
perf: GET /api/v1/preferences: median 800µs, worst 859µs, budget 150ms
perf: GET /api/v1/projects/{id}: median 450µs, worst 534µs, budget 150ms
perf: GET /api/v1/projects/{id}/settings: median 619µs, worst 650µs, budget 150ms
perf: GET /api/v1/roster: median 472µs, worst 540µs, budget 150ms
perf: GET /api/v1/runners/{id}: median 444µs, worst 654µs, budget 150ms
perf: GET /api/v1/specialists: median 8.333ms, worst 10.667ms, budget 150ms
perf: GET /api/v1/specialists/{id}: median 8.135ms, worst 8.373ms, budget 150ms
perf: GET /api/v1/specialists/{id}/template-diff: median 861µs, worst 899µs, budget 150ms
perf: GET /api/v1/tasks/{id}/plan: median 1.105ms, worst 1.15ms, budget 150ms
perf: GET /api/v1/tasks/{id}/thread: median 716µs, worst 737µs, budget 150ms
perf: GET /api/v1/teams: median 428µs, worst 442µs, budget 150ms
perf: GET /api/v1/templates: median 587µs, worst 620µs, budget 150ms
perf: GET /api/v1/templates/{id}: median 440µs, worst 499µs, budget 150ms
perf: GET /auth/callback: median 80µs, worst 86µs, budget 150ms
perf: GET /auth/devices/{id}: median 4.04ms, worst 4.094ms, budget 150ms
perf: GET /auth/verify: median 73µs, worst 101µs, budget 150ms
perf: GET /connections: median 4.141ms, worst 4.409ms, budget 150ms
perf: GET /conversation: median 8.425ms, worst 8.767ms, budget 150ms
perf: GET /conversation/connections: median 240µs, worst 280µs, budget 150ms
perf: GET /conversation/notebook: median 238µs, worst 265µs, budget 150ms
perf: GET /conversation/settings: median 4.394ms, worst 4.607ms, budget 150ms
perf: GET /conversation/settings/autonomy: median 4.562ms, worst 4.79ms, budget 150ms
perf: GET /conversation/settings/connections: median 7.115ms, worst 7.413ms, budget 150ms
perf: GET /conversation/settings/connections/add: median 7.058ms, worst 9.122ms, budget 150ms
perf: GET /conversation/settings/copy: median 4.699ms, worst 4.995ms, budget 150ms
perf: GET /conversation/settings/housekeeping: median 4.628ms, worst 4.822ms, budget 150ms
perf: GET /conversation/settings/machines: median 4.996ms, worst 5.388ms, budget 150ms
perf: GET /conversation/settings/machines/add: median 4.886ms, worst 5.185ms, budget 150ms
perf: GET /conversation/settings/notebook: median 3.997ms, worst 4.027ms, budget 150ms
perf: GET /conversation/settings/thinking: median 4.383ms, worst 4.488ms, budget 150ms
perf: GET /housekeeping: median 4.336ms, worst 4.429ms, budget 150ms
perf: GET /invites/new: median 609µs, worst 647µs, budget 150ms
perf: GET /invites/{id}: median 640µs, worst 672µs, budget 150ms
perf: GET /jobs: median 3.92ms, worst 4.114ms, budget 150ms
perf: GET /jobs/{id}: median 5.326ms, worst 8.424ms, budget 150ms
perf: GET /journey: median 11.019ms, worst 11.384ms, budget 150ms
perf: GET /nav/rail: median 3.403ms, worst 3.556ms, budget 150ms
perf: GET /needs-you: median 10.256ms, worst 10.754ms, budget 150ms
perf: GET /onboarding: median 4.551ms, worst 4.742ms, budget 150ms
perf: GET /people: median 3.685ms, worst 3.776ms, budget 150ms
perf: GET /playbook-suggestions/{suggestion}: median 5.037ms, worst 5.153ms, budget 150ms
perf: GET /playbooks: median 4.409ms, worst 4.634ms, budget 150ms
perf: GET /playbooks/new: median 4.85ms, worst 7.824ms, budget 150ms
perf: GET /playbooks/{id}: median 5.108ms, worst 5.301ms, budget 150ms
perf: GET /playbooks/{id}/edit: median 5.317ms, worst 5.417ms, budget 150ms
perf: GET /playbooks/{id}/template-diff: median 4.314ms, worst 4.42ms, budget 150ms
perf: GET /preferences: median 4.971ms, worst 5.21ms, budget 150ms
perf: GET /preferences/sources/{source}: median 4.62ms, worst 4.883ms, budget 150ms
perf: GET /projects: median 6.524ms, worst 6.593ms, budget 150ms
perf: GET /projects/accounts: median 4.142ms, worst 4.204ms, budget 150ms
perf: GET /projects/new: median 4.154ms, worst 4.485ms, budget 150ms
perf: GET /projects/{id}: median 11.217ms, worst 11.962ms, budget 150ms
perf: GET /projects/{id}/edit: median 4.406ms, worst 6.674ms, budget 150ms
perf: GET /runners/enrol: median 5.33ms, worst 5.655ms, budget 150ms
perf: GET /settings: median 3.935ms, worst 4.115ms, budget 150ms
perf: GET /settings/coordinator: median 6.351ms, worst 6.793ms, budget 150ms
perf: GET /settings/devices: median 3.912ms, worst 4.065ms, budget 150ms
perf: GET /settings/recovery: median 4.146ms, worst 4.245ms, budget 150ms
perf: GET /settings/recovery/release: median 4.1ms, worst 4.225ms, budget 150ms
perf: GET /settings/thinking: median 249µs, worst 269µs, budget 150ms
perf: GET /signed-out: median 267µs, worst 281µs, budget 150ms
perf: GET /signin: median 271µs, worst 316µs, budget 150ms
perf: GET /specialists/new: median 4.055ms, worst 4.169ms, budget 150ms
perf: GET /specialists/{key}: median 11.362ms, worst 11.585ms, budget 150ms
perf: GET /specialists/{key}/edit: median 4.327ms, worst 4.41ms, budget 150ms
perf: GET /specialists/{key}/template-diff: median 4.715ms, worst 6.252ms, budget 150ms
perf: GET /tasks: median 6.556ms, worst 6.676ms, budget 150ms
perf: GET /tasks/new: median 4.103ms, worst 4.316ms, budget 150ms
perf: GET /tasks/{id}: median 6.518ms, worst 6.675ms, budget 150ms
perf: GET /tasks/{id}/merge: median 5.694ms, worst 5.959ms, budget 150ms
perf: GET /tasks/{id}/move: median 5.597ms, worst 5.805ms, budget 150ms
perf: GET /tasks/{id}/plan: median 6.438ms, worst 6.706ms, budget 150ms
perf: GET /tasks/{id}/preview: median 1.681ms, worst 1.78ms, budget 150ms
perf: GET /tasks/{id}/questions/{question}: median 6.042ms, worst 6.612ms, budget 150ms
perf: GET /tasks/{id}/rendered-change: median 5.752ms, worst 6.173ms, budget 150ms
perf: GET /tasks/{id}/rendered-change/{hash}.png: median 5.003ms, worst 5.52ms, budget 150ms
perf: GET /tasks/{id}/thread: median 9.454ms, worst 10.087ms, budget 150ms
perf: GET /team/{specialist}: median 5.255ms, worst 5.607ms, budget 150ms
perf: GET /teams: median 11.341ms, worst 11.631ms, budget 150ms
perf: GET /templates: median 4.189ms, worst 4.27ms, budget 150ms
perf: GET /usage: median 5.21ms, worst 5.331ms, budget 150ms
perf: GET /work: median 3.873ms, worst 4.041ms, budget 150ms
perf: GET /auth/devices/{id}: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /connections: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /conversation: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /conversation/settings: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /conversation/settings/autonomy: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /conversation/settings/connections: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /conversation/settings/connections/add: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /conversation/settings/copy: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /conversation/settings/housekeeping: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /conversation/settings/machines: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /conversation/settings/machines/add: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /conversation/settings/notebook: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /conversation/settings/thinking: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /housekeeping: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /invites/new: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /invites/{id}: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /jobs: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /jobs/{id}: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /journey: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /nav/rail: 0 bytes of framework CSS and JS, gzipped; 16000-byte budget
perf: GET /needs-you: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /onboarding: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /people: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /playbook-suggestions/{suggestion}: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /playbooks: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /playbooks/new: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /playbooks/{id}: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /playbooks/{id}/edit: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /playbooks/{id}/template-diff: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /preferences: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /preferences/sources/{source}: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /projects: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /projects/accounts: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /projects/new: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /projects/{id}: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /projects/{id}/edit: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /runners/enrol: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /settings: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /settings/coordinator: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /settings/devices: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /settings/recovery: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /settings/recovery/release: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /signed-out: 30270 bytes of framework CSS and JS, gzipped; 40000-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /specialists/new: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /specialists/{key}: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /specialists/{key}/edit: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /specialists/{key}/template-diff: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /tasks: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /tasks/new: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /tasks/{id}: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /tasks/{id}/merge: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /tasks/{id}/move: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /tasks/{id}/plan: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /tasks/{id}/preview: 25954 bytes of framework CSS and JS, gzipped; 40000-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /tasks/{id}/questions/{question}: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /tasks/{id}/rendered-change: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /tasks/{id}/thread: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /team/{specialist}: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /teams: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /templates: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /usage: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: GET /work: 57416 bytes of framework CSS and JS, gzipped; 60600-byte budget; it links the whole tokens.css: add Assets: assets to ui.PagesConfig (PagesConfig.Assets) in render.go, and in the layout use {{path $ pageStylesheet}} in place of static/tokens.css and replace the busy.js, live.js, light.js and anchor.js tags and the neededScripts line (or the select.js, calendar.js and datetime.js tags) with {{range pageScripts}}, keeping rastrillo.js and shell.js
perf: cold boot: median 164ms of [164.135602ms 164.209602ms 165.488064ms], budget 500ms

receipt: test step 50.745s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 88 without tests, 0 failed
receipt: slow package 10.644s amadan.net/oficina/equipo/internal/equipotest
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-runner
receipt: slow package 0s amadan.net/oficina/equipo/cmd/equipo-tool-proxy
receipt: slow package 0s amadan.net/oficina/equipo/internal/advice
receipt: slow test 10.1s amadan.net/oficina/equipo/internal/equipotest TestPerfScreens
receipt: slow test 550ms amadan.net/oficina/equipo/internal/equipotest TestPerfBoot
=== cache ===
ci-box: build cache /home/ci/work/repos/oficina__equipo/cache/go-build: 5.04 GiB in 28991 files
ci-box: module cache /home/ci/work/repos/oficina__equipo/cache/go-mod: 1.15 GiB in 40997 files
ci-box: build cache over 4.0 GiB: dropped 2.24 GiB this job did not read, kept 2.80 GiB

landed from merge-credential-fallback

diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index bf6f0876..12bbad0a 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -14,8 +14,8 @@ perf GET /* skip Unknown private paths render 404; this fallback contains no scr
time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial reruns measured 18.079s and 22.031s. Keep migration, recovery, accounting and concurrency assertions; 60s leaves 30 percent headroom above loaded CI.
time internal/equipotest 300s Final fix package rerun measured 187.035s (review 172.4s); 300s gives 60 percent headroom for HTTP, sandbox, authority and final regression coverage.
-size internal/equipo 22598 - Stuck tasks: the task page Retry on a failed preview and the coordinator's retried attempt on the timeline (2026-11-25); measured 22598 source lines.
-size internal/wire 7069 - Native task evidence hosted names and Today done_at, additive device fields; measured 7069 source lines (2026-11-26).
+size internal/equipo 22600 - Stuck tasks' Retry and timeline (2026-11-25), merge_credential and amadan_unreachable copy (2026-11-26); measured 22600 source lines.
+size internal/wire 7088 - Native task evidence fields, merge_credential and amadan_unreachable reasons (2026-11-26); measured 7088 source lines.
size internal/equipotest - 12017 Task 21 repairs historical migration and conversation fixtures after Plan 3, and the Rastrillo upgrade contract comparing served assets with what Assets serves; measured 0/12017 source/test lines.
time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded);
time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s).
@@ -30,7 +30,7 @@ size internal/runner/provider 5731 - Fable follow-up: base and diagnostic gates,
time internal/plan3test 300s Initial cap for combined browser and runner acceptance; measure at both usable stops.
-size internal/plan3test - 11911 Paused-work strings, the Assistant routes and Paul's approved stuck-task strings in the release inventory and API contract (2026-11-25); measured 11911 test lines.
+size internal/plan3test - 11913 Paused-work, Assistant, stuck-task and merge credential strings in the release inventory (2026-11-26); measured 11913 test lines.
time internal/runner/forge 20s Plan 3 CI repair measured 10.527s for the full package (controller CI 10.407s).
time internal/runner/provider 15s Plan 3 CI repair measured 10.346s for the full package (controller CI 10.709s);
@@ -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 28530 22894 Protocol 30: the preview scanner's health in the capability report, the stuck-task tools refused on an older link (2026-11-25); measured 28530/22894.
+size internal/runner/thin 28724 23336 Protocol 30 scanner health and stuck-task tools, merge credential fallback and write scope (2026-11-26); measured 28724/23336.
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/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
index d6e36d8f..ae2e6956 100644
--- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
+++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
@@ -6908,6 +6908,8 @@ records remain unchanged.
| `chat.activity.offer_retry` | Offering to try the merge again… | Copy specialist | Runtime; COPY APPROVED (Paul, 2026-11-25, copy-review 6haczxo74hoyyuf7xkojgqd27e, unchanged) |
| `chat.activity.retry_step` | Trying it again… | Copy specialist | Runtime; COPY APPROVED (Paul, 2026-11-25, copy-review 6haczxo74hoyyuf7xkojgqd27e, unchanged) |
| `work.tl.coordinator_retried` | The coordinator started %s again. | Copy specialist | Runtime; COPY APPROVED (Paul, 2026-11-25, copy-review 6haczxo74hoyyuf7xkojgqd27e, unchanged) |
+| `work.reason.merge_credential` | the runner has no Amadan credential for this repository | Copy specialist | Runtime; COPY APPROVED (Paul, 2026-11-25, copy-review 6wxwi7zo3fph5nu4nm6eipptfq, unchanged) |
+| `work.reason.amadan_unreachable` | Amadan could not be reached to confirm Equipo may merge here | Copy specialist | Runtime; COPY APPROVED (Paul, 2026-11-25, copy-review 6wxwi7zo3fph5nu4nm6eipptfq, unchanged) |
## Task 21
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go
index 088dba28..70c8347e 100644
--- a/internal/equipo/copy.go
+++ b/internal/equipo/copy.go
@@ -1057,6 +1057,8 @@ var pageCopy = map[string]string{
"work.reason.merge_forbidden": "Equipo may not merge in this repository", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.reason.merge_failed": "Amadan did not merge it", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.reason.merge_unborn_default": "the first merge into this empty repository needs an Amadan update", // COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11)
+ "work.reason.merge_credential": "the runner has no Amadan credential for this repository", // COPY APPROVED (Paul, 2026-11-25, copy-review 6wxwi7zo3fph5nu4nm6eipptfq, unchanged)
+ "work.reason.amadan_unreachable": "Amadan could not be reached to confirm Equipo may merge here", // COPY APPROVED (Paul, 2026-11-25, copy-review 6wxwi7zo3fph5nu4nm6eipptfq, unchanged)
"chat.card.merge_question": "Merge %s without checks?", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.card.merge": "Merge", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.card.wait": "Wait for checks", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
diff --git a/internal/plan3test/plan3_release_test.go b/internal/plan3test/plan3_release_test.go
index eaf16089..5cefd80c 100644
--- a/internal/plan3test/plan3_release_test.go
+++ b/internal/plan3test/plan3_release_test.go
@@ -183,6 +183,8 @@ func plan3CopyInventory(t *testing.T) {
approvedFailedReplies := strings.HasPrefix(key, "chat.failed.") && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)") || key == "signin.refused" && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-22, copy-review smart-door-copy-5, unchanged)")
// Paul's own review of the Engineering stop reasons.
approvedStopReasons := slices.Contains([]string{"work.reason.no_further_changes", "work.reason.tools_refused"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-23, copy-review eavqvil43jg2zs3wxx3kxp3bpm, unchanged)")
+ // Paul's own review of the merge step's credential and hub reasons.
+ approvedMergeCredential := slices.Contains([]string{"work.reason.merge_credential", "work.reason.amadan_unreachable"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-25, copy-review 6wxwi7zo3fph5nu4nm6eipptfq, unchanged)")
// Paul's own review of the coordinator's stuck-task strings.
approvedStuckTasks := slices.Contains([]string{"chat.merge.retry_offer", "chat.activity.offer_retry", "chat.activity.retry_step", "work.tl.coordinator_retried"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-25, copy-review 6haczxo74hoyyuf7xkojgqd27e, unchanged)")
acceptedRoster := strings.HasPrefix(key, "roster.") && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14)")
@@ -210,7 +212,7 @@ func plan3CopyInventory(t *testing.T) {
acceptedProjects := slices.Contains([]string{"projects.amadan", "projects.yours", "projects.can_add", "projects.add_reachable", "projects.names", "projects.names_hint", "projects.details", "projects.title", "projects.description", "projects.save", "projects.context", "projects.found", "projects.selected", "projects.owner_add", "projects.selection_lost", "projects.other", "projects.name_question", "projects.personal_names", "projects.forget_name", "docs/api/equipo-v1.md / Projects and starting a request"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-22)")
acceptedAgentAccess := slices.Contains([]string{"copyAgentConfig", "copyAgentForbidden", "copyAgentNotFound", "copyAgentUnavailable", "copyAgentTooLarge", "copyAgentInvalid", "copyAgentMedia", "copyAgentUnauthenticated", "agent.equipo_projects_list", "agent.equipo_tasks_list", "agent.equipo_task_get", "agent.equipo_needs_you", "docs/api/equipo-v1.md / Delegated read-only operations"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-20)")
acceptedCopy := strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Copy, record-bound) sha256:"+copydesk.Hash(rows[key])
- if !approvedStuckTasks && !acceptedPaused && !acceptedNewTeamCard && !acceptedGitHubEgress && !acceptedForgeSeam && !acceptedAPIErrors && !acceptedNativeProjects && !acceptedInjection && !acceptedMail && !acceptedPush && !acceptedAgentAccess && !acceptedProjects && !acceptedCardNames && !acceptedAccess && !acceptedPlacementEdges && !acceptedPlacement && !acceptedReportActions && !acceptedRoster && !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs && !approvedOficina && !approvedFailedReplies && !approvedStopReasons {
+ if !approvedMergeCredential && !approvedStuckTasks && !acceptedPaused && !acceptedNewTeamCard && !acceptedGitHubEgress && !acceptedForgeSeam && !acceptedAPIErrors && !acceptedNativeProjects && !acceptedInjection && !acceptedMail && !acceptedPush && !acceptedAgentAccess && !acceptedProjects && !acceptedCardNames && !acceptedAccess && !acceptedPlacementEdges && !acceptedPlacement && !acceptedReportActions && !acceptedRoster && !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs && !approvedOficina && !approvedFailedReplies && !approvedStopReasons {
t.Fatal("entry has no copy review status or applicable acceptance", key)
}
}
diff --git a/internal/runner/forge/branch.go b/internal/runner/forge/branch.go
index c6f46358..0314b22a 100644
--- a/internal/runner/forge/branch.go
+++ b/internal/runner/forge/branch.go
@@ -200,6 +200,10 @@ func (b BranchPush) head(ctx context.Context, remote workspace.Remote) (string,
// remote resolves the repository's remote and checks it is that one.
func (b BranchPush) remote(ctx context.Context) (workspace.Remote, error) {
remote, err := b.Remote(ctx)
+ if errors.Is(err, workspace.ErrHubUnavailable) {
+ // Write access could not be confirmed: worth trying again.
+ return workspace.Remote{}, fmt.Errorf("resolving the remote: %w", err)
+ }
if err != nil {
return workspace.Remote{}, fmt.Errorf("%w: resolving the remote: %v", ErrPushRefused, err)
}
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 e0c78c4d..46941bf2 100644
--- a/internal/runner/forge/merge.go
+++ b/internal/runner/forge/merge.go
@@ -39,8 +39,41 @@ var (
// the hub refused to make the first merge (unborn_default, or
// is_default once a rebuild pointed its HEAD at the task branch).
ErrMergeUnbornDefault = errors.New("forge: the hub cannot make the first merge into an empty repository")
+ // ErrMergeNoCredential: the runner has no usable forge credential for
+ // the repository (none in the credential file, and it is not one the
+ // agent-wide credential serves), so it refused the merge itself.
+ ErrMergeNoCredential = errors.New("forge: no usable forge credential for the repository")
)
+// NotSentError is a merge Equipo refused itself before any merge request
+// left for the hub: a definite refusal, never "outcome unknown", since the
+// hub cannot have acted on it. Only code that has sent no merge request
+// returns one.
+type NotSentError struct {
+ // Repo is the repository refused, "" when it is not a valid hub key.
+ Repo string
+ Err error
+}
+
+func (e *NotSentError) Error() string {
+ repo := e.Repo
+ if repo == "" {
+ repo = "this repository"
+ }
+ return fmt.Sprintf("%v (%s; refused by the runner, no merge request was sent)", e.Err, repo)
+}
+
+func (e *NotSentError) Unwrap() error { return e.Err }
+
+// NotSent is err as a refusal made before the merge request, naming repo
+// only when it is a valid hub repository.
+func NotSent(repo string, err error) error {
+ if !validRepository(repo) {
+ repo = ""
+ }
+ return &NotSentError{Repo: repo, Err: err}
+}
+
// HubError is the hub's answer to a merge it did not make: its HTTP
// status, its machine-readable reason (the JSON "reason") and its
// sentence (the JSON "error", or a page's text), both redacted and
@@ -65,7 +98,8 @@ func hubError(res MergeResult, err error) error {
// uncertain is ErrMergeUncertain with what is known of why: the hub's
// answer when it gave one, else the cause's words. Only the words: a
-// cause's own identity (a local refusal, say) never decides the outcome.
+// cause's own identity never decides the outcome (MergeBranch settles a
+// NotSentError, the one refusal known to have sent nothing, before this).
func uncertain(res MergeResult, cause error) error {
switch {
case res.Status != 0:
@@ -149,16 +183,20 @@ type hubMergeBody struct {
// HubMerge sends one merge request to the hub with the agent's bearer.
// A transport failure or an unreadable answer is an error: the caller
-// cannot know whether the merge happened.
+// cannot know whether the merge happened. What it refuses before sending
+// is a NotSentError.
func HubMerge(ctx context.Context, client *http.Client, hub string, cred Credential, repo, branch string, req MergeRequest) (MergeResult, error) {
- if !validRepository(repo) || !validRef(branch) || cred.Bearer == "" || strings.ContainsAny(cred.Bearer, "\r\n") {
- return MergeResult{}, ErrMergeRefused
+ if !validRepository(repo) || !validRef(branch) {
+ return MergeResult{}, NotSent(repo, ErrMergeRefused)
+ }
+ if cred.Bearer == "" || strings.ContainsAny(cred.Bearer, "\r\n") {
+ return MergeResult{}, NotSent(repo, ErrMergeNoCredential)
}
parts := strings.Split(strings.TrimPrefix(repo, "amadan.net/"), "/")
body, _ := json.Marshal(req)
hr, err := http.NewRequestWithContext(ctx, http.MethodPost, strings.TrimRight(hub, "/")+"/api/v1/repos/"+url.PathEscape(parts[0])+"/"+url.PathEscape(parts[1])+"/branches/"+url.PathEscape(branch)+"/merge", bytes.NewReader(body))
if err != nil {
- return MergeResult{}, ErrMergeRefused
+ return MergeResult{}, NotSent(repo, ErrMergeRefused)
}
hr.Header.Set("Authorization", "Bearer "+cred.Bearer)
hr.Header.Set("Content-Type", "application/json")
@@ -225,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()
}
@@ -375,6 +417,22 @@ 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
}
+ // An earlier request may still land: reconcile from the default branch
+ // (a read) before the runner's write check, which then gates only a
+ // new request.
+ unresolved := found && rec.Phase == mergeRequested
+ if m.Preflight != nil && !unresolved {
+ // The runner's own refusals come before the remote is read (that
+ // read needs the same credential): definite, as no request was
+ // ever sent.
+ if err := m.Preflight(ctx); err != nil {
+ var ns *NotSentError
+ if !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}
}
@@ -401,6 +459,14 @@ func MergeBranch(ctx context.Context, m BranchMerge) (MergeOutcome, error) {
return MergeOutcome{}, ErrMergeUncertain
}
}
+ before := rec.Phase
+ if m.Preflight != nil && unresolved {
+ // Not landed, and the earlier request is unresolved: a new one only
+ // with write access confirmed; without it, still unknown.
+ if err := m.Preflight(ctx); err != nil {
+ return MergeOutcome{}, uncertain(MergeResult{}, err)
+ }
+ }
if err := m.Confirm(ctx); err != nil {
return MergeOutcome{}, fmt.Errorf("%w: confirming the lease: %v", ErrMergeUncertain, err)
}
@@ -412,6 +478,19 @@ func MergeBranch(ctx context.Context, m BranchMerge) (MergeOutcome, error) {
m.beforeRequest()
}
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, &notSent) && 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
+ }
+ return MergeOutcome{}, rerr
+ }
if rerr == nil && res.Merged {
rec.Phase, rec.SHA, rec.Into = mergeMerged, res.SHA, firstOf(res.Into, st.Default)
if err := m.save(rec); err != nil {
diff --git a/internal/runner/forge/merge_notsent_test.go b/internal/runner/forge/merge_notsent_test.go
new file mode 100644
index 00000000..3dc31c3d
--- /dev/null
+++ b/internal/runner/forge/merge_notsent_test.go
@@ -0,0 +1,208 @@
+package forge
+
+import (
+ "context"
+ "errors"
+ "net/http"
+ "net/http/httptest"
+ "strings"
+ "sync/atomic"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/runner/workspace"
+)
+
+// TestMergeBranchLocalRefusalIsDefinite: a merge Equipo refuses itself
+// before any request leaves for the hub (no usable credential, say) is a
+// definite refusal with its own reason, never "outcome unknown": the
+// remote is not read again to reconcile, the record goes back to the phase
+// it had (prepared), and a later call asks the hub as usual.
+func TestMergeBranchLocalRefusalIsDefinite(t *testing.T) {
+ h := &fakeHub{head: strings.Repeat("a", 40), answer: mergeNow}
+ m := newMerge(t, h)
+ var inspects atomic.Int32
+ m.Inspect = func(ctx context.Context) (RemoteState, error) { inspects.Add(1); return h.inspect(ctx) }
+ refusing := m
+ refusing.Request = func(context.Context, MergeRequest) (MergeResult, error) {
+ return MergeResult{}, NotSent(m.Repo, ErrMergeNoCredential)
+ }
+ _, err := MergeBranch(context.Background(), refusing)
+ if !errors.Is(err, ErrMergeNoCredential) || errors.Is(err, ErrMergeUncertain) {
+ t.Fatalf("local refusal: %v", err)
+ }
+ if !strings.Contains(err.Error(), m.Repo) || strings.Contains(err.Error(), "outcome unknown") {
+ t.Fatalf("local refusal words: %v", err)
+ }
+ if inspects.Load() != 1 {
+ t.Fatalf("a local refusal read the remote %d times", inspects.Load())
+ }
+ if rec, ok, _ := m.load(); !ok || rec.Phase != mergePrepared {
+ t.Fatalf("record after a local refusal: %+v", rec)
+ }
+ out, err := MergeBranch(context.Background(), m)
+ if err != nil || out.Source != SourceHub || len(h.requests) != 1 {
+ t.Fatalf("after the refusal %+v %v (%d requests)", out, err, len(h.requests))
+ }
+}
+
+// TestNotSentNamesOnlyAValidRepository: the refusal's words name the
+// repository only when it is a valid hub key.
+func TestNotSentNamesOnlyAValidRepository(t *testing.T) {
+ if err := NotSent("amadan.net/../x\nInjected", ErrMergeRefused); strings.Contains(err.Error(), "Injected") || !errors.Is(err, ErrMergeRefused) {
+ t.Fatalf("invalid repository named: %v", err)
+ }
+}
+
+// TestHubMergeRefusesLocallyBeforeSending: HubMerge's own refusals (no
+// bearer, a bad repository or branch) are made before any request and
+// say so; the hub is never contacted.
+func TestHubMergeRefusesLocallyBeforeSending(t *testing.T) {
+ var hits atomic.Int32
+ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { hits.Add(1); w.WriteHeader(500) }))
+ defer srv.Close()
+ req := MergeRequest{ExpectSHA: strings.Repeat("a", 40), Strategy: "merge"}
+ for _, c := range []struct {
+ cred Credential
+ repo, branch string
+ want error
+ }{
+ {Credential{Agent: "equipo~p@example.com"}, "amadan.net/oficina/sample", "equipo/tk1-x", ErrMergeNoCredential},
+ {Credential{Agent: "equipo~p@example.com", Bearer: "a\nb"}, "amadan.net/oficina/sample", "equipo/tk1-x", ErrMergeNoCredential},
+ {Credential{Agent: "equipo~p@example.com", Bearer: "token"}, "github.com/x/y", "equipo/tk1-x", ErrMergeRefused},
+ {Credential{Agent: "equipo~p@example.com", Bearer: "token"}, "amadan.net/oficina/sample", "bad..ref", ErrMergeRefused},
+ } {
+ _, err := HubMerge(context.Background(), srv.Client(), srv.URL, c.cred, c.repo, c.branch, req)
+ var ns *NotSentError
+ if !errors.Is(err, c.want) || !errors.As(err, &ns) || errors.Is(err, ErrMergeUncertain) {
+ t.Fatalf("%+v %s %s: %v", c.cred.Agent, c.repo, c.branch, err)
+ }
+ if strings.Contains(err.Error(), "token") {
+ t.Fatalf("bearer in the refusal: %v", err)
+ }
+ }
+ if hits.Load() != 0 {
+ 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)
+ }
+}
+
+// TestMergeBranchReconcilesBeforeTheWriteCheck: an earlier request whose
+// answer was lost landed meanwhile. The write check fails now (a revoked
+// grant, a hub list that cannot be fetched), yet the default branch reads
+// fine: the merge settles from it, and the write check is never asked.
+func TestMergeBranchReconcilesBeforeTheWriteCheck(t *testing.T) {
+ for _, refusal := range []error{ErrMergeRefused, workspace.ErrHubUnavailable} {
+ h := &fakeHub{head: strings.Repeat("a", 40), answer: mergeNow}
+ m := newMerge(t, h)
+ lost := m
+ lost.Request = func(_ context.Context, req MergeRequest) (MergeResult, error) {
+ mergeNow(h, req) // landed; the answer is lost
+ return MergeResult{}, errors.New("answer lost")
+ }
+ lost.Inspect = func(context.Context) (RemoteState, error) {
+ if rec, ok, _ := m.load(); ok && rec.Phase == mergeRequested {
+ return RemoteState{}, errors.New("process killed")
+ }
+ return h.inspect(context.Background())
+ }
+ if _, err := MergeBranch(context.Background(), lost); !errors.Is(err, ErrMergeUncertain) {
+ t.Fatalf("lost: %v", err)
+ }
+ var preflights atomic.Int32
+ m.Preflight = func(context.Context) error { preflights.Add(1); return NotSent(m.Repo, refusal) }
+ out, err := MergeBranch(context.Background(), m)
+ if err != nil || !out.Reconciled || out.SHA != strings.Repeat("8", 40) || preflights.Load() != 0 || len(h.requests) != 0 {
+ t.Fatalf("%v: settled %+v %v (%d preflights, %d requests)", refusal, out, err, preflights.Load(), len(h.requests))
+ }
+ }
+}
+
+// TestPushRemoteUnavailableIsNotRefused: a remote the hub could not be
+// asked about (write access unconfirmed) is a failure to try again, never
+// the definite refusal a missing credential is.
+func TestPushRemoteUnavailableIsNotRefused(t *testing.T) {
+ b := BranchPush{Repo: "amadan.net/oficina/sample", Remote: func(context.Context) (workspace.Remote, error) {
+ return workspace.Remote{}, workspace.ErrHubUnavailable
+ }}
+ _, err := b.remote(context.Background())
+ if !errors.Is(err, workspace.ErrHubUnavailable) || errors.Is(err, ErrPushRefused) {
+ t.Fatalf("unavailable: %v", err)
+ }
+ b.Remote = func(context.Context) (workspace.Remote, error) { return workspace.Remote{}, workspace.ErrGitPassword }
+ if _, err := b.remote(context.Background()); !errors.Is(err, ErrPushRefused) {
+ t.Fatalf("no credential: %v", 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 156c80a3..f917ecee 100644
--- a/internal/runner/thin/forge.go
+++ b/internal/runner/thin/forge.go
@@ -11,6 +11,7 @@ import (
"errors"
"fmt"
"io"
+ "log/slog"
"net/http"
"os"
"os/exec"
@@ -94,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
@@ -160,25 +163,153 @@ 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 errors.Is(err, workspace.ErrHubUnavailable) {
+ return workspace.Remote{}, workspace.ErrHubUnavailable
+ }
+ 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) {
- names, _ := f.creds.RepositoryNames()
- if !slices.Contains(names, repo) {
- // Created or reachable through the agent's namespace grant: the
- // agent-wide git password serves them.
- c, err := f.agent(ctx)
- if err != nil || c.GitPassword == "" {
- return workspace.Remote{}, workspace.ErrGitPassword
+ if names, _ := f.creds.RepositoryNames(); slices.Contains(names, repo) {
+ return f.creds.Resolve(ctx, repo)
+ }
+ // Created or reachable through the agent's namespace grant: the
+ // agent-wide git password serves them.
+ c, err := f.credential(ctx, repo)
+ if err != nil || c.GitPassword == "" {
+ return workspace.Remote{}, workspace.ErrGitPassword
+ }
+ return workspace.Remote{URL: "https://" + repo, GitPassword: c.GitPassword}, nil
+}
+
+// credential is the forge credential for repo, which the caller has
+// 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. 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 {
+ return forge.Credential{}, err
+ }
+ if slices.Contains(names, repo) {
+ return f.creds.Credential(ctx, repo)
+ }
+ if !forgekey.ValidHub(repo) {
+ return forge.Credential{}, forge.ErrMergeNoCredential
+ }
+ c, err := f.creds.Agent(ctx)
+ if err != nil {
+ return forge.Credential{}, err
+ }
+ c.Remote = "https://" + repo
+ return c, nil
+}
+
+// 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)
+ }
+ listed, confirmed := f.writable(ctx, repo, scopeKey(c))
+ if !confirmed {
+ return forge.Credential{}, forge.NotSent(repo, workspace.ErrHubUnavailable)
+ }
+ if !listed {
+ 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 asks the hub now whether it lists repo as writable with the
+// credential key names: confirmed is whether it answered (a list fetched
+// just now with that credential), listed whether the repository is in it.
+// A write is rare, so it never trusts the cached list; the request is
+// conditional (a 304 when nothing changed). Unconfirmed, the write waits.
+func (f *fileForge) writable(ctx context.Context, repo, key string) (listed, confirmed bool) {
+ f.mu.Lock()
+ f.nsAt = time.Time{}
+ f.mu.Unlock()
+ f.list(ctx)
+ f.mu.Lock()
+ defer f.mu.Unlock()
+ confirmed = f.listKey == key && !f.nsAt.IsZero()
+ return confirmed && slices.Contains(f.listed, repo), confirmed
+}
+
+// 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 log == nil {
+ return
+ }
+ if f.creds.Legacy() {
+ log.Warn(legacyAgentCredential)
+ }
+ if !f.enabled {
+ return
+ }
+ for _, repo := range f.createdRepos() {
+ if c, err := f.credential(ctx, repo); err != nil || c.Bearer == "" {
+ log.Warn(createdNoCredential, "repo", repo)
}
- return workspace.Remote{URL: "https://" + repo, GitPassword: c.GitPassword}, nil
}
- return f.creds.Resolve(ctx, repo)
}
// list asks the hub which repositories the agent may write to, at most
@@ -187,13 +318,19 @@ func (f *fileForge) remoteCredential(ctx context.Context, repo string) (workspac
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 {
@@ -208,6 +345,12 @@ func (f *fileForge) list(ctx context.Context) ([]string, []string) {
f.nsAt = time.Now()
return slices.Clone(f.ns), slices.Clone(f.listed)
}
+ if res.StatusCode == http.StatusUnauthorized || res.StatusCode == http.StatusForbidden {
+ // The hub answered: this credential reaches nothing (revoked, or
+ // another's). A denial, not an outage.
+ f.ns, f.listed, f.nsAt, f.etag = []string{}, []string{}, time.Now(), ""
+ return []string{}, []string{}
+ }
var out struct {
Repos []struct {
NS string `json:"ns"`
@@ -315,16 +458,17 @@ func (f *fileForge) adopt(repo string) error {
return ErrAdopted
}
-// Merge sends the hub the merge request with the agent's credential for
-// repo (its own entry, or the agent-wide one).
+// 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 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.ErrMergeRefused
- }
- c, err := f.creds.Credential(ctx, repo)
+ c, err := f.writeCredential(ctx, repo)
if err != nil {
- return forge.MergeResult{}, forge.ErrMergeRefused
+ return forge.MergeResult{}, err
}
return forge.HubMerge(ctx, f.client, f.hub, c, repo, branch, req)
}
@@ -353,7 +497,7 @@ func (f *fileForge) ciCredential(ctx context.Context, repo string) (forge.Creden
if !slices.Contains(f.Repos(), repo) {
return forge.Credential{}, forge.ErrCIRead
}
- c, err := f.creds.Credential(ctx, repo)
+ c, err := f.credential(ctx, repo)
if err != nil {
return forge.Credential{}, forge.ErrCIRead
}
diff --git a/internal/runner/thin/forges.go b/internal/runner/thin/forges.go
index c2828e79..0914e356 100644
--- a/internal/runner/thin/forges.go
+++ b/internal/runner/thin/forges.go
@@ -96,10 +96,29 @@ func (f *Forges) Propose(ctx context.Context, p Proposal) (ProposalRef, error) {
func (f *Forges) Merge(ctx context.Context, repo, branch string, req forge.MergeRequest) (forge.MergeResult, error) {
fg, key, err := f.route(repo)
if err != nil {
- return forge.MergeResult{}, errors.Join(forge.ErrMergeRefused, err)
+ return forge.MergeResult{}, forge.NotSent(repo, errors.Join(forge.ErrMergeRefused, err))
}
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
new file mode 100644
index 00000000..ad5c437c
--- /dev/null
+++ b/internal/runner/thin/merge_credential_test.go
@@ -0,0 +1,440 @@
+package thin
+
+import (
+ "bytes"
+ "context"
+ "errors"
+ "fmt"
+ "log/slog"
+ "net/http"
+ "net/http/httptest"
+ "os"
+ "path/filepath"
+ "strings"
+ "sync"
+ "testing"
+ "time"
+
+ "amadan.net/oficina/equipo/internal/runner/forge"
+ "amadan.net/oficina/equipo/internal/runner/workspace"
+ "amadan.net/oficina/equipo/internal/wire"
+)
+
+// 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 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
+ 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{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 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]))
+ }
+ fmt.Fprintf(w, `{"repos":[%s]}`, strings.Join(parts, ","))
+ return
+ }
+ if r.Method == http.MethodPost && strings.HasSuffix(r.URL.Path, "/merge") {
+ rig.merges = append(rig.merges, r.URL.EscapedPath()+" "+r.Header.Get("Authorization"))
+ fmt.Fprintf(w, `{"merged":true,"sha":%q,"into":"main","branch_closed":true}`, strings.Repeat("8", 40))
+ return
+ }
+ w.WriteHeader(http.StatusNotFound)
+ }))
+ t.Cleanup(srv.Close)
+ dir := t.TempDir()
+ 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(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 {
+ t.Fatal(err)
+ }
+ }
+ return rig
+}
+
+func (rig *mergeCredRig) requests() []string {
+ rig.mu.Lock()
+ defer rig.mu.Unlock()
+ 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 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"}, []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)
+ }
+ if got := rig.requests(); len(got) != 1 || got[0] != "/api/v1/repos/paulca/nearys/branches/equipo%2Ftk1-x/merge Bearer api-first" {
+ t.Fatalf("merge requests %q", got)
+ }
+ // The hub's CI is read with the same credential.
+ if c, err := rig.f.ciCredential(context.Background(), "amadan.net/paulca/nearys"); err != nil || c.Bearer != "api-first" || c.Remote != "https://amadan.net/paulca/nearys" {
+ t.Fatalf("CI credential %+v %v", c.Remote, err)
+ }
+ // A repository the hub lists as writable by the agent is in scope too.
+ rig = newMergeCredRig(t, perRepoOnly, nil, []string{"amadan.net/paulca/listed"})
+ if _, err := rig.f.Merge(context.Background(), "amadan.net/paulca/listed", "equipo/tk1-x", mergeReq); err != nil || len(rig.requests()) != 1 {
+ t.Fatalf("listed repository: %v %q", err, rig.requests())
+ }
+}
+
+// TestMergeCredentialStaysInScope: a repository that is neither in the
+// credential file, nor created here, nor listed by the hub is refused by
+// policy before any request; one whose own entry is unusable never falls
+// back to the agent-wide credential. Both refusals are definite and name
+// the repository, never a credential.
+func TestMergeCredentialStaysInScope(t *testing.T) {
+ rig := newMergeCredRig(t, perRepoOnly, []string{"amadan.net/paulca/nearys"}, []string{"amadan.net/paulca/listed"})
+ for repo, want := range map[string]error{"amadan.net/paulca/unrelated": forge.ErrMergeRefused, "amadan.net/paulca/stale": forge.ErrMergeNoCredential} {
+ _, err := rig.f.Merge(context.Background(), repo, "equipo/tk1-x", mergeReq)
+ var ns *forge.NotSentError
+ if !errors.Is(err, want) || !errors.As(err, &ns) || errors.Is(err, forge.ErrMergeUncertain) {
+ t.Fatalf("%s: %v", repo, err)
+ }
+ if !strings.Contains(err.Error(), repo) || strings.Contains(err.Error(), "api-") || strings.Contains(err.Error(), "git-") {
+ t.Fatalf("%s: refusal words %q", repo, err)
+ }
+ if _, err := rig.f.ciCredential(context.Background(), repo); err == nil {
+ t.Fatalf("%s: CI credential out of scope", repo)
+ }
+ }
+ if got := rig.requests(); len(got) != 0 {
+ t.Fatalf("out-of-scope merge reached the hub: %q", got)
+ }
+ // No agent-wide credential at all: a created repository is refused too.
+ rig = newMergeCredRig(t, `{"agent":"equipo~owner@example.com","repositories":{}}`, []string{"amadan.net/paulca/nearys"}, nil)
+ if _, err := rig.f.Merge(context.Background(), "amadan.net/paulca/nearys", "equipo/tk1-x", mergeReq); !errors.Is(err, forge.ErrMergeNoCredential) || len(rig.requests()) != 0 {
+ t.Fatalf("no agent credential: %v", err)
+ }
+}
+
+// TestMergeStepLocalRefusal: a merge refused on the runner before the hub
+// was contacted ends the step at once (one attempt, no retries) with its
+// own reason, and the log tail names the repository, not "outcome
+// unknown"; the forge record is back at prepared.
+func TestMergeStepLocalRefusal(t *testing.T) {
+ old := mergeBackoff
+ mergeBackoff = time.Millisecond
+ t.Cleanup(func() { mergeBackoff = old })
+ e, f, r, _ := hubRig(t)
+ f.answer = func(int, func() (forge.MergeResult, error)) (forge.MergeResult, error) {
+ return forge.MergeResult{}, forge.NotSent(r.Repo, forge.ErrMergeNoCredential)
+ }
+ rep := e.Exec(context.Background(), r, func(wire.StepReport) {})
+ if rep.State != wire.StepFailed || rep.Reason != "merge_credential" || !rep.Termination || f.requests != 1 {
+ t.Fatalf("report %+v (%d requests)", rep, f.requests)
+ }
+ if !strings.Contains(rep.LogTail, r.Repo) || strings.Contains(rep.LogTail, "outcome unknown") {
+ t.Fatalf("log tail %q", rep.LogTail)
+ }
+ paths, _ := filepath.Glob(filepath.Join(e.root(), "merge", "merge-*.json"))
+ if len(paths) != 1 {
+ t.Fatalf("merge records %v", paths)
+ }
+ if raw, err := os.ReadFile(paths[0]); err != nil || !strings.Contains(string(raw), `"phase":"prepared"`) {
+ t.Fatalf("record %s %v", raw, err)
+ }
+ // A later Merge tap asks the hub again and lands it.
+ f.answer = nil
+ if rep := e.Exec(context.Background(), r, func(wire.StepReport) {}); rep.State != wire.StepDone || f.requests != 2 {
+ t.Fatalf("again %+v (%d requests)", rep, f.requests)
+ }
+}
+
+// TestCheckCreatedCredentials: at start, with repository creation on,
+// every repository the runner created is checked for a usable credential
+// by the merge lookup; each missing one gets one fixed warning naming it,
+// and no credential is logged.
+func TestCheckCreatedCredentials(t *testing.T) {
+ var buf bytes.Buffer
+ log := slog.New(slog.NewTextHandler(&buf, nil))
+ rig := newMergeCredRig(t, perRepoOnly, []string{"amadan.net/paulca/nearys"}, nil)
+ rig.f.checkCreated(context.Background(), log)
+ 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)
+ rig.f.checkCreated(context.Background(), log)
+ out := buf.String()
+ if strings.Count(out, createdNoCredential) != 2 || !strings.Contains(out, "amadan.net/paulca/nearys") || !strings.Contains(out, "amadan.net/paulca/other") || !strings.Contains(out, "level=WARN") {
+ t.Fatalf("warnings %s", out)
+ }
+ if len(rig.requests()) != 0 {
+ t.Fatal("the check contacted the hub")
+ }
+ // Creation off: nothing is checked.
+ buf.Reset()
+ rig.f.enabled = false
+ rig.f.checkCreated(context.Background(), log)
+ if buf.Len() != 0 {
+ 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"
+ blocked := func(t *testing.T, rig *mergeCredRig, what string, want error) {
+ t.Helper()
+ before := len(rig.requests())
+ _, err := rig.f.Merge(ctx, repo, "equipo/tk1-x", mergeReq)
+ var ns *forge.NotSentError
+ if !errors.Is(err, want) || !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)
+ }
+ }
+ refused := func(t *testing.T, rig *mergeCredRig, what string) {
+ t.Helper()
+ blocked(t, rig, what, forge.ErrMergeRefused)
+ }
+ 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()
+ // A 500 is not a denial: write access is unconfirmed (it recovers,
+ // see TestWriteScopeUnavailableRecovers), and nothing is sent. A 401
+ // is the hub refusing the credential: a denial.
+ for status, want := range map[int]error{http.StatusInternalServerError: workspace.ErrHubUnavailable, http.StatusUnauthorized: forge.ErrMergeRefused} {
+ rig.set(func() { rig.listStatus = status })
+ blocked(t, rig, fmt.Sprint("list ", status), want)
+ }
+ })
+ 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())
+ }
+}
+
+// TestWriteScopeUnavailableRecovers: a hub list that fails (a 500, a 502)
+// is not a denial: the merge is refused as "hub
+// unavailable", the push says so rather than asking for a git password,
+// and both go through once the hub answers again. A list that answers
+// without the repository is the denial.
+func TestWriteScopeUnavailableRecovers(t *testing.T) {
+ ctx := context.Background()
+ repo := "amadan.net/paulca/nearys"
+ rig := newMergeCredRig(t, perRepoOnly, []string{repo}, []string{repo})
+ for _, fail := range []func(){
+ func() { rig.listStatus = http.StatusInternalServerError },
+ func() { rig.listStatus = http.StatusBadGateway },
+ } {
+ rig.set(fail)
+ _, err := rig.f.Merge(ctx, repo, "equipo/tk1-x", mergeReq)
+ var ns *forge.NotSentError
+ if !errors.Is(err, workspace.ErrHubUnavailable) || errors.Is(err, forge.ErrMergeRefused) || !errors.As(err, &ns) {
+ t.Fatalf("merge while the list fails: %v", err)
+ }
+ if _, err := rig.f.Remote(ctx, repo, Push); !errors.Is(err, workspace.ErrHubUnavailable) || errors.Is(err, workspace.ErrGitPassword) {
+ t.Fatalf("push while the list fails: %v", err)
+ }
+ }
+ rig.set(func() { rig.listStatus = 0 })
+ if _, err := rig.f.Merge(ctx, repo, "equipo/tk1-x", mergeReq); err != nil {
+ t.Fatalf("merge after recovery: %v", err)
+ }
+ if remote, err := rig.f.Remote(ctx, repo, Push); err != nil || remote.GitPassword != "git-first" {
+ t.Fatalf("push after recovery: %v", err)
+ }
+ // Answered, without the repository: a denial.
+ rig.set(func() { rig.lists["api-first"] = nil })
+ if _, err := rig.f.Merge(ctx, repo, "equipo/tk1-x", mergeReq); !errors.Is(err, forge.ErrMergeRefused) || errors.Is(err, workspace.ErrHubUnavailable) {
+ t.Fatalf("denied: %v", err)
+ }
+}
+
+// TestMergeStepHubUnavailable: the hub cannot confirm write access. The
+// step tries again in place, and goes through once the hub answers; still
+// unavailable, it is deferred (the queue moves on), and past the wait it
+// ends amadan_unreachable, naming the repository.
+func TestMergeStepHubUnavailable(t *testing.T) {
+ old := []time.Duration{mergeBackoff, mergeHubWait}
+ mergeBackoff, mergeHubWait = time.Millisecond, 50*time.Millisecond
+ t.Cleanup(func() { mergeBackoff, mergeHubWait = old[0], old[1] })
+ e, f, r, _ := hubRig(t)
+ f.answer = func(n int, merge func() (forge.MergeResult, error)) (forge.MergeResult, error) {
+ if n == 1 {
+ return forge.MergeResult{}, forge.NotSent(r.Repo, workspace.ErrHubUnavailable)
+ }
+ return merge()
+ }
+ if rep := e.Exec(context.Background(), r, func(wire.StepReport) {}); rep.State != wire.StepDone || f.requests != 2 {
+ t.Fatalf("recovered %+v (%d requests)", rep, f.requests)
+ }
+ e, f, r, _ = hubRig(t)
+ f.answer = func(int, func() (forge.MergeResult, error)) (forge.MergeResult, error) {
+ return forge.MergeResult{}, forge.NotSent(r.Repo, workspace.ErrHubUnavailable)
+ }
+ if err := e.O.State.AcceptDispatch(context.Background(), "d1", r.DispatchCommand); err != nil {
+ t.Fatal(err)
+ }
+ if rep := e.Exec(context.Background(), r, func(wire.StepReport) {}); rep.State != stepDeferred || f.requests != mergeAttempts {
+ t.Fatalf("unavailable %+v (%d requests)", rep, f.requests)
+ }
+ e.O.State.deferStep(context.Background(), r, time.Millisecond)
+ e.O.State.db.Exec("UPDATE steps SET deferred_since=? WHERE step_id=?", stamp(time.Now().Add(-time.Hour)), r.StepID)
+ rep := e.Exec(context.Background(), r, func(wire.StepReport) {})
+ if rep.State != wire.StepFailed || rep.Reason != wire.ReasonAmadanUnreachable || !strings.Contains(rep.LogTail, r.Repo) {
+ t.Fatalf("after the wait %+v", rep)
+ }
+}
diff --git a/internal/runner/thin/mergestep.go b/internal/runner/thin/mergestep.go
index 4b39a078..7a2aabd8 100644
--- a/internal/runner/thin/mergestep.go
+++ b/internal/runner/thin/mergestep.go
@@ -35,6 +35,9 @@ var (
mergeBackoff = 3 * time.Second
mergeCIWait = 10 * time.Minute
mergeCIPoll = 15 * time.Second
+ // mergeHubWait: how long a merge waits, deferred, for the hub to
+ // confirm write access again (workspace.ErrHubUnavailable).
+ mergeHubWait = 10 * time.Minute
)
// MergeAgentHarness names the runner to the hub in the merge's agent block.
@@ -93,6 +96,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
@@ -104,7 +112,11 @@ func (e *Engineer) mergeStep(ctx context.Context, r stepRow, progress func(wire.
cctx, cancel := context.WithTimeout(mctx, 3*time.Minute)
out, err = forge.MergeBranch(cctx, m)
cancel()
- if maskDetail != "" || notAuthorized || !errors.Is(err, forge.ErrMergeUncertain) || uncertain+1 >= mergeAttempts {
+ // Tried again: an outcome the hub may have acted on, and a hub that
+ // could not confirm write access. Any other refusal made here
+ // before contacting it (forge.NotSentError) ends the step.
+ again := errors.Is(err, forge.ErrMergeUncertain) || errors.Is(err, workspace.ErrHubUnavailable)
+ if maskDetail != "" || notAuthorized || !again || uncertain+1 >= mergeAttempts {
break
}
time.Sleep(time.Duration(uncertain+1) * mergeBackoff)
@@ -128,6 +140,17 @@ func (e *Engineer) mergeStep(ctx context.Context, r stepRow, progress func(wire.
return rep
}
}
+ if errors.Is(err, workspace.ErrHubUnavailable) {
+ // Nothing was sent: held for later, releasing the queue, until the
+ // hub answers or the wait is over.
+ e.logDetail("merge", err)
+ since := e.O.State.deferredSince(mctx, r)
+ if since.IsZero() || time.Since(since) < mergeHubWait {
+ rep.State = stepDeferred
+ return rep
+ }
+ return fail(wire.ReasonAmadanUnreachable)
+ }
switch {
case err == nil:
// Done: the merge watch for this candidate ends here, so only this
@@ -159,6 +182,11 @@ func (e *Engineer) mergeStep(ctx context.Context, r stepRow, progress func(wire.
return fail("merge_forbidden")
case errors.Is(err, forge.ErrMergeUnbornDefault):
return fail(wire.ReasonMergeUnbornDefault)
+ case errors.Is(err, forge.ErrMergeNoCredential):
+ // Refused on this runner before the hub was contacted: no
+ // credential serves the repository. The log tail names it.
+ e.logDetail("merge", err)
+ return fail(wire.ReasonMergeCredential)
case errors.Is(err, forge.ErrMergeRefused):
return fail("policy_rejected")
}
diff --git a/internal/runner/thin/run.go b/internal/runner/thin/run.go
index 3315e656..9a431dba 100644
--- a/internal/runner/thin/run.go
+++ b/internal/runner/thin/run.go
@@ -196,6 +196,9 @@ func Run(ctx context.Context, c runner.Config, o Options) error {
if fg == nil {
ff := NewFileForge(c.AmadanCredentialPath, c.StateDir, !o.NoCreate).(*fileForge)
ff.accessTargets = state.accessReadTargets
+ // Each repository it created must have a credential its merges
+ // can use; say which do not, before a merge finds out.
+ ff.checkCreated(ctx, o.Logger)
fg, err = NewForges(ff)
if err != nil {
return err
diff --git a/internal/runner/workspace/workspace.go b/internal/runner/workspace/workspace.go
index 301f2628..f4823cfa 100644
--- a/internal/runner/workspace/workspace.go
+++ b/internal/runner/workspace/workspace.go
@@ -39,6 +39,11 @@ func (r Remote) Username() string {
var ErrGitPassword = errors.New("configure a repository git password (PAT) in EQUIPO_AMADAN_CREDENTIAL_PATH")
+// ErrHubUnavailable: the forge could not be asked whether the agent may
+// write to the repository now (no answer, an error status, an unreadable
+// list). Nothing was sent; unlike a denial, it is worth trying again.
+var ErrHubUnavailable = errors.New("the forge could not be reached to confirm write access; nothing was sent")
+
type ForgeRead interface {
Resolve(context.Context, string) (Remote, error)
}
diff --git a/internal/wire/tasks.go b/internal/wire/tasks.go
index 9cf6ba56..6ea9b383 100644
--- a/internal/wire/tasks.go
+++ b/internal/wire/tasks.go
@@ -1058,6 +1058,13 @@ var StepReasons = map[string]bool{
// merge_not_authorized: the instance refused the merge request's
// confirmation (merge authority); nothing was sent to the hub.
"merge_not_authorized": true,
+ // The runner has no usable forge credential for the repository and
+ // refused the merge itself; nothing was sent to the hub
+ // (ReasonMergeCredential).
+ ReasonMergeCredential: true,
+ // The hub could not confirm write access in time; nothing was sent
+ // (ReasonAmadanUnreachable).
+ ReasonAmadanUnreachable: true,
// Previews (protocol 9): the runner is too old (settled at its
// connection); the account's 20 temporary apps are taken; the task's
// preview expired and its name is still in the Trash; the config is
@@ -1138,3 +1145,15 @@ const MaxSimilarTasks = 3
// the first merge (before amadan#139). Nothing merged; it waits on the
// platform, never retried on its own (protocol 8).
const ReasonMergeUnbornDefault = "merge_unborn_default"
+
+// ReasonMergeCredential: the runner refused a merge step before contacting
+// the hub because no forge credential it holds serves the repository. A
+// definite refusal: nothing was sent, and a later Merge may try again
+// once the credential is there. An older instance records it as unknown.
+const ReasonMergeCredential = "merge_credential"
+
+// ReasonAmadanUnreachable: the hub could not be asked whether the runner
+// may still write to the repository, for longer than the merge waits.
+// Nothing was sent; a later Merge may try again. An older instance records
+// it as unknown.
+const ReasonAmadanUnreachable = "amadan_unreachable"