Mac slice F task 2: wire protocol 37, migration 0120, fixtures
ProtocolMacEngineering (37; 36 is the specialists build's) adds the prepare_base and base frames, Engineering transfers (TransferHeader Kind, OldBaseSHA, Commits, Valid), Xcode access on dispatch and report, a report's kept session and outcome, publication-bound change files and diffs, a pinned ask, a worker's EngineeringStatus and F1 to F7 probes. Encode refuses the frames, Engineering transfers and publication diffs below 37 and drops every new field; WithoutWorkerConnections lets the instance ignore a worker's connections and seal key below 37. Migration 0120 adds runner_transfers.kind and old_base_sha, chat_steps xcode_access, outcome_phase and session_id, and the frozen question pin columns on chat_questions; transfers.go stores and loads kind and old base only. Eight new frame fixtures; the API doc gains EngineeringStatus.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 files changed,
+1,275
−44
.rastrillo/budgets.txt+2 −2docs/api/equipo-v1.openapi.json+20 −0internal/equipo/chat/models.go+13 −8internal/equipo/chat/questions.go+10 −0internal/equipo/chat/tasks.go+9 −1internal/equipo/chat/transfers.go+7 −5internal/equipo/chat/transfers_kind_test.go+98 −0internal/equipo/migrations/0120_mac_engineering.sql+14 −0internal/equipo/migrations/schema.sql+15 −0internal/equipo/migrations_mac_engineering_test.go+150 −0internal/wire/assistant_files_test.go+1 −1internal/wire/assistant_test.go+1 −1internal/wire/change_diffs.go+3 −0internal/wire/change_diffs_test.go+7 −5internal/wire/change_files_test.go+1 −1internal/wire/connections_test.go+3 −1internal/wire/frames.go+5 −1internal/wire/injection_test.go+2 −2internal/wire/mac_engineering.go+338 −0internal/wire/mac_engineering_test.go+491 −0internal/wire/mixed_protocol_test.go+1 −1internal/wire/models_test.go+1 −1internal/wire/opencode_test.go+1 −1internal/wire/pinned_release_test.go+1 −1internal/wire/places_test.go+1 −1internal/wire/publish_test.go+1 −1internal/wire/questions.go+5 −0internal/wire/runners.go+50 −4internal/wire/runners_test.go+1 −1internal/wire/schedule_test.go+1 −1internal/wire/stuck_test.go+1 −1internal/wire/tasks.go+10 −0internal/wire/usage_test.go+1 −1internal/wire/warm_test.go+1 −1internal/wire/wire_test.go+1 −1internal/wire/wiretest/testdata/frames/ask-pinned.json+1 −0internal/wire/wiretest/testdata/frames/base.json+1 −0internal/wire/wiretest/testdata/frames/blob-engineering.json+1 −0internal/wire/wiretest/testdata/frames/dispatch-mac-engineering.json+1 −0internal/wire/wiretest/testdata/frames/hello-worker-conns.json+1 −0internal/wire/wiretest/testdata/frames/prepare-base.json+1 −0internal/wire/wiretest/testdata/frames/published-change-files.json+1 −0internal/wire/wiretest/testdata/frames/step-mac-engineering.json+1 −0
CI failed — run details
CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/mac-slice-f: Type Size Avail | ext4 96G 84G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type Size Avail | ext4 96G 84G
ci-box: bwrap: fetched and verified in 0.4s
ci-box: claude: fetched and verified in 1.4s
ci-box: codex: fetched and verified in 4.6s
ci-box: codex-code-mode-host: fetched and verified in 1.7s
ci-box: libwrap: fetched and verified in 0.4s
ci-box: socat: fetched and verified in 0.4s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 9.9s
ci-box: pi: installed and verified in 7.6s
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.9s
ci-box: clone deepened in 5.2s
ci-box: file times set from content: 3302 files, 213 directories
ci-box: ready in 20.0s
=== 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.151s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
4.7s
+ go list -export -test -tags testbuild -f ./...
5.1s
+ go list -export -test -tags browser,testbuild -f ./internal/equipo ./internal/equipotest ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
3.7s
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 1m20.09s 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.895s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m17.89s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 72.27, cpu waiting 39.02%, memory waiting 0.00%, io waiting 0.38%
--- 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 1m18.742s 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.758s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m16.76s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 72.27, cpu waiting 39.02%, memory waiting 0.00%, io waiting 0.38%
--- 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 1m21.537s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m19.316s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m9.58s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.1s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.64s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 72.27, cpu waiting 38.82%, memory waiting 0.00%, io waiting 0.36%
--- 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 1m17.584s 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.546s amadan.net/oficina/equipo/internal/headless
receipt: slow test 38.67s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 18.66s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.12s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
receipt: slow test 9.09s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
machine: 32 CPUs, load 72.27, cpu waiting 38.95%, memory waiting 0.00%, io waiting 0.39%
--- 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 1m35.733s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m33.898s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m3.32s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.59s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.67s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7.52s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.79s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 67.30, cpu waiting 37.84%, memory waiting 0.00%, io waiting 0.28%
--- 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 3m0.926s 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 2m58.84s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m40.03s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 20.56s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.33s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 8.15s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistantAttachments
receipt: slow test 6.87s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
machine: 32 CPUs, load 22.17, cpu waiting 10.01%, memory waiting 0.00%, io waiting 0.06%
--- 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 2m17.334s 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 2m14.85s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 10.14s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.79s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 3.99s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 3.97s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 2.71s amadan.net/oficina/equipo/internal/thintest TestContractTeamUpdatePersonNeeds
machine: 32 CPUs, load 40.37, cpu waiting 20.78%, memory waiting 0.00%, io waiting 0.14%
--- 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 2m2.795s 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 2m0.213s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.51s amadan.net/oficina/equipo/internal/thintest TestContractRetryPreviewUnverifiedMerge
receipt: slow test 9.05s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 4.93s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.73s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 3.03s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
machine: 32 CPUs, load 49.56, cpu waiting 26.04%, memory waiting 0.00%, io waiting 0.17%
--- 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 5m14.126s, over the 45s its record on line 44 allows; reported only, timing fails on CI
receipt: test step 5m19.897s 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 5m14.126s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 37.08s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.95s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.86s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.51s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 9.95s amadan.net/oficina/equipo/internal/runner/thin TestTimeoutKeepsNothingForAnOlderInstance
machine: 32 CPUs, load 2.85, cpu waiting 1.00%, 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 52.424s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 51.516s amadan.net/oficina/equipo/internal/runner
receipt: slow test 31.48s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 52.03, cpu waiting 33.20%, memory waiting 0.00%, io waiting 0.61%
--- 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.926s 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 59.706s amadan.net/oficina/equipo/internal/runner
receipt: slow test 49.62s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 46.61s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.43s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.63s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 65.52, cpu waiting 38.04%, memory waiting 0.00%, io waiting 0.51%
--- 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.411s 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.653s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.12s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.41s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.13s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.99s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestCoordinatorTransientRefusalKeepsServing
machine: 32 CPUs, load 35.02, cpu waiting 20.89%, memory waiting 0.00%, io waiting 0.80%
--- shard 12 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-a started 30s late; cpu waiting 40.3%, load 30.41
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/equipotest TestDirectDeadReferencesRepository
=== RUN TestDirectDeadReferencesRepository
direct_cutover_test.go:221: repository reference inventory: exit status 1
docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md:161:3: unclassified equipo-runner
docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md:455:17: unclassified equipo-runner
docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md:476:37: unclassified equipo-runner
docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md:481:29: unclassified equipo-runner
docs/superpowers/plans/CONTROLLER-BRIEF-mac-slice-f.md:23:18: unclassified paseo
docs/superpowers/plans/CONTROLLER-BRIEF-mac-slice-f.md:128:25: unclassified Paseo
docs/superpowers/plans/MAC-SLICE-F-PROGRESS.md:36:67: unclassified npm
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:84:40: unclassified equipo-runner
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:86:56: unclassified equipo-runner
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:86:70: unclassified equipo-runner
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:86:125: unclassified equipo-runner
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:281:1: unclassified npm
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:324:32: unclassified node
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:389:17: unclassified NoDe
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:454:44: unclassified NPM
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:455:3: unclassified NPM
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:472:59: unclassified NPM
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:615:13: unclassified npm
docs/superpowers/specs/2026-11-07-equipo-mac-runners.md:695:62: unclassified Node
docs/superpowers/specs/2026-11-07-equipo-mac-runners.md:696:30: unclassified npm
docs/superpowers/specs/2026-11-07-equipo-mac-runners.md:702:24: unclassified equipo-runner
internal/wire/wiretest/testdata/frames/hello-worker-conns.json:1:750: unclassified node
internal/wire/wiretest/testdata/frames/hello-worker-conns.json:1:1439: unclassified node
reference scan: 3014 text files, 3252 matches, 23 failures
--- FAIL: TestDirectDeadReferencesRepository (2.37s)
--- FAIL amadan.net/oficina/equipo/internal/equipotest (package output)
FAIL
rastrillo-budget/v1 ran 1m9.257s
FAIL amadan.net/oficina/equipo/internal/equipotest 69.586s
receipt: test step 1m11.446s 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 1m9.257s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 30.42s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 30.36s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 27.93s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 25.15s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 24.89s amadan.net/oficina/equipo/internal/equipotest TestAuthoritySnapshotChanges
exit status 1
+ go test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' -v -run '^TestDirectDeadReferencesRepository$' -count=1 ./internal/equipotest (retry, once)
FAILED TWICE ./internal/equipotest:TestDirectDeadReferencesRepository equipotest-a
=== RUN TestDirectDeadReferencesRepository
direct_cutover_test.go:221: repository reference inventory: exit status 1
docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md:161:3: unclassified equipo-runner
docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md:455:17: unclassified equipo-runner
docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md:476:37: unclassified equipo-runner
docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md:481:29: unclassified equipo-runner
docs/superpowers/plans/CONTROLLER-BRIEF-mac-slice-f.md:23:18: unclassified paseo
docs/superpowers/plans/CONTROLLER-BRIEF-mac-slice-f.md:128:25: unclassified Paseo
docs/superpowers/plans/MAC-SLICE-F-PROGRESS.md:36:67: unclassified npm
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:84:40: unclassified equipo-runner
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:86:56: unclassified equipo-runner
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:86:70: unclassified equipo-runner
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:86:125: unclassified equipo-runner
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:281:1: unclassified npm
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:324:32: unclassified node
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:389:17: unclassified NoDe
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:454:44: unclassified NPM
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:455:3: unclassified NPM
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:472:59: unclassified NPM
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:615:13: unclassified npm
docs/superpowers/specs/2026-11-07-equipo-mac-runners.md:695:62: unclassified Node
docs/superpowers/specs/2026-11-07-equipo-mac-runners.md:696:30: unclassified npm
docs/superpowers/specs/2026-11-07-equipo-mac-runners.md:702:24: unclassified equipo-runner
internal/wire/wiretest/testdata/frames/hello-worker-conns.json:1:750: unclassified node
internal/wire/wiretest/testdata/frames/hello-worker-conns.json:1:1439: unclassified node
reference scan: 3014 text files, 3252 matches, 23 failures
--- FAIL: TestDirectDeadReferencesRepository (2.25s)
FAIL
rastrillo-budget/v1 ran 2.249s
FAIL amadan.net/oficina/equipo/internal/equipotest 2.418s
FAIL
machine: 32 CPUs, load 60.69, cpu waiting 34.28%, memory waiting 0.00%, io waiting 0.24%
make: *** [Makefile:113: ci-shard] Error 1
amadan: step check shard 12 of 29 failed: exit status 2
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-e started 30s late; cpu waiting 42.4%, load 30.41
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 2m18.31s 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 2m16.145s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 22.03s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 22.02s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 22.01s amadan.net/oficina/equipo/internal/equipotest TestProjectsReopen
receipt: slow test 21.93s amadan.net/oficina/equipo/internal/equipotest TestProjectsAccountRevisionAndValidation
receipt: slow test 21.92s amadan.net/oficina/equipo/internal/equipotest TestProjectsSharedAndGrouped
machine: 32 CPUs, load 25.66, cpu waiting 12.22%, memory waiting 0.00%, io waiting 0.07%
--- 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 42.4%, load 30.41
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 1m19.312s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m13.481s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 15.83s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 14.18s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 11.09s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 11.03s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 8.07s amadan.net/oficina/equipo/internal/equipotest TestRosterBootstrapOnce
machine: 32 CPUs, load 57.03, cpu waiting 32.20%, memory waiting 0.00%, io waiting 0.22%
--- 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.3%, load 30.41
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 1m11.329s 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 1m9.035s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 27.16s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 27.09s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 26.96s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 25.1s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsUpgrade
receipt: slow test 25.07s amadan.net/oficina/equipo/internal/equipotest TestSigninBackgroundSweep
machine: 32 CPUs, load 64.23, cpu waiting 36.33%, memory waiting 0.00%, io waiting 0.26%
--- 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.3%, load 30.41
test lane plan3test: ./internal/plan3test
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/plan3test
--- FAIL amadan.net/oficina/equipo/internal/plan3test TestPlan3ReleaseBoundaries
=== RUN TestPlan3ReleaseBoundaries
--- FAIL: TestPlan3ReleaseBoundaries (0.34s)
--- FAIL amadan.net/oficina/equipo/internal/plan3test TestPlan3ReleaseBoundaries/inventory
=== RUN TestPlan3ReleaseBoundaries/inventory
plan3_release_test.go:22: entry has no copy review status or applicable acceptance work.needs.mac_runner
--- FAIL: TestPlan3ReleaseBoundaries/inventory (0.02s)
--- FAIL amadan.net/oficina/equipo/internal/plan3test (package output)
FAIL
rastrillo-budget/v1 ran 54.808s
FAIL amadan.net/oficina/equipo/internal/plan3test 55.102s
receipt: test step 57.008s 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 54.808s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 4.11s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.5s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.65s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.35s amadan.net/oficina/equipo/internal/plan3test TestPlanMigrationUpgrade
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestPlan3ReleaseBoundaries$/^inventory$' -count=1 ./internal/plan3test (retry, once)
FAILED TWICE ./internal/plan3test:TestPlan3ReleaseBoundaries/inventory plan3test
=== RUN TestPlan3ReleaseBoundaries
=== RUN TestPlan3ReleaseBoundaries/inventory
plan3_release_test.go:22: entry has no copy review status or applicable acceptance work.needs.mac_runner
--- FAIL: TestPlan3ReleaseBoundaries (0.02s)
--- FAIL: TestPlan3ReleaseBoundaries/inventory (0.02s)
FAIL
rastrillo-budget/v1 ran 19ms
FAIL amadan.net/oficina/equipo/internal/plan3test 0.205s
FAIL
machine: 32 CPUs, load 69.07, cpu waiting 38.95%, memory waiting 0.00%, io waiting 0.32%
make: *** [Makefile:113: ci-shard] Error 1
amadan: step check shard 16 of 29 failed: exit status 2
--- shard 17 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: rest started 30s late; cpu waiting 40.3%, load 30.41
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/diffscan ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/github ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/equipo/team: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/forge: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/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/runner/workspace: 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
--- FAIL amadan.net/oficina/equipo/internal/runner/metered TestMeteredRaceAdmitsExactlyOne
=== RUN TestMeteredRaceAdmitsExactlyOne
meter_test.go:205: round 1: ran map[], held map[engineering:busy review:busy]
--- FAIL: TestMeteredRaceAdmitsExactlyOne (0.04s)
--- FAIL amadan.net/oficina/equipo/internal/runner/metered (package output)
FAIL
rastrillo-budget/v1 ran 1.962s
FAIL amadan.net/oficina/equipo/internal/runner/metered 1.970s
budget note: internal/equipo took 2m32.64s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 25.869s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/github took 40.581s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/equipo/setup took 10.946s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 1m57.695s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 26.018s, 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 50.495s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 20.705s, over the 20s its record on line 35 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 12.594s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/provider/pi took 1m18.865s, over the 1m0s its record on line 27 allows; reported only, timing fails on CI
budget note: internal/runner/workspace took 11.388s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 2m38.992s against a 60s target (the gate's other steps are not in this figure)
receipt: 36 packages ran, 32 cached, 16 without tests, 1 failed
receipt: slow package 2m32.64s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 1m57.695s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m18.865s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 1m7.574s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 55.228s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow test 58.83s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 50.31s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 50.07s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
receipt: slow test 49.32s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
receipt: slow test 48.18s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestMeteredRaceAdmitsExactlyOne$' -count=1 ./internal/runner/metered (retry, once)
##############################################################################
FLAKE ./internal/runner/metered:TestMeteredRaceAdmitsExactlyOne rest 098407b024c5ef0995def8ba518c10badfc566c9 0.04s 19.00
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 19.00, cpu waiting 8.76%, memory waiting 0.00%, io waiting 0.05%
--- 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 1m26.607s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m24.643s amadan.net/oficina/equipo/internal/headless
receipt: slow test 38.88s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 15.13s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.96s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.39s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.79s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 69.68, cpu waiting 38.85%, memory waiting 0.00%, io waiting 0.33%
--- 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 1m33.671s 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.672s amadan.net/oficina/equipo/internal/headless
receipt: slow test 29.19s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 21.96s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13.31s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 9.65s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
receipt: slow test 8.7s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
machine: 32 CPUs, load 67.30, cpu waiting 38.14%, memory waiting 0.00%, io waiting 0.29%
--- 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 1m55.641s 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 1m53.848s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.2s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.55s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 13.48s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.36s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
receipt: slow test 11.32s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
machine: 32 CPUs, load 53.27, cpu waiting 28.67%, memory waiting 0.00%, io waiting 0.19%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN TestBrowserCopyContinue
time=2026-11-28T18:45:35.598Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-28T18:45:35.598Z level=INFO msg="startup phase done" phase=state_lock took=211µs
time=2026-11-28T18:45:35.598Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-28T18:45:35.598Z level=INFO msg="startup phase done" phase=claim_roots took=262µs
time=2026-11-28T18:45:35.598Z level=INFO msg="startup phase" phase=sweep
time=2026-11-28T18:45:35.695Z level=INFO msg="startup phase done" phase=sweep took=96.892ms
time=2026-11-28T18:45:35.695Z level=INFO msg="startup phase" phase=credentials
time=2026-11-28T18:45:35.695Z level=INFO msg="startup phase done" phase=credentials took=135µs
time=2026-11-28T18:45:35.695Z level=INFO msg="startup phase" phase=open_state
time=2026-11-28T18:45:35.762Z level=INFO msg="startup phase done" phase=open_state took=66.424ms
time=2026-11-28T18:45:35.762Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-28T18:45:35.764Z level=INFO msg=connecting host=127.0.0.1:34889 protocol=37
time=2026-11-28T18:45:35.764Z level=INFO msg=connected host=127.0.0.1:34889 took=855µs
time=2026-11-28T18:45:35.765Z level=INFO msg="capabilities gathering"
time=2026-11-28T18:45:35.767Z level=INFO msg="capabilities gathered" took=1.956ms tags=linux,claude,go
time=2026-11-28T18:45:35.767Z level=INFO msg="hello sent" protocol=37
time=2026-11-28T18:45:35.777Z level=INFO msg=welcome protocol=37 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.58s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m40.898s
FAIL amadan.net/oficina/equipo/internal/headless 101.109s
receipt: test step 1m42.808s 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 1m40.898s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.12s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 13.38s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 10.23s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 9.61s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.58s amadan.net/oficina/equipo/internal/headless TestBrowserRefreshRace
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserCardAnswerSettlesAtBottom|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' -v -run '^TestBrowserCopyContinue$' -count=1 ./internal/headless (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest 098407b024c5ef0995def8ba518c10badfc566c9 6.58s 60.69
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 57.03, cpu waiting 33.22%, memory waiting 0.00%, io waiting 0.23%
--- shard 22 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-rest: ./internal/equipo
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserPreviewBlocksNavigation|TestBrowserPreviewPassExchange)$' ./internal/equipo
receipt: test step 4.296s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.604s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 1.99s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 610ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/equipotest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserGitHubManifestCSP)$' ./internal/equipotest
receipt: test step 8.338s 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 6.631s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 6.63s amadan.net/oficina/equipo/internal/equipotest TestBrowserGitHubManifestCSP
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor|TestBrowserSmartDoor)$' ./internal/idtest
budget note: internal/idtest took 11.546s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 13.23s 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 11.546s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 9.36s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.18s 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 4.788s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2.842s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.84s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPausedWork|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRhythm|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingSteady|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackPulse|TestBrowserTrackStarCentre|TestBrowserTryAgain)$' ./internal/thintest
receipt: test step 3m36.895s 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 3m34.123s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 24.82s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.44s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.11s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.7s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.36s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 7.53, cpu waiting 3.12%, memory waiting 0.00%, io waiting 0.01%
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless (53s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.73s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.27s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 8.74s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 9.34s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 26.80s
+ 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 (58s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 14.56s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 12.06s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 10.54s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 18.21s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (22s)
ok ./internal/headless TestMixedVersions 19.31s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.78s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin (2s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 65.52, cpu waiting 37.57%, memory waiting 0.00%, io waiting 0.53%
--- 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.734s 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.741s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 186ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 96ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 2ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 0s amadan.net/oficina/equipo/internal/runner/provider/claude/realcli
receipt: slow test 5.45s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.78s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 400ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 190ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 90ms amadan.net/oficina/equipo/internal/runner/provider/codex TestDirectJournalAdapterBarrier
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment
receipt: test step 3.503s 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.123s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 280ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 200ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceOpenCodeBinaryAfterAttestation
receipt: slow test 120ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
machine: 32 CPUs, load 21.32, cpu waiting 10.40%, memory waiting 0.00%, io waiting 1.08%
--- 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.3%, load 30.41
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md:161:3: unclassified equipo-runner
docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md:455:17: unclassified equipo-runner
docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md:476:37: unclassified equipo-runner
docs/superpowers/plans/2026-11-28-mac-runners-slice-f.md:481:29: unclassified equipo-runner
docs/superpowers/plans/CONTROLLER-BRIEF-mac-slice-f.md:23:18: unclassified paseo
docs/superpowers/plans/CONTROLLER-BRIEF-mac-slice-f.md:128:25: unclassified Paseo
docs/superpowers/plans/MAC-SLICE-F-PROGRESS.md:36:67: unclassified npm
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:84:40: unclassified equipo-runner
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:86:56: unclassified equipo-runner
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:86:70: unclassified equipo-runner
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:86:125: unclassified equipo-runner
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:281:1: unclassified npm
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:324:32: unclassified node
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:389:17: unclassified NoDe
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:454:44: unclassified NPM
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:455:3: unclassified NPM
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:472:59: unclassified NPM
docs/superpowers/plans/MAC-SLICE-F-TASK1-FINDINGS.md:615:13: unclassified npm
docs/superpowers/specs/2026-11-07-equipo-mac-runners.md:695:62: unclassified Node
docs/superpowers/specs/2026-11-07-equipo-mac-runners.md:696:30: unclassified npm
docs/superpowers/specs/2026-11-07-equipo-mac-runners.md:702:24: unclassified equipo-runner
internal/wire/wiretest/testdata/frames/hello-worker-conns.json:1:750: unclassified node
internal/wire/wiretest/testdata/frames/hello-worker-conns.json:1:1439: unclassified node
reference scan: 3014 text files, 3252 matches, 23 failures
make[1]: *** [Makefile:238: runner-dead-references] Error 1
machine: 32 CPUs, load 30.41, cpu waiting 17.51%, memory waiting 0.00%, io waiting 0.85%
make: *** [Makefile:113: ci-shard] Error 2
amadan: step check shard 25 of 29 failed: exit status 2
--- shard 26 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: staticcheck started 30s late; cpu waiting 40.3%, load 30.41
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 60.51, cpu waiting 35.99%, memory waiting 0.00%, io waiting 0.57%
--- 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.3%, load 30.41
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===
No vulnerabilities found.
Your code is affected by 0 vulnerabilities.
This scan also found 1 vulnerability in packages you import and 10
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
machine: 32 CPUs, load 60.51, cpu waiting 34.67%, memory waiting 0.00%, io waiting 0.59%
--- 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.3%, load 30.41
shard 28: make gitleaks
[90m6:45PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m6:45PM[0m [32mINF[0m [1m1275 commits scanned.[0m
[90m6:45PM[0m [32mINF[0m [1mscanned ~69070884 bytes (69.07 MB) in 25.5s[0m
[90m6:45PM[0m [33mWRN[0m [1mleaks found: 2[0m
exit status 1
make[1]: *** [Makefile:214: gitleaks] Error 1
machine: 32 CPUs, load 60.51, cpu waiting 35.99%, memory waiting 0.00%, io waiting 0.57%
make: *** [Makefile:113: ci-shard] Error 2
amadan: step check shard 28 of 29 failed: exit status 2
amadan: job failed at step check shards 12, 16, 25, 28 of 29 — its output is above, not at the tail of this log
Intent
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index b7f4378d..2244870f 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -15,7 +15,7 @@ time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial re |
| 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 23946 - Preview grants, retry/timeline, no-access merges, kept work, check-db copy, notification actions, places page and its superseded card, GitHub owner routes, Mac waits; measured 23946. |
| -size internal/wire 8184 - Protocol 31 facts, 32 unfinished work, task evidence, CI units, notification inputs, 33 Assistant files, 34 places, 35 diffs, Mac waits; measured 8184. |
| +size internal/wire 8590 - Protocol 31 facts, 32 unfinished work, task evidence, CI units, notification inputs, 33 Assistant files, 34 places, 35 diffs, Mac waits, 37 Mac Engineering; measured 8590. |
| size internal/equipotest - 12683 GitHub connect value search, lifecycle and sweep-log contracts; Task 21 migration fixtures and Rastrillo asset contract; measured 0/12683 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). |
| @@ -56,7 +56,7 @@ perf GET /api/v1/tasks/{id} skip Thin v1 person API: bearer-only JSON for device |
| perf GET /api/v1/assistant/snapshot skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen. |
| perf GET /api/v1/assistant/messages skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen. |
| perf GET /api/v1/assistant/events skip Assistant event stream (Server-Sent Events), bearer-only and long-lived; not a screen. |
| -size internal/equipo/chat 38116 11998 File facts/diffs, previews, merge authority, unfinished work, CI feedback, notification receipts, Assistant files, places and where their cards land, waiting cards, Mac waits; measured 38116/11998. |
| +size internal/equipo/chat 38141 12096 File facts/diffs, previews, merge authority, unfinished work, CI feedback, notification receipts, Assistant files, places, waiting cards, Mac waits, 0120 storage; measured 38141/12096. |
| perf GET /api/v1/questions/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads questions on /tasks/{id}. |
| perf GET /api/v1/steps/{id}/log skip Thin v1 person API: bearer-only JSON for devices; the browser shows the log tail on /tasks/{id}. |
| perf GET /api/v1/connections/preference skip Connections slice 1 person API: bearer-only JSON for devices; the browser shows the preference on /conversation/connections. |
diff --git a/docs/api/equipo-v1.openapi.json b/docs/api/equipo-v1.openapi.json| index 49b1160e..1b2e19a8 100644 |
| --- a/docs/api/equipo-v1.openapi.json |
| +++ b/docs/api/equipo-v1.openapi.json |
| @@ -19153,6 +19153,9 @@ |
| }, |
| "reach": { |
| "$ref": "#/components/schemas/Reach" |
| + }, |
| + "engineering": { |
| + "$ref": "#/components/schemas/EngineeringStatus" |
| } |
| }, |
| "required": [ |
| @@ -19165,6 +19168,23 @@ |
| "additionalProperties": false, |
| "x-go-type": "wire.Capabilities" |
| }, |
| + "EngineeringStatus": { |
| + "type": "object", |
| + "properties": { |
| + "state": { |
| + "type": "string" |
| + }, |
| + "reason": { |
| + "type": "string" |
| + } |
| + }, |
| + "required": [ |
| + "state", |
| + "reason" |
| + ], |
| + "additionalProperties": false, |
| + "x-go-type": "wire.EngineeringStatus" |
| + }, |
| "Card": { |
| "type": "object", |
| "properties": { |
diff --git a/internal/equipo/chat/models.go b/internal/equipo/chat/models.go| index 1ba41f39..76cc7868 100644 |
| --- a/internal/equipo/chat/models.go |
| +++ b/internal/equipo/chat/models.go |
| @@ -164,14 +164,19 @@ type transferRecord struct { |
| Attempt int64 |
| BaseSHA string |
| CandidateSHA string |
| - Direction string |
| - State string |
| - SHA256 string |
| - Total int |
| - Received int |
| - Bytes int64 |
| - ExpiresAt time.Time |
| - CreatedAt time.Time |
| + // Kind is "" (checks, or a worker's outbound commit) or |
| + // wire.TransferKindEngineering; OldBaseSHA is an Engineering rebase |
| + // round's old base (migration 0120). |
| + Kind string |
| + OldBaseSHA string |
| + Direction string |
| + State string |
| + SHA256 string |
| + Total int |
| + Received int |
| + Bytes int64 |
| + ExpiresAt time.Time |
| + CreatedAt time.Time |
| } |
| func (transferRecord) TableName() string { return "runner_transfers" } |
diff --git a/internal/equipo/chat/questions.go b/internal/equipo/chat/questions.go| index bf00861d..4e89a4c3 100644 |
| --- a/internal/equipo/chat/questions.go |
| +++ b/internal/equipo/chat/questions.go |
| @@ -43,6 +43,16 @@ type questionRecord struct { |
| Revision int64 |
| CreatedAt time.Time |
| UpdatedAt time.Time |
| + // The Engineering attempt, account binding, kept session and runner |
| + // an Engineering question is pinned to, with the pair it is about, |
| + // frozen when the question is created (migration 0120; set from plan |
| + // task 13). Zero on every question made before. |
| + EngAttempt int64 |
| + EngAccount string |
| + EngSession string |
| + RunnerID string |
| + BaseSHA string |
| + CandidateSHA string |
| } |
| func (questionRecord) TableName() string { return "chat_questions" } |
diff --git a/internal/equipo/chat/tasks.go b/internal/equipo/chat/tasks.go| index e51bfdba..79df8a50 100644 |
| --- a/internal/equipo/chat/tasks.go |
| +++ b/internal/equipo/chat/tasks.go |
| @@ -220,6 +220,14 @@ type stepRecord struct { |
| ChecksSandbox string |
| BaseChecks string |
| BaseChecksSHA string |
| + // XcodeAccess is what a Mac worker's Engineering ran with |
| + // (wire.XcodeAccessSandboxed or ""); OutcomePhase what its commit is |
| + // (wire.OutcomeCommitted, OutcomeUnfinished, OutcomeNoShell), kept |
| + // apart from Publication; SessionID the kept Engineering session |
| + // (migration 0120). |
| + XcodeAccess string |
| + OutcomePhase string |
| + SessionID string |
| // ChangeFacts is the review's measured change (wire.ChangeFacts JSON), |
| // kept only when it passed acceptance. DecidedBy is who decided a |
| // merge step ("policy", or "person:<address>"); MergeSource and |
| @@ -1234,7 +1242,7 @@ func (t *txn) dispatchStep(k *taskRecord, s *stepRecord) error { |
| // from the primary as a pack in an inbound transfer. |
| cmd.Needs = decodeList(s.Needs) |
| if s.Specialist == wire.SpecialistChecks { |
| - if _, err := t.openTransfer(*k, *s, primary, s.RunnerID, wire.TransferInbound, cmd.BaseSHA, s.CandidateSHA); err != nil { |
| + if _, err := t.openTransfer(*k, *s, primary, s.RunnerID, wire.TransferHeader{Direction: wire.TransferInbound, BaseSHA: cmd.BaseSHA, CandidateSHA: s.CandidateSHA}); err != nil { |
| return err |
| } |
| } |
diff --git a/internal/equipo/chat/transfers.go b/internal/equipo/chat/transfers.go| index 40570913..7f2a89de 100644 |
| --- a/internal/equipo/chat/transfers.go |
| +++ b/internal/equipo/chat/transfers.go |
| @@ -30,14 +30,16 @@ var hexDigest = regexp.MustCompile(`^[0-9a-f]{64}$`) |
| // openTransfer opens a transfer for one attempt, in the transaction that |
| // placed it (inbound) or accepted its candidate (outbound), and asks the |
| -// sender for the pack (send_pack names the transfer it uploads under). |
| -func (t *txn) openTransfer(k taskRecord, s stepRecord, from, to, direction, base, candidate string) (transferRecord, error) { |
| +// sender for the pack (send_pack names the transfer it uploads under). h |
| +// gives the direction and the commits (kind, base, old base, candidate); |
| +// the attempt's own fields come from the step. |
| +func (t *txn) openTransfer(k taskRecord, s stepRecord, from, to string, h wire.TransferHeader) (transferRecord, error) { |
| var p projectRecord |
| if err := t.db.Where("id = ?", k.ProjectID).First(&p).Error; err != nil { |
| return transferRecord{}, err |
| } |
| now := t.now() |
| - tr := transferRecord{ID: newID("tr_"), Person: s.Person, FromRunner: from, ToRunner: to, Repo: p.Repo, TaskID: k.ID, StepID: s.ID, Attempt: s.Attempt, BaseSHA: base, CandidateSHA: candidate, Direction: direction, State: transferOpen, ExpiresAt: now.Add(wire.TransferTTL), CreatedAt: now} |
| + tr := transferRecord{ID: newID("tr_"), Person: s.Person, FromRunner: from, ToRunner: to, Repo: p.Repo, TaskID: k.ID, StepID: s.ID, Attempt: s.Attempt, BaseSHA: h.BaseSHA, CandidateSHA: h.CandidateSHA, Kind: h.Kind, OldBaseSHA: h.OldBaseSHA, Direction: h.Direction, State: transferOpen, ExpiresAt: now.Add(wire.TransferTTL), CreatedAt: now} |
| if err := t.db.Create(&tr).Error; err != nil { |
| return tr, err |
| } |
| @@ -45,7 +47,7 @@ func (t *txn) openTransfer(k taskRecord, s stepRecord, from, to, direction, base |
| } |
| func transferHeader(tr transferRecord) wire.TransferHeader { |
| - return wire.TransferHeader{ID: tr.ID, Direction: tr.Direction, Repo: tr.Repo, TaskID: tr.TaskID, StepID: tr.StepID, Attempt: tr.Attempt, BaseSHA: tr.BaseSHA, CandidateSHA: tr.CandidateSHA} |
| + return wire.TransferHeader{ID: tr.ID, Direction: tr.Direction, Repo: tr.Repo, TaskID: tr.TaskID, StepID: tr.StepID, Attempt: tr.Attempt, BaseSHA: tr.BaseSHA, CandidateSHA: tr.CandidateSHA, Kind: tr.Kind, OldBaseSHA: tr.OldBaseSHA} |
| } |
| // closeTransfers ends every transfer of a step attempt: nothing of it is |
| @@ -325,6 +327,6 @@ func (t *txn) candidateCommitted(k taskRecord, s stepRecord) error { |
| if err := t.db.Model(&transferRecord{}).Where("step_id = ? AND attempt = ? AND direction = ?", s.ID, s.Attempt, wire.TransferOutbound).Count(&open).Error; err != nil || open > 0 { |
| return err |
| } |
| - _, err = t.openTransfer(k, s, s.RunnerID, primary, wire.TransferOutbound, s.BaseSHA, s.CandidateSHA) |
| + _, err = t.openTransfer(k, s, s.RunnerID, primary, wire.TransferHeader{Direction: wire.TransferOutbound, BaseSHA: s.BaseSHA, CandidateSHA: s.CandidateSHA}) |
| return err |
| } |
diff --git a/internal/equipo/chat/transfers_kind_test.go b/internal/equipo/chat/transfers_kind_test.go| new file mode 100644 |
| index 00000000..31d54633 |
| --- /dev/null |
| +++ b/internal/equipo/chat/transfers_kind_test.go |
| @@ -0,0 +1,98 @@ |
| +package chat |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "io" |
| + "log/slog" |
| + "os" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| + "amadan.net/rastrillo/rastrillo/db" |
| + "gorm.io/gorm" |
| +) |
| + |
| +// A transfer row keeps its kind and old base (migration 0120) and gives |
| +// them back in its header, so an Engineering transfer's chunks are |
| +// checked against exactly what was opened. A checks transfer, and a row |
| +// written before 0120 (NULL columns), reads as before: no kind, no old |
| +// base, and the same header bytes. |
| +func TestTransferStorageKeepsKindAndOldBase(t *testing.T) { |
| + src, err := hkTemplatePath() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + raw, err := os.ReadFile(src) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + path := filepath.Join(t.TempDir(), "transfers.db") |
| + if err := os.WriteFile(path, raw, 0o600); err != nil { |
| + t.Fatal(err) |
| + } |
| + d, err := db.Open(path, slog.New(slog.NewTextHandler(io.Discard, nil))) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + t.Cleanup(func() { _ = d.Close() }) |
| + s := NewStore(d, Authority{Copy: func(key string) string { return key }, PrimaryRunner: func(*gorm.DB, string) (string, error) { return "R1", nil }}, nil) |
| + const person = "owner@example.com" |
| + now := time.Now().UTC() |
| + a, b, c := strings.Repeat("a", 40), strings.Repeat("b", 40), strings.Repeat("c", 40) |
| + k := taskRecord{ID: "tk1", ProjectID: "p1", Creator: person, Stage: wire.StageInProgress, Revision: 1, CreatedAt: now, UpdatedAt: now} |
| + st := stepRecord{ID: "s1", TaskID: "tk1", Idx: 1, Specialist: wire.SpecialistEngineering, Person: person, State: wire.StepQueued, Attempt: 2, RunnerID: "R2"} |
| + for _, row := range []any{&projectRecord{ID: "p1", Repo: "amadan.net/oficina/sample"}, &k, &st} { |
| + if err := d.G.Create(row).Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + var eng, checks transferRecord |
| + if err := s.tx(context.Background(), func(tx *txn) error { |
| + var err error |
| + if eng, err = tx.openTransfer(k, st, "R1", "R2", wire.TransferHeader{Direction: wire.TransferInbound, Kind: wire.TransferKindEngineering, BaseSHA: c, OldBaseSHA: a, CandidateSHA: b}); err != nil { |
| + return err |
| + } |
| + checks, err = tx.openTransfer(k, st, "R1", "R2", wire.TransferHeader{Direction: wire.TransferInbound, BaseSHA: a, CandidateSHA: b}) |
| + return err |
| + }); err != nil { |
| + t.Fatal(err) |
| + } |
| + load := func(id string) transferRecord { |
| + t.Helper() |
| + var tr transferRecord |
| + if err := d.G.Where("id = ?", id).First(&tr).Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + return tr |
| + } |
| + want := wire.TransferHeader{ID: eng.ID, Direction: wire.TransferInbound, Repo: "amadan.net/oficina/sample", TaskID: "tk1", StepID: "s1", Attempt: 2, BaseSHA: c, CandidateSHA: b, Kind: wire.TransferKindEngineering, OldBaseSHA: a} |
| + if got := transferHeader(load(eng.ID)); got != want || !got.Valid() { |
| + t.Fatalf("engineering header %+v, want %+v", got, want) |
| + } |
| + var cmds []commandRecord |
| + if err := d.G.Where("kind = ?", wire.FrameSendPack).Order("seq").Find(&cmds).Error; err != nil || len(cmds) != 2 { |
| + t.Fatalf("send_pack commands %d %v", len(cmds), err) |
| + } |
| + var sent wire.SendPackCommand |
| + if err := json.Unmarshal([]byte(cmds[0].Body), &sent); err != nil || sent.Transfer != want { |
| + t.Fatalf("send_pack %+v %v", sent.Transfer, err) |
| + } |
| + if strings.Contains(cmds[1].Body, `"kind"`) || strings.Contains(cmds[1].Body, `"old_base_sha"`) { |
| + t.Fatalf("checks send_pack carries slice F fields: %s", cmds[1].Body) |
| + } |
| + oldHeader := wire.TransferHeader{ID: checks.ID, Direction: wire.TransferInbound, Repo: "amadan.net/oficina/sample", TaskID: "tk1", StepID: "s1", Attempt: 2, BaseSHA: a, CandidateSHA: b} |
| + if got := transferHeader(load(checks.ID)); got != oldHeader { |
| + t.Fatalf("checks header %+v", got) |
| + } |
| + // A row from before 0120 has NULL in both columns. |
| + if err := d.G.Exec("UPDATE runner_transfers SET kind = NULL, old_base_sha = NULL WHERE id = ?", checks.ID).Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + if got := transferHeader(load(checks.ID)); got != oldHeader || got.Kind != "" || got.OldBaseSHA != "" { |
| + t.Fatalf("pre-0120 header %+v", got) |
| + } |
| +} |
diff --git a/internal/equipo/migrations/0120_mac_engineering.sql b/internal/equipo/migrations/0120_mac_engineering.sql| new file mode 100644 |
| index 00000000..b1c76f1a |
| --- /dev/null |
| +++ b/internal/equipo/migrations/0120_mac_engineering.sql |
| @@ -0,0 +1,14 @@ |
| +-- Mac Engineering (slice F, protocol 37). Additive only: an existing row |
| +-- reads as before (a checks transfer, no Xcode access, no outcome, no |
| +-- kept session, no frozen question pin). |
| +ALTER TABLE runner_transfers ADD COLUMN kind text; |
| +ALTER TABLE runner_transfers ADD COLUMN old_base_sha text; |
| +ALTER TABLE chat_steps ADD COLUMN xcode_access text; |
| +ALTER TABLE chat_steps ADD COLUMN outcome_phase text; |
| +ALTER TABLE chat_steps ADD COLUMN session_id text; |
| +ALTER TABLE chat_questions ADD COLUMN eng_attempt integer; |
| +ALTER TABLE chat_questions ADD COLUMN eng_account text; |
| +ALTER TABLE chat_questions ADD COLUMN eng_session text; |
| +ALTER TABLE chat_questions ADD COLUMN runner_id text; |
| +ALTER TABLE chat_questions ADD COLUMN base_sha text; |
| +ALTER TABLE chat_questions ADD COLUMN candidate_sha text; |
diff --git a/internal/equipo/migrations/schema.sql b/internal/equipo/migrations/schema.sql| index a5e09fec..a6df859d 100644 |
| --- a/internal/equipo/migrations/schema.sql |
| +++ b/internal/equipo/migrations/schema.sql |
| @@ -838,3 +838,18 @@ CREATE INDEX chat_diff_expiry ON chat_change_diffs(expires_at); |
| ALTER TABLE chat_steps ADD COLUMN change_diff_expires_at datetime; |
| ALTER TABLE chat_steps ADD COLUMN change_diff_attempt integer; |
| + |
| +-- Mac Engineering (slice F, protocol 37). Additive only: an existing row |
| +-- reads as before (a checks transfer, no Xcode access, no outcome, no |
| +-- kept session, no frozen question pin). |
| +ALTER TABLE runner_transfers ADD COLUMN kind text; |
| +ALTER TABLE runner_transfers ADD COLUMN old_base_sha text; |
| +ALTER TABLE chat_steps ADD COLUMN xcode_access text; |
| +ALTER TABLE chat_steps ADD COLUMN outcome_phase text; |
| +ALTER TABLE chat_steps ADD COLUMN session_id text; |
| +ALTER TABLE chat_questions ADD COLUMN eng_attempt integer; |
| +ALTER TABLE chat_questions ADD COLUMN eng_account text; |
| +ALTER TABLE chat_questions ADD COLUMN eng_session text; |
| +ALTER TABLE chat_questions ADD COLUMN runner_id text; |
| +ALTER TABLE chat_questions ADD COLUMN base_sha text; |
| +ALTER TABLE chat_questions ADD COLUMN candidate_sha text; |
diff --git a/internal/equipo/migrations_mac_engineering_test.go b/internal/equipo/migrations_mac_engineering_test.go| new file mode 100644 |
| index 00000000..10cd9684 |
| --- /dev/null |
| +++ b/internal/equipo/migrations_mac_engineering_test.go |
| @@ -0,0 +1,150 @@ |
| +package equipo |
| + |
| +import ( |
| + "context" |
| + "database/sql" |
| + "io" |
| + "log/slog" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/rastrillo/rastrillo/db" |
| + "amadan.net/rastrillo/rastrillo/migrate" |
| +) |
| + |
| +// beforeMacEngineering is every migration before slice F's 0120: the |
| +// database a protocol 35 instance leaves behind. |
| +func beforeMacEngineering(t *testing.T) *migrate.Set { |
| + t.Helper() |
| + s := &migrate.Set{} |
| + found := false |
| + for _, m := range BootSchema.All() { |
| + if strings.HasPrefix(m.ID, "equipo/0120_") { |
| + found = true |
| + break |
| + } |
| + s.Add(m) |
| + } |
| + if !found { |
| + t.Fatal("no equipo/0120_ migration") |
| + } |
| + return s |
| +} |
| + |
| +// Migration 0120 over a database holding an open checks transfer (mid |
| +// relay, chunks received) and kept questions (answered, and one still |
| +// running) only adds columns: every row reads as it did, a transfer's |
| +// kind and old base are empty (a checks transfer), a step has no Xcode |
| +// access, outcome or kept session, and a question has no frozen |
| +// Engineering pin, so later code treats each as before slice F. |
| +func TestMacEngineeringMigrationKeepsOpenTransfersAndQuestions(t *testing.T) { |
| + ctx := context.Background() |
| + d, err := db.Open(filepath.Join(t.TempDir(), "protocol35.db"), slog.New(slog.NewTextHandler(io.Discard, nil))) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + defer d.Close() |
| + w := d.Writer() |
| + if _, err := migrate.Apply(ctx, d, beforeMacEngineering(t)); err != nil { |
| + t.Fatal(err) |
| + } |
| + exec := func(q string, args ...any) { |
| + t.Helper() |
| + if _, err := w.Exec(q, args...); err != nil { |
| + t.Fatalf("%s: %v", q, err) |
| + } |
| + } |
| + a, b := strings.Repeat("a", 40), strings.Repeat("b", 40) |
| + exec(`INSERT INTO runner_transfers(id, person, from_runner, to_runner, repo, task_id, step_id, attempt, base_sha, candidate_sha, direction, state, sha256, total, received, bytes, expires_at, created_at) VALUES |
| + ('tr_open','owner@example.com','R1','R2','amadan.net/oficina/sample','tk1','s_checks',1,?,?,'inbound','open',?,3,1,196608,'2026-11-29 10:00:00','2026-11-28 10:00:00'), |
| + ('tr_out','owner@example.com','R2','R1','amadan.net/oficina/sample','tk2','s_eng',2,?,?,'outbound','complete',?,1,1,1024,'2026-11-29 10:00:00','2026-11-28 10:00:00')`, |
| + a, b, strings.Repeat("c", 64), a, b, strings.Repeat("d", 64)) |
| + step := `INSERT INTO chat_steps(id, task_id, idx, specialist, person, state, reason, attempt, base_sha, candidate_sha, askable, runner_id, revision, created_at, updated_at) VALUES (?,?,?,?,?,?,'',?,?,?,?,?,1,'2026-11-28 10:00:00','2026-11-28 10:00:00')` |
| + exec(step, "s_checks", "tk1", 2, "checks", "owner@example.com", "running", 1, a, b, 0, "R2") |
| + exec(step, "s_eng", "tk2", 1, "engineering", "owner@example.com", "done", 2, a, b, 1, "R1") |
| + question := `INSERT INTO chat_questions(id, task_id, asker, idempotency_key, step_id, specialist, chosen, text, state, reason, attempt, dispatched, answer, timing, revision, created_at, updated_at) VALUES (?, 'tk2', 'owner@example.com', ?, 's_eng', 'engineering', '', ?, ?, '', 1, 1, ?, '', 1, '2026-11-28 10:00:00', '2026-11-28 10:00:00')` |
| + exec(question, "q_answered", "k1", "What did you change?", "answered", "The edge swipe.") |
| + exec(question, "q_running", "k2", "And why?", "running", "") |
| + |
| + if _, err := migrate.Apply(ctx, d, BootSchema); err != nil { |
| + t.Fatal(err) |
| + } |
| + str := func(q string, args ...any) string { |
| + t.Helper() |
| + var v sql.NullString |
| + if err := w.QueryRow(q, args...).Scan(&v); err != nil { |
| + t.Fatalf("%s: %v", q, err) |
| + } |
| + return v.String |
| + } |
| + for _, id := range []string{"tr_open", "tr_out"} { |
| + if got := str(`SELECT coalesce(kind,'') || '|' || coalesce(old_base_sha,'') FROM runner_transfers WHERE id=?`, id); got != "|" { |
| + t.Fatalf("transfer %s kind|old base %q", id, got) |
| + } |
| + } |
| + if got := str(`SELECT state || '/' || received || '/' || total || '/' || base_sha || '/' || candidate_sha FROM runner_transfers WHERE id='tr_open'`); got != "open/1/3/"+a+"/"+b { |
| + t.Fatalf("open transfer changed: %s", got) |
| + } |
| + for _, id := range []string{"s_checks", "s_eng"} { |
| + if got := str(`SELECT coalesce(xcode_access,'') || '|' || coalesce(outcome_phase,'') || '|' || coalesce(session_id,'') FROM chat_steps WHERE id=?`, id); got != "||" { |
| + t.Fatalf("step %s new columns %q", id, got) |
| + } |
| + } |
| + if got := str(`SELECT state || '/' || askable || '/' || runner_id FROM chat_steps WHERE id='s_eng'`); got != "done/1/R1" { |
| + t.Fatalf("kept step changed: %s", got) |
| + } |
| + for _, id := range []string{"q_answered", "q_running"} { |
| + if got := str(`SELECT coalesce(eng_attempt,0) || '|' || coalesce(eng_account,'') || '|' || coalesce(eng_session,'') || '|' || coalesce(runner_id,'') || '|' || coalesce(base_sha,'') || '|' || coalesce(candidate_sha,'') FROM chat_questions WHERE id=?`, id); got != "0|||||" { |
| + t.Fatalf("question %s new columns %q", id, got) |
| + } |
| + } |
| + if got := str(`SELECT state || '/' || answer || '/' || attempt FROM chat_questions WHERE id='q_answered'`); got != "answered/The edge swipe./1" { |
| + t.Fatalf("kept question changed: %s", got) |
| + } |
| + // Additive only: every column the protocol 35 tables had is still there. |
| + before, err := migrate.Replay(ctx, beforeMacEngineering(t).All()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + defer before.Close() |
| + columns := func(q interface { |
| + QueryContext(context.Context, string, ...any) (*sql.Rows, error) |
| + }, table string) map[string]bool { |
| + rows, err := q.QueryContext(ctx, "SELECT name FROM pragma_table_info(?)", table) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + defer rows.Close() |
| + out := map[string]bool{} |
| + for rows.Next() { |
| + var n string |
| + if err := rows.Scan(&n); err != nil { |
| + t.Fatal(err) |
| + } |
| + out[n] = true |
| + } |
| + return out |
| + } |
| + added := map[string][]string{ |
| + "runner_transfers": {"kind", "old_base_sha"}, |
| + "chat_steps": {"xcode_access", "outcome_phase", "session_id"}, |
| + "chat_questions": {"eng_attempt", "eng_account", "eng_session", "runner_id", "base_sha", "candidate_sha"}, |
| + } |
| + for table, cols := range added { |
| + was, now := columns(before, table), columns(w, table) |
| + for c := range was { |
| + if !now[c] { |
| + t.Errorf("%s lost %s", table, c) |
| + } |
| + } |
| + for _, c := range cols { |
| + if was[c] || !now[c] { |
| + t.Errorf("%s.%s: before %v, after %v", table, c, was[c], now[c]) |
| + } |
| + } |
| + if len(now) != len(was)+len(cols) { |
| + t.Errorf("%s gained %d columns, want %d", table, len(now)-len(was), len(cols)) |
| + } |
| + } |
| +} |
diff --git a/internal/wire/assistant_files_test.go b/internal/wire/assistant_files_test.go| index d16cd3fe..7dba50d5 100644 |
| --- a/internal/wire/assistant_files_test.go |
| +++ b/internal/wire/assistant_files_test.go |
| @@ -16,7 +16,7 @@ import ( |
| // Assistant message with files is refused, earlier and earlier_more are |
| // dropped, and the Coordinator's and a job's frames go as they are. |
| func TestProtocol33AssistantFiles(t *testing.T) { |
| - if wire.Protocol33 != 33 || wire.ProtocolAssistantFiles != wire.Protocol33 || wire.ProtocolUnfinishedWork != wire.Protocol32 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs || wire.Spoken(99) != 35 { |
| + if wire.Protocol33 != 33 || wire.ProtocolAssistantFiles != wire.Protocol33 || wire.ProtocolUnfinishedWork != wire.Protocol32 || wire.ProtocolCurrent != wire.ProtocolMacEngineering || wire.Spoken(99) != 37 { |
| t.Fatalf("assistant files %d, current %d", wire.ProtocolAssistantFiles, wire.ProtocolCurrent) |
| } |
| if wire.RunnerKeepFiles != 14*24*time.Hour { |
diff --git a/internal/wire/assistant_test.go b/internal/wire/assistant_test.go| index 5835cc3c..478afa50 100644 |
| --- a/internal/wire/assistant_test.go |
| +++ b/internal/wire/assistant_test.go |
| @@ -81,7 +81,7 @@ func TestAssistantCardJSON(t *testing.T) { |
| // A runner that speaks 24 or more is spoken to at 24, the warm |
| // protocol; glances came at 23 and jobs at 22. |
| func TestSpokenIs24(t *testing.T) { |
| - if wire.Spoken(99) != 35 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs || wire.ProtocolWarm != wire.Protocol24 || wire.ProtocolGlance != wire.Protocol23 || wire.ProtocolJobs != wire.Protocol22 || wire.ProtocolCopy != wire.Protocol21 || wire.ProtocolUsageRefresh != wire.Protocol20 || wire.ProtocolAssistant != wire.Protocol19 { |
| + if wire.Spoken(99) != 37 || wire.ProtocolCurrent != wire.ProtocolMacEngineering || wire.ProtocolWarm != wire.Protocol24 || wire.ProtocolGlance != wire.Protocol23 || wire.ProtocolJobs != wire.Protocol22 || wire.ProtocolCopy != wire.Protocol21 || wire.ProtocolUsageRefresh != wire.Protocol20 || wire.ProtocolAssistant != wire.Protocol19 { |
| t.Fatalf("spoken %d, current %d", wire.Spoken(99), wire.ProtocolCurrent) |
| } |
| } |
diff --git a/internal/wire/change_diffs.go b/internal/wire/change_diffs.go| index 4c40b207..19c55bda 100644 |
| --- a/internal/wire/change_diffs.go |
| +++ b/internal/wire/change_diffs.go |
| @@ -50,6 +50,9 @@ type ChangeDiffUpload struct { |
| Data string `json:"data"` |
| Reason string `json:"reason,omitempty"` |
| Truncated bool `json:"truncated"` |
| + // Publication (protocol 37) binds the upload to a primary's |
| + // publication of a worker's candidate; "" is the step runner's own. |
| + Publication string `json:"publication,omitempty"` |
| } |
| type ChangeDiff struct { |
diff --git a/internal/wire/change_diffs_test.go b/internal/wire/change_diffs_test.go| index be98e166..ed29eb82 100644 |
| --- a/internal/wire/change_diffs_test.go |
| +++ b/internal/wire/change_diffs_test.go |
| @@ -11,7 +11,7 @@ import ( |
| ) |
| func TestProtocol35ChangeDiffs(t *testing.T) { |
| - if wire.ProtocolChangeDiffs != 35 || wire.ProtocolCurrent != 35 { |
| + if wire.ProtocolChangeDiffs != 35 || wire.ProtocolCurrent != 37 { |
| t.Fatal("protocol") |
| } |
| f, err := wire.NewFrame("diff", wire.FrameChangeDiff, wire.ChangeDiffUpload{}) |
| @@ -23,19 +23,21 @@ func TestProtocol35ChangeDiffs(t *testing.T) { |
| t.Fatalf("upload at %d", p) |
| } |
| } |
| - if _, err := wire.Encode(f, 35); err != nil { |
| - t.Fatal(err) |
| + for p := 35; p <= wire.ProtocolCurrent; p++ { |
| + if _, err := wire.Encode(f, p); err != nil { |
| + t.Fatal(err) |
| + } |
| } |
| report := wire.StepReport{ChangeDiffs: "collection"} |
| f, _ = wire.NewFrame("done", wire.FrameStep, report) |
| - for p := 1; p <= 35; p++ { |
| + for p := 1; p <= wire.ProtocolCurrent; p++ { |
| got, err := wire.Encode(f, p) |
| if err != nil { |
| t.Fatal(err) |
| } |
| var fields map[string]json.RawMessage |
| _ = json.Unmarshal(got.Data, &fields) |
| - if (fields["change_diffs"] != nil) != (p == 35) { |
| + if (fields["change_diffs"] != nil) != (p >= 35) { |
| t.Fatalf("report at %d", p) |
| } |
| } |
diff --git a/internal/wire/change_files_test.go b/internal/wire/change_files_test.go| index d4f39ae3..f05ff759 100644 |
| --- a/internal/wire/change_files_test.go |
| +++ b/internal/wire/change_files_test.go |
| @@ -11,7 +11,7 @@ import ( |
| ) |
| func TestProtocol31ChangeFiles(t *testing.T) { |
| - if wire.ProtocolChangeFiles != 31 || wire.ProtocolCurrent != 35 { |
| + if wire.ProtocolChangeFiles != 31 || wire.ProtocolCurrent != 37 { |
| t.Fatal("protocol not 31") |
| } |
| facts := &wire.ChangeFiles{Base: strings.Repeat("a", 40), SHA: strings.Repeat("b", 40), Files: 1, Additions: 1, Entries: []wire.ChangedFile{{Path: "a.txt", Status: "added", Additions: 1}}} |
diff --git a/internal/wire/connections_test.go b/internal/wire/connections_test.go| index 2233eea5..4ea0c217 100644 |
| --- a/internal/wire/connections_test.go |
| +++ b/internal/wire/connections_test.go |
| @@ -71,11 +71,13 @@ func TestConnectionTypesCarryNoSecrets(t *testing.T) { |
| // TestConnectionFixturesCarryNoSecrets: the recorded documents a native |
| // app replays hold no secret-shaped key either. |
| func TestConnectionFixturesCarryNoSecrets(t *testing.T) { |
| - for _, name := range []string{"api/connections.json", "api/connection-connecting-codex.json", "api/connection-signing-in-claude.json", "api/connect-request.json", "api/event-connection.json", "frames/connect.json", "frames/cancel_connect.json", "frames/connection.json", "frames/hello.json", "frames/reply-usage.json", "frames/usage.json", "frames/disconnect.json", "frames/sync.json", "frames/preference.json", "api/preferences.json", "api/event-preference.json", "api/connection-metered.json", "api/connection-choose-model.json", "api/connect-request-api-key.json", "api/budget.json", "api/resume-request.json", "api/model-request.json", "frames/budget.json", "frames/model.json", "frames/resume_spend.json", "frames/connect-api-key.json", "frames/usage-probe.json", "frames/hello-metered.json", "frames/release.json", "frames/priority.json", "frames/step-held.json", "frames/preference-until.json", "frames/dispatch-urgent.json", "api/task-held.json", "api/priority-request.json", "api/run-now-request.json", "api/run-now-accepted.json", "api/card-held.json", "frames/models.json", "frames/hello-models.json", "frames/usage-model-mismatch.json", "api/connection-choose-models.json", "api/connection-models.json", "api/models-request.json"} { |
| + for _, name := range []string{"api/connections.json", "api/connection-connecting-codex.json", "api/connection-signing-in-claude.json", "api/connect-request.json", "api/event-connection.json", "frames/connect.json", "frames/cancel_connect.json", "frames/connection.json", "frames/hello.json", "frames/reply-usage.json", "frames/usage.json", "frames/disconnect.json", "frames/sync.json", "frames/preference.json", "api/preferences.json", "api/event-preference.json", "api/connection-metered.json", "api/connection-choose-model.json", "api/connect-request-api-key.json", "api/budget.json", "api/resume-request.json", "api/model-request.json", "frames/budget.json", "frames/model.json", "frames/resume_spend.json", "frames/connect-api-key.json", "frames/usage-probe.json", "frames/hello-metered.json", "frames/release.json", "frames/priority.json", "frames/step-held.json", "frames/preference-until.json", "frames/dispatch-urgent.json", "api/task-held.json", "api/priority-request.json", "api/run-now-request.json", "api/run-now-accepted.json", "api/card-held.json", "frames/models.json", "frames/hello-models.json", "frames/usage-model-mismatch.json", "api/connection-choose-models.json", "api/connection-models.json", "api/models-request.json", "frames/hello-worker-conns.json"} { |
| // seal_key is public (spec §2.4); api_key is a connection's kind |
| // and its card's, never a field (connectors spec §10). |
| raw := strings.ReplaceAll(strings.ToLower(string(wiretest.Fixture(name))), `"seal_key"`, "") |
| raw = strings.ReplaceAll(raw, `"kind":"api_key"`, `"kind":""`) |
| + // token is a connection's kind (a pasted setup-token), never a field. |
| + raw = strings.ReplaceAll(raw, `"kind":"token"`, `"kind":""`) |
| for _, bad := range []string{"token\"", "secret", "credential", "password", "sealed", "_key", "api_key", "access_token", "refresh"} { |
| if strings.Contains(raw, bad) { |
| t.Errorf("%s contains %q", name, bad) |
diff --git a/internal/wire/frames.go b/internal/wire/frames.go| index 674739df..7b581569 100644 |
| --- a/internal/wire/frames.go |
| +++ b/internal/wire/frames.go |
| @@ -67,7 +67,7 @@ type Frame struct { |
| // Durable reports whether a frame must be acked and resent until acked. |
| func (f Frame) Durable() bool { |
| switch f.Type { |
| - case FrameChangeDiff, FrameRequestAccess, FrameAccess, FrameMessage, FrameAttachment, FrameCancel, FrameReply, FrameTurn, FrameToolCall, FrameToolResult, FrameMoveIn, FrameNotebook, FrameReset, FrameDispatch, FrameCancelStep, FrameStep, FrameRecheck, FrameWatchMerge, FrameMerged, FrameAsk, FrameCancelAsk, FrameAnswer, FrameForgetTask, FrameBranch, FrameBlob, FrameSendPack, FramePublish, FramePublished, FrameConnect, FrameCancelConnect, FrameConnection, FrameUsage, FrameDisconnect, FramePreference, FrameSecret, FrameCheck, FrameModel, FrameModels, FrameBudget, FrameResumeSpend, FrameResearchFile, FrameRelease, FramePriority, FrameWarm: |
| + case FramePrepareBase, FrameBase, FrameChangeDiff, FrameRequestAccess, FrameAccess, FrameMessage, FrameAttachment, FrameCancel, FrameReply, FrameTurn, FrameToolCall, FrameToolResult, FrameMoveIn, FrameNotebook, FrameReset, FrameDispatch, FrameCancelStep, FrameStep, FrameRecheck, FrameWatchMerge, FrameMerged, FrameAsk, FrameCancelAsk, FrameAnswer, FrameForgetTask, FrameBranch, FrameBlob, FrameSendPack, FramePublish, FramePublished, FrameConnect, FrameCancelConnect, FrameConnection, FrameUsage, FrameDisconnect, FramePreference, FrameSecret, FrameCheck, FrameModel, FrameModels, FrameBudget, FrameResumeSpend, FrameResearchFile, FrameRelease, FramePriority, FrameWarm: |
| return true |
| } |
| return false |
| @@ -186,6 +186,10 @@ func (f Frame) Decode() (any, error) { |
| v = &Refused{} |
| case FrameChangeDiff: |
| v = &ChangeDiffUpload{} |
| + case FramePrepareBase: |
| + v = &PrepareBaseCommand{} |
| + case FrameBase: |
| + v = &BaseReport{} |
| case FrameResearchFile: |
| v = &ResearchFile{} |
| case FrameRelease: |
diff --git a/internal/wire/injection_test.go b/internal/wire/injection_test.go| index f6ff8397..aea971c9 100644 |
| --- a/internal/wire/injection_test.go |
| +++ b/internal/wire/injection_test.go |
| @@ -7,10 +7,10 @@ import ( |
| ) |
| func TestInjectionProtocolDowngrade(t *testing.T) { |
| - if wire.ProtocolInjectionDefences != 28 || wire.ProtocolCurrent != 35 { |
| + if wire.ProtocolInjectionDefences != 28 || wire.ProtocolCurrent != 37 { |
| t.Fatal("injection guarantees require protocol 28") |
| } |
| - for version, want := range map[int]int{26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, 99: 35} { |
| + for version, want := range map[int]int{26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 32: 32, 33: 33, 34: 34, 35: 35, 36: 36, 37: 37, 99: 37} { |
| if got := wire.Spoken(version); got != want { |
| t.Fatalf("negotiated %d as %d, want %d", version, got, want) |
| } |
diff --git a/internal/wire/mac_engineering.go b/internal/wire/mac_engineering.go| new file mode 100644 |
| index 00000000..a75fb8b0 |
| --- /dev/null |
| +++ b/internal/wire/mac_engineering.go |
| @@ -0,0 +1,338 @@ |
| +package wire |
| + |
| +import ( |
| + "fmt" |
| + "regexp" |
| + "slices" |
| +) |
| + |
| +// Mac Engineering (Mac runners spec §8, slice F): Engineering placed on a |
| +// Mac worker. Everything here is protocol 37 (ProtocolMacEngineering); |
| +// Encode drops each field and refuses each frame and Engineering |
| +// transfer below it (downgradeMacEngineering). |
| + |
| +// Frames. prepare_base asks the primary to resolve the base of an |
| +// Engineering attempt placed on a worker (instance to primary); base is |
| +// its answer (primary to instance). Both durable. |
| +const ( |
| + FramePrepareBase = "prepare_base" |
| + FrameBase = "base" |
| +) |
| + |
| +// macEngineeringOnly are the frame types below ProtocolMacEngineering |
| +// never carries (Speaks). |
| +var macEngineeringOnly = map[string]bool{FramePrepareBase: true, FrameBase: true} |
| + |
| +// PrepareBaseCommand asks the primary to fetch and resolve the base an |
| +// Engineering attempt on a worker starts from, exactly as it would for |
| +// its own Engineering: the default branch's tip, or, for a rebase round |
| +// (Rebase), the new tip that CandidateSHA (made on FromBase) goes on top |
| +// of. The instance binds the reported SHA to the attempt before it |
| +// dispatches to the worker. |
| +type PrepareBaseCommand struct { |
| + TaskID string `json:"task_id"` |
| + StepID string `json:"step_id"` |
| + Attempt int64 `json:"attempt"` |
| + Repo string `json:"repo"` |
| + Rebase bool `json:"rebase"` |
| + FromBase string `json:"from_base"` |
| + CandidateSHA string `json:"candidate_sha"` |
| +} |
| + |
| +// Valid: a named attempt of a repository; a rebase names the commit it |
| +// moves and the base it was made on, and a first step names neither. |
| +func (c PrepareBaseCommand) Valid() bool { |
| + if c.TaskID == "" || c.StepID == "" || c.Attempt < 1 || c.Repo == "" { |
| + return false |
| + } |
| + if !c.Rebase { |
| + return c.FromBase == "" && c.CandidateSHA == "" |
| + } |
| + return ValidCommitSHA(c.FromBase) && ValidCommitSHA(c.CandidateSHA) && c.FromBase != c.CandidateSHA |
| +} |
| + |
| +// BaseReport is the primary's answer to prepare_base: the base it |
| +// resolved, or ReasonBaseUnavailable (the fetch failed, or the default |
| +// branch is unborn, which a worker never takes). |
| +type BaseReport struct { |
| + TaskID string `json:"task_id"` |
| + StepID string `json:"step_id"` |
| + Attempt int64 `json:"attempt"` |
| + BaseSHA string `json:"base_sha"` |
| + Reason string `json:"reason"` |
| +} |
| + |
| +// Valid: exactly one of a commit SHA and base_unavailable. |
| +func (r BaseReport) Valid() bool { |
| + if r.TaskID == "" || r.StepID == "" || r.Attempt < 1 { |
| + return false |
| + } |
| + if r.Reason == "" { |
| + return ValidCommitSHA(r.BaseSHA) |
| + } |
| + return r.Reason == ReasonBaseUnavailable && r.BaseSHA == "" |
| +} |
| + |
| +// Step reasons slice F adds. secret_in_candidate: the worker found one |
| +// of its known secrets (or gitleaks did) in the candidate, so nothing |
| +// was uploaded. workspace_too_large: the base's pack is over |
| +// MaxTransferBytes, so Engineering cannot go to the Mac. engineering_ |
| +// unavailable: the worker could not launch Engineering as certified (a |
| +// settings check, the pinned CLI, the tool proxy). base_unavailable: the |
| +// primary could not resolve the attempt's base. |
| +// |
| +// They are not in StepReasons yet: each needs its work.reason words, |
| +// which are pending copy (plan task 15). Until then an instance records |
| +// them as unknown. |
| +const ( |
| + ReasonSecretInCandidate = "secret_in_candidate" |
| + ReasonWorkspaceTooLarge = "workspace_too_large" |
| + ReasonEngineeringUnavailable = "engineering_unavailable" |
| + ReasonBaseUnavailable = "base_unavailable" |
| +) |
| + |
| +// XcodeAccessSandboxed (DispatchCommand.XcodeAccess, StepReport.XcodeAccess) |
| +// gives Engineering's Bash sandbox the Mach services Xcode needs. "" is |
| +// no Xcode access: the change is built and tested by Checks. |
| +const XcodeAccessSandboxed = "sandboxed" |
| + |
| +// Outcome phases (StepReport.OutcomePhase, PublishCommand.OutcomePhase, |
| +// PublishedReport.OutcomePhase): what a worker's commit is, kept apart |
| +// from progress phases (StepReport.Phase): an ordinary candidate, work |
| +// kept on step_timeout, or a fix round whose shell never worked. |
| +const ( |
| + OutcomeCommitted = "committed" |
| + OutcomeUnfinished = "unfinished" |
| + OutcomeNoShell = "no_shell" |
| +) |
| + |
| +// TransferKindEngineering is an inbound transfer carrying the commits an |
| +// Engineering attempt on a worker starts from. "" is a checks transfer |
| +// (or a worker's outbound commit) as before slice F. |
| +const TransferKindEngineering = "engineering" |
| + |
| +// MaxTransferCommits bounds TransferHeader.Commits: base, old base and |
| +// candidate. |
| +const MaxTransferCommits = 3 |
| + |
| +var commitSHA = regexp.MustCompile(`^(?:[0-9a-f]{40}|[0-9a-f]{64})$`) |
| + |
| +// ValidCommitSHA is a full lowercase SHA-1 or SHA-256 object name. |
| +func ValidCommitSHA(s string) bool { return commitSHA.MatchString(s) } |
| + |
| +// Commits is the list of commits the transfer's pack must yield, in |
| +// order, de-duplicated and bounded by MaxTransferCommits: the candidate |
| +// for a checks transfer or an outbound commit; for an Engineering |
| +// transfer the base, then (a rebase round) the old base and the |
| +// candidate. Empty fields are left out. |
| +func (h TransferHeader) Commits() []string { |
| + named := []string{h.CandidateSHA} |
| + if h.Kind != "" { |
| + named = []string{h.BaseSHA, h.OldBaseSHA, h.CandidateSHA} |
| + } |
| + out := make([]string, 0, MaxTransferCommits) |
| + for _, c := range named { |
| + if c != "" && !slices.Contains(out, c) { |
| + out = append(out, c) |
| + } |
| + } |
| + return out[:min(len(out), MaxTransferCommits)] |
| +} |
| + |
| +// Valid checks the header's kind rules and every SHA it names. A checks |
| +// transfer has a candidate (and its base, when known) and no old base. |
| +// An Engineering transfer is inbound and has a base, and either nothing |
| +// else (a first step or a fix round) or both an old base and a candidate |
| +// (a rebase round). |
| +func (h TransferHeader) Valid() bool { |
| + switch h.Kind { |
| + case "": |
| + if h.OldBaseSHA != "" || h.CandidateSHA == "" || h.BaseSHA != "" && !ValidCommitSHA(h.BaseSHA) { |
| + return false |
| + } |
| + case TransferKindEngineering: |
| + if h.Direction != TransferInbound || h.BaseSHA == "" || (h.OldBaseSHA == "") != (h.CandidateSHA == "") { |
| + return false |
| + } |
| + default: |
| + return false |
| + } |
| + commits := h.Commits() |
| + if len(commits) > MaxTransferCommits { |
| + return false |
| + } |
| + for _, c := range commits { |
| + if !ValidCommitSHA(c) { |
| + return false |
| + } |
| + } |
| + return true |
| +} |
| + |
| +// engineeringTransfer: a header an older peer has no words for. |
| +func (h TransferHeader) engineeringTransfer() bool { return h.Kind != "" || h.OldBaseSHA != "" } |
| + |
| +// EngineeringStatus is a Mac worker's word on whether it can take |
| +// Engineering, beside its claude tag: ready, or the first thing missing. |
| +// Reason is a short detail in the capability string rules ("" when |
| +// ready). Busy is not a state: placement counts running steps. |
| +type EngineeringStatus struct { |
| + State string `json:"state"` |
| + Reason string `json:"reason"` |
| +} |
| + |
| +// Engineering states. |
| +const ( |
| + EngineeringReady = "ready" |
| + EngineeringNoConnection = "no_connection" |
| + EngineeringSignedOut = "signed_out" |
| + EngineeringLimited = "limited" |
| + EngineeringProbesPending = "probes_pending" |
| + EngineeringProbesFailed = "probes_failed" |
| + EngineeringCLIUnpinned = "cli_unpinned" |
| + EngineeringHomeOpen = "home_open" |
| + EngineeringTainted = "tainted" |
| +) |
| + |
| +// EngineeringStates is every Engineering state, ready first. |
| +var EngineeringStates = []string{EngineeringReady, EngineeringNoConnection, EngineeringSignedOut, EngineeringLimited, EngineeringProbesPending, EngineeringProbesFailed, EngineeringCLIUnpinned, EngineeringHomeOpen, EngineeringTainted} |
| + |
| +// EngineeringProbeIDs are the shipped Engineering probes (plan task 14), |
| +// reported in Capabilities.Probes beside P1 to P7. |
| +var EngineeringProbeIDs = []string{"F1", "F2", "F3", "F4", "F5", "F6", "F7"} |
| + |
| +// engineeringProbeSuccess is each F probe's one success verdict. F4 (the |
| +// process group ends and the proof holds) passes; the others prove that |
| +// something was denied (network, reads, the token, Xcode's services, |
| +// native tools, Xcode without access), so they report denied. |
| +var engineeringProbeSuccess = map[string]string{ |
| + "F1": ProbeDenied, |
| + "F2": ProbeDenied, |
| + "F3": ProbeDenied, |
| + "F4": ProbePassed, |
| + "F5": ProbeDenied, |
| + "F6": ProbeDenied, |
| + "F7": ProbeDenied, |
| +} |
| + |
| +// EngineeringProbeSuccess is an F probe's success verdict, "" for any |
| +// other ID. |
| +func EngineeringProbeSuccess(id string) string { return engineeringProbeSuccess[id] } |
| + |
| +// validProbeVerdict: P probes as before (only P2 says denied); an F probe |
| +// says its own success verdict or failed, skipped or unavailable. |
| +func validProbeVerdict(id, verdict string) bool { |
| + if !slices.Contains(probeVerdicts, verdict) { |
| + return false |
| + } |
| + if success, ok := engineeringProbeSuccess[id]; ok { |
| + return verdict == success || verdict != ProbePassed && verdict != ProbeDenied |
| + } |
| + return slices.Contains(ProbeIDs, id) && (verdict != ProbeDenied || id == "P2") |
| +} |
| + |
| +func validEngineeringStatus(s EngineeringStatus) bool { |
| + return slices.Contains(EngineeringStates, s.State) && (s.State != EngineeringReady || s.Reason == "") |
| +} |
| + |
| +// Placements slice F adds: waiting_mac_connection while a Mac fits all |
| +// but claude (its EngineeringStatus says why); waiting_mac_update while |
| +// the Mac or the primary speaks below ProtocolMacEngineering; |
| +// waiting_base while the primary resolves the attempt's base. |
| +const ( |
| + PlacementMacConnection = "waiting_mac_connection" |
| + PlacementMacUpdate = "waiting_mac_update" |
| + PlacementBase = "waiting_base" |
| +) |
| + |
| +// Needs-you kinds slice F adds: a Mac fits Mac Engineering but has no |
| +// usable Claude connection (mac_connection), or it or the primary needs |
| +// an update (mac_update). |
| +const ( |
| + NeedsMacConnection = "mac_connection" |
| + NeedsMacUpdate = "mac_update" |
| +) |
| + |
| +// WithoutMacEngineering drops a hello's Engineering status and F probes |
| +// (in new values; the caller's are untouched). The runner's first hello |
| +// on a connection goes out before the welcome names the protocol, and an |
| +// older instance's ValidCapabilities refuses an F probe; the runner sends |
| +// them once the welcome says 37. It reports whether anything changed. |
| +func WithoutMacEngineering(h *Hello) bool { |
| + c := h.Capabilities |
| + if c == nil { |
| + return false |
| + } |
| + isF := func(p Probe) bool { _, ok := engineeringProbeSuccess[p.ID]; return ok } |
| + if c.Engineering == nil && !slices.ContainsFunc(c.Probes, isF) { |
| + return false |
| + } |
| + out := *c |
| + out.Engineering = nil |
| + if slices.ContainsFunc(c.Probes, isF) { |
| + out.Probes = slices.DeleteFunc(slices.Clone(c.Probes), isF) |
| + } |
| + h.Capabilities = &out |
| + return true |
| +} |
| + |
| +// WithoutWorkerConnections is the instance's reading of a worker's |
| +// hello: below ProtocolMacEngineering a worker holds no connections and |
| +// no seal key, so any it sends are ignored (cleared in new values). A |
| +// primary's hello is never passed here. It reports whether anything |
| +// changed. |
| +func WithoutWorkerConnections(h *Hello, protocol int) bool { |
| + if protocol >= ProtocolMacEngineering || len(h.Connections) == 0 && h.SealKey == "" { |
| + return false |
| + } |
| + h.Connections, h.SealKey = []HeldConnection{}, "" |
| + return true |
| +} |
| + |
| +// downgradeMacEngineering takes slice F out of what a peer below |
| +// ProtocolMacEngineering is sent (the new frames never get this far: |
| +// Speaks refuses them): an Engineering transfer and a diff upload bound |
| +// to a publication are refused; every new field is dropped. It reports |
| +// whether anything changed. |
| +func downgradeMacEngineering(body any, protocol int) (bool, error) { |
| + refuse := func(what string) (bool, error) { |
| + return false, fmt.Errorf("%w: %s at protocol %d", ErrProtocol, what, protocol) |
| + } |
| + switch v := body.(type) { |
| + case *Blob: |
| + if v.Transfer.engineeringTransfer() { |
| + return refuse("an Engineering transfer") |
| + } |
| + case *SendPackCommand: |
| + if v.Transfer.engineeringTransfer() { |
| + return refuse("an Engineering transfer") |
| + } |
| + case *ChangeDiffUpload: |
| + if v.Publication != "" { |
| + return refuse("a publication's diff") |
| + } |
| + case *Hello: |
| + return WithoutMacEngineering(v), nil |
| + case *DispatchCommand: |
| + set := v.XcodeAccess != "" |
| + v.XcodeAccess = "" |
| + return set, nil |
| + case *StepReport: |
| + set := v.XcodeAccess != "" || v.SessionID != "" || v.OutcomePhase != "" |
| + v.XcodeAccess, v.SessionID, v.OutcomePhase = "", "", "" |
| + return set, nil |
| + case *PublishCommand: |
| + set := v.OutcomePhase != "" |
| + v.OutcomePhase = "" |
| + return set, nil |
| + case *PublishedReport: |
| + set := v.ChangeFiles != nil || v.DiffCollection != "" || v.OutcomePhase != "" |
| + v.ChangeFiles, v.DiffCollection, v.OutcomePhase = nil, "", "" |
| + return set, nil |
| + case *AskCommand: |
| + set := v.EngAttempt != 0 || v.EngAccount != "" || v.EngSession != "" |
| + v.EngAttempt, v.EngAccount, v.EngSession = 0, "", "" |
| + return set, nil |
| + } |
| + return false, nil |
| +} |
diff --git a/internal/wire/mac_engineering_test.go b/internal/wire/mac_engineering_test.go| new file mode 100644 |
| index 00000000..e69ef70f |
| --- /dev/null |
| +++ b/internal/wire/mac_engineering_test.go |
| @@ -0,0 +1,491 @@ |
| +package wire_test |
| + |
| +import ( |
| + "bytes" |
| + "encoding/json" |
| + "errors" |
| + "fmt" |
| + "slices" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| + "amadan.net/oficina/equipo/internal/wire/wiretest" |
| +) |
| + |
| +// Slice F (Mac Engineering) is protocol 37. 36 belongs to the dynamic |
| +// specialists build and is not defined on this branch, so a peer at 36 |
| +// is below Mac Engineering. The values are written out so that moving a |
| +// constant fails here. |
| +func TestProtocol37Constants(t *testing.T) { |
| + if wire.Protocol37 != 37 || wire.ProtocolMacEngineering != wire.Protocol37 || wire.ProtocolCurrent != wire.ProtocolMacEngineering || wire.ProtocolChangeDiffs != 35 { |
| + t.Fatalf("mac engineering %d, current %d", wire.ProtocolMacEngineering, wire.ProtocolCurrent) |
| + } |
| + if wire.Spoken(99) != 37 || wire.Spoken(37) != 37 || wire.Spoken(36) != 36 || wire.Spoken(35) != 35 { |
| + t.Fatal("spoken protocol") |
| + } |
| + for kind, want := range map[string]bool{wire.FramePrepareBase: true, wire.FrameBase: true} { |
| + if (wire.Frame{Type: kind}).Durable() != want { |
| + t.Fatalf("%s durable=%v", kind, !want) |
| + } |
| + if wire.Speaks(36, kind) || !wire.Speaks(37, kind) { |
| + t.Fatalf("%s spoken below 37 or not at 37", kind) |
| + } |
| + } |
| + for got, want := range map[string]string{ |
| + wire.FramePrepareBase: "prepare_base", |
| + wire.FrameBase: "base", |
| + wire.TransferKindEngineering: "engineering", |
| + wire.XcodeAccessSandboxed: "sandboxed", |
| + wire.OutcomeCommitted: "committed", |
| + wire.OutcomeUnfinished: "unfinished", |
| + wire.OutcomeNoShell: "no_shell", |
| + wire.ReasonSecretInCandidate: "secret_in_candidate", |
| + wire.ReasonWorkspaceTooLarge: "workspace_too_large", |
| + wire.ReasonEngineeringUnavailable: "engineering_unavailable", |
| + wire.ReasonBaseUnavailable: "base_unavailable", |
| + wire.PlacementMacConnection: "waiting_mac_connection", |
| + wire.PlacementMacUpdate: "waiting_mac_update", |
| + wire.PlacementBase: "waiting_base", |
| + wire.NeedsMacConnection: "mac_connection", |
| + wire.NeedsMacUpdate: "mac_update", |
| + } { |
| + if got != want { |
| + t.Errorf("constant %q, want %q", got, want) |
| + } |
| + } |
| + states := []string{"ready", "no_connection", "signed_out", "limited", "probes_pending", "probes_failed", "cli_unpinned", "home_open", "tainted"} |
| + if !slices.Equal(wire.EngineeringStates, states) || slices.Contains(wire.EngineeringStates, "busy") || wire.EngineeringReady != "ready" { |
| + t.Fatalf("engineering states %v", wire.EngineeringStates) |
| + } |
| + if !slices.Equal(wire.EngineeringProbeIDs, []string{"F1", "F2", "F3", "F4", "F5", "F6", "F7"}) { |
| + t.Fatalf("engineering probes %v", wire.EngineeringProbeIDs) |
| + } |
| +} |
| + |
| +func keysOf(t *testing.T, raw []byte) map[string]bool { |
| + t.Helper() |
| + var m map[string]json.RawMessage |
| + if err := json.Unmarshal(raw, &m); err != nil { |
| + t.Fatal(err) |
| + } |
| + out := map[string]bool{} |
| + for k := range m { |
| + out[k] = true |
| + } |
| + return out |
| +} |
| + |
| +// Every field slice F adds is dropped for a peer below 37 (the protocol |
| +// 35 primary and the 36 specialists build), every new frame and every |
| +// Engineering transfer is refused there, and at 37 each fixture goes out |
| +// byte for byte. Where an older fixture records the same frame, the |
| +// downgraded frame has exactly its keys. |
| +func TestEncodeDropsMacEngineeringBelow37(t *testing.T) { |
| + drops := []struct { |
| + name, older string |
| + gone []string |
| + }{ |
| + {"frames/dispatch-mac-engineering.json", "frames/dispatch-needs.json", []string{"xcode_access"}}, |
| + {"frames/step-mac-engineering.json", "", []string{"xcode_access", "session_id", "outcome_phase"}}, |
| + {"frames/published-change-files.json", "frames/published.json", []string{"change_files", "diff_collection", "outcome_phase"}}, |
| + {"frames/ask-pinned.json", "frames/ask.json", []string{"eng_attempt", "eng_account", "eng_session"}}, |
| + } |
| + for _, d := range drops { |
| + f, _, err := wire.ParseFrame(wiretest.Fixture(d.name)) |
| + if err != nil { |
| + t.Fatalf("%s: %v", d.name, err) |
| + } |
| + if same, err := wire.Encode(f, 37); err != nil || !bytes.Equal(same.Data, f.Data) { |
| + t.Fatalf("%s changed at 37: %v", d.name, err) |
| + } |
| + for _, p := range []int{35, 36} { |
| + old, err := wire.Encode(f, p) |
| + if err != nil { |
| + t.Fatalf("%s at %d: %v", d.name, p, err) |
| + } |
| + keys := keysOf(t, old.Data) |
| + for _, k := range d.gone { |
| + if keys[k] { |
| + t.Errorf("%s kept %s at %d", d.name, k, p) |
| + } |
| + } |
| + want := keysOf(t, f.Data) |
| + for _, k := range d.gone { |
| + delete(want, k) |
| + } |
| + for k := range want { |
| + if !keys[k] { |
| + t.Errorf("%s lost %s at %d", d.name, k, p) |
| + } |
| + } |
| + raw, _ := json.Marshal(old) |
| + if d.older != "" { |
| + if err := wiretest.SameShape(wiretest.Fixture(d.older), raw); err != nil { |
| + t.Errorf("%s at %d is not %s: %v\n%s", d.name, p, d.older, err, raw) |
| + } |
| + } |
| + if _, _, err := wire.ParseFrame(raw); err != nil { |
| + t.Errorf("%s at %d does not parse: %v", d.name, p, err) |
| + } |
| + } |
| + } |
| + |
| + // The worker's hello: the Engineering status and the F probes go; the |
| + // P probes stay, and what is left is a capability report an older |
| + // instance accepts. |
| + f, _, err := wire.ParseFrame(wiretest.Fixture("frames/hello-worker-conns.json")) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if same, err := wire.Encode(f, 37); err != nil || !bytes.Equal(same.Data, f.Data) { |
| + t.Fatalf("hello changed at 37: %v", err) |
| + } |
| + for _, p := range []int{35, 36} { |
| + old, err := wire.Encode(f, p) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if bytes.Contains(old.Data, []byte(`"engineering"`)) || bytes.Contains(old.Data, []byte(`"F`)) || !bytes.Contains(old.Data, []byte(`"P2"`)) { |
| + t.Fatalf("hello at %d: %s", p, old.Data) |
| + } |
| + var h wire.Hello |
| + if err := wire.Strict(old.Data, &h); err != nil || h.Capabilities == nil || len(h.Capabilities.Probes) != 7 || wire.ValidCapabilities(*h.Capabilities) != nil { |
| + t.Fatalf("hello at %d: %v %+v", p, err, h.Capabilities) |
| + } |
| + } |
| + |
| + // Refused below 37: the new frames, an Engineering transfer's chunks |
| + // and its pack request, a publish carrying the worker's outcome only |
| + // as far as it is dropped, and a diff upload bound to a publication. |
| + refused := map[string]wire.Frame{} |
| + for _, name := range []string{"frames/prepare-base.json", "frames/base.json", "frames/blob-engineering.json"} { |
| + f, _, err := wire.ParseFrame(wiretest.Fixture(name)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + refused[name] = f |
| + } |
| + header := wire.TransferHeader{ID: "tr_1", Direction: wire.TransferInbound, Repo: "amadan.net/oficina/sample", TaskID: "tk1", StepID: "s1", Attempt: 1, BaseSHA: strings.Repeat("a", 40), Kind: wire.TransferKindEngineering} |
| + refused["send_pack engineering"], _ = wire.NewFrame("sp", wire.FrameSendPack, wire.SendPackCommand{Transfer: header, Have: []string{}}) |
| + old := header |
| + old.Kind, old.OldBaseSHA = "", strings.Repeat("b", 40) |
| + refused["blob old base"], _ = wire.NewFrame("b", wire.FrameBlob, wire.Blob{Transfer: old}) |
| + refused["change_diff publication"], _ = wire.NewFrame("cd", wire.FrameChangeDiff, wire.ChangeDiffUpload{Publication: "pb_1"}) |
| + for name, f := range refused { |
| + for _, p := range []int{wire.Protocol1, 2, 35, 36} { |
| + if _, err := wire.Encode(f, p); !errors.Is(err, wire.ErrProtocol) { |
| + t.Errorf("%s encoded at %d: %v", name, p, err) |
| + } |
| + } |
| + if same, err := wire.Encode(f, 37); err != nil || !bytes.Equal(same.Data, f.Data) { |
| + t.Errorf("%s changed at 37: %v", name, err) |
| + } |
| + } |
| + |
| + // A publish's outcome is dropped, the rest kept. |
| + pub, _ := wire.NewFrame("pub", wire.FramePublish, wire.PublishCommand{Publication: "pb_1", OutcomePhase: wire.OutcomeUnfinished}) |
| + for _, p := range []int{35, 36} { |
| + got, err := wire.Encode(pub, p) |
| + if err != nil || bytes.Contains(got.Data, []byte(`"outcome_phase"`)) || !bytes.Contains(got.Data, []byte(`"pb_1"`)) { |
| + t.Fatalf("publish at %d: %v %s", p, err, got.Data) |
| + } |
| + } |
| + |
| + // Today's frames are untouched below 37: a checks transfer and a diff |
| + // upload with no publication. |
| + for _, name := range []string{"frames/blob.json", "frames/send_pack.json", "frames/publish.json", "frames/published.json", "frames/ask.json", "frames/dispatch-needs.json", "frames/step-process-group.json"} { |
| + f, _, err := wire.ParseFrame(wiretest.Fixture(name)) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + for _, p := range []int{35, 36} { |
| + if got, err := wire.Encode(f, p); err != nil || !bytes.Equal(got.Data, f.Data) { |
| + t.Errorf("%s changed at %d: %v", name, p, err) |
| + } |
| + } |
| + } |
| + plain, _ := wire.NewFrame("cd", wire.FrameChangeDiff, wire.ChangeDiffUpload{}) |
| + if _, err := wire.Encode(plain, 35); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| + |
| +// A worker's hello carries its connections and seal key only at 37: the |
| +// instance ignores both from a worker below it. |
| +func TestWithoutWorkerConnections(t *testing.T) { |
| + _, body, err := wire.ParseFrame(wiretest.Fixture("frames/hello-worker-conns.json")) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + h := *body.(*wire.Hello) |
| + if len(h.Connections) != 1 || h.SealKey == "" { |
| + t.Fatal("fixture") |
| + } |
| + at37 := h |
| + if wire.WithoutWorkerConnections(&at37, 37) || len(at37.Connections) != 1 || at37.SealKey == "" { |
| + t.Fatal("dropped at 37") |
| + } |
| + for _, p := range []int{1, 2, 35, 36} { |
| + old := h |
| + if !wire.WithoutWorkerConnections(&old, p) || len(old.Connections) != 0 || old.Connections == nil || old.SealKey != "" { |
| + t.Fatalf("kept at %d: %+v", p, old) |
| + } |
| + if wire.WithoutWorkerConnections(&old, p) { |
| + t.Fatal("reported a change twice") |
| + } |
| + } |
| + if len(h.Connections) != 1 { |
| + t.Fatal("mutated the caller's connections") |
| + } |
| +} |
| + |
| +func TestTransferHeaderCommits(t *testing.T) { |
| + a, b, c := strings.Repeat("a", 40), strings.Repeat("b", 40), strings.Repeat("c", 64) |
| + base := wire.TransferHeader{ID: "tr_1", Direction: wire.TransferInbound, Repo: "amadan.net/oficina/sample", TaskID: "tk1", StepID: "s1", Attempt: 1} |
| + if wire.MaxTransferCommits != 3 { |
| + t.Fatalf("bound %d", wire.MaxTransferCommits) |
| + } |
| + for _, tc := range []struct { |
| + name string |
| + edit func(*wire.TransferHeader) |
| + commits []string |
| + valid bool |
| + }{ |
| + {"checks", func(h *wire.TransferHeader) { h.BaseSHA, h.CandidateSHA = a, b }, []string{b}, true}, |
| + {"checks without base", func(h *wire.TransferHeader) { h.CandidateSHA = b }, []string{b}, true}, |
| + {"checks outbound", func(h *wire.TransferHeader) { h.Direction, h.BaseSHA, h.CandidateSHA = wire.TransferOutbound, a, b }, []string{b}, true}, |
| + {"checks without candidate", func(h *wire.TransferHeader) { h.BaseSHA = a }, []string{}, false}, |
| + {"checks with old base", func(h *wire.TransferHeader) { h.BaseSHA, h.OldBaseSHA, h.CandidateSHA = a, c, b }, []string{b}, false}, |
| + {"engineering first", func(h *wire.TransferHeader) { h.Kind, h.BaseSHA = wire.TransferKindEngineering, a }, []string{a}, true}, |
| + {"engineering rebase", func(h *wire.TransferHeader) { |
| + h.Kind, h.BaseSHA, h.OldBaseSHA, h.CandidateSHA = wire.TransferKindEngineering, a, c, b |
| + }, []string{a, c, b}, true}, |
| + {"engineering rebase, base unchanged", func(h *wire.TransferHeader) { |
| + h.Kind, h.BaseSHA, h.OldBaseSHA, h.CandidateSHA = wire.TransferKindEngineering, a, a, b |
| + }, []string{a, b}, true}, |
| + {"engineering rebase onto candidate", func(h *wire.TransferHeader) { |
| + h.Kind, h.BaseSHA, h.OldBaseSHA, h.CandidateSHA = wire.TransferKindEngineering, b, a, b |
| + }, []string{b, a}, true}, |
| + {"engineering without base", func(h *wire.TransferHeader) { h.Kind, h.CandidateSHA = wire.TransferKindEngineering, b }, []string{b}, false}, |
| + {"engineering candidate without old base", func(h *wire.TransferHeader) { |
| + h.Kind, h.BaseSHA, h.CandidateSHA = wire.TransferKindEngineering, a, b |
| + }, []string{a, b}, false}, |
| + {"engineering old base without candidate", func(h *wire.TransferHeader) { |
| + h.Kind, h.BaseSHA, h.OldBaseSHA = wire.TransferKindEngineering, a, c |
| + }, []string{a, c}, false}, |
| + {"engineering outbound", func(h *wire.TransferHeader) { |
| + h.Kind, h.Direction, h.BaseSHA = wire.TransferKindEngineering, wire.TransferOutbound, a |
| + }, []string{a}, false}, |
| + {"unknown kind", func(h *wire.TransferHeader) { h.Kind, h.BaseSHA = "design", a }, []string{a}, false}, |
| + {"short sha", func(h *wire.TransferHeader) { h.Kind, h.BaseSHA = wire.TransferKindEngineering, "abc123" }, []string{"abc123"}, false}, |
| + {"upper-case sha", func(h *wire.TransferHeader) { h.Kind, h.BaseSHA = wire.TransferKindEngineering, strings.ToUpper(a) }, []string{strings.ToUpper(a)}, false}, |
| + {"option-like sha", func(h *wire.TransferHeader) { h.BaseSHA, h.CandidateSHA = a, "--all" }, []string{"--all"}, false}, |
| + {"bad base on checks", func(h *wire.TransferHeader) { h.BaseSHA, h.CandidateSHA = "HEAD", b }, []string{b}, false}, |
| + } { |
| + t.Run(tc.name, func(t *testing.T) { |
| + h := base |
| + tc.edit(&h) |
| + if got := h.Commits(); !slices.Equal(got, tc.commits) { |
| + t.Fatalf("commits %v, want %v", got, tc.commits) |
| + } |
| + if h.Valid() != tc.valid { |
| + t.Fatalf("valid %v, want %v", !tc.valid, tc.valid) |
| + } |
| + }) |
| + } |
| + // The header stays comparable: the instance checks a chunk's header |
| + // against its own row with !=, and a kind or old base is part of it. |
| + x := base |
| + x.Kind, x.BaseSHA = wire.TransferKindEngineering, a |
| + y := x |
| + if x != y { |
| + t.Fatal("equal headers differ") |
| + } |
| + y.OldBaseSHA = c |
| + if x == y { |
| + t.Fatal("old base not compared") |
| + } |
| + y = x |
| + y.Kind = "" |
| + if x == y { |
| + t.Fatal("kind not compared") |
| + } |
| + // A checks header still encodes as it did before slice F. |
| + raw, _ := json.Marshal(wire.TransferHeader{ID: "tr_1", Direction: wire.TransferInbound, BaseSHA: a, CandidateSHA: b}) |
| + if bytes.Contains(raw, []byte(`"kind"`)) || bytes.Contains(raw, []byte(`"old_base_sha"`)) { |
| + t.Fatalf("checks header %s", raw) |
| + } |
| + if !wire.ValidCommitSHA(a) || !wire.ValidCommitSHA(c) || wire.ValidCommitSHA(strings.Repeat("a", 41)) || wire.ValidCommitSHA("") { |
| + t.Fatal("commit sha") |
| + } |
| +} |
| + |
| +// F1 to F7 ride in the same probe list as P1 to P7. Each F probe has one |
| +// success verdict: F4 (the process group) passes; every other one proves |
| +// a denial, so it reports denied, never passed. |
| +func TestValidCapabilitiesF(t *testing.T) { |
| + _, body, err := wire.ParseFrame(wiretest.Fixture("frames/hello-worker-conns.json")) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + good := *body.(*wire.Hello).Capabilities |
| + if err := wire.ValidCapabilities(good); err != nil { |
| + t.Fatal(err) |
| + } |
| + with := func(id, verdict string) wire.Capabilities { |
| + c := good |
| + c.Probes = slices.Clone(good.Probes) |
| + for i := range c.Probes { |
| + if c.Probes[i].ID == id { |
| + c.Probes[i].Verdict = verdict |
| + } |
| + } |
| + return c |
| + } |
| + for _, id := range wire.EngineeringProbeIDs { |
| + success := wire.ProbeDenied |
| + if id == "F4" { |
| + success = wire.ProbePassed |
| + } |
| + if wire.EngineeringProbeSuccess(id) != success { |
| + t.Errorf("%s success %q", id, wire.EngineeringProbeSuccess(id)) |
| + } |
| + for _, v := range []string{wire.ProbePassed, wire.ProbeDenied, wire.ProbeFailed, wire.ProbeSkipped, wire.ProbeUnavailable} { |
| + ok := v == success || v == wire.ProbeFailed || v == wire.ProbeSkipped || v == wire.ProbeUnavailable |
| + if err := wire.ValidCapabilities(with(id, v)); (err == nil) != ok { |
| + t.Errorf("%s %s: %v", id, v, err) |
| + } |
| + } |
| + } |
| + if wire.EngineeringProbeSuccess("P2") != "" || wire.EngineeringProbeSuccess("F8") != "" { |
| + t.Fatal("success for a probe that is not an F probe") |
| + } |
| + // P probes keep their rules: only P2 may say denied. |
| + if wire.ValidCapabilities(with("P4", wire.ProbeDenied)) == nil { |
| + t.Fatal("P4 denied accepted") |
| + } |
| + bad := map[string]func(*wire.Capabilities){ |
| + "F8": func(c *wire.Capabilities) { |
| + c.Probes = append(slices.Clone(c.Probes), wire.Probe{ID: "F8", Verdict: wire.ProbeFailed}) |
| + }, |
| + "F1 twice": func(c *wire.Capabilities) { |
| + c.Probes = append(slices.Clone(c.Probes), wire.Probe{ID: "F1", Verdict: wire.ProbeFailed}) |
| + }, |
| + "lower-case f1": func(c *wire.Capabilities) { c.Probes = []wire.Probe{{ID: "f1", Verdict: wire.ProbeDenied}} }, |
| + "state": func(c *wire.Capabilities) { c.Engineering = &wire.EngineeringStatus{State: "busy"} }, |
| + "empty state": func(c *wire.Capabilities) { c.Engineering = &wire.EngineeringStatus{} }, |
| + "ready reason": func(c *wire.Capabilities) { |
| + c.Engineering = &wire.EngineeringStatus{State: wire.EngineeringReady, Reason: "x"} |
| + }, |
| + "path in reason": func(c *wire.Capabilities) { |
| + c.Engineering = &wire.EngineeringStatus{State: wire.EngineeringHomeOpen, Reason: "Users/paulequipo"} |
| + }, |
| + "long reason": func(c *wire.Capabilities) { |
| + c.Engineering = &wire.EngineeringStatus{State: wire.EngineeringLimited, Reason: strings.Repeat("x", 301)} |
| + }, |
| + "newline reason": func(c *wire.Capabilities) { |
| + c.Engineering = &wire.EngineeringStatus{State: wire.EngineeringLimited, Reason: "a\nb"} |
| + }, |
| + "token in detail": func(c *wire.Capabilities) { |
| + c.Probes = []wire.Probe{{ID: "F3", Verdict: wire.ProbeFailed, Detail: "TOKEN=x"}} |
| + }, |
| + } |
| + for name, edit := range bad { |
| + c := good |
| + edit(&c) |
| + if wire.ValidCapabilities(c) == nil { |
| + t.Errorf("%s accepted", name) |
| + } |
| + } |
| + for _, state := range wire.EngineeringStates { |
| + c := good |
| + reason := "until 18:00" |
| + if state == wire.EngineeringReady { |
| + reason = "" |
| + } |
| + c.Engineering = &wire.EngineeringStatus{State: state, Reason: reason} |
| + if err := wire.ValidCapabilities(c); err != nil { |
| + t.Errorf("%s refused: %v", state, err) |
| + } |
| + } |
| +} |
| + |
| +func TestPrepareBaseAndBaseReport(t *testing.T) { |
| + a, b := strings.Repeat("a", 40), strings.Repeat("b", 40) |
| + first := wire.PrepareBaseCommand{TaskID: "tk1", StepID: "s1", Attempt: 1, Repo: "amadan.net/oficina/sample"} |
| + rebase := wire.PrepareBaseCommand{TaskID: "tk1", StepID: "s1", Attempt: 2, Repo: "amadan.net/oficina/sample", Rebase: true, FromBase: a, CandidateSHA: b} |
| + if !first.Valid() || !rebase.Valid() { |
| + t.Fatal("valid commands refused") |
| + } |
| + for name, edit := range map[string]func(*wire.PrepareBaseCommand){ |
| + "no task": func(c *wire.PrepareBaseCommand) { c.TaskID = "" }, |
| + "no step": func(c *wire.PrepareBaseCommand) { c.StepID = "" }, |
| + "no attempt": func(c *wire.PrepareBaseCommand) { c.Attempt = 0 }, |
| + "no repo": func(c *wire.PrepareBaseCommand) { c.Repo = "" }, |
| + "rebase without from": func(c *wire.PrepareBaseCommand) { c.FromBase = "" }, |
| + "rebase bad candidate": func(c *wire.PrepareBaseCommand) { c.CandidateSHA = "HEAD" }, |
| + "first with candidate": func(c *wire.PrepareBaseCommand) { c.Rebase = false }, |
| + "first with from base": func(c *wire.PrepareBaseCommand) { c.Rebase, c.CandidateSHA = false, "" }, |
| + "rebase onto candidate": func(c *wire.PrepareBaseCommand) { c.FromBase = c.CandidateSHA }, |
| + } { |
| + c := rebase |
| + edit(&c) |
| + if c.Valid() { |
| + t.Errorf("%s accepted", name) |
| + } |
| + } |
| + ok := wire.BaseReport{TaskID: "tk1", StepID: "s1", Attempt: 1, BaseSHA: a} |
| + gone := wire.BaseReport{TaskID: "tk1", StepID: "s1", Attempt: 1, Reason: wire.ReasonBaseUnavailable} |
| + if !ok.Valid() || !gone.Valid() { |
| + t.Fatal("valid reports refused") |
| + } |
| + for name, r := range map[string]wire.BaseReport{ |
| + "both": {TaskID: "tk1", StepID: "s1", Attempt: 1, BaseSHA: a, Reason: wire.ReasonBaseUnavailable}, |
| + "neither": {TaskID: "tk1", StepID: "s1", Attempt: 1}, |
| + "other reason": {TaskID: "tk1", StepID: "s1", Attempt: 1, Reason: "clone_failed"}, |
| + "bad sha": {TaskID: "tk1", StepID: "s1", Attempt: 1, BaseSHA: "main"}, |
| + "no attempt": {TaskID: "tk1", StepID: "s1", BaseSHA: a}, |
| + "no step": {TaskID: "tk1", Attempt: 1, BaseSHA: a}, |
| + } { |
| + if r.Valid() { |
| + t.Errorf("%s accepted", name) |
| + } |
| + } |
| + for name, want := range map[string]any{ |
| + "frames/prepare-base.json": &wire.PrepareBaseCommand{}, |
| + "frames/base.json": &wire.BaseReport{}, |
| + "frames/dispatch-mac-engineering.json": &wire.DispatchCommand{}, |
| + "frames/blob-engineering.json": &wire.Blob{}, |
| + "frames/published-change-files.json": &wire.PublishedReport{}, |
| + "frames/hello-worker-conns.json": &wire.Hello{}, |
| + "frames/ask-pinned.json": &wire.AskCommand{}, |
| + "frames/step-mac-engineering.json": &wire.StepReport{}, |
| + } { |
| + _, body, err := wire.ParseFrame(wiretest.Fixture(name)) |
| + if err != nil { |
| + t.Fatalf("%s: %v", name, err) |
| + } |
| + if got, w := strings.TrimPrefix(typeName(body), "*"), strings.TrimPrefix(typeName(want), "*"); got != w { |
| + t.Fatalf("%s decodes as %s, want %s", name, got, w) |
| + } |
| + } |
| + _, body, _ := wire.ParseFrame(wiretest.Fixture("frames/prepare-base.json")) |
| + if !body.(*wire.PrepareBaseCommand).Valid() { |
| + t.Fatal("prepare-base fixture invalid") |
| + } |
| + _, body, _ = wire.ParseFrame(wiretest.Fixture("frames/base.json")) |
| + if !body.(*wire.BaseReport).Valid() { |
| + t.Fatal("base fixture invalid") |
| + } |
| + _, body, _ = wire.ParseFrame(wiretest.Fixture("frames/blob-engineering.json")) |
| + if h := body.(*wire.Blob).Transfer; !h.Valid() || len(h.Commits()) != 3 { |
| + t.Fatalf("blob-engineering header %+v", h) |
| + } |
| + _, body, _ = wire.ParseFrame(wiretest.Fixture("frames/published-change-files.json")) |
| + if p := body.(*wire.PublishedReport); !wire.ValidChangeFiles(p.ChangeFiles) || !wire.ValidSHA256(p.DiffCollection) { |
| + t.Fatalf("published-change-files %+v", p) |
| + } |
| +} |
| + |
| +func typeName(v any) string { return fmt.Sprintf("%T", v) } |
diff --git a/internal/wire/mixed_protocol_test.go b/internal/wire/mixed_protocol_test.go| index 9b1745b4..ac01f8f9 100644 |
| --- a/internal/wire/mixed_protocol_test.go |
| +++ b/internal/wire/mixed_protocol_test.go |
| @@ -15,7 +15,7 @@ import ( |
| // both go out whole; at 11 both are downgraded. The numbers are written |
| // out so that pointing ProtocolResearch back at 12 fails here. |
| func TestEncodeMixedMeteredAndResearch(t *testing.T) { |
| - if wire.ProtocolMetered != wire.Protocol12 || wire.ProtocolResearch != wire.Protocol13 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolMetered != wire.Protocol12 || wire.ProtocolResearch != wire.Protocol13 || wire.ProtocolCurrent != wire.ProtocolMacEngineering { |
| t.Fatalf("metered %d, research %d, current %d", wire.ProtocolMetered, wire.ProtocolResearch, wire.ProtocolCurrent) |
| } |
| metered := wire.HeldConnection{LocalID: "tensorx-1", Person: "p", Provider: wire.ProviderTensorX, Kind: wire.KindAPIKey, State: wire.ConnHealthy, Harness: wire.HarnessPi, Upstream: "https://api.tensorx.ai", Billing: wire.BillingMetered, Model: "z-ai/glm-5.3", Budget: &wire.Budget{Day: 1, Month: 2, Currency: "USD"}, Spend: &wire.Spend{Currency: "USD"}} |
diff --git a/internal/wire/models_test.go b/internal/wire/models_test.go| index 797653a0..334d2379 100644 |
| --- a/internal/wire/models_test.go |
| +++ b/internal/wire/models_test.go |
| @@ -94,7 +94,7 @@ func modelsFrames(t *testing.T) map[string]wire.Frame { |
| // protocol is checked because an older step in Encode's chain could |
| // undo a newer one (S5's bug). |
| func TestEncodeBelowProtocol18AgainstFrozenSchemas(t *testing.T) { |
| - if wire.ProtocolModels != wire.Protocol18 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolModels != wire.Protocol18 || wire.ProtocolCurrent != wire.ProtocolMacEngineering { |
| t.Fatalf("models %d, current %d", wire.ProtocolModels, wire.ProtocolCurrent) |
| } |
| fs := modelsFrames(t) |
diff --git a/internal/wire/opencode_test.go b/internal/wire/opencode_test.go| index d67e0442..ca8a909a 100644 |
| --- a/internal/wire/opencode_test.go |
| +++ b/internal/wire/opencode_test.go |
| @@ -57,7 +57,7 @@ func providersIn(t *testing.T, raw []byte) (providers, harnesses []string) { |
| // leave hello and sync, its usage rows leave every report, and a connect |
| // or a report about one is refused. At 17 nothing changes. |
| func TestEncodeBelowProtocol17DropsOpenCode(t *testing.T) { |
| - if wire.ProtocolOpenCode != wire.Protocol17 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolOpenCode != wire.Protocol17 || wire.ProtocolCurrent != wire.ProtocolMacEngineering { |
| t.Fatalf("opencode %d, current %d", wire.ProtocolOpenCode, wire.ProtocolCurrent) |
| } |
| budget := &wire.Budget{Day: 1_000_000, Month: 10_000_000, Currency: "USD", Revision: 1} |
diff --git a/internal/wire/pinned_release_test.go b/internal/wire/pinned_release_test.go| index 994f5625..bc282ac1 100644 |
| --- a/internal/wire/pinned_release_test.go |
| +++ b/internal/wire/pinned_release_test.go |
| @@ -13,7 +13,7 @@ import ( |
| // carrying a pinned release loses the release and its pin; an unpinned |
| // release is unchanged from protocol 14. |
| func TestEncodePinnedReleaseBelow29(t *testing.T) { |
| - if wire.ProtocolPinnedRelease != wire.Protocol29 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolPinnedRelease != wire.Protocol29 || wire.ProtocolCurrent != wire.ProtocolMacEngineering { |
| t.Fatalf("pinned %d, current %d", wire.ProtocolPinnedRelease, wire.ProtocolCurrent) |
| } |
| pinned, err := wire.NewFrame("f1", wire.FrameRelease, wire.ReleaseCommand{ID: "rl_1", Person: "p", TaskID: "tk1", StepID: "s1", StepRevision: 1, Connection: "claude-1"}) |
diff --git a/internal/wire/places_test.go b/internal/wire/places_test.go| index b9ce131b..b7b8d596 100644 |
| --- a/internal/wire/places_test.go |
| +++ b/internal/wire/places_test.go |
| @@ -22,7 +22,7 @@ func placesHello() wire.Hello { |
| // refused: an older runner would deploy to its own fixed account, an |
| // older instance would decide a check without the destination. |
| func TestEncodeBelowProtocol31DropsPlaces(t *testing.T) { |
| - if wire.ProtocolPlaces != wire.Protocol34 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs || wire.Spoken(99) != 35 { |
| + if wire.ProtocolPlaces != wire.Protocol34 || wire.ProtocolCurrent != wire.ProtocolMacEngineering || wire.Spoken(99) != 37 { |
| t.Fatalf("places %d, current %d", wire.ProtocolPlaces, wire.ProtocolCurrent) |
| } |
| hello := placesHello() |
diff --git a/internal/wire/publish_test.go b/internal/wire/publish_test.go| index 2b4ae7b0..60f20463 100644 |
| --- a/internal/wire/publish_test.go |
| +++ b/internal/wire/publish_test.go |
| @@ -17,7 +17,7 @@ import ( |
| // and a hello's sites capability are dropped, so nothing a protocol 15 |
| // peer decodes strictly carries them. |
| func TestEncodeBelowProtocol16DropsPublish(t *testing.T) { |
| - if wire.ProtocolPublish != wire.Protocol16 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolPublish != wire.Protocol16 || wire.ProtocolCurrent != wire.ProtocolMacEngineering { |
| t.Fatalf("publish %d, current %d", wire.ProtocolPublish, wire.ProtocolCurrent) |
| } |
| publish := wire.DispatchCommand{Person: "p", TaskID: "tk", StepID: "s", Attempt: 1, Specialist: wire.SpecialistPublish, Findings: []wire.Finding{}, CandidateSHA: strings.Repeat("e", 40), Publish: &wire.PublishDispatch{App: "site-sample", Into: "main"}} |
diff --git a/internal/wire/questions.go b/internal/wire/questions.go| index 721ff041..7fb036e4 100644 |
| --- a/internal/wire/questions.go |
| +++ b/internal/wire/questions.go |
| @@ -107,6 +107,11 @@ type AskCommand struct { |
| CandidateSHA string `json:"candidate_sha"` |
| Title string `json:"title"` |
| Text string `json:"text"` |
| + // Protocol 37: the Engineering attempt, account and kept session the |
| + // question resumes, frozen when it was created (exact pinning). |
| + EngAttempt int64 `json:"eng_attempt,omitempty"` |
| + EngAccount string `json:"eng_account,omitempty"` |
| + EngSession string `json:"eng_session,omitempty"` |
| } |
| // CancelAskCommand stops one attempt of a question. |
diff --git a/internal/wire/runners.go b/internal/wire/runners.go| index 0cf4dea7..61e512f1 100644 |
| --- a/internal/wire/runners.go |
| +++ b/internal/wire/runners.go |
| @@ -61,6 +61,9 @@ const ( |
| Protocol33 = 33 |
| Protocol34 = 34 |
| Protocol35 = 35 |
| + // 36 is allocated to the dynamic specialists build and is not defined |
| + // here; a peer at 36 is below ProtocolMacEngineering. |
| + Protocol37 = 37 |
| // ProtocolSpend is the first protocol with a fix round's Feedback and |
| // a usage row's Turns; Encode drops both below it. |
| ProtocolSpend = Protocol3 |
| @@ -226,7 +229,16 @@ const ( |
| // report's change_diffs and the change_diff_upload frame. Below it |
| // Encode drops the report's diffs and refuses the upload. |
| ProtocolChangeDiffs = Protocol35 |
| - ProtocolCurrent = ProtocolChangeDiffs |
| + // ProtocolMacEngineering adds Engineering on a Mac worker |
| + // (mac_engineering.go, spec §8): the prepare_base and base frames, |
| + // Engineering transfers, a dispatch's and a report's Xcode access, a |
| + // report's kept session and outcome, publication-bound change files |
| + // and diffs, a pinned question, a worker's Engineering status, F |
| + // probes and connections. Below it Encode refuses the frames, the |
| + // transfers and a publication's diffs and drops the fields |
| + // (downgradeMacEngineering). |
| + ProtocolMacEngineering = Protocol37 |
| + ProtocolCurrent = ProtocolMacEngineering |
| ) |
| // Runner roles. A person's first runner is the primary: the coordinator, |
| @@ -312,6 +324,10 @@ type Capabilities struct { |
| // Reach (ProtocolPlaces): the CARLOS logins and deploy keys this |
| // runner holds, no secret. Withheld until the welcome says 31. |
| Reach *Reach `json:"reach,omitempty"` |
| + // Engineering (ProtocolMacEngineering): a Mac worker's word on |
| + // whether it can take Engineering. Withheld until the welcome says 37, |
| + // with the F probes (WithoutMacEngineering). |
| + Engineering *EngineeringStatus `json:"engineering,omitempty"` |
| } |
| // PreviewHost is a preview host a runner pairs with: its kind (an |
| @@ -330,7 +346,8 @@ const ( |
| var previewHostDomain = regexp.MustCompile(`^[a-z0-9-]+(\.[a-z0-9-]+)+$`) |
| -// Probe is one self-probe's result: its ID (P1 to P7), a verdict and a |
| +// Probe is one self-probe's result: its ID (P1 to P7, or F1 to F7 at |
| +// ProtocolMacEngineering), a verdict and a |
| // short detail in the capability string rules (no path, one line). |
| type Probe struct { |
| ID string `json:"id"` |
| @@ -398,7 +415,7 @@ func ValidCapabilities(c Capabilities) error { |
| } |
| seen := map[string]bool{} |
| for _, p := range c.Probes { |
| - if !slices.Contains(ProbeIDs, p.ID) || seen[p.ID] || !slices.Contains(probeVerdicts, p.Verdict) || (p.Verdict == ProbeDenied && p.ID != "P2") { |
| + if seen[p.ID] || !validProbeVerdict(p.ID, p.Verdict) { |
| return ErrCapabilities |
| } |
| seen[p.ID] = true |
| @@ -412,6 +429,9 @@ func ValidCapabilities(c Capabilities) error { |
| if r := c.Reach; r != nil && !validReach(*r) { |
| return ErrCapabilities |
| } |
| + if e := c.Engineering; e != nil && !validEngineeringStatus(*e) { |
| + return ErrCapabilities |
| + } |
| if err := checkStrings(reflect.ValueOf(c)); err != nil { |
| return err |
| } |
| @@ -545,6 +565,11 @@ type TransferHeader struct { |
| Attempt int64 `json:"attempt"` |
| BaseSHA string `json:"base_sha"` |
| CandidateSHA string `json:"candidate_sha"` |
| + // Protocol 37: Kind is "" (checks, or a worker's outbound commit) or |
| + // TransferKindEngineering; an Engineering rebase round also names the |
| + // base the candidate was made on (OldBaseSHA). Commits and Valid. |
| + Kind string `json:"kind,omitempty"` |
| + OldBaseSHA string `json:"old_base_sha,omitempty"` |
| } |
| // Blob is one chunk of a transfer's pack: Index of Total, SHA256 of the |
| @@ -577,6 +602,9 @@ type PublishCommand struct { |
| BaseSHA string `json:"base_sha"` |
| CandidateSHA string `json:"candidate_sha"` |
| Transfer string `json:"transfer"` |
| + // OutcomePhase (protocol 37) is the worker's outcome, which the |
| + // primary echoes in published. |
| + OutcomePhase string `json:"outcome_phase,omitempty"` |
| } |
| // PublishedReport is the primary's answer to a publish: Pushed, or the |
| @@ -591,6 +619,12 @@ type PublishedReport struct { |
| CandidateSHA string `json:"candidate_sha"` |
| Pushed bool `json:"pushed"` |
| Reason string `json:"reason"` |
| + // Protocol 37: the change files and display diffs the primary computed |
| + // for the pushed candidate (the diffs travel as change_diff uploads |
| + // naming this publication), and the publish command's OutcomePhase. |
| + ChangeFiles *ChangeFiles `json:"change_files,omitempty"` |
| + DiffCollection string `json:"diff_collection,omitempty"` |
| + OutcomePhase string `json:"outcome_phase,omitempty"` |
| } |
| // Refused answers a lease frame (ID) the instance would not grant. |
| @@ -617,6 +651,9 @@ func Speaks(protocol int, kind string) bool { |
| if kind == FrameRequestAccess || kind == FrameAccess { |
| return protocol >= ProtocolAccess |
| } |
| + if macEngineeringOnly[kind] { |
| + return protocol >= ProtocolMacEngineering |
| + } |
| return protocol >= Protocol2 || !protocol2Only[kind] |
| } |
| @@ -658,7 +695,9 @@ var ErrProtocol = errors.New("wire: frame not in this protocol") |
| // (downgradeAssistantFiles); below ProtocolPlaces the places fields are |
| // dropped and their frames refused (downgradePlaces); below |
| // ProtocolChangeDiffs a change_diff upload is refused and a step report's |
| -// change_diffs dropped. |
| +// change_diffs dropped. Below ProtocolMacEngineering the prepare_base and |
| +// base frames, an Engineering transfer and a publication's diff upload |
| +// are refused and slice F's fields dropped (downgradeMacEngineering). |
| func Encode(f Frame, protocol int) (Frame, error) { |
| if protocol >= ProtocolCurrent { |
| return f, nil |
| @@ -680,6 +719,13 @@ func Encode(f Frame, protocol int) (Frame, error) { |
| return Frame{}, ErrProtocol |
| } |
| changed := false |
| + if protocol < ProtocolMacEngineering { |
| + dropped, err := downgradeMacEngineering(body, protocol) |
| + if err != nil { |
| + return Frame{}, err |
| + } |
| + changed = dropped |
| + } |
| if protocol < ProtocolChangeDiffs { |
| switch v := body.(type) { |
| case *ChangeDiffUpload: |
diff --git a/internal/wire/runners_test.go b/internal/wire/runners_test.go| index 00a8ac9b..268a21d4 100644 |
| --- a/internal/wire/runners_test.go |
| +++ b/internal/wire/runners_test.go |
| @@ -413,7 +413,7 @@ func TestEncodeBelowProtocol9DropsPreviews(t *testing.T) { |
| if _, err := wire.Encode(d, wire.ProtocolPreview); err != nil { |
| t.Fatal(err) |
| } |
| - if wire.ProtocolCurrent != wire.ProtocolChangeDiffs || wire.ProtocolChangeDiffs != 35 || wire.ProtocolPlaces != 34 || wire.ProtocolAssistantFiles != 33 || wire.ProtocolStuckTasks != 30 || wire.ProtocolPinnedRelease != 29 || wire.ProtocolInjectionDefences != 28 || wire.ProtocolWarm != 24 || wire.ProtocolGlance != 23 || wire.ProtocolJobs != 22 || wire.ProtocolCopy != 21 || wire.ProtocolUsageRefresh != 20 || wire.ProtocolAssistant != 19 || wire.ProtocolModels != 18 || wire.ProtocolOpenCode != 17 || wire.ProtocolPublish != 16 || wire.ProtocolReadings != 15 || wire.ProtocolScheduler != 14 || wire.ProtocolResearch != 13 || wire.ProtocolMetered != 12 || wire.ProtocolPreviewHost != 11 || wire.ProtocolExplore != 10 || wire.ProtocolPreview != 9 { |
| + if wire.ProtocolCurrent != wire.ProtocolMacEngineering || wire.ProtocolMacEngineering != 37 || wire.ProtocolChangeDiffs != 35 || wire.ProtocolPlaces != 34 || wire.ProtocolAssistantFiles != 33 || wire.ProtocolStuckTasks != 30 || wire.ProtocolPinnedRelease != 29 || wire.ProtocolInjectionDefences != 28 || wire.ProtocolWarm != 24 || wire.ProtocolGlance != 23 || wire.ProtocolJobs != 22 || wire.ProtocolCopy != 21 || wire.ProtocolUsageRefresh != 20 || wire.ProtocolAssistant != 19 || wire.ProtocolModels != 18 || wire.ProtocolOpenCode != 17 || wire.ProtocolPublish != 16 || wire.ProtocolReadings != 15 || wire.ProtocolScheduler != 14 || wire.ProtocolResearch != 13 || wire.ProtocolMetered != 12 || wire.ProtocolPreviewHost != 11 || wire.ProtocolExplore != 10 || wire.ProtocolPreview != 9 { |
| t.Fatalf("current %d", wire.ProtocolCurrent) |
| } |
| } |
diff --git a/internal/wire/schedule_test.go b/internal/wire/schedule_test.go| index 1c3832e2..68f5fbbd 100644 |
| --- a/internal/wire/schedule_test.go |
| +++ b/internal/wire/schedule_test.go |
| @@ -17,7 +17,7 @@ import ( |
| // refused anything that spends, never handed it), and a dispatch loses |
| // its priority, deadline and release; what 13 already had is unchanged. |
| func TestEncodeBelowProtocol14DropsScheduler(t *testing.T) { |
| - if wire.ProtocolScheduler != wire.Protocol14 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolScheduler != wire.Protocol14 || wire.ProtocolCurrent != wire.ProtocolMacEngineering { |
| t.Fatalf("scheduler %d, current %d", wire.ProtocolScheduler, wire.ProtocolCurrent) |
| } |
| by := time.Date(2026, 11, 20, 17, 0, 0, 0, time.UTC) |
diff --git a/internal/wire/stuck_test.go b/internal/wire/stuck_test.go| index b0790c7f..47a07aa9 100644 |
| --- a/internal/wire/stuck_test.go |
| +++ b/internal/wire/stuck_test.go |
| @@ -14,7 +14,7 @@ import ( |
| // Stuck tasks (protocol 30): a hello's tool health is a fixed state per |
| // pinned tool, never a path, and an older instance never hears it. |
| func TestProtocol30ToolHealth(t *testing.T) { |
| - if wire.ProtocolStuckTasks != wire.Protocol30 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs || wire.Spoken(99) != 35 { |
| + if wire.ProtocolStuckTasks != wire.Protocol30 || wire.ProtocolCurrent != wire.ProtocolMacEngineering || wire.Spoken(99) != 37 { |
| t.Fatalf("stuck %d, current %d", wire.ProtocolStuckTasks, wire.ProtocolCurrent) |
| } |
| caps := func(h *wire.ToolHealth) wire.Capabilities { |
diff --git a/internal/wire/tasks.go b/internal/wire/tasks.go| index 6921efb5..69b7a68d 100644 |
| --- a/internal/wire/tasks.go |
| +++ b/internal/wire/tasks.go |
| @@ -763,6 +763,9 @@ type DispatchCommand struct { |
| // publish; CandidateSHA the merged commit). Encode refuses a publish |
| // dispatch below 16. |
| Publish *PublishDispatch `json:"publish,omitempty"` |
| + // Protocol 37: XcodeAccess (XcodeAccessSandboxed or "") gives a Mac |
| + // worker's Engineering the Mach services Xcode needs. |
| + XcodeAccess string `json:"xcode_access,omitempty"` |
| } |
| // WatchMergeCommand watches a task's branch for its candidate landing on |
| @@ -883,6 +886,13 @@ type StepReport struct { |
| // Protocol 16. Publish is a publish step's export and, once done, its |
| // outcome. |
| Publish *PublishResult `json:"publish,omitempty"` |
| + // Protocol 37. XcodeAccess echoes what Engineering ran with; |
| + // SessionID names the kept Engineering session (from any runner); |
| + // OutcomePhase is what the commit is (OutcomeCommitted, |
| + // OutcomeUnfinished, OutcomeNoShell), apart from Phase. |
| + XcodeAccess string `json:"xcode_access,omitempty"` |
| + SessionID string `json:"session_id,omitempty"` |
| + OutcomePhase string `json:"outcome_phase,omitempty"` |
| } |
| // ReasonRunnerOutdated settles a preview step whose primary connected |
diff --git a/internal/wire/usage_test.go b/internal/wire/usage_test.go| index 2ef4ad2e..2dbcd016 100644 |
| --- a/internal/wire/usage_test.go |
| +++ b/internal/wire/usage_test.go |
| @@ -44,7 +44,7 @@ func headrooms(t *testing.T, raw []byte) []map[string]json.RawMessage { |
| // decodes strictly against the frozen protocol 14 headroom, and the |
| // caller's own values are untouched; at 15 nothing changes. |
| func TestEncodeBelowProtocol15DropsReadingTimes(t *testing.T) { |
| - if wire.ProtocolReadings != wire.Protocol15 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs { |
| + if wire.ProtocolReadings != wire.Protocol15 || wire.ProtocolCurrent != wire.ProtocolMacEngineering { |
| t.Fatalf("readings %d, current %d", wire.ProtocolReadings, wire.ProtocolCurrent) |
| } |
| at := time.Date(2026, 11, 12, 9, 58, 0, 0, time.UTC) |
diff --git a/internal/wire/warm_test.go b/internal/wire/warm_test.go| index 1801da18..708d68a0 100644 |
| --- a/internal/wire/warm_test.go |
| +++ b/internal/wire/warm_test.go |
| @@ -13,7 +13,7 @@ import ( |
| // other (durable, acked), and Encode refuses it below 24: an older |
| // runner's strict decoder would close the stream on it. |
| func TestEncodeWarmBelow24(t *testing.T) { |
| - if wire.ProtocolWarm != 24 || wire.ProtocolCurrent != wire.ProtocolChangeDiffs || wire.Spoken(99) != 35 { |
| + if wire.ProtocolWarm != 24 || wire.ProtocolCurrent != wire.ProtocolMacEngineering || wire.Spoken(99) != 37 { |
| t.Fatalf("protocols %d %d", wire.ProtocolWarm, wire.ProtocolCurrent) |
| } |
| f, err := wire.NewFrame("c1", wire.FrameWarm, wire.WarmCommand{Person: "ana@example.com"}) |
diff --git a/internal/wire/wire_test.go b/internal/wire/wire_test.go| index dda9d39a..e2bd12be 100644 |
| --- a/internal/wire/wire_test.go |
| +++ b/internal/wire/wire_test.go |
| @@ -33,7 +33,7 @@ func TestFrameFixturesRoundTrip(t *testing.T) { |
| t.Fatalf("%s: round trip\n got %s\nwant %s", name, out, raw) |
| } |
| } |
| - for _, kind := range []string{wire.FrameWelcome, wire.FrameMessage, wire.FrameAttachment, wire.FrameCancel, wire.FrameDrain, wire.FrameAck, wire.FrameHello, wire.FrameSync, wire.FrameDelta, wire.FrameReply, wire.FrameTurn, wire.FrameLease, wire.FrameToolCall, wire.FrameToolResult, wire.FrameActivity, wire.FrameMoveIn, wire.FrameNotebook, wire.FrameReset, wire.FrameDispatch, wire.FrameCancelStep, wire.FrameStep, wire.FrameRecheck, wire.FrameWatchMerge, wire.FrameMerged, wire.FrameAsk, wire.FrameCancelAsk, wire.FrameAnswer, wire.FrameForgetTask, wire.FrameBranch, wire.FrameConnect, wire.FrameCancelConnect, wire.FrameConnection, wire.FrameUsage, wire.FrameDisconnect, wire.FrameStepActivity, wire.FramePreference, wire.FrameBlob, wire.FrameSendPack, wire.FramePublish, wire.FramePublished, wire.FrameRefused, wire.FrameModel, wire.FrameBudget, wire.FrameResumeSpend} { |
| + for _, kind := range []string{wire.FrameWelcome, wire.FrameMessage, wire.FrameAttachment, wire.FrameCancel, wire.FrameDrain, wire.FrameAck, wire.FrameHello, wire.FrameSync, wire.FrameDelta, wire.FrameReply, wire.FrameTurn, wire.FrameLease, wire.FrameToolCall, wire.FrameToolResult, wire.FrameActivity, wire.FrameMoveIn, wire.FrameNotebook, wire.FrameReset, wire.FrameDispatch, wire.FrameCancelStep, wire.FrameStep, wire.FrameRecheck, wire.FrameWatchMerge, wire.FrameMerged, wire.FrameAsk, wire.FrameCancelAsk, wire.FrameAnswer, wire.FrameForgetTask, wire.FrameBranch, wire.FrameConnect, wire.FrameCancelConnect, wire.FrameConnection, wire.FrameUsage, wire.FrameDisconnect, wire.FrameStepActivity, wire.FramePreference, wire.FrameBlob, wire.FrameSendPack, wire.FramePublish, wire.FramePublished, wire.FrameRefused, wire.FrameModel, wire.FrameBudget, wire.FrameResumeSpend, wire.FramePrepareBase, wire.FrameBase} { |
| if !seen[kind] { |
| t.Fatalf("no fixture for frame %s", kind) |
| } |
diff --git a/internal/wire/wiretest/testdata/frames/ask-pinned.json b/internal/wire/wiretest/testdata/frames/ask-pinned.json| new file mode 100644 |
| index 00000000..8a6806ea |
| --- /dev/null |
| +++ b/internal/wire/wiretest/testdata/frames/ask-pinned.json |
| @@ -0,0 +1 @@ |
| +{"id":"c33","type":"ask","data":{"person":"owner@example.com","task_id":"tk0001","step_id":"s_0001","question_id":"q_0002","attempt":1,"specialist":"engineering","repo":"amadan.net/oficina/sample","branch":"equipo/tk0001-swipe-back-from-the-edge-does-nothing","base_sha":"1111111111111111111111111111111111111111","candidate_sha":"2222222222222222222222222222222222222222","title":"Swipe back from the edge does nothing","text":"What did you change and why?","eng_attempt":2,"eng_account":"claude-mac-1","eng_session":"0b6c2f1e-6a4d-4c1b-9f3e-2d7a8b9c0d1e"}} |
diff --git a/internal/wire/wiretest/testdata/frames/base.json b/internal/wire/wiretest/testdata/frames/base.json| new file mode 100644 |
| index 00000000..c8b94f15 |
| --- /dev/null |
| +++ b/internal/wire/wiretest/testdata/frames/base.json |
| @@ -0,0 +1 @@ |
| +{"id":"r-base","type":"base","data":{"task_id":"tk0001","step_id":"s_0001","attempt":2,"base_sha":"3333333333333333333333333333333333333333","reason":""}} |
diff --git a/internal/wire/wiretest/testdata/frames/blob-engineering.json b/internal/wire/wiretest/testdata/frames/blob-engineering.json| new file mode 100644 |
| index 00000000..c556eefa |
| --- /dev/null |
| +++ b/internal/wire/wiretest/testdata/frames/blob-engineering.json |
| @@ -0,0 +1 @@ |
| +{"id":"c32","type":"blob","data":{"transfer":{"id":"tr_0003","direction":"inbound","repo":"amadan.net/oficina/sample","task_id":"tk0001","step_id":"s_0001","attempt":2,"base_sha":"3333333333333333333333333333333333333333","candidate_sha":"2222222222222222222222222222222222222222","kind":"engineering","old_base_sha":"1111111111111111111111111111111111111111"},"index":0,"total":1,"sha256":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08","data":"UEFDSwAAAAIAAAAA"}} |
diff --git a/internal/wire/wiretest/testdata/frames/dispatch-mac-engineering.json b/internal/wire/wiretest/testdata/frames/dispatch-mac-engineering.json| new file mode 100644 |
| index 00000000..4992b490 |
| --- /dev/null |
| +++ b/internal/wire/wiretest/testdata/frames/dispatch-mac-engineering.json |
| @@ -0,0 +1 @@ |
| +{"id":"c31","type":"dispatch","data":{"person":"owner@example.com","task_id":"tk0001","step_id":"s_0001","attempt":1,"specialist":"engineering","repo":"amadan.net/oficina/sample","branch":"equipo/tk0001-swipe-back-from-the-edge-does-nothing","base_sha":"1111111111111111111111111111111111111111","title":"Swipe back from the edge does nothing","brief":"Swiping from the left edge should go back a pane.","findings":[],"candidate_sha":"","republish":false,"from_attempt":0,"avoid_account":"","round":0,"rebase":false,"from_base":"","needs":["macos","xcode","ios_simulator","claude"],"runner_id":"RUNNER2","xcode_access":"sandboxed"}} |
diff --git a/internal/wire/wiretest/testdata/frames/hello-worker-conns.json b/internal/wire/wiretest/testdata/frames/hello-worker-conns.json| new file mode 100644 |
| index 00000000..c7738bc8 |
| --- /dev/null |
| +++ b/internal/wire/wiretest/testdata/frames/hello-worker-conns.json |
| @@ -0,0 +1 @@ |
| +{"id":"r-hello-worker-conns","type":"hello","data":{"generation":4,"repos":[],"create_in":[],"home":"","agent":"","catalog":[],"connections":[{"local_id":"claude-mac-1","person":"owner@example.com","provider":"claude","kind":"token","label":"owner@example.com","state":"healthy","plan":"max","headroom":null}],"versions":{"claude":"2.1.312","runner":"5eae410"},"seal_key":"MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY=","protocol":37,"platform":{"os":"darwin","arch":"arm64"},"label":"Tito Studio","sandbox":"seatbelt","capabilities":{"xcode":{"version":"27.2","build":"27B52"},"simulators":[{"name":"iPhone 18 Pro","runtime":"iOS 27.2","udid":"5C0A1E2B-3D4F-4A5B-9C6D-7E8F90A1B2C3","state":"Shutdown"}],"toolchains":{"go":"go1.26.10","swift":"6.3","node":"v22.12.0"},"harness":{"claude":"2.1.312","codex":"","srt":"0.0.81"},"tags":["macos","xcode","ios_simulator","claude"],"probes":[{"id":"P1","verdict":"passed","detail":"Xcode 27.2 (27B52); 2 iOS runtimes; Tito Studio"},{"id":"P2","verdict":"denied","detail":"every hostile attempt denied; xcodebuild ran in srt"},{"id":"P3","verdict":"skipped","detail":"superseded by token connections"},{"id":"P4","verdict":"passed","detail":"no other home readable; agent loaded; sleep off"},{"id":"P5","verdict":"skipped","detail":"Codex on the Mac is parked (slice G)"},{"id":"P6","verdict":"passed","detail":"group gone in 2s; tree removed"},{"id":"P7","verdict":"passed","detail":"srt 0.0.81; node v22.12.0; rg 14.1.1"},{"id":"F1","verdict":"denied","detail":"control seen; listener saw nothing"},{"id":"F2","verdict":"denied","detail":"no nonce reached the probe tree"},{"id":"F3","verdict":"denied","detail":"no source yielded the token value"},{"id":"F4","verdict":"passed","detail":"setsid child ended by the sweep"},{"id":"F5","verdict":"denied","detail":"hostile fixture denied; build and test completed"},{"id":"F6","verdict":"denied","detail":"every tool call refused; swap race 50 of 50"},{"id":"F7","verdict":"denied","detail":"Xcode unreachable inside; control reached it outside"}],"engineering":{"state":"ready","reason":""}}}} |
diff --git a/internal/wire/wiretest/testdata/frames/prepare-base.json b/internal/wire/wiretest/testdata/frames/prepare-base.json| new file mode 100644 |
| index 00000000..dc490445 |
| --- /dev/null |
| +++ b/internal/wire/wiretest/testdata/frames/prepare-base.json |
| @@ -0,0 +1 @@ |
| +{"id":"c30","type":"prepare_base","data":{"task_id":"tk0001","step_id":"s_0001","attempt":2,"repo":"amadan.net/oficina/sample","rebase":true,"from_base":"1111111111111111111111111111111111111111","candidate_sha":"2222222222222222222222222222222222222222"}} |
diff --git a/internal/wire/wiretest/testdata/frames/published-change-files.json b/internal/wire/wiretest/testdata/frames/published-change-files.json| new file mode 100644 |
| index 00000000..85a4bf76 |
| --- /dev/null |
| +++ b/internal/wire/wiretest/testdata/frames/published-change-files.json |
| @@ -0,0 +1 @@ |
| +{"id":"r-published-files","type":"published","data":{"publication":"pb_0002","task_id":"tk0001","step_id":"s_0001","attempt":1,"candidate_sha":"2222222222222222222222222222222222222222","pushed":true,"reason":"","change_files":{"base":"1111111111111111111111111111111111111111","sha":"2222222222222222222222222222222222222222","files":1,"additions":3,"deletions":1,"binary":0,"entries":[{"path":"Woodstar/EdgeSwipe.swift","status":"modified","additions":3,"deletions":1,"binary":false}],"truncated":false},"diff_collection":"5d41402abc4b2a76b9719d911017c592ae2c4f4a7b1f2e2f9a1c3e5d7f9b1c3e","outcome_phase":"unfinished"}} |
diff --git a/internal/wire/wiretest/testdata/frames/step-mac-engineering.json b/internal/wire/wiretest/testdata/frames/step-mac-engineering.json| new file mode 100644 |
| index 00000000..0c6bdc2d |
| --- /dev/null |
| +++ b/internal/wire/wiretest/testdata/frames/step-mac-engineering.json |
| @@ -0,0 +1 @@ |
| +{"id":"r-step-mac-eng","type":"step","data":{"task_id":"tk0001","step_id":"s_0001","attempt":1,"state":"running","reason":"","base_sha":"1111111111111111111111111111111111111111","candidate_sha":"2222222222222222222222222222222222222222","pushed":false,"termination":false,"summary":"Swipe from the left edge now pops the pane.","headline":"Fixed swipe-back from the edge.","log_tail":"","family":"claude","account":"claude-mac-1","verdict":"","review_label":"","findings":[],"checks":"","gate":"","exit_code":null,"output":"","askable":true,"merge_sha":"","into":"","strategy":"","usage":null,"switched":null,"termination_kind":"process_group","have":["2222222222222222222222222222222222222222"],"phase":"committed","apple":true,"xcode_access":"sandboxed","session_id":"0b6c2f1e-6a4d-4c1b-9f3e-2d7a8b9c0d1e","outcome_phase":"committed"}} |