Merge main into preview pass and retain detail-only file facts
75 files changed,
+5,477
−95
.rastrillo/budgets.txt+6 −6docs/api/equipo-v1.openapi.json+103 −0docs/superpowers/plans/CONTROLLER-REPORT-changes-facts.md+286 −0docs/superpowers/plans/CONTROLLER-REPORT-native-needs-you.md+47 −0docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+2 −0docs/superpowers/plans/CONTROLLER-REPORT-preview-pass.md+20 −4internal/equipo/chat/change_files.go+31 −0internal/equipo/chat/change_files_exposure_test.go+96 −0internal/equipo/chat/change_files_test.go+67 −0internal/equipo/chat/handoff.go+62 −4internal/equipo/chat/handoff_test.go+26 −1internal/equipo/chat/http.go+1 −1internal/equipo/chat/jobs.go+13 −4internal/equipo/chat/tasks.go+36 −5internal/equipo/chat/tools.go+11 −1internal/equipo/copy.go+9 −0internal/equipo/mergegate/presentation_regression_test.go+63 −0internal/equipo/mergegate/testdata/presentation-gate.json+2,696 −0internal/equipo/migrations/0108_change_files.sql+2 −0internal/equipo/migrations/{0108_preview_passes.sql => 0109_preview_passes.sql}+0 −0internal/equipo/migrations/schema.sql+3 −0internal/equipo/templates/work_parts.html+1 −1internal/equipo/work_views.go+6 −0internal/equipo/work_views_test.go+44 −0internal/plan3test/plan3_release_test.go+4 −1internal/runner/thin/change_files.go+97 −0internal/runner/thin/change_files_test.go+198 −0internal/runner/thin/engineer.go+3 −0internal/runner/thin/sandbox_masks_test.go+4 −0internal/thintest/assistant_job_state_contract_test.go+26 −0internal/thintest/assistant_team_contract_test.go+46 −0internal/thintest/change_files_contract_test.go+72 −0internal/wire/assistant_test.go+1 −1internal/wire/change_files.go+98 −0internal/wire/change_files_test.go+117 −0internal/wire/connections_test.go+2 −1internal/wire/injection_test.go+2 −2internal/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/publish_test.go+1 −1internal/wire/runners.go+10 −1internal/wire/runners_test.go+1 −1internal/wire/schedule_test.go+1 −1internal/wire/stuck_test.go+1 −1internal/wire/tasks.go+18 −14internal/wire/testdata/change-paths.json+102 −0internal/wire/usage_test.go+1 −1internal/wire/warm_test.go+1 −1internal/wire/wireschema/wireschema.go+11 −0internal/wire/wireschema/wireschema_test.go+1 −0native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings+138 −0native/apple/Sources/EquipoKit/API/ChangeFiles.swift+95 −0native/apple/Sources/EquipoKit/API/Thin.swift+1 −0native/apple/Sources/EquipoKit/Presentation/ChangedFiles.swift+47 −0native/apple/Sources/EquipoKit/Presentation/NeedsRowModel.swift+10 −4native/apple/Sources/EquipoKit/Presentation/ResumeAction.swift+15 −2native/apple/Sources/EquipoKit/Presentation/TaskDetailModel.swift+3 −2native/apple/Sources/EquipoKit/Preview/PreviewBrowser.swift+1 −1native/apple/Sources/EquipoKit/Preview/PreviewFixture.swift+4 −13native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings+138 −0native/apple/Sources/EquipoKit/Session/EquipoSession.swift+2 −2native/apple/Sources/EquipoKit/UI/Screens/ChangedFilesList.swift+65 −0native/apple/Sources/EquipoKit/UI/Screens/NeedsScreen.swift+3 −3native/apple/Sources/EquipoKit/UI/Screens/TaskDetailScreen.swift+14 −1native/apple/Sources/EquipoKit/UI/TaskViewFixture.swift+32 −4native/apple/Tests/EquipoKitTests/ChangeFilesTests.swift+151 −0native/apple/Tests/EquipoKitTests/Fixtures/task-detail/full.json+27 −1native/apple/Tests/EquipoKitTests/NeedsFollowupTests.swift+178 −0native/apple/Tests/EquipoKitTests/NeedsRowModelTests.swift+5 −4native/ios/UITests/TaskViewUITests.swift+18 −0native/scripts/check-strings.py+15 −1native/scripts/plurals.json+50 −0native/scripts/strings.json+12 −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/preview__pass: Type Size Avail | ext4 96G 86G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type Size Avail | ext4 96G 86G
ci-box: bwrap: fetched and verified in 0.3s
ci-box: claude: fetched and verified in 1.3s
ci-box: codex: fetched and verified in 3.5s
ci-box: codex-code-mode-host: fetched and verified in 1.4s
ci-box: libwrap: fetched and verified in 0.3s
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.3s
ci-box: opencode: installed and verified in 2.2s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 9.3s
ci-box: clone deepened in 4.3s
ci-box: file times set from content: 3107 files, 200 directories
ci-box: ready in 17.7s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
ok amadan.net/oficina/equipo/internal/equipotest 0.143s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
4.4s
+ go list -export -test -tags testbuild -f ./...
4.9s
+ go list -export -test -tags browser,testbuild -f ./internal/equipo ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
3.2s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-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 1m16.656s 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.145s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m15.14s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 63.80, cpu waiting 40.41%, memory waiting 0.00%, io waiting 0.80%
--- 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 1m16.702s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m14.777s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m14.78s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 63.80, cpu waiting 40.41%, memory waiting 0.00%, io waiting 0.80%
--- 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 1m17.601s 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.755s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m6.02s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.34s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.4s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 63.80, cpu waiting 40.41%, memory waiting 0.00%, io waiting 0.80%
--- 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 1m15.381s 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.643s amadan.net/oficina/equipo/internal/headless
receipt: slow test 35.74s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 20.4s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 8.99s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
receipt: slow test 8.52s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
machine: 32 CPUs, load 63.80, cpu waiting 40.22%, memory waiting 0.00%, io waiting 0.82%
--- 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 1m33.225s 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.357s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m2.34s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.18s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.08s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 6.96s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.8s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 62.94, cpu waiting 40.16%, memory waiting 0.00%, io waiting 0.61%
--- 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 2m50.891s 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 2m49.153s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m35.25s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 18.08s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 17.65s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 6.6s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
receipt: slow test 6.47s amadan.net/oficina/equipo/internal/headless TestHeadlessBatchAfterRefusedReply
machine: 32 CPUs, load 22.81, cpu waiting 12.19%, memory waiting 0.00%, io waiting 0.16%
--- 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 2m12.465s 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 2m10.262s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.76s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.74s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 5.23s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 3.91s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 3.73s amadan.net/oficina/equipo/internal/thintest TestContractTeamUpdatePersonNeeds
machine: 32 CPUs, load 40.07, cpu waiting 22.94%, memory waiting 0.00%, io waiting 0.31%
--- 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
--- FAIL amadan.net/oficina/equipo/internal/thintest TestContractRetryAccountActions
=== RUN TestContractRetryAccountActions
retry_contract_test.go:296: sign in again
--- FAIL: TestContractRetryAccountActions (0.20s)
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/thintest (package output)
FAIL
rastrillo-budget/v1 ran 1m38.25s
FAIL amadan.net/oficina/equipo/internal/thintest 98.458s
receipt: test step 1m39.82s 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 1m38.25s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.08s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5.02s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.53s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 3.02s amadan.net/oficina/equipo/internal/thintest TestContractPausedJob
receipt: slow test 2.39s amadan.net/oficina/equipo/internal/thintest TestContractRetryFailedPreviewAfterMerge
exit status 1
+ go 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)' -v -run '^TestContractRetryAccountActions$' -count=1 ./internal/thintest (retry, once)
##############################################################################
FLAKE ./internal/thintest:TestContractRetryAccountActions thintest-contract f149ba6098f89097440b5621c9f3d2ccf1d680fd 0.20s 58.13
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 58.13, cpu waiting 36.79%, memory waiting 0.00%, io waiting 0.51%
--- 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 4m48.855s, over the 45s its record on line 44 allows; reported only, timing fails on CI
receipt: test step 4m54.331s 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 4m48.855s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 37.04s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 37.02s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.83s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.5s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.9s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 3.77, cpu waiting 1.54%, memory waiting 0.00%, io waiting 0.01%
--- shard 9 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane runner-bug: ./internal/runner
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestDirectBugWorkflow$|^TestEnrolKeepsTheRole$' ./internal/runner
receipt: test step 50.747s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 49.764s amadan.net/oficina/equipo/internal/runner
receipt: slow test 29.73s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 49.48, cpu waiting 33.12%, memory waiting 0.00%, io waiting 1.23%
--- 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 1m1.265s 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 1m0.095s amadan.net/oficina/equipo/internal/runner
receipt: slow test 50.08s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 45.2s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.42s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.58s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 61.00, cpu waiting 38.66%, memory waiting 0.00%, io waiting 1.04%
--- 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.48s 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.355s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.13s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.56s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.13s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.71s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestReportPostsRetryExactRequest
machine: 32 CPUs, load 30.47, cpu waiting 22.34%, memory waiting 0.00%, io waiting 1.56%
--- 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.8%, load 19.98
test lane equipotest-a: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[A-D]|^TestQ' ./internal/equipotest
receipt: test step 1m8.436s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m6.515s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 28.07s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 28.03s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 25.87s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 23.18s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 23.16s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelDuplicates
machine: 32 CPUs, load 58.13, cpu waiting 38.57%, memory waiting 0.00%, io waiting 0.55%
--- shard 13 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-e started 30s late; cpu waiting 40.8%, load 19.98
test lane equipotest-e: ./internal/equipotest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^Test[E-P]' ./internal/equipotest
receipt: test step 1m18.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 1m16.822s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 20.32s amadan.net/oficina/equipo/internal/equipotest TestProjectsFailuresRollBack
receipt: slow test 20.3s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 20.29s amadan.net/oficina/equipo/internal/equipotest TestProjectBindingUniqueness
receipt: slow test 20.26s amadan.net/oficina/equipo/internal/equipotest TestProjectRequestActorAndUpdate
receipt: slow test 20.2s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
machine: 32 CPUs, load 51.53, cpu waiting 33.55%, memory waiting 0.00%, io waiting 0.46%
--- 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 41.6%, load 19.98
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 1m15.403s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m10.4s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 15.91s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.61s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.47s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 10.47s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 7.45s amadan.net/oficina/equipo/internal/equipotest TestRosterAuditFailureRollsBack
machine: 32 CPUs, load 55.23, cpu waiting 35.72%, memory waiting 0.00%, io waiting 0.50%
--- 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.8%, load 19.98
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 1m8.705s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m6.964s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 25.06s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 25.01s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 24.96s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 23.01s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsRollbackAndUnavailable
receipt: slow test 22.98s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsConcurrentRevision
machine: 32 CPUs, load 58.13, cpu waiting 38.57%, memory waiting 0.00%, io waiting 0.55%
--- 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.8%, load 19.98
test lane plan3test: ./internal/plan3test
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./internal/plan3test
receipt: test step 54.744s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 52.814s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.78s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.56s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.78s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.63s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.31s amadan.net/oficina/equipo/internal/plan3test TestOnboardingAccountMigration
machine: 32 CPUs, load 63.37, cpu waiting 40.02%, memory waiting 0.00%, io waiting 0.69%
--- 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.8%, load 19.98
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/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/runnerproto: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/workspace: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/runner/containment: its inputs changed
--- FAIL amadan.net/oficina/equipo/internal/equipo TestAPIErrorCopyKeys
=== RUN TestAPIErrorCopyKeys
api_copy_test.go:20: unresolved API error expression at ../equipo/preview_pass_http.go:85:39
--- FAIL: TestAPIErrorCopyKeys (2.17s)
--- FAIL amadan.net/oficina/equipo/internal/equipo (package output)
FAIL
rastrillo-budget/v1 ran 1m40.811s
FAIL amadan.net/oficina/equipo/internal/equipo 101.627s
--- FAIL amadan.net/oficina/equipo/internal/runner/webread TestTimeouts
=== RUN TestTimeouts
fetch_test.go:537: s1: {Source:s1 Origin:paul Parent: URL:https://shop.example.com/slow-body Hops:[{URL:https://shop.example.com/slow-body Address:151.101.1.1 Status:200}] Address:151.101.1.1 Status:200 Type:text/plain Bytes:5 SHA256:2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 Millis:307 Reason: File:s001.txt}
--- FAIL: TestTimeouts (0.63s)
--- FAIL amadan.net/oficina/equipo/internal/runner/webread (package output)
FAIL
rastrillo-budget/v1 ran 2.88s
FAIL amadan.net/oficina/equipo/internal/runner/webread 2.914s
budget note: internal/equipo/chat took 24.074s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 1m55.784s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 23.057s, over the 10s the default allows (measured on the run this cached result came from); reported only, timing fails on CI
budget note: internal/runner/containment took 46.512s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 13.788s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/provider/pi took 1m18.085s, over the 1m0s its record on line 27 allows; reported only, timing fails on CI
budget note: internal/runner/workspace took 11.195s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 2m3.671s against a 60s target (the gate's other steps are not in this figure)
receipt: 34 packages ran, 30 cached, 17 without tests, 2 failed
receipt: slow package 1m55.784s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m40.811s amadan.net/oficina/equipo/internal/equipo
receipt: slow package 1m18.085s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 1m5.19s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 54.829s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow test 54.02s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 46.21s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 45.86s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
receipt: slow test 44.95s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
receipt: slow test 44.26s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestAPIErrorCopyKeys$' -count=1 ./internal/equipo (retry, once)
FAILED TWICE ./internal/equipo:TestAPIErrorCopyKeys rest
=== RUN TestAPIErrorCopyKeys
api_copy_test.go:20: unresolved API error expression at ../equipo/preview_pass_http.go:85:39
--- FAIL: TestAPIErrorCopyKeys (0.76s)
FAIL
rastrillo-budget/v1 ran 764ms
FAIL amadan.net/oficina/equipo/internal/equipo 0.922s
FAIL
+ go test -tags testbuild -timeout 15m -v -run '^TestTimeouts$' -count=1 ./internal/runner/webread (retry, once)
##############################################################################
FLAKE ./internal/runner/webread:TestTimeouts rest f149ba6098f89097440b5621c9f3d2ccf1d680fd 0.63s 28.66
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 28.66, cpu waiting 14.88%, memory waiting 0.00%, io waiting 0.19%
make: *** [Makefile:113: ci-shard] Error 1
amadan: step check shard 17 of 29 failed: exit status 2
--- shard 18 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-chat: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$' ./internal/headless
receipt: test step 1m24.697s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m23.019s amadan.net/oficina/equipo/internal/headless
receipt: slow test 38.35s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.69s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.38s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.3s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.28s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 63.37, cpu waiting 39.75%, memory waiting 0.00%, io waiting 0.67%
--- 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 1m30.75s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m28.989s amadan.net/oficina/equipo/internal/headless
receipt: slow test 27.35s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 21.1s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 13s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 10s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
receipt: slow test 9.15s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
machine: 32 CPUs, load 62.94, cpu waiting 40.16%, memory waiting 0.00%, io waiting 0.61%
--- shard 20 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-connections: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
receipt: test step 1m52.743s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m51.156s amadan.net/oficina/equipo/internal/headless
receipt: slow test 13.87s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.34s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.32s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.35s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
receipt: slow test 11.33s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
machine: 32 CPUs, load 48.44, cpu waiting 30.46%, memory waiting 0.00%, io waiting 0.42%
--- shard 21 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-headless-rest: ./internal/headless
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' ./internal/headless
--- FAIL amadan.net/oficina/equipo/internal/headless TestBrowserCopyContinue
=== RUN TestBrowserCopyContinue
time=2026-11-26T12:29:29.758Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-26T12:29:29.758Z level=INFO msg="startup phase done" phase=state_lock took=149µs
time=2026-11-26T12:29:29.758Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-26T12:29:29.758Z level=INFO msg="startup phase done" phase=claim_roots took=122µs
time=2026-11-26T12:29:29.758Z level=INFO msg="startup phase" phase=sweep
time=2026-11-26T12:29:29.816Z level=INFO msg="startup phase done" phase=sweep took=58.112ms
time=2026-11-26T12:29:29.816Z level=INFO msg="startup phase" phase=credentials
rastrillo: budget test: go test failed
time=2026-11-26T12:29:29.816Z level=INFO msg="startup phase done" phase=credentials took=162µs
time=2026-11-26T12:29:29.816Z level=INFO msg="startup phase" phase=open_state
time=2026-11-26T12:29:29.884Z level=INFO msg="startup phase done" phase=open_state took=67.955ms
time=2026-11-26T12:29:29.885Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-26T12:29:29.887Z level=INFO msg=connecting host=127.0.0.1:42273 protocol=31
time=2026-11-26T12:29:29.890Z level=INFO msg=connected host=127.0.0.1:42273 took=1.18ms
time=2026-11-26T12:29:29.890Z level=INFO msg="capabilities gathering"
time=2026-11-26T12:29:29.892Z level=INFO msg="capabilities gathered" took=1.799ms tags=linux,claude,go
time=2026-11-26T12:29:29.895Z level=INFO msg="hello sent" protocol=31
time=2026-11-26T12:29:29.900Z level=INFO msg=welcome protocol=31 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.46s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m32.708s
FAIL amadan.net/oficina/equipo/internal/headless 92.897s
receipt: test step 1m34.165s 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 1m32.708s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.92s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.28s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 10.57s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 9.41s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.42s amadan.net/oficina/equipo/internal/headless TestBrowserNotebookLook
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|TestBrowserConnectionsSignInEmail|TestBrowserConnectionsSignInSwitch|TestBrowserConnectionsToken|TestBrowserCopyContinue|TestBrowserCopySettingAndFlag|TestBrowserDraftIsTheMessage|TestBrowserDraftStreamsFormatted|TestBrowserEmptyExplore|TestBrowserMoveIn|TestBrowserNotebook|TestBrowserNotebookLook|TestBrowserPasteBox|TestBrowserPasteBoxLook|TestBrowserPasteCopiesItsBox|TestBrowserRailFollowsWork|TestBrowserReceiptFollowsReview|TestBrowserReceiptsDesktop|TestBrowserReceiptsTouch|TestBrowserRefreshRace|TestBrowserStalePageReloads|TestBrowserTaskCard|TestBrowserTaskThread|TestBrowserThinkingAndCards|TestBrowserUsageAndAdvice|TestBrowserWaitingTurns|TestNotebookScreenshots)$' -skip '^TestBrowserChat$|^TestBrowserChatSendStaysOnPage$|^TestBrowserComposer$|^TestBrowserComposerReconcile$|^TestBrowserComposerFocus$|^TestBrowserComposerDock$|^TestBrowserDraftStreamsFormatted$|^TestBrowserDraftIsTheMessage$|^TestBrowserTaskCard$|^TestBrowserReceiptFollowsReview$|^TestBrowserRailFollowsWork$|^TestBrowserTaskThread$|^TestBrowserAskAfterMerge$|^TestBrowserReceiptsDesktop$|^TestBrowserReceiptsTouch$|^TestBrowserConnections|^TestBrowserPasteBox$|^TestBrowserPasteCopiesItsBox$' -v -run '^TestBrowserCopyContinue$' -count=1 ./internal/headless (retry, once)
##############################################################################
FLAKE ./internal/headless:TestBrowserCopyContinue browser-headless-rest f149ba6098f89097440b5621c9f3d2ccf1d680fd 6.46s 61.18
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 58.13, cpu waiting 37.74%, memory waiting 0.00%, io waiting 0.53%
--- 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.075s 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.556s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 1.9s amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewPassExchange
receipt: slow test 660ms amadan.net/oficina/equipo/internal/equipo TestBrowserPreviewBlocksNavigation
browser lane browser-rest: ./internal/idtest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserOficinaIDDoor|TestBrowserSmartDoor)$' ./internal/idtest
budget note: internal/idtest took 11.589s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 12.953s 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.589s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 9.3s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.29s amadan.net/oficina/equipo/internal/idtest TestBrowserOficinaIDDoor
browser lane browser-rest: ./internal/plan3test
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestTeamsHierarchyBrowser)$' ./internal/plan3test
receipt: test step 3.617s 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.16s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.16s 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.357s 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.728s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 24.08s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.41s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.03s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.64s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 8.86s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
machine: 32 CPUs, load 8.08, cpu waiting 3.93%, memory waiting 0.00%, io waiting 0.04%
--- 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.67s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.25s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 8.46s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 8.73s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 28.24s
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^C5_review_auth$|^TestHeadlessConnections$/^C5_review_failover$|^TestHeadlessConnections$/^C5_review_on_codex$|^TestHeadlessConnections$/^C5_review_other_family_first$' ./internal/headless (61s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 21.53s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 11.61s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 10.31s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 15.83s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (21s)
ok ./internal/headless TestMixedVersions 19.24s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.81s
+ 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 61.00, cpu waiting 38.93%, memory waiting 0.00%, io waiting 1.01%
--- 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.733s 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.947s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 240ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 71ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 2ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider/gotoolchain
receipt: slow test 5.6s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.72s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 470ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 240ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxToolchain
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment
receipt: test step 3.692s 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.291s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 350ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 230ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 140ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryCleansScratch
receipt: slow test 130ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryMalformedRecord
machine: 32 CPUs, load 16.28, cpu waiting 11.73%, memory waiting 0.00%, io waiting 2.11%
--- 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.8%, load 19.98
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2819 text files, 3228 matches, 0 failures
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go tool fiesta spacing -skip tokens.css internal/equipo/static
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 92 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok amadan.net/oficina/equipo/internal/equipo 2.537s
machine: 32 CPUs, load 63.80, cpu waiting 40.41%, memory waiting 0.00%, io waiting 0.80%
--- 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.8%, load 19.98
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 49.48, cpu waiting 34.59%, memory waiting 0.00%, io waiting 1.19%
--- 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 41.6%, load 19.98
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===
No vulnerabilities found.
Your code is affected by 0 vulnerabilities.
This scan also found 0 vulnerabilities in packages you import and 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 30.47, cpu waiting 22.34%, memory waiting 0.00%, io waiting 1.56%
--- 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 41.6%, load 19.98
shard 28: make gitleaks
[90m12:29PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m12:29PM[0m [32mINF[0m [1m1183 commits scanned.[0m
[90m12:29PM[0m [32mINF[0m [1mscanned ~66887404 bytes (66.89 MB) in 25.3s[0m
[90m12:29PM[0m [32mINF[0m [1mno leaks found[0m
machine: 32 CPUs, load 57.61, cpu waiting 36.01%, memory waiting 0.00%, io waiting 1.15%
amadan: job failed at step check shard 17 of 29 — its output is above, not at the tail of this log
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 9ab13b35..93643d0d 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -14,8 +14,8 @@ perf GET /* skip Unknown private paths render 404; this fallback contains no scr |
| time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial reruns measured 18.079s and 22.031s. Keep migration, recovery, accounting and concurrency assertions; 60s leaves 30 percent headroom above loaded CI. |
| time internal/equipotest 300s Final fix package rerun measured 187.035s (review 172.4s); 300s gives 60 percent headroom for HTTP, sandbox, authority and final regression coverage. |
| -size internal/equipo 23189 - Native preview pass issuance, exact bound grant exchange and wrapper-only authority (2026-11-26); measured 23189 source lines. |
| -size internal/wire 7088 - Native task evidence fields, merge_credential and amadan_unreachable reasons (2026-11-26); measured 7088 source lines. |
| +size internal/equipo 23204 - Native preview pass issuance, bound wrapper grants, Retry/timeline and honest no-access merge copy; measured 23204 source lines (2026-11-26). |
| +size internal/wire 7199 - Protocol 31 display facts, shared path validation, native task evidence fields and merge credential reasons; measured 7199 source lines (2026-11-26). |
| size internal/equipotest - 12017 Task 21 repairs historical migration and conversation fixtures after Plan 3, and the Rastrillo upgrade contract comparing served assets with what Assets serves; measured 0/12017 source/test lines. |
| time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded); |
| time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s). |
| @@ -30,7 +30,7 @@ size internal/runner/provider 5731 - Fable follow-up: base and diagnostic gates, |
| time internal/plan3test 300s Initial cap for combined browser and runner acceptance; measure at both usable stops. |
| -size internal/plan3test - 11964 Native preview pass device contract alongside existing release inventory (2026-11-26); measured 11964 test lines. |
| +size internal/plan3test - 11967 Preview pass device contract plus paused-work, Assistant, stuck-task, merge credential and no-access release inventory; measured 11967 test lines (2026-11-26). |
| time internal/runner/forge 20s Plan 3 CI repair measured 10.527s for the full package (controller CI 10.407s). |
| time internal/runner/provider 15s Plan 3 CI repair measured 10.346s for the full package (controller CI 10.709s); |
| @@ -38,7 +38,7 @@ time internal/runner/provider 15s Plan 3 CI repair measured 10.346s for the full |
| perf GET /releases/* skip Verified runner release file downloads, not browser GET screens. |
| perf GET /install.sh skip Mac runners: the one-line bootstrap a terminal pipes to sh, not a browser screen. |
| time internal/runner/containment 15s Plan 3 loaded CI measured 10.817s; |
| -size internal/runner/thin 28724 23336 Protocol 30 scanner health and stuck-task tools, merge credential fallback and write scope (2026-11-26); measured 28724/23336. |
| +size internal/runner/thin 28824 23538 Protocol 31 display facts, merge credential fallback, validation and Engineering-only publication guards; measured 28824/23538 (2026-11-26). |
| time internal/thintest 240s Thin contract and page tests, the Assistant's and the models' included, share one harness. Measured 202s on a shared 16 CPU box (2026-11-13); CI runs two lanes. |
| time internal/runner/mac 30s Mac runners (Darwin worker): real process groups killed after a grace and proven gone (SIGTERM, SIGKILL, the marker sweep), and the probes run end to end with fake srt and xcodebuild, P6 killing. |
| time internal/runner/thin 45s Thin v1 slice 4 review: real git repositories for the merge and squash checks, a stalled fetch, and a 16 MiB candidate streamed through the review diff and the checks pack (about 5s). |
| @@ -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 34845 9685 Task read authority shared within the preview pass transaction; measured 34845/9685 (2026-11-26). |
| +size internal/equipo/chat 34984 9873 Detail-only file facts, hosted projection, completion time, no-access merges and transactional preview task reads; measured 34984/9873 (2026-11-26). |
| 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. |
| @@ -71,7 +71,7 @@ perf GET /tasks/{id}/files/{file} skip Research kept images: the bytes of one im |
| perf GET /api/v1/runners skip Mac runners person API: bearer-only JSON for devices; the browser shows runners in the Team section. |
| time cmd/equipo-runner 60s TestReleaseRunnerHasNoFakeWorker builds the release runner and the thin package under testbuild (about 12s locally). |
| size internal/headless - 11437 Grant scenarios for a named repository (hub #48); the sign-in's account email at 1280 and 390; measured 11437 test lines. |
| -size internal/thintest - 35085 Stuck-task contracts plus paused-job fixed-clock coverage at three hours (2026-11-26); measured 35085 test lines. |
| +size internal/thintest - 35229 Protocol 31 facts and detail-only contracts, stuck tasks, paused-job clock, no-access merges; measured 35229 test lines (2026-11-26). |
| perf GET /api/v1/projects/{id}/merge-policy skip Merge authority person API: bearer-only JSON for devices; the browser reads the policy on /projects/{id}. |
| perf GET /api/v1/usage skip Thin v1 person API: bearer-only JSON for devices; the browser reads usage through /usage. |
diff --git a/docs/api/equipo-v1.openapi.json b/docs/api/equipo-v1.openapi.json| index b792ad36..08dcd8f1 100644 |
| --- a/docs/api/equipo-v1.openapi.json |
| +++ b/docs/api/equipo-v1.openapi.json |
| @@ -22423,6 +22423,10 @@ |
| }, |
| "retried_by": { |
| "type": "string" |
| + }, |
| + "change_files": { |
| + "description": "Bounded presentation facts, included only on GET /tasks/{id} detail reads. Absent from task lists, snapshots, events and Coordinator tools.", |
| + "$ref": "#/components/schemas/ChangeFiles" |
| } |
| }, |
| "required": [ |
| @@ -24280,6 +24284,105 @@ |
| "format": "date-time" |
| } |
| } |
| + }, |
| + "ChangeFiles": { |
| + "type": "object", |
| + "properties": { |
| + "base": { |
| + "type": "string" |
| + }, |
| + "sha": { |
| + "type": "string" |
| + }, |
| + "files": { |
| + "type": "integer", |
| + "format": "int64", |
| + "minimum": 0 |
| + }, |
| + "additions": { |
| + "type": "integer", |
| + "format": "int64", |
| + "minimum": 0 |
| + }, |
| + "deletions": { |
| + "type": "integer", |
| + "format": "int64", |
| + "minimum": 0 |
| + }, |
| + "binary": { |
| + "type": "integer", |
| + "format": "int64", |
| + "minimum": 0 |
| + }, |
| + "entries": { |
| + "type": [ |
| + "array", |
| + "null" |
| + ], |
| + "items": { |
| + "$ref": "#/components/schemas/ChangedFile" |
| + }, |
| + "maxItems": 200, |
| + "description": "At most 200 entries. Totals cover the complete bounded scan; truncated is true when entries were omitted. The encoded facts are bounded to 96 KiB." |
| + }, |
| + "truncated": { |
| + "type": "boolean" |
| + } |
| + }, |
| + "required": [ |
| + "base", |
| + "sha", |
| + "files", |
| + "additions", |
| + "deletions", |
| + "binary", |
| + "entries", |
| + "truncated" |
| + ], |
| + "additionalProperties": false, |
| + "x-go-type": "wire.ChangeFiles" |
| + }, |
| + "ChangedFile": { |
| + "type": "object", |
| + "properties": { |
| + "path": { |
| + "type": "string" |
| + }, |
| + "old_path": { |
| + "type": "string" |
| + }, |
| + "status": { |
| + "type": "string", |
| + "enum": [ |
| + "added", |
| + "modified", |
| + "deleted", |
| + "renamed" |
| + ] |
| + }, |
| + "additions": { |
| + "type": "integer", |
| + "format": "int64", |
| + "minimum": 0 |
| + }, |
| + "deletions": { |
| + "type": "integer", |
| + "format": "int64", |
| + "minimum": 0 |
| + }, |
| + "binary": { |
| + "type": "boolean" |
| + } |
| + }, |
| + "required": [ |
| + "path", |
| + "status", |
| + "additions", |
| + "deletions", |
| + "binary" |
| + ], |
| + "additionalProperties": false, |
| + "x-go-type": "wire.ChangedFile" |
| } |
| }, |
| "responses": { |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-changes-facts.md b/docs/superpowers/plans/CONTROLLER-REPORT-changes-facts.md| new file mode 100644 |
| index 00000000..69f3742c |
| --- /dev/null |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-changes-facts.md |
| @@ -0,0 +1,286 @@ |
| +# Changed files facts |
| + |
| +Branch changes/facts starts at origin/main 18fb5be4 in its own physical TMPDIR |
| +worktree. Slice 5b is excluded: no diff endpoint, contents, or native diff view. |
| +No new GET route or performance exemption is needed. |
| + |
| +## Report and device contract |
| + |
| +The controller approved ProtocolChangeFiles = 31 on 2026-11-26. The separate |
| +optional change_files field carries Engineering presentation facts on |
| +StepReport and the device Step. Existing wire.ChangeFacts, Review measurement, |
| +acceptFacts and merge authority are unchanged. |
| + |
| +Facts bind the accepted step's base and candidate. Entries contain only path, |
| +status (added/modified/deleted/renamed), old path for a rename, additions, |
| +deletions and a binary flag. MaxChangeEntries is 200; encoded facts are also |
| +bounded to 96 KiB. Totals cover the complete scan, including omitted entries; |
| +truncated means entries were omitted. Each raw/numstat listing is bounded to |
| +1 MiB. A failed, malformed, mismatched or clipped scan supplies no facts, |
| +rather than invented totals. Paths retain spaces and Unicode; invalid/control |
| +paths are refused. No file contents, tokens, or new network calls are added. |
| + |
| +Engineering measures its local candidate/base pair during publication, including |
| +republish. It reuses Review's NUL-safe raw and numstat parsers. A first commit |
| +with no base is measured only after proving it is a root commit; a missing base |
| +on a later commit remains unknown. Review retains its existing handling. |
| + |
| +The additive chat_steps.change_files column stores only accepted Engineering |
| +facts. Attempt and runner authority use the existing report path; acceptance |
| +also checks protocol, role, specialist, exact base/candidate and bounds. The |
| +device projection validates stored facts again and hides them while the step |
| +is no longer done. Task-read visibility is inherited unchanged. Encode removes |
| +change_files below protocol 31. Older runners remain usable; native links out. |
| + |
| +The OpenAPI schema includes the optional field, entry statuses, nonnegative |
| +counts and the 200-entry limit. The full native task fixture round-trips the |
| +new nested field. A runner-to-device contract covers protocol 31 and protocol |
| +30, exact mapping, and the absence of merge-authority/private fields. |
| + |
| +## Native presentation and copy |
| + |
| +Changed files selects the last Engineering step for the task's current |
| +candidate, with matching facts SHA/base. Missing, invalid or older facts keep |
| +the existing web link. The bounded list shows per-file counts and status, |
| +renames with the old path, and non-text files. Lists longer than ten entries |
| +group by folder. Empty totals remain real zeroes only when the scan completed. |
| + |
| +File taps build the known Amadan repository page with fixed host and ref/path |
| +query parameters, then use the existing allowlisted opener. Amadan's actual |
| +route was verified in its local internal/hub/browse_render.go. Candidate SHA |
| +pins ordinary files; deleted files use the base. Spaces, Unicode, plus signs, |
| +query delimiters and fragments are encoded as path data. Non-Amadan repository |
| +identifiers and traversal paths cannot construct a file URL. iPhone uses the |
| +existing Safari sheet; Mac uses the default browser. |
| + |
| +Luna approved native.changes.* on 2026-11-26: |
| +- added: Added |
| +- modified: Changed |
| +- deleted: Deleted |
| +- renamed: Renamed |
| +- binary: Non-text file |
| +- renamed_from: Renamed from %@ |
| +- truncated: Showing the first %lld files. Open on Amadan for the full list. |
| +- total: %lld files, %lld lines added, %lld removed |
| + |
| +Both generated catalogs carry the review comment. Catalog substitutions |
| +pluralize files and lines independently. The checker verifies that the ordinary |
| +plural forms still match the reviewed English source. Native tests pin |
| +"1 file, 1 line added, 0 removed" and all singular/plural combinations. Compact |
| +row counts stay numeric; their accessibility label uses the reviewed plural |
| +phrases. |
| + |
| +## Test-first and authority proof |
| + |
| +Initial commands, with GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0: |
| +- go test ./internal/runner/thin -run |
| + 'TestEngineeringChangeFiles|TestChangeFilesBounds' -count=1: |
| + red for missing API, then green. Real git tests cover spaces, Unicode, |
| + rename, deletion, non-text data and 203 files bounded to 200. |
| +- go test ./internal/wire -run 'TestProtocol31|TestChangeFilesValidation': |
| + red for missing protocol/field, then green. A frozen main StepReport key set |
| + strictly rejects the new field in every downgraded protocol 1 through 30. |
| +- go test ./internal/equipo/chat -run |
| + '^TestEngineeringChangeFilesAcceptance': |
| + red for missing acceptance/storage/projection, then green. |
| +- go test ./internal/runner/thin -run '^TestChangeFilesInitialCommit$' -count=1: |
| + red (nil facts) before the proven-root path, then green. |
| +- swift test --package-path native/apple --filter ChangeFilesTests: |
| + red for missing decoding/presentation APIs, then green. |
| + |
| +A detached worktree of clean main 18fb5be4 captured sixty Review gate decisions: |
| +fifteen input cases at protocols 27, 28, 30 and 31. Cases cover approval, |
| +checks, hold, size, binary/special/signing changes, gate files, shortened review, |
| +missing/incomplete evidence, ask policy and a person's decision. The frozen |
| +testdata/presentation-gate.json is compared byte for byte by |
| +TestPresentationFactsLeaveReviewGateUnchanged on this branch. It passes. |
| +A separate real-git test also compares Review facts and its decision before |
| +and after collecting display facts. The detached worktree was removed. |
| + |
| +Additional focused commands pass: |
| +- go test ./internal/thintest -run '^TestContractEngineeringChangeFiles$' -count=1 |
| +- go test ./internal/equipo/mergegate ./internal/runner/thin ./internal/wire |
| + ./internal/plan3test -run |
| + 'TestPresentationFactsLeaveReviewGateUnchanged|TestSandboxMasksPublish|TestProtocol31|TestPersonAPIDeviceContract' |
| + -count=1 |
| +- go test ./internal/equipo -run |
| + 'TestMigrationModels|TestConversationMigrationSnapshot' -count=1 |
| +- swift test --package-path native/apple --filter |
| + 'ChangeFilesTests|TaskDetailTests.fullWire' |
| + |
| +## Mutations |
| + |
| +Scripts changes-facts-mutate-go.py and changes-facts-mutate-native.py run one |
| +mutation at a time, require an actual test assertion failure (not a compile |
| +error), and restore the source in finally. All 43 are killed. |
| + |
| +Server/runner (23): downgrade boundary; wire entry bound; wire byte bound; |
| +wire exact totals; truncation consistency; runner entry bound; runner byte |
| +bound; clipped scan; ancestor requirement; proven root requirement; matching |
| +raw/numstat paths; additions; binary flag; rename old path; publication mapping; |
| +acceptance protocol; role; specialist; base; candidate; device step state; |
| +device mapping; persistent storage. |
| + |
| +Native (20): current candidate; latest matching step; Engineering specialist; |
| +done state; facts SHA; facts base; valid facts; folder grouping; repository |
| +shape; file path; deleted-file base ref; plus encoding; count argument order; |
| +entry bound; byte bound; truncation consistency; binary counts; duplicate paths; |
| +server slash escaping; server HTML escaping. |
| + |
| +The first current-candidate mutation survived because the old step fixture |
| +still carried the new candidate's facts. The fixture now binds that old |
| +measurement to its own candidate. The mutation then fails, as do all others. |
| +The clipped-scan fixture ends the bounded prefix exactly on a valid raw record, |
| +so ignoring clipping cannot pass merely because a parser rejects a partial row. |
| + |
| +## Validation and evidence |
| + |
| +Go build, vet, staticcheck v0.7.0, govulncheck, copy release, references, lanes, |
| +formatting, spacing, gitleaks and migration checks pass. Vet and staticcheck |
| +target linux/amd64, as instructed for macOS toolproxy compatibility. The size |
| +gate first reported the expected added lines; existing package exemptions now |
| +record the exact measured source/test sizes and the scope that added them. |
| +The corrected budget gate passes. No timing budget was increased. |
| + |
| +native/scripts/check-native.sh passes: 325 tests in 42 suites, one existing |
| +known issue, 327 byte-identical web strings, references, Mac and iOS Simulator |
| +builds. The eight new native entries retain Luna's approved wording. |
| + |
| +Two TaskViewUI tests pass on an iPhone 18 Pro / iOS 27 simulator: the list and |
| +old-runner fallback, and accessibility extra-large text. Screenshots from this |
| +branch are in polish-audit/equipo-daily-driver/site/build/slice5/: |
| +- iphone-changed-files.png |
| +- iphone-changed-files-large.png |
| +- iphone-changed-files-old-runner.png |
| +- mac-changed-files.png |
| + |
| +The Mac capture uses the built debug app and the same offline fixture transport. |
| +Both platforms retain the existing pinned decision. The screenshots were |
| +inspected; paths wrap at large text sizes. The fixture app and simulator were |
| +closed and the temporary simulator removed. |
| + |
| +Main c74fd0ac (landed Needs you) was merged normally before publishing. String |
| +conflicts keep both reviewed catalogs; existing size exemptions include the |
| +merged done_at mapping and tests. Final results are recorded below; the exact-head |
| +Linux verdict is saved in the screenshot validation directory. |
| + |
| +Final self-review added a test-first JSON byte-bound regression: Swift normally |
| +escapes slashes, whereas Go leaves them literal and escapes HTML characters. |
| +Native now measures the server's snake-case JSON representation with the same |
| +escaping. A valid 200-entry nested-path listing is accepted, while a shorter |
| +HTML-character listing over the server's byte bound is rejected. The test |
| +failed both assertions before the fix; removing either encoding rule is killed |
| +by changes-facts-mutate-json.py. The seven focused ChangeFiles tests pass. |
| + |
| +Final native gate after the main merge and byte-bound fix passes: 350 tests in |
| +46 suites, one existing known issue, 330 web-parity strings, Mac and Simulator |
| +builds. Post-merge budget, formatting and focused device/runner contract tests |
| +also pass. Post-commit runner-dead-references passes. |
| + |
| +The full local macOS `make test` is not green: toolproxy requires unix.O_PATH, |
| +browser tests have no Chromium, and existing runner/provider checks fail. |
| +Representative TestOnboardingClaudeHeadlessBrowserLogin and |
| +TestPublishCoreAuthorizationContract failures were reproduced unchanged on |
| +clean origin/main c74fd0ac in a detached worktree, then that worktree was removed. |
| +No platform bypass or test weakening was added. Linux hub CI is the final gate; |
| +its full result is archived beside the screenshots in validation/ci-final.json. |
| + |
| +Local `make perf` runs TestPerfScreens and TestPerfBoot, but the target fails |
| +while building the same Linux-only toolproxy dependency (`unix.O_PATH`). The |
| +Linux CI performance target must pass; no performance exemption was added. |
| +The validation directory preserves both local failure logs and all passing |
| +focused, mutation, native and screenshot-test logs for review. |
| + |
| +The first final-head Linux run (4d654482) exposed three wire contract omissions: |
| +TestInjectionProtocolDowngrade still expected 30 when negotiating 99; |
| +TestEnumsAreTheWireConstants needed the ChangedFile status constant family; |
| +and TestConnectionTypesCarryNoSecrets needed exact exceptions for |
| +ChangedFile.path and ChangedFile.old_path. These are validated repository-relative |
| +names; the audit still rejects every other secret-shaped field. The status |
| +values now use shared wire constants. All `go test ./internal/wire/...` tests |
| +pass after the fixes. The failed CI log is retained as ci-4d654482-failed.json; |
| +the subsequent exact-head verdict is in ci-final.json. |
| + |
| +## Fable review follow-up, 2026-11-26 |
| + |
| +The device detail read now opts into file facts when building the view. |
| +Ordinary task and step projections omit them, including the Coordinator tool, |
| +lists, snapshots, events and action responses. GET /tasks/{id} uses TaskDetail, |
| +with the same current-member and task-read authorization as Task. The OpenAPI |
| +field description and schema generator explicitly say detail only. |
| + |
| +The new 45-file, three-round fixture first failed on every ordinary projection |
| +and on the Coordinator's clipped JSON. After the change, the complete tool |
| +answer decodes and retains both verdict=approve and needs_you=merge. The |
| +runner-to-device contract also checks that /tasks and /snapshot omit facts, |
| +while detail retains them for protocol 31 and omits them for older runners. |
| + |
| +Go and native share internal/wire/testdata/change-paths.json. Both reject Cc, |
| +U+200E/F, U+202A–202E and U+2066–2069, and accept other format characters, |
| +including a ZWJ emoji filename. Invalid facts are rejected by the existing |
| +acceptance validation before storage. Native validates the optional field at |
| +decode or assignment and discards invalid facts without losing the task; |
| +rendering no longer repeats the validation and JSON byte measurement. Legacy |
| +payloads and valid facts still round-trip. |
| + |
| +Test-first commands and results: |
| + |
| +- GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test ./internal/wire ./internal/equipo/chat ./internal/runner/thin -run 'TestChangeFiles|TestChangePath' -count=1 |
| + failed before implementation: bidi paths accepted, invalid facts accepted |
| + for storage, ordinary projections leaked facts, Coordinator JSON truncated. |
| + Runner guard regression cases passed before mutation. |
| +- swift test --package-path native/apple --filter ChangeFilesTests |
| + failed before implementation: ZWJ rejected, bidi accepted, invalid |
| + decoded/assigned facts retained. All 10 tests passed after implementation. |
| +- The focused final Go run includes wire, chat, runner/thin, thintest and |
| + plan3test, matching ChangeFiles, ChangePath, EngineeringChangeFiles, |
| + ContractEngineeringChangeFiles, PersonAPIDeviceContract and |
| + OpsAreWhatTheHandlersWrite. All pass after merging main. |
| + |
| +All 27 follow-up mutations were killed by assertion failures, then restored: |
| + |
| +- Go validation: absolute path, backslash, invalid UTF-8, binary line counts, |
| + candidate and base commit length, binaries greater than files, Cc characters, bidi characters. |
| +- Server projection: acceptance validation removed; default task view includes |
| + facts; detail opt-in removed; HTTP detail calls ordinary Task; active and |
| + retired step opt-in guards removed. |
| +- Runner: final validation removed; commit-pattern guard removed; type-change |
| + mapping removed; non-Engineering publication includes facts. |
| +- Native: empty/leading path segments, Cc characters, backslash, old-path |
| + validation, bidi characters, decode validation, assignment validation and |
| + repository-name pattern removed. |
| + |
| +The executable mutation script, exact commands, exit statuses and per-mutation |
| +logs are saved in site/build/slice5/validation/review/. Run it from the worktree |
| +as python3 facts-review-mutations.py wire chat contract runner and |
| +python3 facts-review-mutations.py native, plus |
| +python3 facts-review-mutations.py extra-wire extra-chat. It restores each source |
| +after testing. The 45-file fixture includes one retired round as well as two |
| +active rounds, so both step collections are covered. |
| + |
| +Live link verification: curl -sI |
| +'https://amadan.net/oficina/equipo?ref=main&path=go.mod' returned HTTP/2 200 on |
| +2026-11-26. A GET returned the go.mod file viewer and its module line, not a |
| +repository listing or sign-in page. The existing /namespace/repo?ref=&path= |
| +shape is correct; the native tests retain commit-pinned refs and plus escaping. |
| + |
| +Main 7c113ac8 was merged normally in e0eeee7a. This includes the landed composer |
| +and merge-credential fixes. The native parity gate found main's two new reviewed |
| +stop reasons, work.reason.merge_credential and work.reason.amadan_unreachable; |
| +both were copied exactly from the web catalog (Paul's existing approval). |
| +No new wording or copy question was introduced. Measured size records cover the |
| +new projection/guard tests and the merged main changes; no timing budget changed. |
| + |
| + |
| +Final native gate passes: 356 tests in 47 suites, one existing known issue, |
| +332 web-parity strings, Mac build and iOS Simulator build. Linux-targeted |
| +make build and make vet pass with GOTOOLCHAIN=go1.26.11, CGO_ENABLED=0, |
| +GOOS=linux and GOARCH=amd64. Staticcheck v0.7.0 and govulncheck pass using |
| +make staticcheck / make govulncheck with their go-run -exec wrapper setting |
| +GOOS=linux GOARCH=amd64 for the analyser. Formatting, spacing, copy release, |
| +lane coverage, migration, measured size and gitleaks checks pass. |
| + |
| +The ordinary macOS make build and make perf hit the existing Linux-only |
| +toolproxy dependency (unix.O_PATH). TestPerfScreens and TestPerfBoot themselves |
| +passed; the full Linux hub gate remains authoritative. No platform bypass, |
| +new route or performance exemption was added. |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-native-needs-you.md b/docs/superpowers/plans/CONTROLLER-REPORT-native-needs-you.md| index a330b53d..df3d9ae8 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-native-needs-you.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-native-needs-you.md |
| @@ -364,3 +364,50 @@ mac-needs-you.png; refreshed Today, empty and merge-confirmation captures too. |
| The new aside image shows the real native stub and Undo; the ordinary list |
| shows Set aside on the merge row. Screenshots and mutation/gate logs are in |
| the audit site's build/slice4 and validation directories. No new copy questions. |
| + |
| +## Refresh follow-ups, 2026-11-26 |
| + |
| +Branch `native/needs-you-followups`, from origin/main `7c113ac8`. |
| +The last matching Resume connection survives task/connection reads and |
| +transient network failures. A changed hold or authoritative connection result, |
| +or a refused task/connection/resume request, clears it. Existing task revision |
| +freshness guards remain in force. A refused Resume clears before its refetch, |
| +so a second tap cannot reuse a rejected pause revision. |
| + |
| +Event refreshes no longer bump every row's read key. The task revision drives |
| +row reads; explicit Needs you pull-to-refresh and read-error Retry also bump |
| +the retry generation. Unchanged successfully read rows skip HTTP even then; |
| +failed task or connection reads retry. Resume/Run now retain their forced |
| +post-action task read. Direction Set aside now pins `aside: true` in the actual |
| +request, and Undo pins false. |
| + |
| +Test-first commands and evidence: |
| +- `swift test --package-path native/apple --filter 'NeedsFollowupTests|NeedsRowModelTests'` |
| + failed with 15 assertion issues before the behavioral implementation |
| + (after correcting a test-only private-setter compilation error). |
| +- Focused restored-source suite including StoppedWorkReviewTests passed 30 |
| + tests before adding the final retry/changed-hold cases. |
| +- `python3 "$TMPDIR/needs-followups-mutate.py"` and |
| + `python3 "$TMPDIR/needs-followups-extra.py"`: all 14 mutations killed. |
| + The failed-task retry mutation initially survived because the fixture had |
| + never loaded successfully. Added a previously successful row whose later |
| + read fails; the same mutation then failed on read count and recovery. |
| + |
| +Mutations: clear before task read; clear before connection read; remove row |
| +revision cache; ignore changed revision; ignore failed task read; ignore |
| +failed connection read; refresh every event; never retry failed rows; retain |
| +refused task connection; retain refused connection response; retain refused |
| +Resume before refetch; retain removed hold; direction Set aside sends false; |
| +retain changed step connection while reading. Each was restored in `finally`; |
| +each killed run contains an assertion failure, not a compiler error. |
| + |
| +The gate also imports main's two missing reviewed web reason strings, |
| +`work.reason.merge_credential` and `work.reason.amadan_unreachable`, unchanged. |
| +No new copy and no server behavior changes. Evidence is under the audit site's |
| +`build/slice4/validation/followups/` (red/green logs, mutation scripts/results, |
| +and native gate). |
| + |
| +Final `native/scripts/check-native.sh`: passed, 354 tests in 47 suites with |
| +one existing known issue, 332 parity strings, Mac and iPhone Simulator builds. |
| +`git diff --check`: passed. Post-commit reference scan and Linux CI verdict |
| +are recorded with the pushed head in the evidence directory. |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index ae2e6956..e3b15798 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -6910,6 +6910,8 @@ records remain unchanged. |
| | `work.tl.coordinator_retried` | The coordinator started %s again. | Copy specialist | Runtime; COPY APPROVED (Paul, 2026-11-25, copy-review 6haczxo74hoyyuf7xkojgqd27e, unchanged) | |
| | `work.reason.merge_credential` | the runner has no Amadan credential for this repository | Copy specialist | Runtime; COPY APPROVED (Paul, 2026-11-25, copy-review 6wxwi7zo3fph5nu4nm6eipptfq, unchanged) | |
| | `work.reason.amadan_unreachable` | Amadan could not be reached to confirm Equipo may merge here | Copy specialist | Runtime; COPY APPROVED (Paul, 2026-11-25, copy-review 6wxwi7zo3fph5nu4nm6eipptfq, unchanged) | |
| +| `assistant.team.no_access` | The change is ready, but it can't go live until access to publish it is set up. | Told to the Assistant: where the work stands once going live was refused for want of access (merge_credential, merge_forbidden), instead of "waits for a go-ahead" | Runtime; COPY APPROVED (Paul, 2026-11-26, coordinator session, unchanged) | |
| +| `assistant.job.detail.no_access` | It can't go live until access to publish it is set up. | Base job card: a stopped job's sentence more when going live was refused for want of access | Runtime; COPY APPROVED (Paul, 2026-11-26, coordinator session, unchanged) | |
| ## Task 21 |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-preview-pass.md b/docs/superpowers/plans/CONTROLLER-REPORT-preview-pass.md| index c03624b2..a706a425 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-preview-pass.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-preview-pass.md |
| @@ -86,7 +86,7 @@ subtest or occurrence. No surviving mutation is counted as killed. |
| ## Validation |
| -- Native gate passed: 359 tests in 48 suites, one existing known issue; |
| +- Pre-merge native gate passed: 359 tests in 48 suites, one existing known issue; |
| 334 web-parity strings, security scripts, fixtures and both platform builds. |
| Recorded in `preview-native-final-gate.log`. |
| - `GOOS=linux GOARCH=amd64 make build` passed, including the Darwin runner build. |
| @@ -116,9 +116,9 @@ POST-body exchange, wrapper cookie, shared wrapper and iframe. The external |
| example page is disposable fixture content. The server is loopback-only behind |
| a temporary HTTPS tailnet port. The fixture config contains a disposable test |
| credential, stays private, and is deleted at teardown. It is not committed or |
| -archived. No production account or credential is used. The Mac capture hosts |
| -the production sheet content in a normal NSHostingView with the actual loaded |
| -WKWebView: macOS SheetHostingView omits its SwiftUI layer from cacheDisplay. |
| +archived. No production account or credential is used. The Mac image is the live |
| +sheet, captured with AppKit. Its header uses the app palette background so |
| +bitmap exports preserve the same readable surface as the window. |
| The iframe's external service remains responsible for its own availability. |
| Grant expiry prevents new wrapper reads; it cannot retract HTML already |
| @@ -127,3 +127,19 @@ The pass does not approve an unsafe preview or confer any merge authority. |
| Final commit and Linux CI verdict are sent to the controller after pushing; |
| no merge, deployment or release is performed. |
| + |
| + |
| +## Main integration before publication |
| + |
| +Normally merged main `088e5863` after `2469eaa8`, as requested. Kept the |
| +Changed files tab and its explicit detail-only projection. The transactional |
| +`TaskAt` read shares authority and opts out of file facts; `TaskDetail` still |
| +opts in. Retained the new native load result and preview invalidation together. |
| +Moved the preview tables to migration 0109 after main's 0108 change-files field. |
| +Combined budget reasons and remeasured 23204 app source, 34984/9873 chat |
| +source/tests, and 11967 plan contract test lines. Re-ran validation on the merge. |
| + |
| +The merged native gate passed: 377 tests in 50 suites, one existing known issue, |
| +334 web-parity strings, and both builds (`preview-native-merged-gate.log`). |
| +Merged preview/visibility contracts, migration, copy, lane coverage and browser |
| +exchange checks passed. Changed-files projection tests passed on the merge. |
diff --git a/internal/equipo/chat/change_files.go b/internal/equipo/chat/change_files.go| new file mode 100644 |
| index 00000000..14662b27 |
| --- /dev/null |
| +++ b/internal/equipo/chat/change_files.go |
| @@ -0,0 +1,31 @@ |
| +package chat |
| + |
| +import ( |
| + "encoding/json" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// Presentation facts are bound to the accepted Engineering attempt. They |
| +// never enter acceptFacts or mergegate's inputs. |
| +func acceptChangeFiles(l Lease, role string, s stepRecord, f *wire.ChangeFiles) string { |
| + if l.Protocol < wire.ProtocolChangeFiles || role != wire.RolePrimary && role != wire.RoleWorker || |
| + s.Specialist != wire.SpecialistEngineering || !wire.ValidChangeFiles(f) || |
| + f.Base != s.BaseSHA || f.SHA != s.CandidateSHA { |
| + return "" |
| + } |
| + raw, _ := json.Marshal(f) |
| + return string(raw) |
| +} |
| + |
| +func stepChangeFilesView(s stepRecord) *wire.ChangeFiles { |
| + if s.Specialist != wire.SpecialistEngineering || s.State != wire.StepDone || s.ChangeFiles == "" { |
| + return nil |
| + } |
| + var f wire.ChangeFiles |
| + if json.Unmarshal([]byte(s.ChangeFiles), &f) != nil || !wire.ValidChangeFiles(&f) || |
| + f.Base != s.BaseSHA || f.SHA != s.CandidateSHA { |
| + return nil |
| + } |
| + return &f |
| +} |
diff --git a/internal/equipo/chat/change_files_exposure_test.go b/internal/equipo/chat/change_files_exposure_test.go| new file mode 100644 |
| index 00000000..adc40573 |
| --- /dev/null |
| +++ b/internal/equipo/chat/change_files_exposure_test.go |
| @@ -0,0 +1,96 @@ |
| +package chat |
| + |
| +import ( |
| + "amadan.net/oficina/equipo/internal/wire" |
| + "context" |
| + "encoding/json" |
| + "fmt" |
| + "strings" |
| + "testing" |
| +) |
| + |
| +func TestChangeFilesStayOutOfCoordinatorListsSnapshotAndEvents(t *testing.T) { |
| + r := newMeteredRig(t) |
| + ctx := context.Background() |
| + must := func(err error) { |
| + t.Helper() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + must(r.s.db.G.Exec("CREATE TABLE runners (id text, person text, role text, label text, revoked_at datetime, removing_at datetime, tainted_at datetime)").Error) |
| + k := taskRecord{ID: "tk_files_projection", ProjectID: "p_files", Creator: hkOwner, Stage: wire.StageReadyToMerge, Revision: 1} |
| + must(r.s.db.G.Create(&projectRecord{ID: k.ProjectID, Title: "Files", TitleSet: true, Repo: "oficina/sample"}).Error) |
| + must(r.s.db.G.Create(&k).Error) |
| + for round := 0; round < 3; round++ { |
| + sha := strings.Repeat(fmt.Sprint(round+1), 40) |
| + facts := wire.ChangeFiles{Base: strings.Repeat("a", 40), SHA: sha, Files: 45, Additions: 45, Entries: []wire.ChangedFile{}} |
| + for i := 0; i < 45; i++ { |
| + facts.Entries = append(facts.Entries, wire.ChangedFile{Path: fmt.Sprintf("Sources/round%d/file%02d.swift", round, i), Status: wire.ChangeFileAdded, Additions: 1}) |
| + } |
| + raw, err := json.Marshal(facts) |
| + must(err) |
| + must(r.s.db.G.Create(&stepRecord{ID: fmt.Sprintf("eng%d", round), TaskID: k.ID, Idx: round * 2, Retired: round == 0, Specialist: wire.SpecialistEngineering, State: wire.StepDone, BaseSHA: facts.Base, CandidateSHA: sha, Pushed: true, ChangeFiles: string(raw)}).Error) |
| + must(r.s.db.G.Create(&stepRecord{ID: fmt.Sprintf("review%d", round), TaskID: k.ID, Idx: round*2 + 1, Retired: round == 0, Specialist: wire.SpecialistReview, State: wire.StepDone, CandidateSHA: sha, Verdict: wire.VerdictApprove, Checks: wire.ChecksPassed}).Error) |
| + } |
| + noFacts := func(name string, v any) { |
| + t.Helper() |
| + raw, err := json.Marshal(v) |
| + must(err) |
| + if strings.Contains(string(raw), `"change_files"`) { |
| + t.Errorf("%s leaked change_files", name) |
| + } |
| + } |
| + task, err := r.s.Task(ctx, hkOwner, k.ID) |
| + must(err) |
| + noFacts("ordinary task", task) |
| + detail, err := r.s.TaskDetail(ctx, hkOwner, k.ID) |
| + must(err) |
| + if len(detail.EarlierSteps) != 2 { |
| + t.Fatal("fixture must include a retired round") |
| + } |
| + for _, step := range append(detail.Steps, detail.EarlierSteps...) { |
| + if step.Specialist == wire.SpecialistEngineering && (step.ChangeFiles == nil || len(step.ChangeFiles.Entries) != 45) { |
| + t.Fatal("detail lost facts") |
| + } |
| + } |
| + list, err := r.s.Tasks(ctx, hkOwner) |
| + must(err) |
| + noFacts("list", list) |
| + snapshot, err := r.s.Snapshot(ctx, hkOwner) |
| + must(err) |
| + noFacts("snapshot", snapshot) |
| + must(r.s.tx(ctx, func(tx *txn) error { |
| + result, err := tx.readTask(k.ID) |
| + if err != nil { |
| + return err |
| + } |
| + var decoded wire.Task |
| + if err := json.Unmarshal([]byte(result.Text), &decoded); err != nil { |
| + t.Errorf("Coordinator task was clipped: %v", err) |
| + } else if decoded.Verdict != wire.VerdictApprove || decoded.NeedsYou != wire.NeedsMerge { |
| + t.Errorf("Coordinator lost current status: verdict=%q needs_you=%q", decoded.Verdict, decoded.NeedsYou) |
| + } |
| + if strings.Contains(result.Text, `"change_files"`) { |
| + t.Error("Coordinator leaked change_files") |
| + } |
| + return tx.taskEvent(k) |
| + })) |
| + events, err := r.s.Events(ctx, hkOwner, 0, 100) |
| + must(err) |
| + noFacts("events", events) |
| + if len(events) == 0 { |
| + t.Fatal("fixture emitted no task event") |
| + } |
| +} |
| + |
| +func TestChangeFilesRejectInvalidBeforeStorage(t *testing.T) { |
| + base, sha := strings.Repeat("a", 40), strings.Repeat("b", 40) |
| + step := stepRecord{Specialist: wire.SpecialistEngineering, State: wire.StepDone, BaseSHA: base, CandidateSHA: sha} |
| + for _, path := range []string{"/absolute", "a\\b", "a\nb", "a\u202eb", string([]byte{255})} { |
| + facts := &wire.ChangeFiles{Base: base, SHA: sha, Files: 1, Entries: []wire.ChangedFile{{Path: path, Status: wire.ChangeFileAdded}}} |
| + if stored := acceptChangeFiles(Lease{Protocol: 31}, wire.RolePrimary, step, facts); stored != "" { |
| + t.Errorf("invalid path stored: %q", path) |
| + } |
| + } |
| +} |
diff --git a/internal/equipo/chat/change_files_test.go b/internal/equipo/chat/change_files_test.go| new file mode 100644 |
| index 00000000..b0c3990d |
| --- /dev/null |
| +++ b/internal/equipo/chat/change_files_test.go |
| @@ -0,0 +1,67 @@ |
| +package chat |
| + |
| +import ( |
| + "encoding/json" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +func TestEngineeringChangeFilesAcceptanceAndDeviceView(t *testing.T) { |
| + base, sha := strings.Repeat("a", 40), strings.Repeat("b", 40) |
| + facts := &wire.ChangeFiles{Base: base, SHA: sha, Files: 1, Additions: 2, Entries: []wire.ChangedFile{{Path: "space 日本語.txt", Status: "added", Additions: 2}}} |
| + good := stepRecord{ID: "s", State: wire.StepDone, Specialist: wire.SpecialistEngineering, BaseSHA: base, CandidateSHA: sha, Attempt: 2} |
| + for name, tc := range map[string]struct { |
| + protocol int |
| + role string |
| + step stepRecord |
| + facts *wire.ChangeFiles |
| + want bool |
| + }{ |
| + "primary": {31, wire.RolePrimary, good, facts, true}, |
| + "worker": {31, wire.RoleWorker, good, facts, true}, |
| + "old": {30, wire.RolePrimary, good, facts, false}, |
| + "role": {31, "unknown", good, facts, false}, |
| + "missing": {31, wire.RolePrimary, good, nil, false}, |
| + "review": {31, wire.RolePrimary, stepRecord{Specialist: wire.SpecialistReview, BaseSHA: base, CandidateSHA: sha}, facts, false}, |
| + "candidate": {31, wire.RolePrimary, stepRecord{Specialist: wire.SpecialistEngineering, BaseSHA: base, CandidateSHA: base}, facts, false}, |
| + "base": {31, wire.RolePrimary, stepRecord{Specialist: wire.SpecialistEngineering, BaseSHA: sha, CandidateSHA: sha}, facts, false}, |
| + } { |
| + t.Run(name, func(t *testing.T) { |
| + stored := acceptChangeFiles(Lease{Protocol: tc.protocol}, tc.role, tc.step, tc.facts) |
| + if (stored != "") != tc.want { |
| + t.Fatalf("accept: %q", stored) |
| + } |
| + s := tc.step |
| + s.ChangeFiles = stored |
| + v := stepView(s) |
| + if v.ChangeFiles != nil { |
| + t.Fatal("ordinary step view leaked facts") |
| + } |
| + v.ChangeFiles = stepChangeFilesView(s) |
| + if (v.ChangeFiles != nil) != tc.want { |
| + t.Fatalf("view %+v", v.ChangeFiles) |
| + } |
| + if tc.want { |
| + a, _ := json.Marshal(v.ChangeFiles) |
| + b, _ := json.Marshal(facts) |
| + if string(a) != string(b) { |
| + t.Fatalf("%s != %s", a, b) |
| + } |
| + } |
| + }) |
| + } |
| + raw, _ := json.Marshal(facts) |
| + for _, s := range []stepRecord{ |
| + {State: wire.StepDone, Specialist: wire.SpecialistReview, BaseSHA: base, CandidateSHA: sha, ChangeFiles: string(raw)}, |
| + {State: wire.StepDone, Specialist: wire.SpecialistEngineering, BaseSHA: base, CandidateSHA: base, ChangeFiles: string(raw)}, |
| + {State: wire.StepDone, Specialist: wire.SpecialistEngineering, BaseSHA: sha, CandidateSHA: sha, ChangeFiles: string(raw)}, |
| + {State: wire.StepRunning, Specialist: wire.SpecialistEngineering, BaseSHA: base, CandidateSHA: sha, ChangeFiles: string(raw)}, |
| + {State: wire.StepDone, Specialist: wire.SpecialistEngineering, BaseSHA: base, CandidateSHA: sha, ChangeFiles: "{"}, |
| + } { |
| + if stepChangeFilesView(s) != nil { |
| + t.Fatal("stale or malformed projection") |
| + } |
| + } |
| +} |
diff --git a/internal/equipo/chat/handoff.go b/internal/equipo/chat/handoff.go| index 6e9a300d..7becee0f 100644 |
| --- a/internal/equipo/chat/handoff.go |
| +++ b/internal/equipo/chat/handoff.go |
| @@ -740,6 +740,23 @@ func (t *txn) handoffSettled(h handoffRecord) (bool, error) { |
| return true, nil |
| } |
| +// noAccess: s is a merge step refused for want of access to publish to |
| +// the repository: the runner had no usable credential for it (merge_credential), |
| +// or the hub said the agent may not merge there (merge_forbidden). |
| +func noAccess(s *stepRecord) bool { |
| + return s != nil && s.Specialist == wire.SpecialistMerge && (s.Reason == wire.ReasonMergeCredential || s.Reason == "merge_forbidden") |
| +} |
| + |
| +// goingLiveCause is why going live stopped on the failed step s: |
| +// causeNoAccess when it is a merge refused for want of access (trying |
| +// again cannot help), else causeGoingLive. |
| +func goingLiveCause(s *stepRecord) string { |
| + if noAccess(s) { |
| + return causeNoAccess |
| + } |
| + return causeGoingLive |
| +} |
| + |
| // mergeFailed: the task is back at Ready to merge because its candidate's |
| // merge failed and ended (merge.go's mergeFailed): only the person's |
| // Merge tries it again. |
| @@ -827,6 +844,10 @@ func (t *txn) taskSummary(k taskRecord) (string, error) { |
| stage := "assistant.team.stage." + k.Stage |
| switch needs := pr.needsYou(k); { |
| case wire.FinalStage(k.Stage): |
| + case (needs == wire.NeedsMerge || needs == wire.NeedsRetry) && !k.CancelRequested && pr.merge != nil && pr.merge.State == wire.StepFailed && pr.merge.Terminated && noAccess(pr.merge): |
| + // Going live was refused for want of access: what is missing, |
| + // never "waits for a go-ahead". |
| + stage = "assistant.team.no_access" |
| case needs != "" && needs != wire.NeedsMerge: |
| stage = "assistant.team.stopped" |
| case !slices.Contains(wire.Stages, k.Stage) || k.CancelRequested: |
| @@ -898,6 +919,43 @@ func (t *txn) stopReason(h handoffRecord) (string, error) { |
| // on the person from the moment it is raised), unless the work ended: a |
| // project's question left open then is not the job's stop. |
| func (t *txn) jobStop(h handoffRecord, settled bool) (reason, cause string, ended bool, err error) { |
| + reason, cause, ended, err = t.firstStop(h, settled) |
| + if err != nil || cause != causeGoingLive { |
| + return reason, cause, ended, err |
| + } |
| + // Going live failed: refused for want of access on any of its tasks |
| + // says so, whichever came first, so the person is never told to try |
| + // again what cannot work until access is set up. |
| + tasks, err := t.handoffTasks(h) |
| + if err != nil { |
| + return "", "", false, err |
| + } |
| + for _, k := range tasks { |
| + if wire.FinalStage(k.Stage) { |
| + continue |
| + } |
| + steps, err := t.steps(k.ID) |
| + if err != nil { |
| + return "", "", false, err |
| + } |
| + var newest *stepRecord |
| + for i := range steps { |
| + if steps[i].Specialist != wire.SpecialistResearch { |
| + newest = &steps[i] |
| + } |
| + } |
| + pr := progressFor(k, steps) |
| + switch needs := pr.needsYou(k); { |
| + case needs == wire.NeedsMerge && mergeFailed(k, pr) && noAccess(pr.merge), needs == wire.NeedsRetry && noAccess(newest): |
| + return reason, causeNoAccess, ended, nil |
| + } |
| + } |
| + return reason, cause, ended, nil |
| +} |
| + |
| +// firstStop is jobStop's stop from the first task (oldest first) that |
| +// stops the job, before any access refusal among them is looked for. |
| +func (t *txn) firstStop(h handoffRecord, settled bool) (reason, cause string, ended bool, err error) { |
| tasks, err := t.handoffTasks(h) |
| if err != nil { |
| return "", "", false, err |
| @@ -932,9 +990,9 @@ func (t *txn) jobStop(h handoffRecord, settled bool) (reason, cause string, ende |
| pr := progressFor(k, steps) |
| switch needs := pr.needsYou(k); { |
| case needs == wire.NeedsMerge && mergeFailed(k, pr): |
| - return stopBlocked, causeGoingLive, false, nil |
| + return stopBlocked, goingLiveCause(pr.merge), false, nil |
| case needs == wire.NeedsRetry && live: |
| - return stopBlocked, causeGoingLive, false, nil |
| + return stopBlocked, goingLiveCause(newest), false, nil |
| case needs == wire.NeedsRetry: |
| failed = true |
| case needs != "" && needs != wire.NeedsMerge: |
| @@ -1115,9 +1173,9 @@ func (t *txn) jobNote(h handoffRecord) (string, error) { |
| return "", err |
| } |
| // A Publish asked again because going live failed is not ready: the |
| - // person tries again. |
| + // person tries again. Nor is going live refused for want of access. |
| ready := false |
| - if !asking && cause != causeGoingLive { |
| + if !asking && cause != causeGoingLive && cause != causeNoAccess { |
| if ready, err = t.readyToTry(h); err != nil { |
| return "", err |
| } |
diff --git a/internal/equipo/chat/handoff_test.go b/internal/equipo/chat/handoff_test.go| index 5114835b..65b0f273 100644 |
| --- a/internal/equipo/chat/handoff_test.go |
| +++ b/internal/equipo/chat/handoff_test.go |
| @@ -101,7 +101,7 @@ func TestFallbackTitle(t *testing.T) { |
| // step, and going live that failed. Unknown, it is no line. |
| func TestJobNoteBlockedLines(t *testing.T) { |
| causes := []string{wire.CardAccess, wire.CardHome, wire.CardDirection, wire.CardSpecialist, wire.CardResearchSources, wire.CardResearchInventory, wire.CardMergeShips, wire.CardMergePolicy, |
| - wire.NeedsHeld, wire.NeedsBranchMoved, wire.NeedsReviewBlocked, wire.NeedsFixRounds, wire.NeedsMergeConflict, wire.NeedsMachineRemoved, wire.NeedsRunnerOffline, wire.NeedsMacSandbox, wire.NeedsDirection, causeGoingLive} |
| + wire.NeedsHeld, wire.NeedsBranchMoved, wire.NeedsReviewBlocked, wire.NeedsFixRounds, wire.NeedsMergeConflict, wire.NeedsMachineRemoved, wire.NeedsRunnerOffline, wire.NeedsMacSandbox, wire.NeedsDirection, causeGoingLive, causeNoAccess} |
| for _, c := range causes { |
| if line := blockedLine(c); line == "" || strings.HasSuffix(line, ".") || strings.ContainsAny(line, "\n[]") { |
| t.Errorf("%s: %q", c, line) |
| @@ -115,4 +115,29 @@ func TestJobNoteBlockedLines(t *testing.T) { |
| t.Errorf("%q: %q", c, line) |
| } |
| } |
| + // Going live refused for want of access: what is missing, and never |
| + // an invitation to try the same again. |
| + if line := blockedLine(causeNoAccess); !strings.Contains(line, "no access") || strings.Contains(strings.ToLower(line), "equipo") || strings.Contains(line, "need to try it again") || line == blockedLine(causeGoingLive) { |
| + t.Errorf("no access: %q", line) |
| + } |
| +} |
| + |
| +// TestGoingLiveCause: a failed merge refused for want of access (the |
| +// runner's own refusal, or the hub's forbidden) stops its job on access; |
| +// any other failed merge or publish on going live. |
| +func TestGoingLiveCause(t *testing.T) { |
| + for _, c := range []struct { |
| + s *stepRecord |
| + want string |
| + }{ |
| + {&stepRecord{Specialist: wire.SpecialistMerge, Reason: wire.ReasonMergeCredential}, causeNoAccess}, |
| + {&stepRecord{Specialist: wire.SpecialistMerge, Reason: "merge_forbidden"}, causeNoAccess}, |
| + {&stepRecord{Specialist: wire.SpecialistMerge, Reason: "merge_failed"}, causeGoingLive}, |
| + {&stepRecord{Specialist: wire.SpecialistPublish, Reason: wire.ReasonMergeCredential}, causeGoingLive}, |
| + {nil, causeGoingLive}, |
| + } { |
| + if got := goingLiveCause(c.s); got != c.want { |
| + t.Errorf("%+v: %q, want %q", c.s, got, c.want) |
| + } |
| + } |
| } |
diff --git a/internal/equipo/chat/http.go b/internal/equipo/chat/http.go| index 0b88ba91..17ff1ac3 100644 |
| --- a/internal/equipo/chat/http.go |
| +++ b/internal/equipo/chat/http.go |
| @@ -821,7 +821,7 @@ func (h *HTTP) tasks(w http.ResponseWriter, r *http.Request, p personapi.PersonP |
| } |
| func (h *HTTP) task(w http.ResponseWriter, r *http.Request, p personapi.PersonPrincipal) { |
| - out, err := h.Store.Task(r.Context(), p.Address, chi.URLParam(r, "id")) |
| + out, err := h.Store.TaskDetail(r.Context(), p.Address, chi.URLParam(r, "id")) |
| if err != nil { |
| h.fail(w, r, err) |
| return |
diff --git a/internal/equipo/chat/jobs.go b/internal/equipo/chat/jobs.go| index 96a99efa..990c6fc0 100644 |
| --- a/internal/equipo/chat/jobs.go |
| +++ b/internal/equipo/chat/jobs.go |
| @@ -223,11 +223,16 @@ func (t *txn) jobView(h handoffRecord) (state, result, detail, carryOn string, l |
| } |
| return state, t.copy("assistant.job.status." + key), t.copy("assistant.job.detail." + key), "", links, nil |
| } |
| - return state, t.copy("assistant.job." + state), t.copy("assistant.job.detail." + state), "", links, nil |
| + detail = t.copy("assistant.job.detail." + state) |
| + if state == wire.JobStopped && key != "" { |
| + detail = t.copy("assistant.job.detail." + key) |
| + } |
| + return state, t.copy("assistant.job." + state), detail, "", links, nil |
| } |
| -// jobState is jobView's state, a working job's status key and the link |
| -// the state offers first, if any. |
| +// jobState is jobView's state, a working job's status key (a stopped |
| +// job's detail key when it has one of its own) and the link the state |
| +// offers first, if any. |
| func (t *txn) jobState(h handoffRecord) (state, key string, first *wire.CardLink, err error) { |
| if h.State == handoffCancelled { |
| return wire.JobStopped, "", nil, nil |
| @@ -238,7 +243,7 @@ func (t *txn) jobState(h handoffRecord) (state, key string, first *wire.CardLink |
| } |
| // The job's note's stop (jobStop): a blocker only the person clears |
| // stops it before its work settles too. |
| - reason, _, ended, err := t.jobStop(h, settled) |
| + reason, cause, ended, err := t.jobStop(h, settled) |
| if err != nil { |
| return "", "", nil, err |
| } |
| @@ -271,6 +276,10 @@ func (t *txn) jobState(h handoffRecord) (state, key string, first *wire.CardLink |
| if err != nil || asking { |
| return wire.JobAsking, "", nil, err |
| } |
| + if reason != "" && cause == causeNoAccess { |
| + // Going live refused for want of access: its own sentence. |
| + return wire.JobStopped, causeNoAccess, nil, nil |
| + } |
| if reason != "" { |
| return wire.JobStopped, "", nil, nil |
| } |
diff --git a/internal/equipo/chat/tasks.go b/internal/equipo/chat/tasks.go| index 976c1edc..07865566 100644 |
| --- a/internal/equipo/chat/tasks.go |
| +++ b/internal/equipo/chat/tasks.go |
| @@ -224,6 +224,7 @@ type stepRecord struct { |
| // kept only when it passed acceptance. DecidedBy is who decided a |
| // merge step ("policy", or "person:<address>"); MergeSource and |
| // MergeParents (JSON) where its SHA came from. |
| + ChangeFiles string // Presentation only: bounded Engineering file list. |
| ChangeFacts string |
| DecidedBy string |
| MergeSource string |
| @@ -506,6 +507,14 @@ func stepViewSwitched(s stepRecord) wire.Step { |
| // taskView is the task with its project, findings, steps and thread. |
| func (t *txn) taskView(k taskRecord) (wire.Task, error) { |
| + return t.taskViewWith(k, taskViewOptions{}) |
| +} |
| + |
| +// Large presentation facts are opt-in for the device detail read. All tools, |
| +// lists, snapshots, events and ordinary reads use taskView's compact default. |
| +type taskViewOptions struct{ changeFiles bool } |
| + |
| +func (t *txn) taskViewWith(k taskRecord, options taskViewOptions) (wire.Task, error) { |
| v := wire.Task{Stopping: k.MoveAbandoned && k.CancelRequested && !wire.FinalStage(k.Stage), PreparingProject: strings.HasPrefix(k.MoveProject, "new:"), Moving: k.MoveProject != "", CopyHold: k.CopyHold, ID: k.ID, Revision: k.Revision, ProjectID: k.ProjectID, Title: k.Title, Brief: k.Brief, Stage: k.Stage, Branch: k.Branch, BaseSHA: k.BaseSHA, Creator: k.Creator, TurnID: k.TurnID, Findings: []wire.Finding{}, Steps: []wire.Step{}, Thread: []wire.ThreadEntry{}, CreatedAt: k.CreatedAt, UpdatedAt: k.UpdatedAt} |
| if k.DoneAt != nil { |
| done := k.DoneAt.UTC() |
| @@ -533,6 +542,9 @@ func (t *txn) taskView(k taskRecord) (wire.Task, error) { |
| } |
| for _, s := range steps { |
| sv := stepViewSwitched(s) |
| + if options.changeFiles { |
| + sv.ChangeFiles = stepChangeFilesView(s) |
| + } |
| sv.RunnerLabel = t.stepRunnerLabel(s) |
| sv.Paused = t.stepPaused(k, s) |
| if s.Specialist == wire.SpecialistResearch && (s.State == wire.StepDone || s.State == wire.StepFailed || s.State == wire.StepCancelled) { |
| @@ -552,7 +564,11 @@ func (t *txn) taskView(k taskRecord) (wire.Task, error) { |
| return v, err |
| } |
| for _, st := range earlier { |
| - v.EarlierSteps = append(v.EarlierSteps, stepView(st)) |
| + sv := stepView(st) |
| + if options.changeFiles { |
| + sv.ChangeFiles = stepChangeFilesView(st) |
| + } |
| + v.EarlierSteps = append(v.EarlierSteps, sv) |
| } |
| pr := progressFor(k, steps) |
| for i := len(steps) - 1; i >= 0; i-- { |
| @@ -775,7 +791,7 @@ func (t *txn) writeStep(s *stepRecord) error { |
| } |
| s.Revision++ |
| s.UpdatedAt = t.now() |
| - if err := t.db.Model(&stepRecord{}).Where("id = ?", s.ID).Select("base_checks", "base_checks_sha", "copy_owner", "copy_revision", "copy_result", "failure_signature", "state", "reason", "attempt", "base_sha", "candidate_sha", "pushed", "terminated", "summary", "log_tail", "started_at", "finished_at", "revision", "updated_at", "headline", "family", "account", "verdict", "review_label", "findings", "checks", "gate", "exit_code", "output", "republish", "from_attempt", "askable", "rebase", "from_base", "from_candidate", "merge_sha", "merge_into", "merge_strategy", "without_checks", "switched", "activity", "runner_id", "needs", "placement", "waiting_since", "refused_by", "withdrawn", "termination_kind", "publication", "publication_id", "apple", "checks_sandbox", "change_facts", "decided_by", "merge_source", "merge_parents", "hosted_ci", "kind", "note", "sandbox_runner", "unsandboxed_by", "unsandboxed_at", "unsandboxed_attempt", "unsandboxed_runner", "has_preview", "preview", "boundary", "question", "request_turn", "sources_card", "sources_hash", "research_grant", "research_grant_revision", "hold", "housekeeping_attempt", "coordinator_attempt", "held_at", "publish", "model").Updates(s).Error; err != nil { |
| + if err := t.db.Model(&stepRecord{}).Where("id = ?", s.ID).Select("base_checks", "base_checks_sha", "copy_owner", "copy_revision", "copy_result", "failure_signature", "state", "reason", "attempt", "base_sha", "candidate_sha", "pushed", "terminated", "summary", "log_tail", "started_at", "finished_at", "revision", "updated_at", "headline", "family", "account", "verdict", "review_label", "findings", "checks", "gate", "exit_code", "output", "republish", "from_attempt", "askable", "rebase", "from_base", "from_candidate", "merge_sha", "merge_into", "merge_strategy", "without_checks", "switched", "activity", "runner_id", "needs", "placement", "waiting_since", "refused_by", "withdrawn", "termination_kind", "publication", "publication_id", "apple", "checks_sandbox", "change_files", "change_facts", "decided_by", "merge_source", "merge_parents", "hosted_ci", "kind", "note", "sandbox_runner", "unsandboxed_by", "unsandboxed_at", "unsandboxed_attempt", "unsandboxed_runner", "has_preview", "preview", "boundary", "question", "request_turn", "sources_card", "sources_hash", "research_grant", "research_grant_revision", "hold", "housekeeping_attempt", "coordinator_attempt", "held_at", "publish", "model").Updates(s).Error; err != nil { |
| return err |
| } |
| if s.Retired { |
| @@ -1561,6 +1577,7 @@ func (t *txn) stepReport(l Lease, v *wire.StepReport) error { |
| } |
| s.Pushed = true |
| } |
| + s.ChangeFiles = acceptChangeFiles(l, role, s, v.ChangeFiles) |
| s.Apple = v.Apple |
| s.Askable = v.Askable |
| if s.Rebase && s.BaseSHA != "" { |
| @@ -1929,9 +1946,19 @@ func (t *txn) recentTasks(limit int) ([]wire.Task, error) { |
| } |
| // Task reads one task. |
| -func (s *Store) Task(ctx context.Context, person, id string) (out wire.Task, err error) { |
| +func (s *Store) Task(ctx context.Context, person, id string) (wire.Task, error) { |
| + return s.readTaskView(ctx, person, id, taskViewOptions{}) |
| +} |
| + |
| +// TaskDetail is the device's GET /tasks/{id} projection, including bounded |
| +// file facts. It shares Task's current-member and task-read authorization. |
| +func (s *Store) TaskDetail(ctx context.Context, person, id string) (wire.Task, error) { |
| + return s.readTaskView(ctx, person, id, taskViewOptions{changeFiles: true}) |
| +} |
| + |
| +func (s *Store) readTaskView(ctx context.Context, person, id string, options taskViewOptions) (out wire.Task, err error) { |
| err = s.read(ctx, func(tx *gorm.DB) error { |
| - out, err = s.TaskAt(ctx, tx, id) |
| + out, err = s.taskAt(ctx, tx, id, options) |
| return err |
| }) |
| return out, err |
| @@ -1940,6 +1967,10 @@ func (s *Store) Task(ctx context.Context, person, id string) (out wire.Task, err |
| // TaskAt uses task-read authority on the caller's transaction. Preview grants |
| // need that same read atomically with their credential and single-use checks. |
| func (s *Store) TaskAt(ctx context.Context, tx *gorm.DB, id string) (wire.Task, error) { |
| + return s.taskAt(ctx, tx, id, taskViewOptions{}) |
| +} |
| + |
| +func (s *Store) taskAt(ctx context.Context, tx *gorm.DB, id string, options taskViewOptions) (wire.Task, error) { |
| if err := s.authority.CurrentPerson(ctx, tx); err != nil { |
| return wire.Task{}, err |
| } |
| @@ -1948,7 +1979,7 @@ func (s *Store) TaskAt(ctx context.Context, tx *gorm.DB, id string) (wire.Task, |
| if err != nil { |
| return wire.Task{}, err |
| } |
| - return t.taskView(k) |
| + return t.taskViewWith(k, options) |
| } |
| // CancelTask is POST /tasks/{id}/cancel: owners only. |
diff --git a/internal/equipo/chat/tools.go b/internal/equipo/chat/tools.go| index ac78940b..d23c6d72 100644 |
| --- a/internal/equipo/chat/tools.go |
| +++ b/internal/equipo/chat/tools.go |
| @@ -134,9 +134,15 @@ const ( |
| // the person tries going live again. |
| const causeGoingLive = "going_live" |
| +// causeNoAccess: a job's merge was refused for want of access to publish |
| +// to its repository (goingLiveCause): trying again cannot help until |
| +// someone sets that access up, so the person is never invited to. |
| +const causeNoAccess = "no_access" |
| + |
| // blockedLine is noteBlocked's plain words for what stopped a job for |
| // its person: a team card that waits on them (by kind), a task's need, |
| -// or going live that failed ("" for anything else). |
| +// going live that failed, or going live refused for want of access ("" for |
| +// anything else). |
| func blockedLine(cause string) string { |
| switch cause { |
| case wire.CardAccess: |
| @@ -167,6 +173,10 @@ func blockedLine(cause string) string { |
| return "they need to let it be tested on their Mac" |
| case causeGoingLive: |
| return "going live failed, and they need to try it again" |
| + case causeNoAccess: |
| + // Read by the model only, never shown as copy (covered: Paul, |
| + // 2026-11-26, coordinator session). It never names Equipo. |
| + return "there is no access to publish it where the work lives, and someone needs to set that access up before it can go live; trying again will not help until then" |
| } |
| return "" |
| } |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index 70c8347e..fc169758 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -2414,6 +2414,15 @@ var pageCopy = map[string]string{ |
| "api.already_running": "A request to run this work is already in progress.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| "api.offer_changed": "The option to run this work has changed. Check the current option, then try again.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| "work.pause.run_now_may_bill": "This may use a plan that bills per use.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| + |
| + // Going live refused for want of access to publish to the repository: |
| + // the runner had no usable credential for it (merge_credential), or the |
| + // hub said the agent may not merge there (merge_forbidden). Trying |
| + // again cannot help until someone sets that access up, so neither |
| + // invites it: where the work stands, told to the Assistant, and the |
| + // stopped job card's sentence more. |
| + "assistant.team.no_access": "The change is ready, but it can't go live until access to publish it is set up.", // COPY APPROVED (Paul, 2026-11-26, coordinator session, unchanged) |
| + "assistant.job.detail.no_access": "It can't go live until access to publish it is set up.", // COPY APPROVED (Paul, 2026-11-26, coordinator session, unchanged) |
| } |
| // pasteLabels are the paste box's words, for the shared renderer, and |
diff --git a/internal/equipo/mergegate/presentation_regression_test.go b/internal/equipo/mergegate/presentation_regression_test.go| new file mode 100644 |
| index 00000000..30ad3557 |
| --- /dev/null |
| +++ b/internal/equipo/mergegate/presentation_regression_test.go |
| @@ -0,0 +1,63 @@ |
| +package mergegate |
| + |
| +import ( |
| + "encoding/json" |
| + "os" |
| + "path/filepath" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// This golden was measured on main 18fb5be4 before ChangeFiles existed. |
| +// It pins byte-identical decisions for identical inputs, including protocol 31. |
| +func TestPresentationFactsLeaveReviewGateUnchanged(t *testing.T) { |
| + cases := map[string]func(*Inputs){ |
| + "ordinary": func(*Inputs) {}, |
| + "checked": func(i *Inputs) { i.Checks = wire.ChecksPassed; i.Eligible = true }, |
| + "failed": func(i *Inputs) { i.Checks = wire.ChecksFailed }, |
| + "not-approved": func(i *Inputs) { i.Verdict = wire.VerdictChanges }, |
| + "held": func(i *Inputs) { i.Hold = "Wait" }, |
| + "large": func(i *Inputs) { i.Change.Files = 201; i.Change.Lines = 5000 }, |
| + "binary": func(i *Inputs) { i.Change.Binary = 1 }, |
| + "special": func(i *Inputs) { i.Change.Special = true }, |
| + "signing": func(i *Inputs) { i.Change.Signing = true }, |
| + "gate-files": func(i *Inputs) { i.Change.GateFilesChanged = true }, |
| + "short-review": func(i *Inputs) { i.Change.ReviewTruncated = true }, |
| + "incomplete": func(i *Inputs) { i.Change.Complete = false }, |
| + "missing": func(i *Inputs) { i.Change = nil }, |
| + "ask": func(i *Inputs) { i.Policy.Mode = ModeAsk }, |
| + "person": func(i *Inputs) { i.Person = true }, |
| + } |
| + all := map[string]map[int]Decision{} |
| + for name, change := range cases { |
| + all[name] = map[int]Decision{} |
| + for _, protocol := range []int{27, 28, 30, 31} { |
| + in := passing() |
| + in.Protocol = protocol |
| + change(&in) |
| + all[name][protocol] = Decide(in) |
| + } |
| + } |
| + got, err := json.MarshalIndent(all, "", " ") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + got = append(got, '\n') |
| + file := filepath.Join("testdata", "presentation-gate.json") |
| + if os.Getenv("EQUIPO_CAPTURE_GATE_BASELINE") == "1" { |
| + if err := os.MkdirAll("testdata", 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.WriteFile(file, got, 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + want, err := os.ReadFile(file) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if string(got) != string(want) { |
| + t.Fatal("Review gate decisions changed from main baseline") |
| + } |
| +} |
diff --git a/internal/equipo/mergegate/testdata/presentation-gate.json b/internal/equipo/mergegate/testdata/presentation-gate.json| new file mode 100644 |
| index 00000000..1867c53b |
| --- /dev/null |
| +++ b/internal/equipo/mergegate/testdata/presentation-gate.json |
| @@ -0,0 +1,2696 @@ |
| +{ |
| + "ask": { |
| + "27": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": false |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": false, |
| + "value": "ask" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "ask", |
| + "stance": "merge", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": false, |
| + "value": "ask" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "ask", |
| + "stance": "merge", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": false, |
| + "value": "ask" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "ask", |
| + "stance": "merge", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": false, |
| + "value": "ask" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + } |
| + }, |
| + "binary": { |
| + "27": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": false |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "ask", |
| + "stance": "merge", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "ask", |
| + "stance": "merge", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "ask", |
| + "stance": "merge", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + } |
| + }, |
| + "checked": { |
| + "27": { |
| + "class": "ask", |
| + "stance": "merge", |
| + "checks": true, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "first_ready_checked", |
| + "ok": true |
| + }, |
| + { |
| + "name": "checked_in_sandbox", |
| + "ok": true |
| + }, |
| + { |
| + "name": "trusted_base_checks", |
| + "ok": true |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": false |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "act", |
| + "checks": true, |
| + "decided_by": "policy", |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "first_ready_checked", |
| + "ok": true |
| + }, |
| + { |
| + "name": "checked_in_sandbox", |
| + "ok": true |
| + }, |
| + { |
| + "name": "trusted_base_checks", |
| + "ok": true |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "act", |
| + "checks": true, |
| + "decided_by": "policy", |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "first_ready_checked", |
| + "ok": true |
| + }, |
| + { |
| + "name": "checked_in_sandbox", |
| + "ok": true |
| + }, |
| + { |
| + "name": "trusted_base_checks", |
| + "ok": true |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "act", |
| + "checks": true, |
| + "decided_by": "policy", |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "first_ready_checked", |
| + "ok": true |
| + }, |
| + { |
| + "name": "checked_in_sandbox", |
| + "ok": true |
| + }, |
| + { |
| + "name": "trusted_base_checks", |
| + "ok": true |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + } |
| + }, |
| + "failed": { |
| + "27": { |
| + "class": "never", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": false, |
| + "value": "failed" |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "never", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": false, |
| + "value": "failed" |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "never", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": false, |
| + "value": "failed" |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "never", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": false, |
| + "value": "failed" |
| + } |
| + ] |
| + } |
| + }, |
| + "gate-files": { |
| + "27": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": false |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": false |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": false |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": false |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": false |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + } |
| + }, |
| + "held": { |
| + "27": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": false |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": false |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": false |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": false |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": false |
| + } |
| + ] |
| + } |
| + }, |
| + "incomplete": { |
| + "27": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": false |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": false |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": false |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": false |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": false |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + } |
| + }, |
| + "large": { |
| + "27": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": false |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "ask", |
| + "stance": "merge", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "ask", |
| + "stance": "merge", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "ask", |
| + "stance": "merge", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + } |
| + }, |
| + "missing": { |
| + "27": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": false |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": false |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": false |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": false |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": false |
| + }, |
| + { |
| + "name": "small", |
| + "ok": false |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + } |
| + }, |
| + "not-approved": { |
| + "27": { |
| + "class": "never", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": false |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "never", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": false |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "never", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": false |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "never", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": false |
| + } |
| + ] |
| + } |
| + }, |
| + "ordinary": { |
| + "27": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": false |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "act", |
| + "checks": false, |
| + "decided_by": "policy", |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "act", |
| + "checks": false, |
| + "decided_by": "policy", |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "act", |
| + "checks": false, |
| + "decided_by": "policy", |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + } |
| + }, |
| + "person": { |
| + "27": { |
| + "class": "act", |
| + "checks": false, |
| + "decided_by": "person", |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "act", |
| + "checks": false, |
| + "decided_by": "person", |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "act", |
| + "checks": false, |
| + "decided_by": "person", |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "act", |
| + "checks": false, |
| + "decided_by": "person", |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + } |
| + ] |
| + } |
| + }, |
| + "short-review": { |
| + "27": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": false |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": false |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": false |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": false |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": false |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": true |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + } |
| + }, |
| + "signing": { |
| + "27": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": false |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + } |
| + }, |
| + "special": { |
| + "27": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": false |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "28": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "30": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + }, |
| + "31": { |
| + "class": "ask", |
| + "stance": "wait", |
| + "checks": false, |
| + "reasons": [ |
| + { |
| + "name": "approved_exact_sha", |
| + "ok": true |
| + }, |
| + { |
| + "name": "environment_reason", |
| + "ok": true, |
| + "value": "needs_macos" |
| + }, |
| + { |
| + "name": "runner_protocol", |
| + "ok": true |
| + }, |
| + { |
| + "name": "facts_present", |
| + "ok": true |
| + }, |
| + { |
| + "name": "gate_files_unchanged", |
| + "ok": true |
| + }, |
| + { |
| + "name": "review_diff_complete", |
| + "ok": true |
| + }, |
| + { |
| + "name": "small", |
| + "ok": true |
| + }, |
| + { |
| + "name": "not_sensitive", |
| + "ok": false |
| + }, |
| + { |
| + "name": "main_does_not_ship", |
| + "ok": true, |
| + "value": "no" |
| + }, |
| + { |
| + "name": "policy_allows", |
| + "ok": true, |
| + "value": "rules" |
| + }, |
| + { |
| + "name": "no_hold", |
| + "ok": true |
| + } |
| + ] |
| + } |
| + } |
| +} |
diff --git a/internal/equipo/migrations/0108_change_files.sql b/internal/equipo/migrations/0108_change_files.sql| new file mode 100644 |
| index 00000000..c5c326c3 |
| --- /dev/null |
| +++ b/internal/equipo/migrations/0108_change_files.sql |
| @@ -0,0 +1,2 @@ |
| +-- Bounded Engineering file-list facts, never merge authority. |
| +ALTER TABLE chat_steps ADD COLUMN change_files text; |
diff --git a/internal/equipo/migrations/0108_preview_passes.sql b/internal/equipo/migrations/0109_preview_passes.sql| similarity index 100% |
| rename from internal/equipo/migrations/0108_preview_passes.sql |
| rename to internal/equipo/migrations/0109_preview_passes.sql |
diff --git a/internal/equipo/migrations/schema.sql b/internal/equipo/migrations/schema.sql| index b64239e8..b7f9cf3d 100644 |
| --- a/internal/equipo/migrations/schema.sql |
| +++ b/internal/equipo/migrations/schema.sql |
| @@ -778,6 +778,9 @@ ALTER TABLE chat_cards ADD COLUMN carry_on_connection text; |
| ALTER TABLE chat_releases ADD COLUMN connection text; |
| ALTER TABLE chat_steps ADD COLUMN coordinator_attempt integer; |
| +-- Bounded Engineering file-list facts, never merge authority. |
| +ALTER TABLE chat_steps ADD COLUMN change_files text; |
| + |
| -- Device passes and wrapper-only grants never create a general sign-in session. |
| CREATE TABLE preview_passes ( |
| hash text PRIMARY KEY, id text, instance text, person text, credential text, |
diff --git a/internal/equipo/templates/work_parts.html b/internal/equipo/templates/work_parts.html| index 1a04a0cd..4e1be335 100644 |
| --- a/internal/equipo/templates/work_parts.html |
| +++ b/internal/equipo/templates/work_parts.html |
| @@ -36,7 +36,7 @@ |
| {{define "decision"}}{{$t := .Task}}{{with $t.Decision}}<div equipo-decision{{if eq $.From "task"}} id="decide"{{end}}{{with .Tone}} data-tone="{{.}}"{{end}} data-need="{{.Need}}" data-decision="{{$t.ID}}"> |
| {{if $.Head}}{{template "mono" $t.Mono}}<div equipo-d-title><a href="/tasks/{{$t.ID}}">{{$t.Title}}</a><div equipo-quiet>{{template "placement-chip" $t}} · {{template "source" $t}}</div></div>{{end}} |
| <p equipo-d-why>{{.Why}}</p> |
| -<p equipo-d-ask>{{.Ask}}</p>{{if .Link}}<p equipo-quiet data-direction-line>{{with .LinkText}}{{.}} {{end}}<a equipo-link href="{{.Link}}" rel="noopener noreferrer" target="_blank" data-direction-link>{{.LinkLabel}}</a>{{with .AltLink}} <a equipo-link href="{{.}}" rel="noopener noreferrer" target="_blank" data-direction-branch>{{$t.Decision.AltLabel}}</a>{{end}}</p>{{end}}{{with .Said}}<p equipo-quiet data-triage-said>{{.}}</p>{{end}}{{with .Failed}}<p equipo-quiet data-triage-failed>{{.}}</p>{{end}}{{with .Recommend}}<p equipo-quiet data-triage-recommend>{{.}}</p>{{end}} |
| +{{with .Ask}}<p equipo-d-ask>{{.}}</p>{{end}}{{if .Link}}<p equipo-quiet data-direction-line>{{with .LinkText}}{{.}} {{end}}<a equipo-link href="{{.Link}}" rel="noopener noreferrer" target="_blank" data-direction-link>{{.LinkLabel}}</a>{{with .AltLink}} <a equipo-link href="{{.}}" rel="noopener noreferrer" target="_blank" data-direction-branch>{{$t.Decision.AltLabel}}</a>{{end}}</p>{{end}}{{with .Said}}<p equipo-quiet data-triage-said>{{.}}</p>{{end}}{{with .Failed}}<p equipo-quiet data-triage-failed>{{.}}</p>{{end}}{{with .Recommend}}<p equipo-quiet data-triage-recommend>{{.}}</p>{{end}} |
| <div equipo-d-actions>{{if .CopyContinue}}<form method="post" action="/conversation/tasks/{{$t.ID}}/continue-without-copy"><input type="hidden" name="from" value="{{$.From}}"><button equipo-btn data-primary type="submit" data-copy-continue>{{copy "copy.continue"}}</button></form>{{end}}{{with .Card}}<form method="post" action="/conversation/cards/{{.ID}}/answer"><input type="hidden" name="revision" value="{{.Revision}}"><input type="hidden" name="from" value="{{$.From}}"><input type="hidden" name="task" value="{{$t.ID}}">{{if $.Task.Decision.Note}}<textarea rst-input name="note" maxlength="1000" rows="2" aria-label="{{copy "chat.card.direction_note"}}" placeholder="{{copy "chat.card.direction_note"}}" data-direction-note></textarea>{{end}}{{range $.Task.Decision.Choices}}<button equipo-btn{{if .Primary}} data-primary{{end}} type="submit" name="choice" value="{{.Value}}" data-merge-choice="{{.Value}}">{{.Label}}</button>{{end}}</form>{{end}}{{if .Fold}}<form method="post" action="/tasks/{{$t.ID}}/duplicate"><input type="hidden" name="from" value="{{$.From}}"><input type="hidden" name="of" value="{{$t.Dup.ID}}"><button equipo-btn data-primary type="submit" data-task-duplicate>{{copy "work.decide.fold"}}</button></form>{{end}}{{if .Recover}}<form method="post" action="/conversation/tasks/{{$t.ID}}/recover"><input type="hidden" name="from" value="{{$.From}}"><button equipo-btn data-primary type="submit" data-task-recover>{{copy "work.recover"}}</button></form>{{end}}{{with .Unsandboxed}}<details equipo-mach-confirm data-unsandboxed><summary equipo-btn>{{copy "work.decide.unsandboxed"}}</summary><div><p>{{.Warning}}</p><form method="post" action="/conversation/tasks/{{$t.ID}}/unsandboxed"><input type="hidden" name="from" value="{{$.From}}"><input type="hidden" name="step" value="{{.Step}}"><input type="hidden" name="attempt" value="{{.Attempt}}"><button equipo-btn data-danger type="submit" data-task-unsandboxed>{{copy "work.decide.unsandboxed_confirm"}}</button></form></div></details>{{end}}{{if .Retry}}<form method="post" action="/conversation/tasks/{{$t.ID}}/retry"><input type="hidden" name="from" value="{{$.From}}"><button {{if .Fold}}equipo-link{{else}}equipo-btn data-primary{{end}} type="submit" data-task-retry>{{copy "work.retry"}}</button></form>{{end}}{{if .Round}}<form method="post" action="/conversation/tasks/{{$t.ID}}/round"><input type="hidden" name="from" value="{{$.From}}"><button equipo-btn data-primary type="submit" data-task-round>{{copy "work.decide.round"}}</button></form>{{end}}{{if .Talk}}<a equipo-btn href="/conversation?about={{$t.ID}}" data-ask-coordinator>{{copy "work.decide.ask_coordinator"}}</a>{{end}}{{if .Cancel}}<form method="post" action="/conversation/tasks/{{$t.ID}}/cancel"><input type="hidden" name="from" value="{{$.From}}"><button equipo-link type="submit" data-task-cancel>{{copy "work.decide.cancel"}}</button></form>{{end}}{{with .Hint}}<span equipo-quiet>{{.}}</span>{{end}}<span equipo-d-quiet>{{if .Mac}}<a equipo-link href="/conversation/settings/machines/add" data-set-up-mac>{{copy "work.decide.mac_set_up"}}</a>{{end}}<a equipo-link href="/conversation?about={{$t.ID}}" data-ask-about>{{copy "work.ask_about"}}</a></span></div> |
| </div>{{end}}{{end}} |
| {{define "star-toggle"}}{{$p := .P}}<form method="post" action="/projects/{{$p.ID}}/star" equipo-star-form><input type="hidden" name="starred" value="{{if $p.Star.On}}0{{else}}1{{end}}"><input type="hidden" name="from" value="{{.From}}"><button type="submit" equipo-star{{if $p.Star.On}} aria-pressed="true"{{if $p.Star.Auto}} data-auto{{end}}{{else}} aria-pressed="false"{{end}} aria-label="{{$p.Star.Label}}" title="{{$p.Star.Who}}" data-star-toggle>{{icon "star"}}</button></form>{{end}} |
diff --git a/internal/equipo/work_views.go b/internal/equipo/work_views.go| index 49195a39..72051daa 100644 |
| --- a/internal/equipo/work_views.go |
| +++ b/internal/equipo/work_views.go |
| @@ -750,6 +750,12 @@ func decisionOf(t wire.Task, v taskLine) *decisionView { |
| d.Why = fmt.Sprintf(copyText("work.decide.stopped_why"), who(v.Stopped), reason, attempt) |
| d.Retry, d.Cancel = v.Retry, v.Cancel |
| d.Ask = copyText("work.decide.retry_ask") |
| + if v.Stopped != nil && v.Stopped.Specialist == wire.SpecialistMerge && (v.Stopped.Reason == wire.ReasonMergeCredential || v.Stopped.Reason == "merge_forbidden") { |
| + // Trying again cannot help until someone sets up access: |
| + // the reason says what is missing, and nothing asks to try |
| + // again (Retry stays, for once access is given). |
| + d.Ask = "" |
| + } |
| case wire.NeedsFixRounds: |
| d.Tone, d.Why, d.Ask, d.Talk, d.Cancel, d.Round = "attention", copyText("work.decide.fix_rounds_why"), copyText("work.decide.talk_ask"), true, v.Cancel, v.Mine |
| if t.ChecksReason == "base_checks_failed" { |
diff --git a/internal/equipo/work_views_test.go b/internal/equipo/work_views_test.go| index fa9393e7..06e9eccd 100644 |
| --- a/internal/equipo/work_views_test.go |
| +++ b/internal/equipo/work_views_test.go |
| @@ -1,6 +1,7 @@ |
| package equipo |
| import ( |
| + "fmt" |
| "strings" |
| "testing" |
| "time" |
| @@ -51,6 +52,49 @@ func TestStoppedMergeShowsTheHubAnswer(t *testing.T) { |
| t.Fatalf("no stopped merge in %+v", timelineOf(task, v)) |
| } |
| +// A merge the runner refused for want of access says what is missing, |
| +// on the stage line and in the timeline, not that Amadan did not merge |
| +// it; the runner's words on which precondition failed are its details. |
| +func TestStoppedMergeWithoutAccess(t *testing.T) { |
| + now := time.Now() |
| + words := copyText("work.reason." + wire.ReasonMergeCredential) |
| + if words == "" { |
| + t.Fatal("no words for merge_credential") |
| + } |
| + tail := "error: forge: no usable forge credential for the repository" |
| + task := wire.Task{ID: "tk1", Creator: "a@example.com", Stage: wire.StageReadyToMerge, Steps: []wire.Step{{Specialist: wire.SpecialistMerge, State: wire.StepFailed, Reason: wire.ReasonMergeCredential, Attempt: 1, Terminated: true, LogTail: tail, FinishedAt: &now}}} |
| + v := taskLineOf(task, "a@example.com") |
| + v.richOf(task, "a@example.com", nil, now) |
| + if v.StageLine != fmt.Sprintf(copyText("work.stopped"), words) { |
| + t.Fatalf("stage line %q", v.StageLine) |
| + } |
| + for _, it := range timelineOf(task, v) { |
| + if it.Kind == "stopped" && it.Headline == sentenceCase(words)+"." { |
| + if html := string(pasteBox.Render(it.Markdown)); !strings.Contains(html, "no usable forge credential") { |
| + t.Fatalf("details %q", html) |
| + } |
| + return |
| + } |
| + } |
| + t.Fatalf("no stopped merge in %+v", timelineOf(task, v)) |
| +} |
| + |
| +// A merge stopped for want of access that waits on the person asks no |
| +// "Try again?": nothing the person can retry helps until access is |
| +// given. Another stopped merge still asks. |
| +func TestStoppedMergeWithoutAccessAsksNoRetry(t *testing.T) { |
| + now := time.Now() |
| + for reason, ask := range map[string]string{wire.ReasonMergeCredential: "", "merge_forbidden": "", "merge_failed": copyText("work.decide.retry_ask")} { |
| + task := wire.Task{ID: "tk1", Creator: "a@example.com", Stage: wire.StageMerging, NeedsYou: wire.NeedsRetry, Steps: []wire.Step{{Specialist: wire.SpecialistMerge, State: wire.StepFailed, Reason: reason, Attempt: 1, Terminated: true, FinishedAt: &now}}} |
| + v := taskLineOf(task, "a@example.com") |
| + v.richOf(task, "a@example.com", nil, now) |
| + d := decisionOf(task, v) |
| + if d == nil || d.Ask != ask || !strings.Contains(d.Why, copyText("work.reason."+reason)) { |
| + t.Fatalf("%s: %+v", reason, d) |
| + } |
| + } |
| +} |
| + |
| // A push the hub refused shows the person why: the stopped step's details |
| // carry the refusal and git's answer from the runner's report, as written |
| // (the runner redacts and bounds them). |
diff --git a/internal/plan3test/plan3_release_test.go b/internal/plan3test/plan3_release_test.go| index 5cefd80c..7707fb82 100644 |
| --- a/internal/plan3test/plan3_release_test.go |
| +++ b/internal/plan3test/plan3_release_test.go |
| @@ -183,6 +183,9 @@ func plan3CopyInventory(t *testing.T) { |
| approvedFailedReplies := strings.HasPrefix(key, "chat.failed.") && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)") || key == "signin.refused" && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-22, copy-review smart-door-copy-5, unchanged)") |
| // Paul's own review of the Engineering stop reasons. |
| approvedStopReasons := slices.Contains([]string{"work.reason.no_further_changes", "work.reason.tools_refused"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-23, copy-review eavqvil43jg2zs3wxx3kxp3bpm, unchanged)") |
| + // Paul's approval of the no-access going-live strings, given in the |
| + // coordinator's session (2026-11-26). |
| + approvedNoAccess := slices.Contains([]string{"assistant.team.no_access", "assistant.job.detail.no_access"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-26, coordinator session, unchanged)") |
| // Paul's own review of the merge step's credential and hub reasons. |
| approvedMergeCredential := slices.Contains([]string{"work.reason.merge_credential", "work.reason.amadan_unreachable"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-25, copy-review 6wxwi7zo3fph5nu4nm6eipptfq, unchanged)") |
| // Paul's own review of the coordinator's stuck-task strings. |
| @@ -212,7 +215,7 @@ func plan3CopyInventory(t *testing.T) { |
| acceptedProjects := slices.Contains([]string{"projects.amadan", "projects.yours", "projects.can_add", "projects.add_reachable", "projects.names", "projects.names_hint", "projects.details", "projects.title", "projects.description", "projects.save", "projects.context", "projects.found", "projects.selected", "projects.owner_add", "projects.selection_lost", "projects.other", "projects.name_question", "projects.personal_names", "projects.forget_name", "docs/api/equipo-v1.md / Projects and starting a request"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-22)") |
| acceptedAgentAccess := slices.Contains([]string{"copyAgentConfig", "copyAgentForbidden", "copyAgentNotFound", "copyAgentUnavailable", "copyAgentTooLarge", "copyAgentInvalid", "copyAgentMedia", "copyAgentUnauthenticated", "agent.equipo_projects_list", "agent.equipo_tasks_list", "agent.equipo_task_get", "agent.equipo_needs_you", "docs/api/equipo-v1.md / Delegated read-only operations"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-20)") |
| acceptedCopy := strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Copy, record-bound) sha256:"+copydesk.Hash(rows[key]) |
| - if !approvedMergeCredential && !approvedStuckTasks && !acceptedPaused && !acceptedNewTeamCard && !acceptedGitHubEgress && !acceptedForgeSeam && !acceptedAPIErrors && !acceptedNativeProjects && !acceptedInjection && !acceptedMail && !acceptedPush && !acceptedAgentAccess && !acceptedProjects && !acceptedCardNames && !acceptedAccess && !acceptedPlacementEdges && !acceptedPlacement && !acceptedReportActions && !acceptedRoster && !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs && !approvedOficina && !approvedFailedReplies && !approvedStopReasons { |
| + if !approvedNoAccess && !approvedMergeCredential && !approvedStuckTasks && !acceptedPaused && !acceptedNewTeamCard && !acceptedGitHubEgress && !acceptedForgeSeam && !acceptedAPIErrors && !acceptedNativeProjects && !acceptedInjection && !acceptedMail && !acceptedPush && !acceptedAgentAccess && !acceptedProjects && !acceptedCardNames && !acceptedAccess && !acceptedPlacementEdges && !acceptedPlacement && !acceptedReportActions && !acceptedRoster && !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs && !approvedOficina && !approvedFailedReplies && !approvedStopReasons { |
| t.Fatal("entry has no copy review status or applicable acceptance", key) |
| } |
| } |
diff --git a/internal/runner/thin/change_files.go b/internal/runner/thin/change_files.go| new file mode 100644 |
| index 00000000..604dd7bc |
| --- /dev/null |
| +++ b/internal/runner/thin/change_files.go |
| @@ -0,0 +1,97 @@ |
| +package thin |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "math" |
| + "os/exec" |
| + "strings" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/workspace" |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// changeFiles reuses Review's NUL-safe parsers, without changing its |
| +// measurement or its conservative 200-file merge-authority bound. |
| +func changeFiles(ctx context.Context, git, gitDir, base, sha string) *wire.ChangeFiles { |
| + if base != "" && !shaPattern.MatchString(base) || !shaPattern.MatchString(sha) { |
| + return nil |
| + } |
| + run := func(args ...string) (string, bool) { |
| + cmd := exec.CommandContext(ctx, git, append([]string{"--git-dir=" + gitDir, "-c", "core.quotePath=false"}, args...)...) |
| + env := workspace.GitEnvironment() |
| + env["HOME"] = "/nonexistent" |
| + for k, v := range env { |
| + cmd.Env = append(cmd.Env, k+"="+v) |
| + } |
| + out, clipped, err := boundedOutput(cmd, factsOutput) |
| + return string(out), err == nil && !clipped |
| + } |
| + pair := []string{base, sha} |
| + if base == "" { |
| + parents, ok := run("rev-list", "--parents", "-n", "1", sha) |
| + if !ok || strings.TrimSpace(parents) != sha { |
| + return nil |
| + } |
| + pair = []string{"--root", "--no-commit-id", sha} |
| + } else if _, ok := run("merge-base", "--is-ancestor", base, sha); !ok { |
| + return nil |
| + } |
| + raw, ok1 := run(append([]string{"diff-tree", "-r", "-z", "--raw", "-M", "--no-abbrev", "--no-ext-diff", "--no-textconv"}, pair...)...) |
| + num, ok2 := run(append([]string{"diff-tree", "-r", "-z", "--numstat", "-M", "--no-ext-diff", "--no-textconv"}, pair...)...) |
| + if !ok1 || !ok2 { |
| + return nil |
| + } |
| + return changeFileListings(base, sha, raw, num) |
| +} |
| + |
| +func changeFileListings(base, sha, raw, num string) *wire.ChangeFiles { |
| + entries, ok1 := parseRaw(raw) |
| + stats, ok2 := parseNumstat(num) |
| + if !ok1 || !ok2 || len(entries) != len(stats) { |
| + return nil |
| + } |
| + f := &wire.ChangeFiles{Base: base, SHA: sha, Files: len(entries), Entries: []wire.ChangedFile{}} |
| + for i, e := range entries { |
| + s := stats[i] |
| + if s.path != e.New || s.old != e.Old || s.added > math.MaxInt-f.Additions || s.deleted > math.MaxInt-f.Deletions { |
| + return nil |
| + } |
| + f.Additions += s.added |
| + f.Deletions += s.deleted |
| + if s.binary { |
| + f.Binary++ |
| + } |
| + status := "" |
| + switch e.Status[0] { |
| + case 'A': |
| + status = wire.ChangeFileAdded |
| + case 'D': |
| + status = wire.ChangeFileDeleted |
| + case 'M', 'T': |
| + status = wire.ChangeFileModified |
| + case 'R': |
| + status = wire.ChangeFileRenamed |
| + default: |
| + return nil |
| + } |
| + if len(f.Entries) < wire.MaxChangeEntries { |
| + if !wire.ValidChangePath(e.New) || e.Old != "" && !wire.ValidChangePath(e.Old) { |
| + return nil |
| + } |
| + f.Entries = append(f.Entries, wire.ChangedFile{Path: e.New, OldPath: e.Old, Status: status, Additions: s.added, Deletions: s.deleted, Binary: s.binary}) |
| + } |
| + } |
| + for { |
| + f.Truncated = len(f.Entries) < f.Files |
| + encoded, _ := json.Marshal(f) |
| + if len(encoded) <= wire.MaxChangeFilesBytes { |
| + break |
| + } |
| + f.Entries = f.Entries[:len(f.Entries)-1] |
| + } |
| + if !wire.ValidChangeFiles(f) { |
| + return nil |
| + } |
| + return f |
| +} |
diff --git a/internal/runner/thin/change_files_test.go b/internal/runner/thin/change_files_test.go| new file mode 100644 |
| index 00000000..8e6fc656 |
| --- /dev/null |
| +++ b/internal/runner/thin/change_files_test.go |
| @@ -0,0 +1,198 @@ |
| +package thin |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "fmt" |
| + "os" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/equipo/mergegate" |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +func TestEngineeringChangeFiles(t *testing.T) { |
| + dir, git := factsRepo(t) |
| + base := git("rev-parse", "HEAD") |
| + git("mv", "README.md", "read me 日本語.md") |
| + git("rm", "Sources/Pane.swift") |
| + writeFile(t, dir, "new space.txt", "one\ntwo\n") |
| + writeFile(t, dir, "assets/icon.png", "\x89PNG\x00changed") |
| + git("add", "-A") |
| + git("commit", "-qm", "candidate") |
| + sha := git("rev-parse", "HEAD") |
| + before := measure(t, dir, base, sha, "") |
| + decision := func(f *wire.ChangeFacts) []byte { |
| + b, err := json.Marshal(mergegate.Decide(mergegate.Inputs{Candidate: sha, Verdict: wire.VerdictApprove, Checks: wire.ChecksPassed, BaseChecks: true, Eligible: true, Change: f, Protocol: wire.ProtocolCurrent, Policy: mergegate.DefaultPolicy()})) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + return b |
| + } |
| + previous := string(decision(before)) |
| + f := changeFiles(context.Background(), "/usr/bin/git", filepath.Join(dir, ".git"), base, sha) |
| + if f == nil || f.Base != base || f.SHA != sha || f.Files != 4 || f.Additions != 2 || f.Deletions != 1 || f.Binary != 1 || f.Truncated || len(f.Entries) != 4 { |
| + t.Fatalf("facts: %+v", f) |
| + } |
| + entries := map[string]wire.ChangedFile{} |
| + for _, e := range f.Entries { |
| + entries[e.Path] = e |
| + } |
| + if e := entries["read me 日本語.md"]; e.Status != "renamed" || e.OldPath != "README.md" { |
| + t.Fatalf("rename: %+v", e) |
| + } |
| + if e := entries["Sources/Pane.swift"]; e.Status != "deleted" || e.Deletions != 1 { |
| + t.Fatalf("delete: %+v", e) |
| + } |
| + if e := entries["assets/icon.png"]; !e.Binary || e.Status != "modified" || e.Additions != 0 { |
| + t.Fatalf("binary: %+v", e) |
| + } |
| + if e := entries["new space.txt"]; e.Status != "added" || e.Additions != 2 { |
| + t.Fatalf("added: %+v", e) |
| + } |
| + after := measure(t, dir, base, sha, "") |
| + a, _ := json.Marshal(before) |
| + b, _ := json.Marshal(after) |
| + if string(a) != string(b) || previous != string(decision(after)) { |
| + t.Fatal("presentation changed Review facts or gate decision") |
| + } |
| + if changeFiles(context.Background(), "/usr/bin/git", filepath.Join(dir, ".git"), sha, base) != nil { |
| + t.Fatal("nonancestor accepted") |
| + } |
| +} |
| + |
| +func TestChangeFilesBounds(t *testing.T) { |
| + dir, git := factsRepo(t) |
| + base := git("rev-parse", "HEAD") |
| + for i := 0; i < wire.MaxChangeEntries+3; i++ { |
| + writeFile(t, dir, fmt.Sprintf("many/%03d.txt", i), "one\n") |
| + } |
| + git("add", "-A") |
| + git("commit", "-qm", "many") |
| + f := changeFiles(context.Background(), "/usr/bin/git", filepath.Join(dir, ".git"), base, git("rev-parse", "HEAD")) |
| + if f == nil || len(f.Entries) != 200 || !f.Truncated || f.Files != 203 || f.Additions != 203 || f.Deletions != 0 { |
| + t.Fatalf("bounded exact totals: %+v", f) |
| + } |
| +} |
| + |
| +func TestChangeFilesByteBoundAndMalformedListings(t *testing.T) { |
| + base, sha := strings.Repeat("a", 40), strings.Repeat("b", 40) |
| + var raw, num strings.Builder |
| + for i := 0; i < 200; i++ { |
| + name := fmt.Sprintf("%03d/%s", i, strings.Repeat("x", 3900)) |
| + fmt.Fprintf(&raw, ":000000 100644 %s %s A\x00%s\x00", base, sha, name) |
| + fmt.Fprintf(&num, "1\t0\t%s\x00", name) |
| + } |
| + f := changeFileListings(base, sha, raw.String(), num.String()) |
| + if f == nil || !f.Truncated || len(f.Entries) >= 200 || len(f.Entries) == 0 || f.Files != 200 || f.Additions != 200 { |
| + t.Fatalf("byte bound: %+v", f) |
| + } |
| + encoded, _ := json.Marshal(f) |
| + if len(encoded) > wire.MaxChangeFilesBytes { |
| + t.Fatalf("encoded %d bytes", len(encoded)) |
| + } |
| + for name, parts := range map[string][2]string{ |
| + "bad-raw": {"not raw", num.String()}, |
| + "bad-num": {raw.String(), "not numstat"}, |
| + "missing-stat": {raw.String(), ""}, |
| + "mismatched-path": {":000000 100644 " + base + " " + sha + " A\x00one\x00", "1\t0\ttwo\x00"}, |
| + "traversal": {":000000 100644 " + base + " " + sha + " A\x00../secret\x00", "1\t0\t../secret\x00"}, |
| + } { |
| + t.Run(name, func(t *testing.T) { |
| + if changeFileListings(base, sha, parts[0], parts[1]) != nil { |
| + t.Fatal("malformed listing accepted") |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestChangeFilesClippedScanNeverInventsTotals(t *testing.T) { |
| + dir := t.TempDir() |
| + fake := filepath.Join(dir, "git") |
| + // Exactly 4096 complete raw records fit the 1 MiB read bound. A final |
| + // complete record is clipped, so parsing the prefix alone would look valid. |
| + script := `#!/usr/bin/python3 |
| +import sys |
| +head=":000000 100644 "+"a"*40+" "+"b"*40+" A\0" |
| +width=256-len(head)-1 |
| +if "--raw" in sys.argv: |
| + for i in range(4097): |
| + name=str(i).zfill(width) |
| + sys.stdout.buffer.write((head+name+"\0").encode()) |
| +elif "--numstat" in sys.argv: |
| + for i in range(4096): |
| + sys.stdout.buffer.write(("1\t0\t"+str(i).zfill(width)+"\0").encode()) |
| +` |
| + if err := os.WriteFile(fake, []byte(script), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + f := changeFiles(context.Background(), fake, dir, strings.Repeat("a", 40), strings.Repeat("b", 40)) |
| + if f != nil { |
| + t.Fatalf("clipped scan has invented totals: %+v", f) |
| + } |
| +} |
| + |
| +func TestChangeFilesInitialCommit(t *testing.T) { |
| + dir, git := factsRepo(t) |
| + root := git("rev-parse", "HEAD") |
| + f := changeFiles(context.Background(), "/usr/bin/git", filepath.Join(dir, ".git"), "", root) |
| + if f == nil || f.Base != "" || f.SHA != root || f.Files != 5 { |
| + t.Fatalf("initial commit: %+v", f) |
| + } |
| + writeFile(t, dir, "later.txt", "later\n") |
| + git("add", "-A") |
| + git("commit", "-qm", "later") |
| + if changeFiles(context.Background(), "/usr/bin/git", filepath.Join(dir, ".git"), "", git("rev-parse", "HEAD")) != nil { |
| + t.Fatal("missing base on non-root commit was guessed") |
| + } |
| +} |
| + |
| +func TestChangeFilesFinalValidationAndTypeChange(t *testing.T) { |
| + base, sha := strings.Repeat("a", 40), strings.Repeat("b", 40) |
| + raw := fmt.Sprintf(":100644 120000 %s %s T\x00link\x00", base, sha) |
| + f := changeFileListings(base, sha, raw, "1\t1\tlink\x00") |
| + if f == nil || len(f.Entries) != 1 || f.Entries[0].Status != wire.ChangeFileModified { |
| + t.Fatalf("type change: %+v", f) |
| + } |
| + if changeFileListings(base, sha, raw+raw, "1\t1\tlink\x001\t1\tlink\x00") != nil { |
| + t.Fatal("duplicate paths passed final validation") |
| + } |
| +} |
| + |
| +func TestChangeFilesInvalidCommitsNeverInvokeGit(t *testing.T) { |
| + dir := t.TempDir() |
| + fake := filepath.Join(dir, "git") |
| + if err := os.WriteFile(fake, []byte("#!/bin/sh\n: > \"$0.called\"\n"), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + good := strings.Repeat("a", 40) |
| + for _, pair := range [][2]string{{good, strings.Repeat("b", 39)}, {strings.Repeat("b", 39), good}, {good, strings.Repeat("z", 40)}} { |
| + if changeFiles(context.Background(), fake, dir, pair[0], pair[1]) != nil { |
| + t.Fatal("invalid commit accepted") |
| + } |
| + if _, err := os.Stat(fake + ".called"); !os.IsNotExist(err) { |
| + t.Fatal("git invoked for invalid commit") |
| + } |
| + } |
| +} |
| + |
| +func TestChangeFilesPublishedOnlyByEngineering(t *testing.T) { |
| + for _, specialist := range []string{wire.SpecialistEngineering, wire.SpecialistCopy} { |
| + t.Run(specialist, func(t *testing.T) { |
| + e, f, r, _ := hubRig(t) |
| + r.Specialist, r.StepID, r.Branch = specialist, "s2", "equipo/tk1-another-fix" |
| + base := gitOut(t, f.dir, "rev-parse", "main") |
| + gitDir := e.tree(r, base).GitDir |
| + gitOut(t, filepath.Dir(f.dir), "clone", "-q", "--bare", f.dir, gitDir) |
| + tree := gitOut(t, filepath.Dir(f.dir), "--git-dir="+gitDir, "rev-parse", base+"^{tree}") |
| + r.Base, r.Candidate = base, gitOut(t, filepath.Dir(f.dir), "--git-dir="+gitDir, "commit-tree", tree, "-p", base, "-m", "another fix") |
| + r.CandidateSHA = base |
| + rep := e.publish(context.Background(), r, wire.StepReport{}) |
| + if (rep.ChangeFiles != nil) != (specialist == wire.SpecialistEngineering) { |
| + t.Fatalf("%s facts: %+v", specialist, rep.ChangeFiles) |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/runner/thin/engineer.go b/internal/runner/thin/engineer.go| index ee0d9f89..d04cfe45 100644 |
| --- a/internal/runner/thin/engineer.go |
| +++ b/internal/runner/thin/engineer.go |
| @@ -420,6 +420,9 @@ func (e *Engineer) publish(ctx context.Context, r stepRow, rep wire.StepReport) |
| tree.GitDir = from |
| } |
| } |
| + if r.Specialist == wire.SpecialistEngineering { |
| + rep.ChangeFiles = changeFiles(ctx, tree.Git, tree.GitDir, r.Base, r.Candidate) |
| + } |
| expectedHead := "" |
| if r.Specialist == wire.SpecialistCopy { |
| expectedHead = r.CandidateSHA |
diff --git a/internal/runner/thin/sandbox_masks_test.go b/internal/runner/thin/sandbox_masks_test.go| index 61017f81..15a29685 100644 |
| --- a/internal/runner/thin/sandbox_masks_test.go |
| +++ b/internal/runner/thin/sandbox_masks_test.go |
| @@ -91,10 +91,14 @@ func TestSandboxMasksPublish(t *testing.T) { |
| t.Fatalf("real file removed: %v", err) |
| } |
| r.Candidate = sha |
| + r.Specialist = wire.SpecialistEngineering |
| rep := e.publish(ctx, r, wire.StepReport{}) |
| if rep.State != wire.StepDone || !rep.Pushed { |
| t.Fatalf("publish: %+v", rep) |
| } |
| + if rep.ChangeFiles == nil || rep.ChangeFiles.Base != r.Base || rep.ChangeFiles.SHA != sha || !wire.ValidChangeFiles(rep.ChangeFiles) { |
| + t.Fatalf("published candidate has no display facts: %+v", rep.ChangeFiles) |
| + } |
| paths := "\n" + gitOut(t, f.dir, "ls-tree", "-r", "--name-only", r.Branch) + "\n" |
| if kind == "placeholders" { |
| for _, p := range maskTestPaths { |
diff --git a/internal/thintest/assistant_job_state_contract_test.go b/internal/thintest/assistant_job_state_contract_test.go| index dc90ebbe..697d17f6 100644 |
| --- a/internal/thintest/assistant_job_state_contract_test.go |
| +++ b/internal/thintest/assistant_job_state_contract_test.go |
| @@ -6,6 +6,7 @@ import ( |
| "testing" |
| "time" |
| + "amadan.net/oficina/equipo/internal/equipo" |
| "amadan.net/oficina/equipo/internal/wire" |
| ) |
| @@ -194,6 +195,31 @@ func TestContractTeamJobSettledStates(t *testing.T) { |
| o.settledStopped(request) |
| o.noteFor("the failed merge's note", blockedOn("going live failed, and they need to try it again")) |
| }}, |
| + {"merge_credential", func(o *teamRig, request, id string, merge *wire.DispatchCommand) { |
| + // The runner refused the merge itself: no access to publish to |
| + // the repository. Stopped, saying what is missing, and the |
| + // Assistant is not told to have the person try again. |
| + o.step("pw-m-run", wire.StepReport{TaskID: merge.TaskID, StepID: merge.StepID, Attempt: merge.Attempt, State: wire.StepRunning, BaseSHA: merge.BaseSHA, CandidateSHA: merge.CandidateSHA}) |
| + o.step("pw-m-fail", wire.StepReport{TaskID: merge.TaskID, StepID: merge.StepID, Attempt: merge.Attempt, State: wire.StepFailed, Reason: wire.ReasonMergeCredential, BaseSHA: merge.BaseSHA, CandidateSHA: merge.CandidateSHA, Termination: true}) |
| + o.wait("ready to merge again", func(c *Conversation) bool { return c.Tasks[id].Stage == wire.StageReadyToMerge }) |
| + o.endUpdates() |
| + card := o.jobOf(request, "stopped", func(c wire.AssistantCard) bool { return c.State != wire.JobWorking }) |
| + if card.State != wire.JobStopped || card.Result != equipo.RunnerCopy("assistant.job.stopped") || card.Detail != equipo.RunnerCopy("assistant.job.detail.no_access") { |
| + o.t.Fatalf("the job card %+v, want stopped for want of access", card) |
| + } |
| + if n := o.openOutcomes(); n != 0 { |
| + o.t.Fatalf("%d go-ahead or Publish cards open", n) |
| + } |
| + note := o.noteFor("the refused merge's note", blockedOn(noAccessLine)) |
| + for _, retry := range []string{"try it again", "go-ahead", "team_nudge", equipo.RunnerCopy("assistant.team.stage.ready_to_merge")} { |
| + if strings.Contains(note, retry) { |
| + o.t.Fatalf("the note invites %q: %q", retry, note) |
| + } |
| + } |
| + if !strings.Contains(note, equipo.RunnerCopy("assistant.team.no_access")) { |
| + o.t.Fatalf("the note does not say what is missing: %q", note) |
| + } |
| + }}, |
| {"publish_declined", func(o *teamRig, request, id string, merge *wire.DispatchCommand) { |
| o.mergedStep("pw-m", merge, strings.Repeat("e", 40)) |
| o.wait("done", func(c *Conversation) bool { return c.Tasks[id].Stage == wire.StageDone }) |
diff --git a/internal/thintest/assistant_team_contract_test.go b/internal/thintest/assistant_team_contract_test.go| index 1a6dffcf..fa008099 100644 |
| --- a/internal/thintest/assistant_team_contract_test.go |
| +++ b/internal/thintest/assistant_team_contract_test.go |
| @@ -7,6 +7,7 @@ import ( |
| "net/http" |
| "regexp" |
| "slices" |
| + "strconv" |
| "strings" |
| "testing" |
| "time" |
| @@ -1708,9 +1709,16 @@ func personNeeds() []personNeed { |
| {"merge_failed", "going live failed, and they need to try it again", func(o *teamRig, id, step string) { |
| o.exec("UPDATE chat_steps SET specialist = ?, state = ?, terminated = 1, reason = 'provider_failed' WHERE id = ?", wire.SpecialistMerge, wire.StepFailed, step) |
| }}, |
| + {"merge_credential", noAccessLine, func(o *teamRig, id, step string) { |
| + o.exec("UPDATE chat_steps SET specialist = ?, state = ?, terminated = 1, reason = ? WHERE id = ?", wire.SpecialistMerge, wire.StepFailed, wire.ReasonMergeCredential, step) |
| + }}, |
| } |
| } |
| +// noAccessLine is the note's plain line for going live refused for want |
| +// of access to the repository: what is missing, not "try it again". |
| +const noAccessLine = "there is no access to publish it where the work lives, and someone needs to set that access up before it can go live; trying again will not help until then" |
| + |
| // TestContractTeamUpdatePersonNeeds (ruling P4j): every need only the |
| // person can meet stops the job for them: the note says what in plain |
| // words and never asks the Assistant to nudge it, however its step |
| @@ -1991,3 +1999,41 @@ func TestContractOutcomePublishInThread(t *testing.T) { |
| t.Fatal("the publish result is not in the thread") |
| } |
| } |
| + |
| +// TestContractTeamUpdateNoAccessAmongTasks: a job following two tasks, |
| +// one whose merge failed and one refused for want of access, in either |
| +// order: the note says access is missing, never "try it again". |
| +func TestContractTeamUpdateNoAccessAmongTasks(t *testing.T) { |
| + for _, order := range []string{"failed_first", "refused_first"} { |
| + t.Run(order, func(t *testing.T) { |
| + o := newTeamRigAt(t, wire.ProtocolCurrent) |
| + o.ask("Can we fix two bugs in Tito? Login is broken and so is search") |
| + _, cmd := o.handoff("na1", "Login is broken and so is search", "") |
| + var ids, steps []string |
| + o.in(cmd.TurnID, func() { |
| + for i, title := range []string{"Fix the login", "Fix the search"} { |
| + key := "na-" + strconv.Itoa(i) |
| + id := o.record(key+"-rec", title) |
| + if res := o.call(key+"-start", wire.ToolStartTask, map[string]string{"task": id, "brief": "Fix it."}); res.IsError { |
| + o.t.Fatalf("start %+v", res) |
| + } |
| + _, body := o.expect(wire.FrameDispatch) |
| + ids, steps = append(ids, id), append(steps, body.(*wire.DispatchCommand).StepID) |
| + } |
| + }) |
| + reasons := []string{"provider_failed", wire.ReasonMergeCredential} |
| + if order == "refused_first" { |
| + reasons[0], reasons[1] = reasons[1], reasons[0] |
| + } |
| + for i, step := range steps { |
| + o.exec("UPDATE chat_steps SET specialist = ?, state = ?, terminated = 1, reason = ? WHERE id = ?", wire.SpecialistMerge, wire.StepFailed, reasons[i], step) |
| + } |
| + if _, err := o.client.PostThread(o.ctx, ids[0], "For the record.", "na-note"); err != nil { |
| + t.Fatal(err) |
| + } |
| + if note := o.noteFor("the note", blockedOn(noAccessLine)); strings.Contains(note, "try it again") { |
| + t.Fatalf("note %q", note) |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/thintest/change_files_contract_test.go b/internal/thintest/change_files_contract_test.go| new file mode 100644 |
| index 00000000..5f1d64cf |
| --- /dev/null |
| +++ b/internal/thintest/change_files_contract_test.go |
| @@ -0,0 +1,72 @@ |
| +package thintest |
| + |
| +import ( |
| + "encoding/json" |
| + "reflect" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +func TestContractEngineeringChangeFiles(t *testing.T) { |
| + for _, protocol := range []int{wire.ProtocolChangeFiles, wire.ProtocolChangeFiles - 1} { |
| + t.Run(string(rune('A'+protocol)), func(t *testing.T) { |
| + r := newToolRigAt(t, protocol) |
| + base, cand := strings.Repeat("1", 40), strings.Repeat("2", 40) |
| + id := taskID(t, r.call("files-record", wire.ToolRecordTask, map[string]any{"repo": "oficina/sample", "title": "Changed file facts", "brief": "Adjust the README", "separate": true})) |
| + if res := r.call("files-start", wire.ToolStartTask, map[string]string{"task": id, "brief": "Adjust it"}); res.IsError { |
| + t.Fatal(res) |
| + } |
| + _, body := r.expect(wire.FrameDispatch) |
| + eng := body.(*wire.DispatchCommand) |
| + facts := &wire.ChangeFiles{Base: base, SHA: cand, Files: 2, Additions: 3, Deletions: 1, Entries: []wire.ChangedFile{ |
| + {Path: "docs/read me 日本語.md", OldPath: "README.md", Status: "renamed", Additions: 3, Deletions: 1}, |
| + {Path: "empty.txt", Status: "added"}, |
| + }} |
| + r.step("files-done", wire.StepReport{TaskID: id, StepID: eng.StepID, Attempt: eng.Attempt, State: wire.StepDone, BaseSHA: base, CandidateSHA: cand, Pushed: true, Termination: true, ChangeFiles: facts}) |
| + task, err := r.client.Task(r.ctx, id) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + // Only this detail route carries file facts, even for new runners. |
| + list, err := r.client.Tasks(r.ctx) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + snapshot, err := r.client.Snapshot(r.ctx) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + for name, value := range map[string]any{"list": list, "snapshot": snapshot} { |
| + raw, err := json.Marshal(value) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if strings.Contains(string(raw), "\"change_files\"") { |
| + t.Fatalf("%s leaked file facts", name) |
| + } |
| + } |
| + got := task.Steps[0].ChangeFiles |
| + if protocol < 31 { |
| + if got != nil { |
| + t.Fatalf("old runner facts: %+v", got) |
| + } |
| + return |
| + } |
| + if !reflect.DeepEqual(got, facts) { |
| + t.Fatalf("device facts: %+v", got) |
| + } |
| + raw, _ := json.Marshal(got) |
| + for _, secret := range []string{"review_step", "old_mode", "new_mode", "complete", "repo", "content", "token"} { |
| + if strings.Contains(string(raw), "\""+secret+"\"") { |
| + t.Fatalf("non-display field: %s", raw) |
| + } |
| + } |
| + // Engineering presentation is never Review's accepted merge evidence. |
| + if task.MergeDecision != nil { |
| + t.Fatalf("Engineering facts made a merge decision: %+v", task.MergeDecision) |
| + } |
| + }) |
| + } |
| +} |
diff --git a/internal/wire/assistant_test.go b/internal/wire/assistant_test.go| index 3d0b8ab5..4e8a748b 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) != 30 || wire.ProtocolCurrent != wire.ProtocolStuckTasks || 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) != 31 || wire.ProtocolCurrent != wire.ProtocolChangeFiles || 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_files.go b/internal/wire/change_files.go| new file mode 100644 |
| index 00000000..cb5d91fe |
| --- /dev/null |
| +++ b/internal/wire/change_files.go |
| @@ -0,0 +1,98 @@ |
| +package wire |
| + |
| +import ( |
| + "encoding/json" |
| + "path" |
| + "strings" |
| + "unicode" |
| + "unicode/utf8" |
| +) |
| + |
| +const ( |
| + ChangeFileAdded = "added" |
| + ChangeFileModified = "modified" |
| + ChangeFileDeleted = "deleted" |
| + ChangeFileRenamed = "renamed" |
| +) |
| + |
| +// ChangeFiles is presentation only. Merge authority consumes ChangeFacts, |
| +// independently measured by Review, never these Engineering measurements. |
| +type ChangeFiles struct { |
| + Base string `json:"base"` |
| + SHA string `json:"sha"` |
| + Files int `json:"files"` |
| + Additions int `json:"additions"` |
| + Deletions int `json:"deletions"` |
| + Binary int `json:"binary"` |
| + Entries []ChangedFile `json:"entries"` |
| + Truncated bool `json:"truncated"` |
| +} |
| +type ChangedFile struct { |
| + Path string `json:"path"` |
| + OldPath string `json:"old_path,omitempty"` |
| + Status string `json:"status"` |
| + Additions int `json:"additions"` |
| + Deletions int `json:"deletions"` |
| + Binary bool `json:"binary"` |
| +} |
| + |
| +// MaxChangeFilesBytes leaves room for the rest of a bounded StepReport. |
| +const MaxChangeFilesBytes = 96 << 10 |
| + |
| +func ValidChangePath(s string) bool { |
| + return s != "" && len(s) <= 4096 && utf8.ValidString(s) && !strings.HasPrefix(s, "/") && |
| + s != "." && s != ".." && !strings.HasPrefix(s, "../") && path.Clean(s) == s && |
| + !strings.ContainsAny(s, "\\") && strings.IndexFunc(s, unsafeChangePathRune) < 0 |
| +} |
| + |
| +// Keep in sync with native ThinChangeFiles.path and the shared path fixture. |
| +// Other format characters (for example ZWJ in emoji names) are valid. |
| +func unsafeChangePathRune(r rune) bool { |
| + return unicode.IsControl(r) || r == 0x200e || r == 0x200f || |
| + r >= 0x202a && r <= 0x202e || r >= 0x2066 && r <= 0x2069 |
| +} |
| + |
| +func ValidChangeFiles(f *ChangeFiles) bool { |
| + if f == nil || f.Entries == nil || f.Base != "" && len(f.Base) != 40 || len(f.SHA) != 40 || strings.Trim(f.Base+f.SHA, "0123456789abcdef") != "" || |
| + f.Files < 0 || f.Additions < 0 || f.Deletions < 0 || f.Binary < 0 || f.Binary > f.Files || |
| + len(f.Entries) > MaxChangeEntries || len(f.Entries) > f.Files || f.Truncated != (len(f.Entries) < f.Files) { |
| + return false |
| + } |
| + a, d, b := 0, 0, 0 |
| + seen := map[string]bool{} |
| + for _, e := range f.Entries { |
| + if !ValidChangePath(e.Path) || seen[e.Path] || e.Additions < 0 || e.Deletions < 0 { |
| + return false |
| + } |
| + seen[e.Path] = true |
| + switch e.Status { |
| + case ChangeFileAdded, ChangeFileModified, ChangeFileDeleted: |
| + if e.OldPath != "" { |
| + return false |
| + } |
| + case ChangeFileRenamed: |
| + if !ValidChangePath(e.OldPath) || e.OldPath == e.Path { |
| + return false |
| + } |
| + default: |
| + return false |
| + } |
| + // Subtraction checks also prevent integer overflow. |
| + if e.Additions > f.Additions-a || e.Deletions > f.Deletions-d { |
| + return false |
| + } |
| + a += e.Additions |
| + d += e.Deletions |
| + if e.Binary { |
| + b++ |
| + if e.Additions != 0 || e.Deletions != 0 { |
| + return false |
| + } |
| + } |
| + } |
| + if b > f.Binary || !f.Truncated && (a != f.Additions || d != f.Deletions || b != f.Binary) { |
| + return false |
| + } |
| + raw, err := json.Marshal(f) |
| + return err == nil && len(raw) <= MaxChangeFilesBytes |
| +} |
diff --git a/internal/wire/change_files_test.go b/internal/wire/change_files_test.go| new file mode 100644 |
| index 00000000..cd74f040 |
| --- /dev/null |
| +++ b/internal/wire/change_files_test.go |
| @@ -0,0 +1,117 @@ |
| +package wire_test |
| + |
| +import ( |
| + "encoding/json" |
| + "fmt" |
| + "os" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +func TestProtocol31ChangeFiles(t *testing.T) { |
| + if wire.ProtocolChangeFiles != 31 || wire.ProtocolCurrent != 31 { |
| + 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}}} |
| + report := wire.StepReport{StepID: "s", Attempt: 1, State: wire.StepDone, ChangeFiles: facts} |
| + f, err := wire.NewFrame("r", wire.FrameStep, report) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + for p := 1; p <= 31; p++ { |
| + got, err := wire.Encode(f, p) |
| + if err != nil { |
| + t.Fatalf("%d: %v", p, err) |
| + } |
| + var fields map[string]json.RawMessage |
| + if err := json.Unmarshal(got.Data, &fields); err != nil { |
| + t.Fatal(err) |
| + } |
| + if (fields["change_files"] != nil) != (p >= 31) { |
| + t.Fatalf("field at %d: %s", p, got.Data) |
| + } |
| + if p < 31 { |
| + frozen13(t, "pre-31 StepReport", got.Data, frozen30StepReport) |
| + } |
| + |
| + } |
| + if report.ChangeFiles == nil { |
| + t.Fatal("Encode mutated input") |
| + } |
| +} |
| + |
| +func TestChangeFilesValidation(t *testing.T) { |
| + valid := func() *wire.ChangeFiles { |
| + return &wire.ChangeFiles{Base: strings.Repeat("a", 40), SHA: strings.Repeat("b", 40), Files: 1, Additions: 1, Entries: []wire.ChangedFile{{Path: "dir/a 日本語.txt", Status: "added", Additions: 1}}} |
| + } |
| + if !wire.ValidChangeFiles(valid()) { |
| + t.Fatal("valid paths refused") |
| + } |
| + for name, mutate := range map[string]func(*wire.ChangeFiles){ |
| + "nil-list": func(f *wire.ChangeFiles) { f.Files = 0; f.Additions = 0; f.Entries = nil }, |
| + "base": func(f *wire.ChangeFiles) { f.Base = "main" }, |
| + "sha": func(f *wire.ChangeFiles) { f.SHA = strings.Repeat("z", 40) }, |
| + "negative": func(f *wire.ChangeFiles) { f.Additions = -1 }, |
| + "totals": func(f *wire.ChangeFiles) { f.Additions = 2 }, |
| + "truncation": func(f *wire.ChangeFiles) { f.Files = 2 }, |
| + "status": func(f *wire.ChangeFiles) { f.Entries[0].Status = "copy" }, |
| + "old": func(f *wire.ChangeFiles) { f.Entries[0].OldPath = "old" }, |
| + "rename": func(f *wire.ChangeFiles) { f.Entries[0].Status = "renamed" }, |
| + "binary": func(f *wire.ChangeFiles) { f.Entries[0].Binary = true; f.Binary = 1 }, |
| + "short-base": func(f *wire.ChangeFiles) { f.Base = strings.Repeat("a", 39) }, |
| + "short-sha": func(f *wire.ChangeFiles) { f.SHA = strings.Repeat("b", 39) }, |
| + "excess-binaries": func(f *wire.ChangeFiles) { f.Entries = []wire.ChangedFile{}; f.Truncated = true; f.Binary = 2 }, |
| + "invalid-utf8": func(f *wire.ChangeFiles) { f.Entries[0].Path = string([]byte{255}) }, |
| + "path": func(f *wire.ChangeFiles) { f.Entries[0].Path = "../evil" }, |
| + "control": func(f *wire.ChangeFiles) { f.Entries[0].Path = "a\nb" }, |
| + "byte-bound": func(f *wire.ChangeFiles) { |
| + f.Files = 200 |
| + f.Additions = 200 |
| + f.Entries = []wire.ChangedFile{} |
| + for i := 0; i < 200; i++ { |
| + f.Entries = append(f.Entries, wire.ChangedFile{Path: fmt.Sprintf("%d/%s", i, strings.Repeat("x", 2000)), Status: "added", Additions: 1}) |
| + } |
| + }, |
| + "duplicate": func(f *wire.ChangeFiles) { f.Files = 2; f.Additions = 2; f.Entries = append(f.Entries, f.Entries[0]) }, |
| + "bound": func(f *wire.ChangeFiles) { |
| + f.Files = 201 |
| + f.Additions = 201 |
| + f.Entries = []wire.ChangedFile{} |
| + for i := 0; i < 201; i++ { |
| + f.Entries = append(f.Entries, wire.ChangedFile{Path: fmt.Sprintf("file-%d", i), Status: "added", Additions: 1}) |
| + } |
| + }, |
| + } { |
| + t.Run(name, func(t *testing.T) { |
| + f := valid() |
| + mutate(f) |
| + if wire.ValidChangeFiles(f) { |
| + t.Fatal("invalid accepted") |
| + } |
| + }) |
| + } |
| +} |
| + |
| +// Frozen from main 18fb5be4, before protocol 31. |
| +var frozen30StepReport = keySet("base_checks base_checks_sha failure copy task_id step_id attempt state reason base_sha candidate_sha pushed termination summary headline log_tail family account verdict review_label findings checks gate exit_code output askable merge_sha into strategy usage switched termination_kind have phase apple checks_sandbox change merge_source merge_parents hosted has_preview preview research hold publish") |
| + |
| +func TestChangePathSharedCases(t *testing.T) { |
| + raw, err := os.ReadFile("testdata/change-paths.json") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var cases []struct { |
| + Path string |
| + Valid bool |
| + } |
| + if err := json.Unmarshal(raw, &cases); err != nil { |
| + t.Fatal(err) |
| + } |
| + for _, c := range cases { |
| + if got := wire.ValidChangePath(c.Path); got != c.Valid { |
| + t.Errorf("path %q: %v, want %v", c.Path, got, c.Valid) |
| + } |
| + } |
| +} |
diff --git a/internal/wire/connections_test.go b/internal/wire/connections_test.go| index e386a1a1..2233eea5 100644 |
| --- a/internal/wire/connections_test.go |
| +++ b/internal/wire/connections_test.go |
| @@ -44,7 +44,8 @@ func TestConnectionTypesCarryNoSecrets(t *testing.T) { |
| // seal_key is the runner's public key (spec §2.4): public by design. |
| // An advice card’s key is its kind and subject (connectors spec §9). |
| // CopyFlag.key identifies an app string; CopyResult.tokens is its numeric usage. |
| - allowed := map[string]bool{"CopyFlag.key": true, "CopyResult.tokens": true, "Advice.key": true, "Hello.seal_key": true, "Runner.seal_key": true, "Usage.input_tokens": true, "Usage.output_tokens": true, "Usage.cached_input_tokens": true, "Usage.cache_write_tokens": true, "Usage.reasoning_output_tokens": true} |
| + // ChangedFile paths are validated repository-relative names, never account paths. |
| + allowed := map[string]bool{"ChangedFile.path": true, "ChangedFile.old_path": true, "CopyFlag.key": true, "CopyResult.tokens": true, "Advice.key": true, "Hello.seal_key": true, "Runner.seal_key": true, "Usage.input_tokens": true, "Usage.output_tokens": true, "Usage.cached_input_tokens": true, "Usage.cache_write_tokens": true, "Usage.reasoning_output_tokens": true} |
| counter, _ := reflect.TypeOf(wire.CopyResult{}).FieldByName("Tokens") |
| if counter.Type.Kind() != reflect.Int64 { |
| t.Fatal("Copy token counter must remain numeric") |
diff --git a/internal/wire/injection_test.go b/internal/wire/injection_test.go| index e6678b6c..49ac9e94 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 != 30 { |
| + if wire.ProtocolInjectionDefences != 28 || wire.ProtocolCurrent != 31 { |
| t.Fatal("injection guarantees require protocol 28") |
| } |
| - for version, want := range map[int]int{26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 99: 30} { |
| + for version, want := range map[int]int{26: 26, 27: 27, 28: 28, 29: 29, 30: 30, 31: 31, 99: 31} { |
| if got := wire.Spoken(version); got != want { |
| t.Fatalf("negotiated %d as %d, want %d", version, got, want) |
| } |
diff --git a/internal/wire/mixed_protocol_test.go b/internal/wire/mixed_protocol_test.go| index 38424ed1..73a547f3 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.Protocol30 { |
| + if wire.ProtocolMetered != wire.Protocol12 || wire.ProtocolResearch != wire.Protocol13 || wire.ProtocolCurrent != wire.Protocol31 { |
| 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 28012643..892faa67 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.Protocol30 { |
| + if wire.ProtocolModels != wire.Protocol18 || wire.ProtocolCurrent != wire.Protocol31 { |
| 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 ef98f25b..6458a7ef 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.Protocol30 { |
| + if wire.ProtocolOpenCode != wire.Protocol17 || wire.ProtocolCurrent != wire.Protocol31 { |
| 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 0a71599a..aeb0eb6c 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.Protocol30 { |
| + if wire.ProtocolPinnedRelease != wire.Protocol29 || wire.ProtocolCurrent != wire.Protocol31 { |
| 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/publish_test.go b/internal/wire/publish_test.go| index 6f940f0d..d47cb0c2 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.Protocol30 { |
| + if wire.ProtocolPublish != wire.Protocol16 || wire.ProtocolCurrent != wire.Protocol31 { |
| 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/runners.go b/internal/wire/runners.go| index a1c77dc5..56d363f6 100644 |
| --- a/internal/wire/runners.go |
| +++ b/internal/wire/runners.go |
| @@ -56,6 +56,7 @@ const ( |
| Protocol28 = 28 |
| Protocol29 = 29 |
| Protocol30 = 30 |
| + Protocol31 = 31 |
| // ProtocolSpend is the first protocol with a fix round's Feedback and |
| // a usage row's Turns; Encode drops both below it. |
| ProtocolSpend = Protocol3 |
| @@ -194,7 +195,9 @@ const ( |
| // Below it Encode drops the tool health and refuses the tool's call |
| // (downgradeStuck). |
| ProtocolStuckTasks = Protocol30 |
| - ProtocolCurrent = ProtocolStuckTasks |
| + // ProtocolChangeFiles adds bounded Engineering file-list facts. |
| + ProtocolChangeFiles = Protocol31 |
| + ProtocolCurrent = ProtocolChangeFiles |
| ) |
| // Runner roles. A person's first runner is the primary: the coordinator, |
| @@ -637,6 +640,12 @@ func Encode(f Frame, protocol int) (Frame, error) { |
| } |
| changed = dropped |
| } |
| + if protocol < ProtocolChangeFiles { |
| + if v, ok := body.(*StepReport); ok && v.ChangeFiles != nil { |
| + v.ChangeFiles = nil |
| + changed = true |
| + } |
| + } |
| if protocol < ProtocolPinnedRelease { |
| if v, ok := body.(*ReleaseCommand); ok && v.Connection != "" { |
| return Frame{}, fmt.Errorf("%w: a pinned release at protocol %d", ErrProtocol, protocol) |
diff --git a/internal/wire/runners_test.go b/internal/wire/runners_test.go| index cbf4fdd6..d54328bd 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.ProtocolStuckTasks || 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.ProtocolChangeFiles || 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 50478281..5eab12b5 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.Protocol30 { |
| + if wire.ProtocolScheduler != wire.Protocol14 || wire.ProtocolCurrent != wire.Protocol31 { |
| 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 337db477..ea32482a 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.Protocol30 || wire.Spoken(99) != 30 { |
| + if wire.ProtocolStuckTasks != wire.Protocol30 || wire.ProtocolCurrent != wire.Protocol31 || wire.Spoken(99) != 31 { |
| 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 6ea9b383..32963498 100644 |
| --- a/internal/wire/tasks.go |
| +++ b/internal/wire/tasks.go |
| @@ -235,20 +235,22 @@ type StepHosted struct { |
| // forge confirmed the branch points at it. Terminated is the runner's |
| // proof that the attempt's namespace has exited. |
| type Step struct { |
| - BaseChecks string `json:"base_checks,omitempty"` |
| - ID string `json:"id"` |
| - Revision int64 `json:"revision"` |
| - TaskID string `json:"task_id"` |
| - Index int `json:"index"` |
| - Specialist string `json:"specialist"` |
| - State string `json:"state"` |
| - Reason string `json:"reason"` |
| - Attempt int64 `json:"attempt"` |
| - BaseSHA string `json:"base_sha"` |
| - CandidateSHA string `json:"candidate_sha"` |
| - Pushed bool `json:"pushed"` |
| - Terminated bool `json:"terminated"` |
| - Summary string `json:"summary"` |
| + // ChangeFiles is included only by the device GET /tasks/{id} detail projection. |
| + ChangeFiles *ChangeFiles `json:"change_files,omitempty"` |
| + BaseChecks string `json:"base_checks,omitempty"` |
| + ID string `json:"id"` |
| + Revision int64 `json:"revision"` |
| + TaskID string `json:"task_id"` |
| + Index int `json:"index"` |
| + Specialist string `json:"specialist"` |
| + State string `json:"state"` |
| + Reason string `json:"reason"` |
| + Attempt int64 `json:"attempt"` |
| + BaseSHA string `json:"base_sha"` |
| + CandidateSHA string `json:"candidate_sha"` |
| + Pushed bool `json:"pushed"` |
| + Terminated bool `json:"terminated"` |
| + Summary string `json:"summary"` |
| // Headline is the step's outcome in one plain sentence (Engineering's |
| // change, Review's verdict), written by the specialist; Summary has the |
| // rest. Empty when the specialist gave none. |
| @@ -794,6 +796,8 @@ type CancelStepCommand struct { |
| // its candidate), done (pushed), failed or cancelled. Termination is true |
| // once the attempt's namespace exit was observed. Reason is a fixed code. |
| type StepReport struct { |
| + // Protocol 31: Engineering file-list facts, presentation only. |
| + ChangeFiles *ChangeFiles `json:"change_files,omitempty"` |
| BaseChecks string `json:"base_checks,omitempty"` |
| BaseChecksSHA string `json:"base_checks_sha,omitempty"` |
| Failure *copydesk.Signature `json:"failure,omitempty"` |
diff --git a/internal/wire/testdata/change-paths.json b/internal/wire/testdata/change-paths.json| new file mode 100644 |
| index 00000000..5e42630e |
| --- /dev/null |
| +++ b/internal/wire/testdata/change-paths.json |
| @@ -0,0 +1,102 @@ |
| +[ |
| + { |
| + "path": "file.txt", |
| + "valid": true |
| + }, |
| + { |
| + "path": "docs/read me \u65e5\u672c\u8a9e.txt", |
| + "valid": true |
| + }, |
| + { |
| + "path": "emoji/\ud83d\udc69\u200d\ud83d\udcbb.txt", |
| + "valid": true |
| + }, |
| + { |
| + "path": "format/a\u200cb.txt", |
| + "valid": true |
| + }, |
| + { |
| + "path": "", |
| + "valid": false |
| + }, |
| + { |
| + "path": "/absolute", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a//b", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a/../b", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a/./b", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\\b", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u0000b", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u001fb", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u007fb", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u0085b", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u200eb", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u200fb", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u202ab", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u202bb", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u202cb", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u202db", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u202eb", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u2066b", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u2067b", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u2068b", |
| + "valid": false |
| + }, |
| + { |
| + "path": "a\u2069b", |
| + "valid": false |
| + } |
| +] |
diff --git a/internal/wire/usage_test.go b/internal/wire/usage_test.go| index 2eeede17..5b254189 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.Protocol30 { |
| + if wire.ProtocolReadings != wire.Protocol15 || wire.ProtocolCurrent != wire.Protocol31 { |
| 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 81358c7d..66bd188d 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.ProtocolStuckTasks || wire.Spoken(99) != 30 { |
| + if wire.ProtocolWarm != 24 || wire.ProtocolCurrent != wire.ProtocolChangeFiles || wire.Spoken(99) != 31 { |
| 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/wireschema/wireschema.go b/internal/wire/wireschema/wireschema.go| index e04dddd3..f3644000 100644 |
| --- a/internal/wire/wireschema/wireschema.go |
| +++ b/internal/wire/wireschema/wireschema.go |
| @@ -155,6 +155,7 @@ var EventData = map[string]any{ |
| // person has a primary runner, or whose primary has not reported, has a |
| // runner with no role. |
| var Enums = map[string][]string{ |
| + "ChangedFile.status": {wire.ChangeFileAdded, wire.ChangeFileModified, wire.ChangeFileDeleted, wire.ChangeFileRenamed}, |
| "Turn.state": {"", wire.TurnQueued, wire.TurnRunning, wire.TurnWaiting, wire.TurnReplied, wire.TurnFailed, wire.TurnCancelled}, |
| "Turn.kind": {wire.TurnPerson, wire.TurnMoveIn, wire.TurnExplore, wire.TurnHousekeeping}, |
| "Message.role": {"", wire.RolePerson, wire.RoleCoordinator}, |
| @@ -460,6 +461,16 @@ func (g *gen) fields(t reflect.Type, name string, props *ordered, required *[]st |
| s.set("enum", values) |
| g.enums[name+"."+key] = true |
| } |
| + if name == "Step" && key == "change_files" { |
| + s.set("description", "Bounded presentation facts, included only on GET /tasks/{id} detail reads. Absent from task lists, snapshots, events and Coordinator tools.") |
| + } |
| + if name == "ChangeFiles" && key == "entries" { |
| + s.set("maxItems", wire.MaxChangeEntries) |
| + s.set("description", "At most 200 entries. Totals cover the complete bounded scan; truncated is true when entries were omitted. The encoded facts are bounded to 96 KiB.") |
| + } |
| + if (name == "ChangeFiles" || name == "ChangedFile") && (key == "additions" || key == "deletions" || key == "files" || name == "ChangeFiles" && key == "binary") { |
| + s.set("minimum", 0) |
| + } |
| props.set(key, s) |
| if !omit && !g.input { |
| *required = append(*required, key) |
diff --git a/internal/wire/wireschema/wireschema_test.go b/internal/wire/wireschema/wireschema_test.go| index 6c66ec8b..232839b5 100644 |
| --- a/internal/wire/wireschema/wireschema_test.go |
| +++ b/internal/wire/wireschema/wireschema_test.go |
| @@ -135,6 +135,7 @@ func TestDump(t *testing.T) { |
| // different field's, recorded here so a new constant must be placed). |
| // zero are values the field takes that no constant names. |
| var families = map[string]struct{ prefix, other, zero string }{ |
| + "ChangedFile.status": {"ChangeFile", "", ""}, |
| "Turn.state": {"Turn", "TurnPerson TurnMoveIn TurnExplore TurnHousekeeping TurnTeamUpdate", `""`}, |
| "Turn.kind": {"Turn", "TurnQueued TurnRunning TurnWaiting TurnReplied TurnFailed TurnCancelled TurnTeamUpdate", ""}, // team_update: the Assistant's lane only |
| "Message.role": {"Role", "RolePrimary RoleWorker RoleAssistant", `""`}, // assistant: the Assistant's lane only |
diff --git a/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings b/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings| index d84a36e0..9a517d30 100644 |
| --- a/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings |
| +++ b/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings |
| @@ -1355,6 +1355,144 @@ |
| } |
| } |
| }, |
| + "native.changes.added": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Added" |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.binary": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Non-text file" |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.deleted": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Deleted" |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.modified": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Changed" |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.renamed": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Renamed" |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.renamed_from": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Renamed from %@" |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.total": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%#@files@, %#@lines@, %3$lld removed" |
| + }, |
| + "substitutions": { |
| + "files": { |
| + "argNum": 1, |
| + "formatSpecifier": "lld", |
| + "variations": { |
| + "plural": { |
| + "one": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%lld file" |
| + } |
| + }, |
| + "other": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%lld files" |
| + } |
| + } |
| + } |
| + } |
| + }, |
| + "lines": { |
| + "argNum": 2, |
| + "formatSpecifier": "lld", |
| + "variations": { |
| + "plural": { |
| + "one": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%lld line added" |
| + } |
| + }, |
| + "other": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%lld lines added" |
| + } |
| + } |
| + } |
| + } |
| + } |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.truncated": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Showing the first %lld files. Open on Amadan for the full list." |
| + } |
| + } |
| + } |
| + }, |
| "native.needs.done_at": { |
| "extractionState": "manual", |
| "localizations": { |
diff --git a/native/apple/Sources/EquipoKit/API/ChangeFiles.swift b/native/apple/Sources/EquipoKit/API/ChangeFiles.swift| new file mode 100644 |
| index 00000000..2ee56890 |
| --- /dev/null |
| +++ b/native/apple/Sources/EquipoKit/API/ChangeFiles.swift |
| @@ -0,0 +1,95 @@ |
| +import Foundation |
| + |
| +public struct ThinChangedFile: Codable, Sendable, Equatable, Identifiable { |
| + public var path: String |
| + public var oldPath: String? = nil |
| + public var status: String |
| + public var additions: Int |
| + public var deletions: Int |
| + public var binary: Bool |
| + public var id: String { path } |
| +} |
| +public struct ThinChangeFiles: Codable, Sendable, Equatable { |
| + public var base: String |
| + public var sha: String |
| + public var files: Int |
| + public var additions: Int |
| + public var deletions: Int |
| + public var binary: Int |
| + public var entries: [ThinChangedFile] |
| + public var truncated: Bool |
| + |
| + var isValid: Bool { |
| + guard (base.isEmpty || Self.commit(base)), Self.commit(sha), files >= 0, additions >= 0, deletions >= 0, |
| + binary >= 0, binary <= files, entries.count <= 200, entries.count <= files, |
| + truncated == (entries.count < files), Set(entries.map(\.path)).count == entries.count else { return false } |
| + var added = 0, removed = 0, binaries = 0 |
| + for file in entries { |
| + guard Self.path(file.path), ["added", "modified", "deleted", "renamed"].contains(file.status), |
| + file.additions >= 0, file.deletions >= 0, |
| + file.additions <= additions - added, file.deletions <= deletions - removed else { return false } |
| + if file.status == "renamed" { |
| + guard let old = file.oldPath, Self.path(old), old != file.path else { return false } |
| + } else if file.oldPath != nil { return false } |
| + added += file.additions; removed += file.deletions |
| + if file.binary { |
| + guard file.additions == 0, file.deletions == 0 else { return false } |
| + binaries += 1 |
| + } |
| + } |
| + guard binaries <= binary, truncated || (added == additions && removed == deletions && binaries == binary), |
| + let size = wireSize, size <= 96 * 1024 else { return false } |
| + return true |
| + } |
| + private var wireSize: Int? { |
| + let encoder = JSONEncoder() |
| + encoder.keyEncodingStrategy = .convertToSnakeCase |
| + encoder.outputFormatting = [.withoutEscapingSlashes] |
| + guard let data = try? encoder.encode(self), var json = String(data: data, encoding: .utf8) else { return nil } |
| + // Match encoding/json's HTML and separator escaping, including old_path. |
| + for (character, escape) in [("<", #"\u003c"#), (">", #"\u003e"#), ("&", #"\u0026"#), ("\u{2028}", #"\u2028"#), ("\u{2029}", #"\u2029"#)] { |
| + json = json.replacingOccurrences(of: character, with: escape) |
| + } |
| + return json.utf8.count |
| + } |
| + static func commit(_ value: String) -> Bool { |
| + value.utf8.count == 40 && value.utf8.allSatisfy { (48...57).contains($0) || (97...102).contains($0) } |
| + } |
| + static func path(_ value: String) -> Bool { |
| + !value.isEmpty && value.utf8.count <= 4096 && !value.contains("\\") |
| + && !value.unicodeScalars.contains { |
| + $0.properties.generalCategory == .control || $0.value == 0x200e || $0.value == 0x200f |
| + || (0x202a...0x202e).contains($0.value) || (0x2066...0x2069).contains($0.value) |
| + } |
| + && value.split(separator: "/", omittingEmptySubsequences: false).allSatisfy { !$0.isEmpty && $0 != "." && $0 != ".." } |
| + } |
| +} |
| + |
| +// Validate the optional presentation field on entry, including decoded payloads |
| +// and programmatic assignment. A malformed optional field cannot hide the task. |
| +@propertyWrapper public struct ValidatedChangeFiles: Codable, Sendable, Equatable { |
| + private var value: ThinChangeFiles? |
| + public var wrappedValue: ThinChangeFiles? { |
| + get { value } |
| + set { value = newValue.flatMap { $0.isValid ? $0 : nil } } |
| + } |
| + public init(wrappedValue: ThinChangeFiles?) { |
| + value = wrappedValue.flatMap { $0.isValid ? $0 : nil } |
| + } |
| + public init(from decoder: Decoder) throws { |
| + self.init(wrappedValue: try? ThinChangeFiles(from: decoder)) |
| + } |
| + public func encode(to encoder: Encoder) throws { |
| + try value.encode(to: encoder) |
| + } |
| +} |
| +extension KeyedDecodingContainer { |
| + func decode(_ type: ValidatedChangeFiles.Type, forKey key: Key) throws -> ValidatedChangeFiles { |
| + try decodeIfPresent(type, forKey: key) ?? ValidatedChangeFiles(wrappedValue: nil) |
| + } |
| +} |
| +extension KeyedEncodingContainer { |
| + mutating func encode(_ value: ValidatedChangeFiles, forKey key: Key) throws { |
| + if let facts = value.wrappedValue { try encode(facts, forKey: key) } |
| + } |
| +} |
diff --git a/native/apple/Sources/EquipoKit/API/Thin.swift b/native/apple/Sources/EquipoKit/API/Thin.swift| index 10223b39..9086996a 100644 |
| --- a/native/apple/Sources/EquipoKit/API/Thin.swift |
| +++ b/native/apple/Sources/EquipoKit/API/Thin.swift |
| @@ -81,6 +81,7 @@ public struct ThinStepHosted: Codable, Sendable, Equatable { |
| } |
| public struct ThinStep: Codable, Sendable, Identifiable, Equatable { |
| + @ValidatedChangeFiles public var changeFiles: ThinChangeFiles? = nil |
| public var hosted: ThinStepHosted? = nil |
| public var baseChecks: String? = nil |
| public var revision: Int64? = nil |
diff --git a/native/apple/Sources/EquipoKit/Presentation/ChangedFiles.swift b/native/apple/Sources/EquipoKit/Presentation/ChangedFiles.swift| new file mode 100644 |
| index 00000000..f6bb2545 |
| --- /dev/null |
| +++ b/native/apple/Sources/EquipoKit/Presentation/ChangedFiles.swift |
| @@ -0,0 +1,47 @@ |
| +import Foundation |
| + |
| +enum ChangedFilesPresentation { |
| + static func facts(_ task: ThinTask) -> ThinChangeFiles? { |
| + guard !task.candidateSha.isEmpty, |
| + let step = task.steps?.last(where: { $0.specialist == "engineering" && $0.candidateSha == task.candidateSha }), |
| + step.state == "done", let facts = step.changeFiles, facts.sha == task.candidateSha, facts.base == step.baseSha else { return nil } |
| + return facts |
| + } |
| + struct Group: Identifiable { |
| + var folder: String |
| + var files: [ThinChangedFile] |
| + var id: String { folder } |
| + } |
| + static func groups(_ facts: ThinChangeFiles) -> [Group] { |
| + guard facts.entries.count > 10 else { return [Group(folder: "", files: facts.entries)] } |
| + let folders = Dictionary(grouping: facts.entries) { String($0.path.split(separator: "/").dropLast().joined(separator: "/")) } |
| + return folders.keys.sorted().map { Group(folder: $0, files: folders[$0] ?? []) } |
| + } |
| + static func fileURL(task: ThinTask, facts: ThinChangeFiles, file: ThinChangedFile) -> URL? { |
| + guard let source = task.repo else { return nil } |
| + let repo = source.hasPrefix("amadan.net/") ? String(source.dropFirst("amadan.net/".count)) : source |
| + let parts = repo.split(separator: "/", omittingEmptySubsequences: false) |
| + guard parts.count == 2, parts.allSatisfy({ |
| + $0 != "." && $0 != ".." && $0.range(of: #"^[A-Za-z0-9_.-]+$"#, options: .regularExpression) != nil |
| + }), ThinChangeFiles.path(file.path), |
| + (file.status != "deleted" || ThinChangeFiles.commit(facts.base)), ThinChangeFiles.commit(facts.sha) else { return nil } |
| + var url = URLComponents() |
| + url.scheme = "https"; url.host = "amadan.net"; url.path = "/" + repo |
| + url.queryItems = [URLQueryItem(name: "ref", value: file.status == "deleted" ? facts.base : facts.sha), |
| + URLQueryItem(name: "path", value: file.path)] |
| + // Go's query decoder treats a literal plus as a space. |
| + url.percentEncodedQuery = url.percentEncodedQuery?.replacingOccurrences(of: "+", with: "%2B") |
| + return url.url |
| + } |
| + static func total(files: Int, additions: Int, deletions: Int) -> String { |
| + String.localizedStringWithFormat(Bundle.module.localizedString(forKey: "native.changes.total", value: nil, table: nil), files, additions, deletions) |
| + } |
| + static func status(_ file: ThinChangedFile) -> String { |
| + switch file.status { |
| + case "added": EquipoStrings.text("native.changes.added") |
| + case "deleted": EquipoStrings.text("native.changes.deleted") |
| + case "renamed": EquipoStrings.text("native.changes.renamed") |
| + default: EquipoStrings.text("native.changes.modified") |
| + } |
| + } |
| +} |
diff --git a/native/apple/Sources/EquipoKit/Presentation/NeedsRowModel.swift b/native/apple/Sources/EquipoKit/Presentation/NeedsRowModel.swift| index 556620e3..c9733000 100644 |
| --- a/native/apple/Sources/EquipoKit/Presentation/NeedsRowModel.swift |
| +++ b/native/apple/Sources/EquipoKit/Presentation/NeedsRowModel.swift |
| @@ -23,11 +23,17 @@ extension TaskDetailModel { |
| case .failed: failure = EquipoStrings.text("card.failed") |
| } |
| } |
| - func loadNeedsRow() async { |
| - needsResume.connection = nil |
| - await load() |
| + func loadNeedsRow(force: Bool = false) async { |
| + guard force || loaded?.revision != task?.revision || readFailure != nil || needsResume.readFailed else { return } |
| + if let error = await load() { |
| + if ResumeAction.refused(error) { needsResume.connection = nil } |
| + return |
| + } |
| if let task, let step = TaskPause(task, mine: session.isMine(task))?.resumeStep { |
| await needsResume.load(client: session.client, step: step) |
| + } else { |
| + needsResume.connection = nil |
| + needsResume.readFailed = false |
| } |
| } |
| func performNeedsAction(_ shown: NeedsRowAction? = nil) async { |
| @@ -48,7 +54,7 @@ extension TaskDetailModel { |
| failure = await session.runNow(task: taskID, run) |
| } |
| await session.refresh() |
| - await loadNeedsRow() |
| + await loadNeedsRow(force: true) |
| case .open, .question: break |
| } |
| } |
diff --git a/native/apple/Sources/EquipoKit/Presentation/ResumeAction.swift b/native/apple/Sources/EquipoKit/Presentation/ResumeAction.swift| index 43edd10d..05238e31 100644 |
| --- a/native/apple/Sources/EquipoKit/Presentation/ResumeAction.swift |
| +++ b/native/apple/Sources/EquipoKit/Presentation/ResumeAction.swift |
| @@ -3,10 +3,22 @@ import Observation |
| @MainActor @Observable final class ResumeAction { |
| var connection: ResumeConnection? |
| + var readFailed = false |
| + static func refused(_ error: Error) -> Bool { |
| + guard let error = error as? EquipoAPIError else { return false } |
| + return error.endsSession || error.status.map { (400..<500).contains($0) && $0 != 429 } == true |
| + } |
| func load(client: EquipoClient, step: ThinStep) async { |
| - connection = nil |
| - if let list = try? await client.resumeConnections() { |
| + if let connection, StoppedWorkActions.connection(for: step, in: [connection]) == nil { |
| + self.connection = nil |
| + } |
| + do { |
| + let list = try await client.resumeConnections() |
| + readFailed = false |
| connection = StoppedWorkActions.connection(for: step, in: list.items ?? []) |
| + } catch { |
| + readFailed = true |
| + if Self.refused(error) { connection = nil } |
| } |
| } |
| func perform(client: EquipoClient, step: ThinStep) async -> String? { |
| @@ -14,6 +26,7 @@ import Observation |
| do { try await client.resumeConnection(connection); return nil } |
| catch { |
| // A stale pause revision must never be offered for the next tap. |
| + if Self.refused(error) { self.connection = nil } |
| await load(client: client, step: step) |
| return EquipoStrings.text("card.failed") |
| } |
diff --git a/native/apple/Sources/EquipoKit/Presentation/TaskDetailModel.swift b/native/apple/Sources/EquipoKit/Presentation/TaskDetailModel.swift| index d4889483..3c5777c0 100644 |
| --- a/native/apple/Sources/EquipoKit/Presentation/TaskDetailModel.swift |
| +++ b/native/apple/Sources/EquipoKit/Presentation/TaskDetailModel.swift |
| @@ -43,12 +43,13 @@ import Observation |
| guard let task, loaded?.revision == task.revision, readFailure == nil else { return .init() } |
| return TaskActionRules(task: task, viewer: session.me?.address ?? "", owner: session.me?.role == "owner", cards: session.cards) |
| } |
| - func load() async { |
| + @discardableResult func load() async -> (any Error)? { |
| do { |
| loaded = try await session.client.task(taskID); readFailure = nil |
| if let loaded { session.previews.observe([loaded]) } |
| + return nil |
| } |
| - catch { readFailure = StoppedWorkActions.logFailure(error) } |
| + catch { readFailure = StoppedWorkActions.logFailure(error); return error } |
| } |
| func beginMove() async { |
| guard !busy, rules.available.contains(.move), let task else { return } |
diff --git a/native/apple/Sources/EquipoKit/Preview/PreviewBrowser.swift b/native/apple/Sources/EquipoKit/Preview/PreviewBrowser.swift| index d46cd720..0429698e 100644 |
| --- a/native/apple/Sources/EquipoKit/Preview/PreviewBrowser.swift |
| +++ b/native/apple/Sources/EquipoKit/Preview/PreviewBrowser.swift |
| @@ -68,7 +68,7 @@ struct PreviewSheetContent: View { |
| }.padding(.horizontal) |
| Divider() |
| PreviewWebView(web: web) |
| - } |
| + }.background(Palette.background) |
| } |
| } |
diff --git a/native/apple/Sources/EquipoKit/Preview/PreviewFixture.swift b/native/apple/Sources/EquipoKit/Preview/PreviewFixture.swift| index d10d3b10..42ddf49f 100644 |
| --- a/native/apple/Sources/EquipoKit/Preview/PreviewFixture.swift |
| +++ b/native/apple/Sources/EquipoKit/Preview/PreviewFixture.swift |
| @@ -31,23 +31,14 @@ public struct PreviewFixture: View { |
| #if os(macOS) |
| if let capture = ProcessInfo.processInfo.environment["EQUIPO_FIXTURE_CAPTURE"] { |
| try? await Task.sleep(for: .seconds(5)) |
| - // SheetHostingView omits its SwiftUI layer in cacheDisplay. |
| - // Host the identical content with the actual loaded WebKit view. |
| - if let browser = session.previews.page?.resource as? PreviewBrowser, let web = browser.webView { |
| - let host = NSHostingView(rootView: PreviewSheetContent(web: web, dismiss: session.previews.dismiss) |
| - .frame(width: 800, height: 620).preferredColorScheme(.light)) |
| - let window = NSWindow(contentRect: NSRect(x: 0, y: 0, width: 800, height: 620), styleMask: [.titled], backing: .buffered, defer: false) |
| - window.isReleasedWhenClosed = false; window.contentView = host |
| - window.orderFront(nil) |
| - try? await Task.sleep(for: .seconds(1)) |
| - host.layoutSubtreeIfNeeded(); window.displayIfNeeded() |
| - if let bitmap = host.bitmapImageRepForCachingDisplay(in: host.bounds) { |
| - host.cacheDisplay(in: host.bounds, to: bitmap) |
| + if let window = NSApp.windows.first(where: { $0.isSheet }), let view = window.contentView { |
| + view.layoutSubtreeIfNeeded(); window.displayIfNeeded() |
| + if let bitmap = view.bitmapImageRepForCachingDisplay(in: view.bounds) { |
| + view.cacheDisplay(in: view.bounds, to: bitmap) |
| if let data = bitmap.representation(using: .png, properties: [:]) { |
| _ = FileManager.default.createFile(atPath: capture, contents: data) |
| } |
| } |
| - window.close() |
| } |
| } |
| #endif |
diff --git a/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings b/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings| index d84a36e0..9a517d30 100644 |
| --- a/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings |
| +++ b/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings |
| @@ -1355,6 +1355,144 @@ |
| } |
| } |
| }, |
| + "native.changes.added": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Added" |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.binary": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Non-text file" |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.deleted": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Deleted" |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.modified": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Changed" |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.renamed": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Renamed" |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.renamed_from": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Renamed from %@" |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.total": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%#@files@, %#@lines@, %3$lld removed" |
| + }, |
| + "substitutions": { |
| + "files": { |
| + "argNum": 1, |
| + "formatSpecifier": "lld", |
| + "variations": { |
| + "plural": { |
| + "one": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%lld file" |
| + } |
| + }, |
| + "other": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%lld files" |
| + } |
| + } |
| + } |
| + } |
| + }, |
| + "lines": { |
| + "argNum": 2, |
| + "formatSpecifier": "lld", |
| + "variations": { |
| + "plural": { |
| + "one": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%lld line added" |
| + } |
| + }, |
| + "other": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%lld lines added" |
| + } |
| + } |
| + } |
| + } |
| + } |
| + } |
| + } |
| + } |
| + }, |
| + "native.changes.truncated": { |
| + "comment": "COPY APPROVED: Luna, 2026-11-26.", |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Showing the first %lld files. Open on Amadan for the full list." |
| + } |
| + } |
| + } |
| + }, |
| "native.needs.done_at": { |
| "extractionState": "manual", |
| "localizations": { |
diff --git a/native/apple/Sources/EquipoKit/Session/EquipoSession.swift b/native/apple/Sources/EquipoKit/Session/EquipoSession.swift| index cb274be0..6427c5df 100644 |
| --- a/native/apple/Sources/EquipoKit/Session/EquipoSession.swift |
| +++ b/native/apple/Sources/EquipoKit/Session/EquipoSession.swift |
| @@ -135,9 +135,10 @@ public final class EquipoSession { |
| // MARK: Reading |
| /// Everything the screens show, once at a time: a burst of callers shares one pass. |
| - public func refresh() async { |
| + public func refresh(retryNeeds: Bool = false) async { |
| guard status != .signedOut else { return } |
| await runner.run { [weak self] in await self?.refreshPass() } |
| + if retryNeeds, !isInvalidated { needsReadGeneration &+= 1 } |
| } |
| private func refreshPass() async { |
| @@ -156,7 +157,6 @@ public final class EquipoSession { |
| needsYou = needsList.items ?? [] |
| status = .ready |
| refreshFailed = false |
| - needsReadGeneration &+= 1 |
| await sendZone() |
| // The team answers again: what was waiting goes now, as itself. |
| for item in outgoing where item.state == .waiting { |
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/ChangedFilesList.swift b/native/apple/Sources/EquipoKit/UI/Screens/ChangedFilesList.swift| new file mode 100644 |
| index 00000000..ac703386 |
| --- /dev/null |
| +++ b/native/apple/Sources/EquipoKit/UI/Screens/ChangedFilesList.swift |
| @@ -0,0 +1,65 @@ |
| +import SwiftUI |
| + |
| +/// The bounded Engineering listing, shared by the phone tab and Mac detail. |
| +struct ChangedFilesList: View { |
| + let facts: ThinChangeFiles |
| + var openFile: (ThinChangedFile) -> Void |
| + |
| + var body: some View { |
| + VStack(alignment: .leading, spacing: 16) { |
| + Text(ChangedFilesPresentation.total(files: facts.files, additions: facts.additions, deletions: facts.deletions)) |
| + .font(.headline).fixedSize(horizontal: false, vertical: true) |
| + ForEach(ChangedFilesPresentation.groups(facts)) { group in |
| + VStack(alignment: .leading, spacing: 0) { |
| + if !group.folder.isEmpty { |
| + Text(verbatim: group.folder).font(Typo.secondaryStrong).foregroundStyle(Palette.secondary).padding(.bottom, 8) |
| + } |
| + ForEach(group.files) { file in |
| + Button { openFile(file) } label: { ChangedFileLabel(file: file) } |
| + .buttonStyle(.plain) |
| + .accessibilityLabel(accessibility(file)) |
| + .accessibilityIdentifier("changed-file-" + file.path) |
| + Divider() |
| + } |
| + } |
| + } |
| + if facts.truncated { |
| + Text(String(format: EquipoStrings.text("native.changes.truncated"), facts.entries.count)) |
| + .font(Typo.secondary).foregroundStyle(Palette.secondary).fixedSize(horizontal: false, vertical: true) |
| + } |
| + } |
| + } |
| + private func accessibility(_ file: ThinChangedFile) -> String { |
| + [file.path, ChangedFilesPresentation.status(file), |
| + file.oldPath.map { String(format: EquipoStrings.text("native.changes.renamed_from"), $0) }, |
| + file.binary ? EquipoStrings.text("native.changes.binary") |
| + : ChangedFilesPresentation.total(files: 1, additions: file.additions, deletions: file.deletions)] |
| + .compactMap { $0 }.joined(separator: ", ") |
| + } |
| +} |
| + |
| +private struct ChangedFileLabel: View { |
| + let file: ThinChangedFile |
| + var body: some View { |
| + HStack(alignment: .top, spacing: 12) { |
| + VStack(alignment: .leading, spacing: 6) { |
| + Text(verbatim: file.path).font(.system(.subheadline, design: .monospaced)) |
| + .foregroundStyle(Palette.text).fixedSize(horizontal: false, vertical: true) |
| + if let old = file.oldPath { |
| + Text(String(format: EquipoStrings.text("native.changes.renamed_from"), old)) |
| + .font(Typo.caption).foregroundStyle(Palette.secondary).fixedSize(horizontal: false, vertical: true) |
| + } |
| + HStack(spacing: 12) { |
| + Text(ChangedFilesPresentation.status(file)).font(Typo.caption).foregroundStyle(Palette.secondary) |
| + if file.binary { |
| + Text(EquipoStrings.text("native.changes.binary")).font(Typo.caption).foregroundStyle(Palette.secondary) |
| + } else { |
| + Text(verbatim: "+\(file.additions)").foregroundStyle(Palette.positive) |
| + Text(verbatim: "−\(file.deletions)").foregroundStyle(Palette.negative) |
| + } |
| + }.font(.system(.caption, design: .monospaced)) |
| + }.frame(maxWidth: .infinity, alignment: .leading) |
| + Image(systemName: "arrow.up.right").font(.caption).foregroundStyle(Palette.secondary) |
| + }.padding(.vertical, 12).frame(minHeight: 44).contentShape(Rectangle()) |
| + } |
| +} |
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/NeedsScreen.swift b/native/apple/Sources/EquipoKit/UI/Screens/NeedsScreen.swift| index 9bcbd520..c685d7f0 100644 |
| --- a/native/apple/Sources/EquipoKit/UI/Screens/NeedsScreen.swift |
| +++ b/native/apple/Sources/EquipoKit/UI/Screens/NeedsScreen.swift |
| @@ -10,7 +10,7 @@ public struct NeedsScreen: View { |
| ScrollView { |
| VStack(alignment: .leading, spacing: 20) { |
| if let needs = session.needsYou { |
| - if session.refreshFailed { ReadFailed { Task { await session.refresh() } } } |
| + if session.refreshFailed { ReadFailed { Task { await session.refresh(retryNeeds: true) } } } |
| if needs.isEmpty { |
| if session.tasks.isEmpty { |
| ContentUnavailableView(EquipoStrings.text("work.needs_empty"), systemImage: "checkmark.circle") |
| @@ -31,7 +31,7 @@ public struct NeedsScreen: View { |
| TodaySection(session: session, now: context.date, openTask: openTask) |
| } |
| } else if session.refreshFailed { |
| - ReadFailed { Task { await session.refresh() } } |
| + ReadFailed { Task { await session.refresh(retryNeeds: true) } } |
| } else { |
| ProgressView().accessibilityLabel(EquipoStrings.text("tab.needs")).frame(maxWidth: .infinity).padding(.top, 40) |
| } |
| @@ -39,7 +39,7 @@ public struct NeedsScreen: View { |
| .padding(16).frame(maxWidth: 760).frame(maxWidth: .infinity) |
| } |
| .scrollDismissesKeyboard(.interactively) |
| - .refreshable { await session.refresh() } |
| + .refreshable { await session.refresh(retryNeeds: true) } |
| .background(Palette.background) |
| } |
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/TaskDetailScreen.swift b/native/apple/Sources/EquipoKit/UI/Screens/TaskDetailScreen.swift| index a83cc8a5..108c7441 100644 |
| --- a/native/apple/Sources/EquipoKit/UI/Screens/TaskDetailScreen.swift |
| +++ b/native/apple/Sources/EquipoKit/UI/Screens/TaskDetailScreen.swift |
| @@ -46,7 +46,15 @@ public struct TaskScreen: View { |
| switch tab { |
| case .overview: overview(task) |
| case .checks: TaskChecksView(task: task, client: model.session.client) |
| - case .changes: webEvidence(task, preview: false) |
| + case .changes: |
| + if let facts = ChangedFilesPresentation.facts(task) { |
| + ChangedFilesList(facts: facts) { file in |
| + if let url = ChangedFilesPresentation.fileURL(task: task, facts: facts, file: file) { |
| + model.session.settings.openChanges(origin: model.session.origin, url: url) |
| + } else { openWeb(task) } |
| + } |
| + } |
| + webEvidence(task, preview: false) |
| case .preview: previewEvidence(task) |
| } |
| }.padding(16).frame(maxWidth: 760).frame(maxWidth: .infinity, alignment: .topLeading) |
| @@ -64,6 +72,11 @@ public struct TaskScreen: View { |
| } |
| .scrollDismissesKeyboard(.interactively) |
| .background(Palette.background) |
| + #if DEBUG |
| + .onAppear { |
| + if (ProcessInfo.processInfo.environment["EQUIPO_TASK_FIXTURE"] ?? "").hasPrefix("changes") { tab = .changes } |
| + } |
| + #endif |
| .task(id: model.session.task(model.taskID)?.revision) { await model.load() } |
| .refreshable { await model.session.refresh(); await model.load() } |
| .sheet(item: $model.confirmation) { confirm in TaskConfirmationSheet(model: model, confirmation: confirm) } |
diff --git a/native/apple/Sources/EquipoKit/UI/TaskViewFixture.swift b/native/apple/Sources/EquipoKit/UI/TaskViewFixture.swift| index cc54e279..f8c2ce5e 100644 |
| --- a/native/apple/Sources/EquipoKit/UI/TaskViewFixture.swift |
| +++ b/native/apple/Sources/EquipoKit/UI/TaskViewFixture.swift |
| @@ -45,6 +45,8 @@ public struct TaskViewFixture: View { |
| } |
| private struct TaskViewFixtureTransport: EquipoTransport { |
| + private var changes: Bool { (ProcessInfo.processInfo.environment["EQUIPO_TASK_FIXTURE"] ?? "").hasPrefix("changes") } |
| + private var candidate: String { changes ? String(repeating: "b", count: 40) : "3f9c2a167de8" } |
| private var hosted: Bool { ProcessInfo.processInfo.environment["EQUIPO_TASK_FIXTURE"] == "hosted" } |
| private var failed: Bool { hosted || ProcessInfo.processInfo.environment["EQUIPO_TASK_FIXTURE"] == "checks" } |
| let origin = URL(string: "https://fixture.invalid")! |
| @@ -62,12 +64,33 @@ private struct TaskViewFixtureTransport: EquipoTransport { |
| return APIResponse(status: 200, data: try JSONSerialization.data(withJSONObject: value)) |
| } |
| func lines(_ request: APIRequest) async throws -> AsyncThrowingStream<String, Error> { AsyncThrowingStream { $0.finish() } } |
| + private var changeFiles: [String: Any] { |
| + let base = String(repeating: "a", count: 40) |
| + func file(_ path: String, _ status: String, _ added: Int = 0, _ removed: Int = 0, old: String? = nil, binary: Bool = false) -> [String: Any] { |
| + var result: [String: Any] = ["path": path, "status": status, "additions": added, "deletions": removed, "binary": binary] |
| + if let old { result["old_path"] = old } |
| + return result |
| + } |
| + if ProcessInfo.processInfo.environment["EQUIPO_TASK_FIXTURE"] == "changes-long" { |
| + return ["base": base, "sha": candidate, "files": 203, "additions": 203, "deletions": 0, "binary": 0, |
| + "entries": (0..<200).map { file("Sources/Folder\($0 % 4)/File\($0).swift", "added", 1) }, "truncated": true] |
| + } |
| + return ["base": base, "sha": candidate, "files": 6, "additions": 55, "deletions": 10, "binary": 1, "truncated": false, |
| + "entries": [ |
| + file("Sources/Session/EquipoSession.swift", "modified", 24, 4), |
| + file("Tests/NeedsBadgeTests.swift", "modified", 19, 2), |
| + file("Sources/Needs/Badge.swift", "added", 12), |
| + file("Resources/Badge.png", "modified", binary: true), |
| + file("docs/Badge behaviour.md", "renamed", old: "docs/Badge notes.md"), |
| + file("Sources/Needs/OldBadge.swift", "deleted", 0, 4) |
| + ]] |
| + } |
| private var card: [String: Any] { |
| ["id": "card_merge", "revision": 3, "kind": "merge", "state": "open", "turn_id": "", "project_id": "project", "name": "", "question": "Merge the fix for the Needs you badge?", "options": ["merge", "not_now"], "choice": "", "task_id": "tk_fixture", "created_at": "2026-11-26T09:42:00Z", "updated_at": "2026-11-26T09:42:00Z"] |
| } |
| private var task: [String: Any] { |
| func step(_ id: String, _ specialist: String, _ headline: String, _ summary: String = "") -> [String: Any] { |
| - ["id": id, "specialist": specialist, "candidate_sha": "3f9c2a167de8", "state": "done", "reason": "", "headline": headline, "summary": summary, "verdict": "", "review_label": "", "checks": "", "gate": "", "started_at": "2026-11-26T09:42:00Z", "finished_at": "2026-11-26T09:48:00Z"] |
| + ["id": id, "specialist": specialist, "candidate_sha": candidate, "state": "done", "reason": "", "headline": headline, "summary": summary, "verdict": "", "review_label": "", "checks": "", "gate": "", "started_at": "2026-11-26T09:42:00Z", "finished_at": "2026-11-26T09:48:00Z"] |
| } |
| var checks = step("checks", "checks", failed ? "One test failed" : "Native checks passed") |
| checks["checks"] = failed ? "failed" : "passed"; checks["gate"] = ".amadan/ci.d"; checks["exit_code"] = failed ? 1 : 0 |
| @@ -81,10 +104,15 @@ private struct TaskViewFixtureTransport: EquipoTransport { |
| review["summary"] = "The signed-out account still contributes to the Needs you badge. Clear its count and prevent late requests from restoring it." |
| review["verdict"] = "changes_requested"; review["review_label"] = "changes_requested" |
| } |
| + var engineering = step("engineering", "engineering", "Clear the badge when signing out") |
| + if changes && ProcessInfo.processInfo.environment["EQUIPO_TASK_FIXTURE"] != "changes-old" { |
| + engineering["base_sha"] = String(repeating: "a", count: 40) |
| + engineering["change_files"] = changeFiles |
| + } |
| let steps = failed |
| - ? [step("engineering", "engineering", "Clear the badge when signing out"), earlierReview, checks, review] |
| - : [step("engineering", "engineering", "Clear the badge when signing out"), checks, review] |
| - return ["id": "tk_fixture", "revision": 9, "project_id": "project", "project": "Equipo", "repo": "oficina/equipo", "title": "Fix the Needs you badge after sign-out", "brief": "When I sign out on my iPhone, the Needs you badge still shows the old count. Clear it as soon as I sign out, and keep it clear if a request finishes afterwards.", "stage": "ready_to_merge", "branch": "equipo/needs-badge-sign-out", "url": "https://amadan.net/oficina/equipo", "candidate_sha": "3f9c2a167de8", "checks": failed ? "failed" : "passed", "checks_reason": "", "verdict": failed ? "changes_requested" : "approve", "review_label": failed ? "changes_requested" : "approved", "needs_you": failed ? "fix_rounds" : "merge", "merge_offered": !failed, "creator": "paul@example.com", "created_at": "2026-11-26T09:40:00Z", "updated_at": "2026-11-26T09:48:00Z", "steps": steps] |
| + ? [engineering, earlierReview, checks, review] |
| + : [engineering, checks, review] |
| + return ["id": "tk_fixture", "revision": 9, "project_id": "project", "project": "Equipo", "repo": "oficina/equipo", "title": "Fix the Needs you badge after sign-out", "brief": "When I sign out on my iPhone, the Needs you badge still shows the old count. Clear it as soon as I sign out, and keep it clear if a request finishes afterwards.", "stage": "ready_to_merge", "branch": "equipo/needs-badge-sign-out", "url": "https://amadan.net/oficina/equipo", "candidate_sha": candidate, "checks": failed ? "failed" : "passed", "checks_reason": "", "verdict": failed ? "changes_requested" : "approve", "review_label": failed ? "changes_requested" : "approved", "needs_you": failed ? "fix_rounds" : "merge", "merge_offered": !failed, "creator": "paul@example.com", "created_at": "2026-11-26T09:40:00Z", "updated_at": "2026-11-26T09:48:00Z", "steps": steps] |
| } |
| } |
| #endif |
diff --git a/native/apple/Tests/EquipoKitTests/ChangeFilesTests.swift b/native/apple/Tests/EquipoKitTests/ChangeFilesTests.swift| new file mode 100644 |
| index 00000000..3f9575eb |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/ChangeFilesTests.swift |
| @@ -0,0 +1,151 @@ |
| +import Foundation |
| +import Testing |
| +@testable import EquipoKit |
| + |
| +@Suite struct ChangeFilesTests { |
| + static let base = String(repeating: "a", count: 40) |
| + static let sha = String(repeating: "b", count: 40) |
| + static func facts() -> ThinChangeFiles { |
| + .init(base: base, sha: sha, files: 1, additions: 1, deletions: 0, binary: 0, |
| + entries: [.init(path: "Sources/Hello 日本語.swift", status: "added", additions: 1, deletions: 0, binary: false)], truncated: false) |
| + } |
| + @Test func currentCandidateLatestEngineeringOnlyAndOldRunnerFallback() throws { |
| + var task = try TaskDetailTests.task(); task.candidateSha = Self.sha |
| + var step = task.steps![0]; step.specialist = "engineering"; step.state = "done"; step.pushed = true |
| + step.baseSha = Self.base; step.candidateSha = Self.sha; step.changeFiles = Self.facts() |
| + task.steps = [step] |
| + #expect(ChangedFilesPresentation.facts(task) == Self.facts()) |
| + var old = step; old.candidateSha = Self.base; old.changeFiles?.sha = Self.base |
| + task.steps = [step, old] |
| + #expect(ChangedFilesPresentation.facts(task) == Self.facts()) |
| + var newest = step; newest.id = "new"; newest.changeFiles = nil |
| + task.steps = [step, newest] |
| + #expect(ChangedFilesPresentation.facts(task) == nil) |
| + for specialist in ["review", "copy", "checks"] { |
| + step.specialist = specialist; task.steps = [step] |
| + #expect(ChangedFilesPresentation.facts(task) == nil) |
| + } |
| + step.specialist = "engineering"; step.changeFiles?.sha = Self.base; task.steps = [step] |
| + #expect(ChangedFilesPresentation.facts(task) == nil) |
| + step.changeFiles = Self.facts(); step.baseSha = Self.sha; task.steps = [step] |
| + #expect(ChangedFilesPresentation.facts(task) == nil) |
| + step.baseSha = Self.base; step.state = "running"; task.steps = [step] |
| + #expect(ChangedFilesPresentation.facts(task) == nil) |
| + step.state = "done"; step.changeFiles?.additions = -1; task.steps = [step] |
| + #expect(ChangedFilesPresentation.facts(task) == nil) |
| + let legacy: ThinTask = try Fixture.decode("thin/task") |
| + #expect(legacy.steps?.allSatisfy { $0.changeFiles == nil } == true) |
| + } |
| + @Test func fileLinksArePinnedEncodedAndAllowlisted() throws { |
| + var task = try TaskDetailTests.task(); task.repo = "amadan.net/oficina/equipo" |
| + var file = Self.facts().entries[0]; file.path = "docs/a+b & 日本語 #%.md" |
| + let url = try #require(ChangedFilesPresentation.fileURL(task: task, facts: Self.facts(), file: file)) |
| + #expect(url.host == "amadan.net") |
| + #expect(url.path == "/oficina/equipo") |
| + #expect(url.absoluteString.contains("%2B")) |
| + let query = try #require(URLComponents(url: url, resolvingAgainstBaseURL: false)?.queryItems) |
| + #expect(query.first { $0.name == "ref" }?.value == Self.sha) |
| + #expect(query.first { $0.name == "path" }?.value == file.path) |
| + var opened: URL? |
| + SettingsNavigation.openChanges(origin: URL(string: "https://equipo.example")!, url: url) { opened = $0 } |
| + #expect(opened == url) |
| + file.status = "deleted" |
| + let deleted = try #require(ChangedFilesPresentation.fileURL(task: task, facts: Self.facts(), file: file)) |
| + #expect(URLComponents(url: deleted, resolvingAgainstBaseURL: false)?.queryItems?.first { $0.name == "ref" }?.value == Self.base) |
| + for repo in ["evil.example/oficina/equipo", "https://evil.example/oficina/equipo", "amadan.net@evil.example/o/r", "../evil", "oficina/equipo/extra"] { |
| + task.repo = repo |
| + #expect(ChangedFilesPresentation.fileURL(task: task, facts: Self.facts(), file: file) == nil) |
| + } |
| + task.repo = "oficina/equipo"; file.path = "../secret" |
| + #expect(ChangedFilesPresentation.fileURL(task: task, facts: Self.facts(), file: file) == nil) |
| + } |
| + @Test func boundsAndGroupingKeepEveryDisplayedPath() { |
| + var facts = Self.facts() |
| + facts.entries = (0..<200).map { .init(path: "folder\($0 % 3)/file\($0).txt", status: "added", additions: 1, deletions: 0, binary: false) } |
| + facts.files = 203; facts.additions = 203; facts.truncated = true |
| + #expect(facts.isValid) |
| + let groups = ChangedFilesPresentation.groups(facts) |
| + #expect(groups.count == 3) |
| + #expect(Set(groups.flatMap(\.files).map(\.path)) == Set(facts.entries.map(\.path))) |
| + facts.entries.append(.init(path: "extra", status: "added", additions: 1, deletions: 0, binary: false)) |
| + #expect(!facts.isValid) |
| + facts = Self.facts(); facts.files = 2 |
| + #expect(!facts.isValid) |
| + facts = Self.facts(); facts.entries[0].additions = -1 |
| + #expect(!facts.isValid) |
| + facts = Self.facts(); facts.entries[0].status = "future" |
| + #expect(!facts.isValid) |
| + facts = Self.facts(); facts.entries[0].binary = true; facts.binary = 1 |
| + #expect(!facts.isValid) |
| + } |
| + @Test func encodedBytesAndDuplicatePathsAreBounded() { |
| + var facts = Self.facts(); facts.files = 200; facts.additions = 200 |
| + facts.entries = (0..<200).map { .init(path: "\($0)/" + String(repeating: "x", count: 3900), status: "added", additions: 1, deletions: 0, binary: false) } |
| + #expect(!facts.isValid) |
| + facts = Self.facts(); facts.files = 2; facts.additions = 2; facts.entries.append(facts.entries[0]) |
| + #expect(!facts.isValid) |
| + } |
| + @Test func byteBoundUsesTheServersJSONEscaping() { |
| + var facts = Self.facts(); facts.files = 200; facts.additions = 200 |
| + facts.entries = (0..<200).map { .init(path: String(repeating: "a/", count: 150) + "file\($0)", status: "added", additions: 1, deletions: 0, binary: false) } |
| + // Go leaves slashes unescaped: this complete listing fits its 96 KiB bound. |
| + #expect(facts.isValid) |
| + facts.entries = (0..<200).map { .init(path: String(repeating: "<", count: 150) + "file\($0)", status: "added", additions: 1, deletions: 0, binary: false) } |
| + // Go escapes HTML characters, so these shorter paths exceed that bound. |
| + #expect(!facts.isValid) |
| + } |
| + @Test func initialCommitAndReviewedStatusWords() throws { |
| + var facts = Self.facts(); facts.base = "" |
| + #expect(facts.isValid) |
| + var task = try TaskDetailTests.task(); task.repo = "oficina/equipo" |
| + #expect(ChangedFilesPresentation.fileURL(task: task, facts: facts, file: facts.entries[0]) != nil) |
| + for (status, words) in [("added", "Added"), ("modified", "Changed"), ("deleted", "Deleted"), ("renamed", "Renamed")] { |
| + var file = facts.entries[0]; file.status = status |
| + #expect(ChangedFilesPresentation.status(file) == words) |
| + } |
| + } |
| + @Test func reviewedCountsPluralizeFilesAndLines() { |
| + #expect(ChangedFilesPresentation.total(files: 1, additions: 1, deletions: 0) == "1 file, 1 line added, 0 removed") |
| + #expect(ChangedFilesPresentation.total(files: 2, additions: 1, deletions: 3) == "2 files, 1 line added, 3 removed") |
| + #expect(ChangedFilesPresentation.total(files: 1, additions: 2, deletions: 1) == "1 file, 2 lines added, 1 removed") |
| + #expect(ChangedFilesPresentation.total(files: 0, additions: 0, deletions: 0) == "0 files, 0 lines added, 0 removed") |
| + } |
| +} |
| + |
| +extension ChangeFilesTests { |
| + @Test func sharedPathRulesAndRenameSources() throws { |
| + struct Case: Decodable { let path: String; let valid: Bool } |
| + var root = URL(fileURLWithPath: #filePath) |
| + for _ in 0..<5 { root.deleteLastPathComponent() } |
| + let cases = try JSONDecoder().decode([Case].self, from: Data(contentsOf: root.appendingPathComponent("internal/wire/testdata/change-paths.json"))) |
| + for item in cases { |
| + #expect(ThinChangeFiles.path(item.path) == item.valid, "path: \(item.path.debugDescription)") |
| + var facts = Self.facts(); facts.entries[0].status = "renamed"; facts.entries[0].oldPath = item.path |
| + #expect(facts.isValid == item.valid) |
| + } |
| + } |
| + @Test func invalidFactsAreDiscardedAtStepDecodeAndAssignment() throws { |
| + let encoder = EquipoJSON.encoder; encoder.dateEncodingStrategy = .iso8601 |
| + let original = try TaskDetailTests.task().steps![0] |
| + var valid = original; valid.changeFiles = Self.facts() |
| + #expect(try EquipoJSON.decoder.decode(ThinStep.self, from: encoder.encode(valid)).changeFiles == Self.facts()) |
| + let old = try JSONSerialization.jsonObject(with: encoder.encode(original)) as! [String: Any] |
| + #expect(old["change_files"] == nil) |
| + for path in ["/absolute", "a//b", "a\nb", "a\\b", "a\u{202e}b"] { |
| + var facts = Self.facts(); facts.entries[0].path = path |
| + var body = try JSONSerialization.jsonObject(with: encoder.encode(original)) as! [String: Any] |
| + body["change_files"] = try JSONSerialization.jsonObject(with: encoder.encode(facts)) |
| + let step = try EquipoJSON.decoder.decode(ThinStep.self, from: JSONSerialization.data(withJSONObject: body)) |
| + #expect(step.changeFiles == nil) |
| + var assigned = original; assigned.changeFiles = facts |
| + #expect(assigned.changeFiles == nil) |
| + } |
| + } |
| + @Test func repositoryNamesMustMatchTheForgePattern() throws { |
| + var task = try TaskDetailTests.task() |
| + for repo in ["oficina/a?b", "oficina/a%2Fb", "name space/repo", "oficina/💻"] { |
| + task.repo = repo |
| + #expect(ChangedFilesPresentation.fileURL(task: task, facts: Self.facts(), file: Self.facts().entries[0]) == nil) |
| + } |
| + } |
| +} |
diff --git a/native/apple/Tests/EquipoKitTests/Fixtures/task-detail/full.json b/native/apple/Tests/EquipoKitTests/Fixtures/task-detail/full.json| index 1992fa63..d69c7642 100644 |
| --- a/native/apple/Tests/EquipoKitTests/Fixtures/task-detail/full.json |
| +++ b/native/apple/Tests/EquipoKitTests/Fixtures/task-detail/full.json |
| @@ -405,7 +405,33 @@ |
| "bytes": 7, |
| "outcome": "outcome fixture" |
| }, |
| - "retried_by": "retried_by fixture" |
| + "retried_by": "retried_by fixture", |
| + "change_files": { |
| + "base": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", |
| + "sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", |
| + "files": 2, |
| + "additions": 4, |
| + "deletions": 1, |
| + "binary": 0, |
| + "truncated": false, |
| + "entries": [ |
| + { |
| + "path": "docs/日本語 notes.md", |
| + "old_path": "docs/old notes.md", |
| + "status": "renamed", |
| + "additions": 4, |
| + "deletions": 1, |
| + "binary": false |
| + }, |
| + { |
| + "path": "empty.txt", |
| + "status": "added", |
| + "additions": 0, |
| + "deletions": 0, |
| + "binary": false |
| + } |
| + ] |
| + } |
| } |
| ], |
| "thread": [ |
diff --git a/native/apple/Tests/EquipoKitTests/NeedsFollowupTests.swift b/native/apple/Tests/EquipoKitTests/NeedsFollowupTests.swift| new file mode 100644 |
| index 00000000..8f05a20d |
| --- /dev/null |
| +++ b/native/apple/Tests/EquipoKitTests/NeedsFollowupTests.swift |
| @@ -0,0 +1,178 @@ |
| +import Foundation |
| +import Testing |
| +@testable import EquipoKit |
| + |
| +@MainActor @Suite struct NeedsFollowupTests { |
| + func heldTask() throws -> ThinTask { |
| + var task = try NeedsRowActionTests.stopped(); task.needsYou = "held" |
| + task.steps![0].state = "running"; task.steps![0].runnerId = "runner" |
| + task.steps![0].hold = ThinHold(reason: "spend_unknown", connection: "local", provider: "codex", stepRevision: 4) |
| + return task |
| + } |
| + func connection(_ revision: Int = 4) -> APIResponse { |
| + APIResponse(status: 200, data: Data(""" |
| + {"items":[{"id":"conn","runner_id":"runner","local_id":"local","provider":"codex","spend":{"unknown":true,"pause_revision":\(revision)}}]} |
| + """.utf8)) |
| + } |
| + @Test func resumeStaysAvailableDuringBothReads() async throws { |
| + let task = try heldTask() |
| + let transport = ScriptedTransport() |
| + let gate = NeedsReadGate(base: transport) |
| + let (model, _) = try await NeedsRowModelTests().setup(task, transport: transport, service: gate) |
| + transport.on("GET /connections", .success(connection())) |
| + await model.loadNeedsRow() |
| + for path in ["/tasks/" + task.id, "/connections"] { |
| + await gate.pause(path) |
| + let read = Task { await model.loadNeedsRow(force: true) } |
| + await gate.waitUntilHeld() |
| + #expect(model.needsResume.connection?.spend?.pauseRevision == 4) |
| + #expect(model.needsAction.kind == .resume) |
| + await gate.release(); await read.value |
| + } |
| + } |
| + @Test func unchangedRowsDoNotReadAgainAndOnlyFailedRowsRetry() async throws { |
| + let task = try NeedsRowActionTests.stopped() |
| + let (good, transport) = try await NeedsRowModelTests().setup(task) |
| + let failed = TaskDetailModel(session: good.session, taskID: task.id) |
| + await good.loadNeedsRow() |
| + transport.replace("GET /tasks/" + task.id, with: .failure(.offline)) |
| + await failed.loadNeedsRow() |
| + let goodKey = good.needsReadKey, failedKey = failed.needsReadKey |
| + for _ in 0..<3 { |
| + await good.session.handle(#"data: {"type":"changed","resource":"task","cursor":12}"#) |
| + await good.session.settle() |
| + #expect(good.needsReadKey == goodKey) |
| + #expect(failed.needsReadKey == failedKey) |
| + } |
| + await good.loadNeedsRow() |
| + #expect(transport.sent("GET /tasks/" + task.id).count == 2) |
| + let encoder = EquipoJSON.encoder; encoder.dateEncodingStrategy = .iso8601 |
| + transport.replace("GET /tasks/" + task.id, with: .success(APIResponse(status: 200, data: try encoder.encode(task)))) |
| + await good.session.refresh(retryNeeds: true) |
| + #expect(failed.needsReadKey != failedKey) |
| + await good.loadNeedsRow(); await failed.loadNeedsRow() |
| + #expect(transport.sent("GET /tasks/" + task.id).count == 3) |
| + #expect(failed.readFailure == nil) |
| + var changed = task; changed.revision += 1 |
| + transport.replace("GET /tasks", with: .success(APIResponse(status: 200, data: try encoder.encode(["items": [changed]])))) |
| + transport.replace("GET /needs-you", with: .success(APIResponse(status: 200, data: try encoder.encode(["items": [changed]])))) |
| + await good.session.refresh() |
| + transport.replace("GET /tasks/" + task.id, with: .success(APIResponse(status: 200, data: try encoder.encode(changed)))) |
| + await good.loadNeedsRow() |
| + #expect(transport.sent("GET /tasks/" + task.id).count == 4) |
| + #expect(good.loaded?.revision == changed.revision) |
| + } |
| + @Test func transientErrorsKeepConnectionButChangedAndRefusedReadsClearIt() async throws { |
| + let task = try heldTask() |
| + let (model, transport) = try await NeedsRowModelTests().setup(task) |
| + transport.on("GET /connections", .success(connection())) |
| + await model.loadNeedsRow() |
| + transport.replace("GET /connections", with: .failure(.offline)) |
| + await model.loadNeedsRow(force: true) |
| + #expect(model.needsResume.connection?.id == "conn") |
| + transport.replace("GET /tasks/" + task.id, with: .failure(.offline)) |
| + await model.loadNeedsRow(force: true) |
| + #expect(model.needsResume.connection?.id == "conn") |
| + transport.replace("GET /tasks/" + task.id, with: .success(APIResponse(status: 403, data: Data()))) |
| + await model.loadNeedsRow(force: true) |
| + #expect(model.needsResume.connection == nil) |
| + } |
| + @Test func previouslyLoadedRowRetriesItsFailedRead() async throws { |
| + let task = try NeedsRowActionTests.stopped() |
| + let (model, transport) = try await NeedsRowModelTests().setup(task) |
| + await model.loadNeedsRow() |
| + transport.replace("GET /tasks/" + task.id, with: .failure(.offline)) |
| + await model.loadNeedsRow(force: true) |
| + let encoder = EquipoJSON.encoder; encoder.dateEncodingStrategy = .iso8601 |
| + transport.replace("GET /tasks/" + task.id, with: .success(APIResponse(status: 200, data: try encoder.encode(task)))) |
| + await model.session.refresh(retryNeeds: true) |
| + await model.loadNeedsRow() |
| + #expect(model.readFailure == nil) |
| + #expect(transport.sent("GET /tasks/" + task.id).count == 3) |
| + } |
| + @Test func changedHoldClearsOldConnectionBeforeItsRead() async throws { |
| + let task = try heldTask() |
| + let transport = ScriptedTransport() |
| + let gate = NeedsReadGate(base: transport) |
| + let client = EquipoClient(transport: gate, token: "fixture") |
| + let action = ResumeAction() |
| + transport.on("GET /connections", .success(connection())) |
| + await action.load(client: client, step: task.steps![0]) |
| + var step = task.steps![0]; step.runnerId = "replacement" |
| + await gate.pause("/connections") |
| + let read = Task { await action.load(client: client, step: step) } |
| + await gate.waitUntilHeld() |
| + #expect(action.connection == nil) |
| + await gate.release(); await read.value |
| + #expect(action.connection == nil) |
| + } |
| + @Test func failedConnectionReadRetriesAndRefusalClearsIt() async throws { |
| + let task = try heldTask() |
| + let (model, transport) = try await NeedsRowModelTests().setup(task) |
| + transport.on("GET /connections", .success(connection())) |
| + await model.loadNeedsRow() |
| + transport.replace("GET /connections", with: .failure(.offline)) |
| + await model.loadNeedsRow(force: true) |
| + transport.replace("GET /connections", with: .success(connection(5))) |
| + await model.session.refresh(retryNeeds: true) |
| + await model.loadNeedsRow() |
| + #expect(model.needsResume.connection?.spend?.pauseRevision == 5) |
| + #expect(transport.sent("GET /connections").count == 3) |
| + transport.replace("GET /connections", with: .success(APIResponse(status: 403, data: Data()))) |
| + await model.loadNeedsRow(force: true) |
| + #expect(model.needsResume.connection == nil) |
| + } |
| + @Test func changedConnectionResultAndTaskHoldClearResume() async throws { |
| + let task = try heldTask() |
| + let (model, transport) = try await NeedsRowModelTests().setup(task) |
| + transport.on("GET /connections", .success(connection())) |
| + await model.loadNeedsRow() |
| + transport.replace("GET /connections", with: .success(APIResponse(status: 200, data: Data(#"{"items":[]}"#.utf8)))) |
| + await model.loadNeedsRow(force: true) |
| + #expect(model.needsResume.connection == nil) |
| + transport.replace("GET /connections", with: .success(connection())) |
| + await model.loadNeedsRow(force: true) |
| + var changed = task; changed.steps![0].hold = nil |
| + let encoder = EquipoJSON.encoder; encoder.dateEncodingStrategy = .iso8601 |
| + transport.replace("GET /tasks/" + task.id, with: .success(APIResponse(status: 200, data: try encoder.encode(changed)))) |
| + await model.loadNeedsRow(force: true) |
| + #expect(model.needsResume.connection == nil) |
| + } |
| + @Test func refusedResumeClearsConnectionBeforeReload() async throws { |
| + let task = try heldTask() |
| + let transport = ScriptedTransport() |
| + let gate = NeedsReadGate(base: transport) |
| + let client = EquipoClient(transport: gate, token: "fixture") |
| + let action = ResumeAction() |
| + transport.on("GET /connections", .success(connection())) |
| + transport.on("POST /connections/conn/resume", .success(APIResponse(status: 409, data: Data()))) |
| + await action.load(client: client, step: task.steps![0]) |
| + transport.replace("GET /connections", with: .failure(.offline)) |
| + await gate.pause("/connections") |
| + let send = Task { await action.perform(client: client, step: task.steps![0]) } |
| + await gate.waitUntilHeld() |
| + #expect(action.connection == nil) |
| + await gate.release(); _ = await send.value |
| + #expect(action.connection == nil) |
| + } |
| +} |
| + |
| +private actor NeedsReadGate: EquipoTransport { |
| + nonisolated let origin = URL(string: "https://oficina.example.test")! |
| + nonisolated let base: ScriptedTransport |
| + init(base: ScriptedTransport) { self.base = base } |
| + var path: String? |
| + var held = false |
| + var continuation: CheckedContinuation<Void, Never>? |
| + func pause(_ path: String) { self.path = path; held = false } |
| + func waitUntilHeld() async { while !held { await Task.yield() } } |
| + func release() { continuation?.resume(); continuation = nil } |
| + func send(_ request: APIRequest) async throws -> APIResponse { |
| + if path == request.path { |
| + path = nil; held = true |
| + await withCheckedContinuation { continuation = $0 } |
| + } |
| + return try await base.send(request) |
| + } |
| + func lines(_ request: APIRequest) async throws -> AsyncThrowingStream<String, Error> { try await base.lines(request) } |
| +} |
diff --git a/native/apple/Tests/EquipoKitTests/NeedsRowModelTests.swift b/native/apple/Tests/EquipoKitTests/NeedsRowModelTests.swift| index 058bd851..a90c1ae3 100644 |
| --- a/native/apple/Tests/EquipoKitTests/NeedsRowModelTests.swift |
| +++ b/native/apple/Tests/EquipoKitTests/NeedsRowModelTests.swift |
| @@ -3,8 +3,7 @@ import Testing |
| @testable import EquipoKit |
| @MainActor @Suite struct NeedsRowModelTests { |
| - func setup(_ task: ThinTask, cards: [ThinCard] = []) async throws -> (TaskDetailModel, ScriptedTransport) { |
| - let transport = ScriptedTransport() |
| + func setup(_ task: ThinTask, cards: [ThinCard] = [], transport: ScriptedTransport = ScriptedTransport(), service: (any EquipoTransport)? = nil) async throws -> (TaskDetailModel, ScriptedTransport) { |
| let encoder = EquipoJSON.encoder; encoder.dateEncodingStrategy = .iso8601 |
| var snapshot: Snapshot = try Fixture.decode("thin/snapshot") |
| snapshot.tasks = [task]; snapshot.cards = cards |
| @@ -14,7 +13,7 @@ import Testing |
| transport.on("GET /tasks/" + task.id, .success(APIResponse(status: 200, data: try encoder.encode(task)))) |
| var account = DeviceAccount.new(origin: transport.origin, label: "Test") |
| account.credential = DeviceCredential(id: "fixture", token: "fixture", audience: "equipo.person.v1", instanceId: "fixture", expiresAt: .distantFuture) |
| - let session = EquipoSession(account: account, accounts: DeviceAccounts(store: MemorySecretStore()), transport: transport) |
| + let session = EquipoSession(account: account, accounts: DeviceAccounts(store: MemorySecretStore()), transport: service ?? transport) |
| await session.refresh() |
| let model = TaskDetailModel(session: session, taskID: task.id) |
| return (model, transport) |
| @@ -83,7 +82,7 @@ import Testing |
| let key = model.needsReadKey |
| let encoder = EquipoJSON.encoder; encoder.dateEncodingStrategy = .iso8601 |
| transport.replace("GET /tasks/" + task.id, with: .success(APIResponse(status: 200, data: try encoder.encode(task)))) |
| - await model.session.refresh() |
| + await model.session.refresh(retryNeeds: true) |
| #expect(model.needsReadKey != key) |
| model.needsResume.connection = ResumeConnection(id: "stale", runnerId: "r", localId: "c", provider: "codex", spend: .init(unknown: true, pauseRevision: 1)) |
| await model.loadNeedsRow() |
| @@ -124,6 +123,7 @@ import Testing |
| #expect(!transport.requests.contains { $0.path.hasSuffix("/answer") }) |
| let body = try JSONSerialization.jsonObject(with: try #require(transport.sent(route).first?.body)) as! [String: Any] |
| #expect(body["revision"] as? Int == 12) |
| + #expect(body["aside"] as? Bool == true) |
| // Undo is the existing AsideStub session call, with the new revision. |
| var restored = card; restored.aside = false; restored.revision = 14 |
| transport.replace(route, with: .success(APIResponse(status: 200, data: try encoder.encode(restored)))) |
| @@ -133,6 +133,7 @@ import Testing |
| #expect(transport.sent(route).count == 2) |
| let undo = try JSONSerialization.jsonObject(with: try #require(transport.sent(route).last?.body)) as! [String: Any] |
| #expect(undo["revision"] as? Int == 13) |
| + #expect(undo["aside"] as? Bool == false) |
| } |
| @Test func unreadFailedStaleAndBusyRowsCannotSend() async throws { |
| let task = try NeedsRowActionTests.stopped() |
diff --git a/native/ios/UITests/TaskViewUITests.swift b/native/ios/UITests/TaskViewUITests.swift| index 84b221f8..d9c43172 100644 |
| --- a/native/ios/UITests/TaskViewUITests.swift |
| +++ b/native/ios/UITests/TaskViewUITests.swift |
| @@ -1,6 +1,24 @@ |
| import XCTest |
| final class TaskViewUITests: XCTestCase { |
| + @MainActor func testChangedFilesAndOldRunnerFallback() { |
| + let app = launch("changes") |
| + XCTAssertTrue(app.buttons["changed-file-Sources/Session/EquipoSession.swift"].waitForExistence(timeout: 15)) |
| + XCTAssertTrue(app.staticTexts["6 files, 55 lines added, 10 removed"].exists) |
| + XCTAssertTrue(app.staticTexts["Non-text file"].exists) |
| + XCTAssertTrue(app.staticTexts["Renamed from docs/Badge notes.md"].exists) |
| + capture("iphone-changed-files") |
| + app.terminate() |
| + let old = launch("changes-old") |
| + XCTAssertTrue(old.buttons["Open on the web"].waitForExistence(timeout: 15)) |
| + XCTAssertFalse(old.buttons["changed-file-Sources/Session/EquipoSession.swift"].exists) |
| + capture("iphone-changed-files-old-runner") |
| + } |
| + @MainActor func testChangedFilesLargeText() { |
| + let app = launch("changes", large: true) |
| + XCTAssertTrue(app.buttons["changed-file-Sources/Session/EquipoSession.swift"].waitForExistence(timeout: 15)) |
| + capture("iphone-changed-files-large") |
| + } |
| @MainActor func testOverviewMenuAndMergeConfirmation() { |
| let app = launch("overview") |
| XCTAssertTrue(app.buttons["task-more"].waitForExistence(timeout: 15)) |
diff --git a/native/scripts/check-strings.py b/native/scripts/check-strings.py| index e02953d4..dfdd26d7 100755 |
| --- a/native/scripts/check-strings.py |
| +++ b/native/scripts/check-strings.py |
| @@ -14,9 +14,11 @@ source = json.loads((native / 'scripts/strings.json').read_text()) |
| # iPhone's widget extension draws the Live Activity with on its own. |
| catalog_paths = [native / 'apple/Sources' / target / 'Resources/Localizable.xcstrings' for target in ('EquipoKit', 'EquipoActivity')] |
| +plurals = json.loads((native / 'scripts/plurals.json').read_text()) |
| + |
| def catalog(): |
| return {'sourceLanguage': 'en', 'version': '1.0', 'strings': { |
| - k: {'extractionState': 'manual', 'localizations': {'en': {'stringUnit': {'state': 'translated', 'value': v}}}} |
| + k: {**({'comment': 'COPY APPROVED: Luna, 2026-11-26.'} if k.startswith('native.changes.') else {}), 'extractionState': 'manual', 'localizations': {'en': plurals.get(k, {'stringUnit': {'state': 'translated', 'value': v}})}} |
| for k, v in sorted(source.items())}} |
| def used_keys(): |
| @@ -33,6 +35,18 @@ def used_keys(): |
| return keys |
| problems = [] |
| +# The plural catalog's ordinary forms must stay identical to the reviewed |
| +# English source. Singular forms are exercised by native localization tests. |
| +for key, value in plurals.items(): |
| + ordinary = value['stringUnit']['value'] |
| + for name, substitution in value['substitutions'].items(): |
| + ordinary = ordinary.replace('%#@' + name + '@', substitution['variations']['plural']['other']['stringUnit']['value']) |
| + ordinary = re.sub(r'%[0-9]+\$', '%', ordinary) |
| + if ordinary != source.get(key): |
| + problems.append(f'{key}: plural catalog differs from reviewed source') |
| + for match in re.findall(r'"value": "([^"]*)"', json.dumps(value, ensure_ascii=False)): |
| + if '—' in match or '!' in match: problems.append(f'{key}: unreviewed punctuation in plural form') |
| + |
| for k in sorted(used_keys() - source.keys()): problems.append(f'no English text for key: {k}') |
| for k, v in source.items(): |
| if '—' in v: problems.append(f'em dash in {k}') |
diff --git a/native/scripts/plurals.json b/native/scripts/plurals.json| new file mode 100644 |
| index 00000000..036343b2 |
| --- /dev/null |
| +++ b/native/scripts/plurals.json |
| @@ -0,0 +1,50 @@ |
| +{ |
| + "native.changes.total": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%#@files@, %#@lines@, %3$lld removed" |
| + }, |
| + "substitutions": { |
| + "files": { |
| + "argNum": 1, |
| + "formatSpecifier": "lld", |
| + "variations": { |
| + "plural": { |
| + "one": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%lld file" |
| + } |
| + }, |
| + "other": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%lld files" |
| + } |
| + } |
| + } |
| + } |
| + }, |
| + "lines": { |
| + "argNum": 2, |
| + "formatSpecifier": "lld", |
| + "variations": { |
| + "plural": { |
| + "one": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%lld line added" |
| + } |
| + }, |
| + "other": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "%lld lines added" |
| + } |
| + } |
| + } |
| + } |
| + } |
| + } |
| + } |
| +} |
diff --git a/native/scripts/strings.json b/native/scripts/strings.json| index 9eec1b67..863faad6 100644 |
| --- a/native/scripts/strings.json |
| +++ b/native/scripts/strings.json |
| @@ -404,9 +404,12 @@ |
| "work.priority.mark_urgent": "Mark urgent", |
| "work.priority.normal": "Normal priority", |
| "work.priority.urgent": "Urgent", |
| + "work.reason.amadan_unreachable": "Amadan could not be reached to confirm Equipo may merge here", |
| + "work.reason.merge_credential": "the runner has no Amadan credential for this repository", |
| "work.reason.account_unavailable": "no model account was ready", |
| "work.reason.amadan_ci_failed": "Amadan's own CI did not pass", |
| "work.reason.amadan_ci_pending": "Amadan's own CI had not finished", |
| + "work.reason.amadan_unreachable": "Amadan could not be reached to confirm Equipo may merge here", |
| "work.reason.base_checks_failed": "the base version's checks failed", |
| "work.reason.base_gate_unavailable": "the check files from the base version could not be loaded", |
| "work.reason.branch_moved": "the branch moved on Amadan", |
| @@ -422,6 +425,7 @@ |
| "work.reason.limited": "its model account reached its limit", |
| "work.reason.machine_removed": "the machine was removed mid-step", |
| "work.reason.merge_conflict": "it conflicts with the default branch", |
| + "work.reason.merge_credential": "the runner has no Amadan credential for this repository", |
| "work.reason.merge_failed": "Amadan did not merge it", |
| "work.reason.merge_forbidden": "Equipo may not merge in this repository", |
| "work.reason.merge_not_authorized": "my rules require me to ask before merging", |
| @@ -484,6 +488,14 @@ |
| "work.star.add": "Star %@", |
| "work.star.remove": "Unstar %@", |
| "work.tl.merge_dropped": "An earlier attempt to add this change was dropped when the task became an exploration.", |
| + "native.changes.added": "Added", |
| + "native.changes.modified": "Changed", |
| + "native.changes.deleted": "Deleted", |
| + "native.changes.renamed": "Renamed", |
| + "native.changes.binary": "Non-text file", |
| + "native.changes.renamed_from": "Renamed from %@", |
| + "native.changes.truncated": "Showing the first %lld files. Open on Amadan for the full list.", |
| + "native.changes.total": "%lld files, %lld lines added, %lld removed", |
| "chat.day.today": "Today", |
| "work.needs_empty": "Nothing needs you right now.", |
| "native.needs.running_now": "Running now", |