Review fixes: Run now pinned to what it promised (protocol 29), and the rest of Fable's review
Human
Prompt
Fable reviewed feat/paused-work at 4df616bc: CHANGES REQUESTED, 1 blocker, 5 should-fix, 13 nits. Controller rulings, test-first: B1 pin the predicted connection on the release and have the runner admit only there (no fallback to metered or another family); the instance's prediction uses the runner's inputs; a runner too old to honour a pinned release gets plain "Run it now anyway" and no carry_on, gated on protocol (bump if needed). S1 isolate per-card errors in refreshJobs. S2 stop offering Run now after it is accepted; a repeat tap says it is already running. S3 name the actual runner. S4 Luna confirms five strings. S5 zone- and date-independent tests, plus digests, sweep, quiet hours and day boundaries in a non-UTC zone, across a zone change and DST. Nits: fix the cheap ones and list the rest.
From this commit's own message. The prompt ledger has no entries for it — which is what a squashed, rebased or amended commit looks like, and what every commit looks like in a repo without a ledger.
Summary
B1: Run now's release names the connection the person was shown; the runner admits the leave there only (schedule.DecidePinned) or keeps the hold, so a subscription promise never bills a metered connection, stale readings included. The prediction uses the runner's inputs (Review's family rule, Research's first pass, a fix round's kept session). Protocol 29 carries the pin; below it Encode refuses a pinned release and drops a pinned dispatch's release, and the instance offers plain Run it now anyway with no carry_on. S1: the minute's sweep projects job cards one transaction each and skips a failing one. S2: Run now is not offered once written; a repeat tap is 409 already_running. S3: the offline line names the runner. S5: housekeeping and day-box tests on Madrid's clock, and the sweep and digest at the local hour across both Dublin DST Sundays and a zone change (AtHour, N1). Nits N5, N6, N9, N10, N11, N12 fixed; the rest listed in the controller report.
Agent notes
Deploy: the instance and runners speak protocol 29. A runner on 28 keeps working, with plain Run now. Upgrade the runners to get the named, pinned offer and Base's carry_on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
60 files changed,
+1,150
−163
.rastrillo/budgets.txt+5 −5docs/api/equipo-v1.openapi.json+7 −8docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+14 −1docs/superpowers/specs/2026-11-24-paused-work-design.md+30 −2internal/equipo/chat/days.go+3 −2internal/equipo/chat/housekeeping_control.go+3 −5internal/equipo/chat/http.go+2 −0internal/equipo/chat/job_paused.go+34 −16internal/equipo/chat/paused.go+120 −24internal/equipo/chat/paused_test.go+221 −2internal/equipo/chat/schedule.go+39 −7internal/equipo/chat/zone_test.go+59 −0internal/equipo/chat_page.go+1 −1internal/equipo/copy.go+2 −1internal/equipo/handlers.go+2 −0internal/equipo/housekeeping/policy.go+8 −0internal/equipo/housekeeping/zone_test.go+60 −0internal/equipo/labels_test.go+2 −2internal/equipo/migrations/0106_release_connection.sql+3 −0internal/equipo/migrations/schema.sql+1 −0internal/equipo/pause_view.go+11 −1internal/equipo/pause_view_test.go+14 −1internal/equipo/usage_page_test.go+2 −2internal/equipo/work_pages.go+13 −6internal/plan3test/plan3_release_test.go+1 −1internal/runner/thin/pinned_release_test.go+72 −0internal/runner/thin/schedule.go+31 −5internal/runner/thin/schedule_test.go+1 −1internal/runner/thin/state.go+6 −0internal/schedule/pinned_test.go+51 −0internal/schedule/schedule.go+23 −0internal/thintest/assistant_paused_contract_test.go+7 −0internal/thintest/housekeeping_contract_test.go+21 −18internal/thintest/paused_browser_test.go+5 −1internal/thintest/rollup_pages_test.go+6 −3internal/thintest/scheduler_contract_test.go+6 −4internal/thintest/zone.go+41 −0internal/wire/assistant_test.go+1 −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+45 −0internal/wire/publish_test.go+1 −1internal/wire/runners.go+20 −1internal/wire/runners_test.go+1 −1internal/wire/schedule.go+13 −4internal/wire/schedule_test.go+1 −1internal/wire/tasks.go+3 −0internal/wire/usage_test.go+1 −1internal/wire/warm_test.go+1 −1internal/wire/wiretest/testdata/api/task-held.json+1 −1native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings+34 −1native/apple/Sources/EquipoKit/API/Thin.swift+6 −4native/apple/Sources/EquipoKit/Presentation/Pause.swift+25 −18native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings+34 −1native/apple/Sources/EquipoKit/UI/Screens/TaskScreens.swift+2 −1native/apple/Tests/EquipoKitTests/PausedTests.swift+24 −0native/scripts/check-parity.py+1 −1native/scripts/strings.json+4 −1
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/feat__paused-work: 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.7s
ci-box: codex: fetched and verified in 3.4s
ci-box: codex-code-mode-host: fetched and verified in 1.3s
ci-box: libwrap: fetched and verified in 0.3s
ci-box: socat: fetched and verified in 0.3s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: image pulled in 10.2s
ci-box: pi: installed and verified in 7.5s
ci-box: opencode: installed and verified in 2.3s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.8s
ci-box: clone deepened in 3.5s
ci-box: file times set from content: 2986 files, 193 directories
ci-box: ready in 17.1s
=== 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.149s
=== compile ===
go build ./...
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py compile
+ go build -tags testbuild ./...
4.2s
+ go list -export -test -tags testbuild -f ./...
4.7s
+ go list -export -test -tags browser,testbuild -f ./internal/equipo ./internal/headless ./internal/idtest ./internal/plan3test ./internal/thintest
3.3s
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -version
staticcheck 2026.1 (v0.7.0)
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 -version
Go: go1.26.11
Scanner: govulncheck@v1.8.0
DB: https://vuln.go.dev
DB updated: 2026-11-23 20:05:14 +0000 UTC
go run github.com/zricethezav/gitleaks/v8@v8.30.1 version
version is set by build process
=== check ===
--- shard 0 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-work: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$' ./internal/headless
receipt: test step 1m18.204s 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.36s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m16.36s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 66.66, cpu waiting 41.76%, memory waiting 0.00%, io waiting 0.58%
--- 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 1m19.046s 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.855s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m16.85s amadan.net/oficina/equipo/internal/headless TestHeadless
machine: 32 CPUs, load 66.66, cpu waiting 41.76%, memory waiting 0.00%, io waiting 0.58%
--- shard 2 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-connections: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -run '^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$' ./internal/headless
receipt: test step 1m19.242s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m17.436s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m7.63s amadan.net/oficina/equipo/internal/headless TestHeadlessConnections
receipt: slow test 5.23s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenPasteEndToEnd
receipt: slow test 4.57s amadan.net/oficina/equipo/internal/headless TestHeadlessTokenConnection
machine: 32 CPUs, load 66.66, cpu waiting 41.76%, memory waiting 0.00%, io waiting 0.58%
--- 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.396s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m13.57s amadan.net/oficina/equipo/internal/headless
receipt: slow test 36.23s amadan.net/oficina/equipo/internal/headless TestMacWorker
receipt: slow test 19.54s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.05s amadan.net/oficina/equipo/internal/headless TestHeadlessPrewarm
receipt: slow test 8.74s amadan.net/oficina/equipo/internal/headless TestHeadlessAttachments
machine: 32 CPUs, load 65.67, cpu waiting 41.23%, memory waiting 0.00%, io waiting 0.62%
--- 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.827s 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 1m32.036s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m2.85s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 9.25s amadan.net/oficina/equipo/internal/headless TestHeadlessRunnerKillLeavesNoCopies
receipt: slow test 8.25s amadan.net/oficina/equipo/internal/headless TestHeadlessCopyRotation
receipt: slow test 7.08s amadan.net/oficina/equipo/internal/headless TestHeadlessPolicyGuards
receipt: slow test 4.6s amadan.net/oficina/equipo/internal/headless TestHeadlessNewHouseRuleStartsFresh
machine: 32 CPUs, load 60.33, cpu waiting 40.99%, memory waiting 0.00%, io waiting 0.45%
--- shard 5 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane headless-rest: ./internal/headless
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^TestHeadless$/^4c_rebase$|^TestHeadless$/^4b_ask$|^TestHeadless$/^4c_checks_card$|^TestHeadless$/^4_step_crash$|^TestHeadless$/^4_review$|^TestHeadless$/^2b_access$|^TestHeadless$/^runner_crash$|^TestHeadless$/^2b_first_message$|^TestHeadless$/^4_checks_honest$|^TestHeadless$/^7_stream_resume$|^TestHeadless$/^2b_notebook$|^TestHeadless$/^2b_move_in$|^TestHeadless$/^2b_desk_failure$|^TestHeadless$/^cancel$|^TestHeadlessConnections$|^TestHeadlessTokenPasteEndToEnd$|^TestHeadlessTokenConnection$|^TestMacWorker$|^TestHeadlessAttachments$|^TestHeadlessPrewarm$|^TestHeadless$/^1_first_token$|^TestHeadless$/^6_quick_messages$|^TestHeadless$/^8_instance_restart$|^TestHeadless$/^3_runner_offline$|^TestHeadlessCopyRotation$|^TestHeadlessPolicyGuards$|^TestHeadlessRunnerKillLeavesNoCopies$|^TestHeadlessNewHouseRuleStartsFresh$|^TestHeadless$/^3_engineering$|^TestHeadless$/^3_step_cancel$|^TestHeadless$/^3_step_contained$|^TestHeadless$/^3_step_refused$|^TestHeadless$/^3_empty_repo$|^TestHeadless$/^3_empty_engineering$|^TestHeadless$/^3_empty_merge$|^TestHeadless$/^3_empty_merge_rebuilt$|^TestHeadless$/^3_empty_fix_round$' ./internal/headless
receipt: test step 2m45.635s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m43.448s amadan.net/oficina/equipo/internal/headless
receipt: slow test 1m37.43s amadan.net/oficina/equipo/internal/headless TestHeadlessAssistant
receipt: slow test 18.63s amadan.net/oficina/equipo/internal/headless TestHeadless
receipt: slow test 8.77s amadan.net/oficina/equipo/internal/headless TestHeadlessResearchHandoff
receipt: slow test 6.62s amadan.net/oficina/equipo/internal/headless TestHeadlessTurnBatching
receipt: slow test 6.5s amadan.net/oficina/equipo/internal/headless TestHeadlessBatchAfterRefusedReply
machine: 32 CPUs, load 23.61, cpu waiting 13.50%, memory waiting 0.00%, io waiting 0.13%
--- 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 2m10.532s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 2m8.315s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 8.37s amadan.net/oficina/equipo/internal/thintest TestContractTeamJobSettledStates
receipt: slow test 6.75s amadan.net/oficina/equipo/internal/thintest TestExplorePreviewsOff
receipt: slow test 3.97s amadan.net/oficina/equipo/internal/thintest TestContractPreviewHeldUntilPublishAnswer
receipt: slow test 3.79s amadan.net/oficina/equipo/internal/thintest TestContractTeamNudgePersonNeeds
receipt: slow test 2.53s amadan.net/oficina/equipo/internal/thintest TestResearchDoneFallsBack
machine: 32 CPUs, load 38.71, cpu waiting 24.55%, memory waiting 0.00%, io waiting 0.25%
--- shard 7 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
test lane thintest-contract: ./internal/thintest
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m -skip '^Test([^C]|C[^o]|Co[^n]|Con[^t])|^TestContract(Assistant|Outcome|Team|Handoff|HostAllowlist|HostIsPerPerson|Look|Use[A-Z]|RemoteCall|LanesRunAtOnce|NoMergeQuestionWhenGateMerges|PreviewHeldUntilPublishAnswer|PreviewNotHeldBelow19|PublishNeedsOwnerAnswer)' ./internal/thintest
receipt: test step 1m32.482s 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 1m30.128s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 9.24s amadan.net/oficina/equipo/internal/thintest TestContractPreviewNotScheduled
receipt: slow test 5.08s amadan.net/oficina/equipo/internal/thintest TestContractPublishNotOffered
receipt: slow test 4.52s amadan.net/oficina/equipo/internal/thintest TestContractMacRecheckMergeAuthority
receipt: slow test 2.38s amadan.net/oficina/equipo/internal/thintest TestContractPublishNameTaken
receipt: slow test 2.37s amadan.net/oficina/equipo/internal/thintest TestContractPreview
machine: 32 CPUs, load 62.88, cpu waiting 40.82%, memory waiting 0.00%, io waiting 0.47%
--- 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.375s, over the 45s its record on line 44 allows; reported only, timing fails on CI
receipt: test step 4m54.163s 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.375s amadan.net/oficina/equipo/internal/runner/thin
receipt: slow test 37.01s amadan.net/oficina/equipo/internal/runner/thin TestModelsEngineeringProbesThenRunsTheStrongest
receipt: slow test 36.97s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeAnsweredByAnotherModel
receipt: slow test 36.78s amadan.net/oficina/equipo/internal/runner/thin TestModelsUnhealthyRetriedOnDemand
receipt: slow test 18.46s amadan.net/oficina/equipo/internal/runner/thin TestModelsProbeRunsInsideTheAdmission
receipt: slow test 6.99s amadan.net/oficina/equipo/internal/runner/thin TestOpenCodeStepsRealOpenCode
machine: 32 CPUs, load 3.73, cpu waiting 1.60%, 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 51.486s 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 50.443s amadan.net/oficina/equipo/internal/runner
receipt: slow test 30.41s amadan.net/oficina/equipo/internal/runner TestDirectBugWorkflow
receipt: slow test 20.03s amadan.net/oficina/equipo/internal/runner TestEnrolKeepsTheRole
machine: 32 CPUs, load 54.86, cpu waiting 33.61%, memory waiting 0.00%, io waiting 0.93%
--- 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 1m2.71s 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 1m1.378s amadan.net/oficina/equipo/internal/runner
receipt: slow test 51.19s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowCandidateOrder
receipt: slow test 47.05s amadan.net/oficina/equipo/internal/runner TestPlanWorkflowFeature
receipt: slow test 8.47s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryCallRefusalKeepsServing
receipt: slow test 1.7s amadan.net/oficina/equipo/internal/runner TestCoordinatorRefusalMatrix
machine: 32 CPUs, load 65.90, cpu waiting 40.21%, memory waiting 0.00%, io waiting 0.76%
--- 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.369s 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.409s amadan.net/oficina/equipo/internal/runner
receipt: slow test 5.14s amadan.net/oficina/equipo/internal/runner TestDirectFaultIsolation
receipt: slow test 3.41s amadan.net/oficina/equipo/internal/runner TestClaimRefusalsBackOff
receipt: slow test 3.12s amadan.net/oficina/equipo/internal/runner TestCoordinatorRecoveryRefusedKeepsServing
receipt: slow test 2.84s amadan.net/oficina/equipo/internal/runner TestToolVerbUnderFakeHarness
receipt: slow test 1.61s amadan.net/oficina/equipo/internal/runner TestCoordinatorTransientRefusalKeepsServing
machine: 32 CPUs, load 33.65, cpu waiting 22.89%, memory waiting 0.00%, io waiting 1.17%
--- 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.2%, load 25.00
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.926s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m6.922s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 27.96s amadan.net/oficina/equipo/internal/equipotest TestAuthorityCoreIntegration
receipt: slow test 27.84s amadan.net/oficina/equipo/internal/equipotest TestBootstrapNamesOwnersSetting
receipt: slow test 25.67s amadan.net/oficina/equipo/internal/equipotest TestAccountLabelMigration
receipt: slow test 22.93s amadan.net/oficina/equipo/internal/equipotest TestBudgetConfigurationFailuresAreAtomic
receipt: slow test 22.77s amadan.net/oficina/equipo/internal/equipotest TestAuthorityGrantReferences
machine: 32 CPUs, load 57.02, cpu waiting 38.81%, memory waiting 0.00%, io waiting 0.41%
--- 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 41.2%, load 25.00
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.924s 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.883s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 20.85s amadan.net/oficina/equipo/internal/equipotest TestProjectWritesRequireCurrentOwner
receipt: slow test 20.84s amadan.net/oficina/equipo/internal/equipotest TestProjectRetryAndRevision
receipt: slow test 20.83s amadan.net/oficina/equipo/internal/equipotest TestProjectOwnersAreMembers
receipt: slow test 20.78s amadan.net/oficina/equipo/internal/equipotest TestProjectRejectsUnsafeBinding
receipt: slow test 20.75s amadan.net/oficina/equipo/internal/equipotest TestProjectRequestActorAndUpdate
machine: 32 CPUs, load 50.85, cpu waiting 33.55%, memory waiting 0.00%, io waiting 0.35%
--- shard 14 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: equipotest-r started 30s late; cpu waiting 40.2%, load 25.00
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.899s 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.612s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 16.43s amadan.net/oficina/equipo/internal/equipotest TestReleaseStampContract
receipt: slow test 13.31s amadan.net/oficina/equipo/internal/equipotest TestRosterChangesAffectExistingSession
receipt: slow test 10.29s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalWhileAssigned
receipt: slow test 10.16s amadan.net/oficina/equipo/internal/equipotest TestRosterRemovalRollsBack
receipt: slow test 7.25s amadan.net/oficina/equipo/internal/equipotest TestRosterAuditFailureRollsBack
machine: 32 CPUs, load 53.97, cpu waiting 35.75%, memory waiting 0.00%, io waiting 0.37%
--- 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.2%, load 25.00
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.8s 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.962s amadan.net/oficina/equipo/internal/equipotest
receipt: slow test 25.53s amadan.net/oficina/equipo/internal/equipotest TestSigninNoProof
receipt: slow test 25.02s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedExistingTeam
receipt: slow test 24.98s amadan.net/oficina/equipo/internal/equipotest TestSpecialistsSeedRollback
receipt: slow test 23.18s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettings
receipt: slow test 23.17s amadan.net/oficina/equipo/internal/equipotest TestSpecialistSettingsCurrentOwner
machine: 32 CPUs, load 57.02, cpu waiting 38.81%, memory waiting 0.00%, io waiting 0.41%
--- 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.2%, load 25.00
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 55.317s 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 53.487s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 3.81s amadan.net/oficina/equipo/internal/plan3test TestPlan3Upgrade
receipt: slow test 3.55s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3B
receipt: slow test 1.83s amadan.net/oficina/equipo/internal/plan3test TestConversationQuestionRace
receipt: slow test 1.53s amadan.net/oficina/equipo/internal/plan3test TestCoordinatorAcceptance3A
receipt: slow test 1.29s amadan.net/oficina/equipo/internal/plan3test TestPlanMigrationUpgrade
machine: 32 CPUs, load 63.48, cpu waiting 40.85%, memory waiting 0.00%, io waiting 0.52%
--- 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.2%, load 25.00
test lane rest: ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags testbuild -timeout 15m ./cmd/equipo ./cmd/equipo-runner ./cmd/equipo-tool-proxy ./internal/advice ./internal/attach ./internal/attach/attachtest ./internal/chatmarkdown ./internal/chatsend ./internal/chatstream ./internal/coordinator ./internal/coordinatorcontract ./internal/coordinatormail ./internal/copydesk ./internal/equipo ./internal/equipo/activity ./internal/equipo/assist ./internal/equipo/chat ./internal/equipo/conversation ./internal/equipo/conversation/chatstate ./internal/equipo/door ./internal/equipo/housekeeping ./internal/equipo/icons ./internal/equipo/identity ./internal/equipo/kernel ./internal/equipo/library ./internal/equipo/mergegate ./internal/equipo/notifications ./internal/equipo/oficina ./internal/equipo/oficina/oficinatest ./internal/equipo/oficinaid ./internal/equipo/ownermode ./internal/equipo/pause ./internal/equipo/personapi ./internal/equipo/planning ./internal/equipo/push ./internal/equipo/setup ./internal/equipo/team ./internal/equipo/teamcontract ./internal/equipo/triage ./internal/fakeclaude ./internal/fakecodex ./internal/fakeopencode ./internal/fakepi ./internal/idtest ./internal/ownermodetest ./internal/release ./internal/runner/checks ./internal/runner/connect ./internal/runner/containment ./internal/runner/containment/sysunix ./internal/runner/egress ./internal/runner/forge ./internal/runner/forge/forgetest ./internal/runner/heartbeat ./internal/runner/mac ./internal/runner/mcpresource ./internal/runner/metered ./internal/runner/planflow ./internal/runner/provider ./internal/runner/provider/claude ./internal/runner/provider/claude/realcli ./internal/runner/provider/codex ./internal/runner/provider/gotoolchain ./internal/runner/provider/opencode ./internal/runner/provider/pi ./internal/runner/setup ./internal/runner/transporttest ./internal/runner/webread ./internal/runner/workspace ./internal/runnerproto ./internal/schedule ./internal/sealbox ./internal/specialist ./internal/stagingtest ./internal/taskplan ./internal/testci ./internal/toolproxy ./internal/websource ./internal/wire ./internal/wire/forgekey ./internal/wire/wireschema ./internal/wire/wiretest ./tools/drive
cache miss: amadan.net/oficina/equipo/internal/chatmarkdown: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/copydesk: its inputs changed
cache miss: amadan.net/oficina/equipo/internal/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/testci TestBudgetRecordsAreShort
=== RUN TestBudgetRecordsAreShort
budgets_file_test.go:37: .rastrillo/budgets.txt:41: reason is 206 bytes, over 200
budgets_file_test.go:37: .rastrillo/budgets.txt:59: reason is 235 bytes, over 200
--- FAIL: TestBudgetRecordsAreShort (0.00s)
--- FAIL amadan.net/oficina/equipo/internal/testci (package output)
FAIL
rastrillo-budget/v1 ran 2.001s
FAIL amadan.net/oficina/equipo/internal/testci 2.008s
budget note: internal/equipo took 56.163s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/equipo/chat took 21.054s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/idtest took 2m2.301s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/release took 36.558s, 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 48.543s, over the 15s its record on line 40 allows; reported only, timing fails on CI
budget note: internal/runner/forge took 21.151s, over the 20s its record on line 35 allows; reported only, timing fails on CI
budget note: internal/runner/provider/claude/realcli took 14.228s, over the 10s the default allows; reported only, timing fails on CI
budget note: internal/runner/provider/pi took 1m21.702s, over the 1m0s its record on line 27 allows; reported only, timing fails on CI
budget note: internal/runner/workspace took 13.964s, over the 10s the default allows; reported only, timing fails on CI
receipt: test step 2m8.174s against a 60s target (the gate's other steps are not in this figure)
receipt: 38 packages ran, 27 cached, 17 without tests, 1 failed
receipt: slow package 2m2.301s amadan.net/oficina/equipo/internal/idtest
receipt: slow package 1m21.702s amadan.net/oficina/equipo/internal/runner/provider/pi
receipt: slow package 1m8.326s amadan.net/oficina/equipo/internal/runner/provider/opencode
receipt: slow package 57.911s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 56.163s amadan.net/oficina/equipo/internal/equipo
receipt: slow test 56.16s amadan.net/oficina/equipo/internal/idtest TestDoorRemembersOficinaID
receipt: slow test 47.07s amadan.net/oficina/equipo/internal/idtest TestDoorOficinaSettingsUnreadableIsNoLoop
receipt: slow test 46.68s amadan.net/oficina/equipo/internal/idtest TestDoorForgetsOficinaIDForARefusedSession
receipt: slow test 45.95s amadan.net/oficina/equipo/internal/idtest TestDoorStepUpIsLocal
receipt: slow test 45.18s amadan.net/oficina/equipo/internal/idtest TestDoorNeverJudgesANativeSession
rastrillo: budget test: go test failed
exit status 1
+ go test -tags testbuild -timeout 15m -v -run '^TestBudgetRecordsAreShort$' -count=1 ./internal/testci (retry, once)
FAILED TWICE ./internal/testci:TestBudgetRecordsAreShort rest
=== RUN TestBudgetRecordsAreShort
budgets_file_test.go:37: .rastrillo/budgets.txt:41: reason is 206 bytes, over 200
budgets_file_test.go:37: .rastrillo/budgets.txt:59: reason is 235 bytes, over 200
--- FAIL: TestBudgetRecordsAreShort (0.00s)
FAIL
rastrillo-budget/v1 ran 0s
FAIL amadan.net/oficina/equipo/internal/testci 0.004s
FAIL
machine: 32 CPUs, load 25.05, cpu waiting 14.92%, memory waiting 0.00%, io waiting 0.14%
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 1m25.99s against a 60s target (the gate's other steps are not in this figure)
receipt: 1 packages ran, 0 cached, 0 without tests, 0 failed
receipt: slow package 1m24.324s amadan.net/oficina/equipo/internal/headless
receipt: slow test 39.32s amadan.net/oficina/equipo/internal/headless TestBrowserDraftIsTheMessage
receipt: slow test 14.91s amadan.net/oficina/equipo/internal/headless TestBrowserDraftStreamsFormatted
receipt: slow test 10.39s amadan.net/oficina/equipo/internal/headless TestBrowserChat
receipt: slow test 7.25s amadan.net/oficina/equipo/internal/headless TestBrowserComposer
receipt: slow test 6.72s amadan.net/oficina/equipo/internal/headless TestBrowserChatSendStaysOnPage
machine: 32 CPUs, load 63.48, cpu waiting 40.60%, memory waiting 0.00%, io waiting 0.50%
--- 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 1m32.805s 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 1m30.908s amadan.net/oficina/equipo/internal/headless
receipt: slow test 28.41s amadan.net/oficina/equipo/internal/headless TestBrowserRailFollowsWork
receipt: slow test 21.6s amadan.net/oficina/equipo/internal/headless TestBrowserTaskThread
receipt: slow test 12.98s amadan.net/oficina/equipo/internal/headless TestBrowserReceiptFollowsReview
receipt: slow test 10.04s amadan.net/oficina/equipo/internal/headless TestBrowserTaskCard
receipt: slow test 9.34s amadan.net/oficina/equipo/internal/headless TestBrowserAskAfterMerge
machine: 32 CPUs, load 60.33, cpu waiting 40.99%, memory waiting 0.00%, io waiting 0.45%
--- 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 1m54.568s 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 1m52.797s amadan.net/oficina/equipo/internal/headless
receipt: slow test 15.02s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsConversation
receipt: slow test 13.39s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAddPage
receipt: slow test 12.5s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsAdd
receipt: slow test 11.38s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsSignInEmail
receipt: slow test 11.38s amadan.net/oficina/equipo/internal/headless TestBrowserConnectionsMeteredLimitRequired
machine: 32 CPUs, load 47.50, cpu waiting 30.49%, memory waiting 0.00%, io waiting 0.31%
--- 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-24T15:10:31.491Z level=INFO msg="startup phase" phase=state_lock
time=2026-11-24T15:10:31.491Z level=INFO msg="startup phase done" phase=state_lock took=85µs
time=2026-11-24T15:10:31.491Z level=INFO msg="startup phase" phase=claim_roots
time=2026-11-24T15:10:31.492Z level=INFO msg="startup phase done" phase=claim_roots took=86µs
time=2026-11-24T15:10:31.492Z level=INFO msg="startup phase" phase=sweep
time=2026-11-24T15:10:31.538Z level=INFO msg="startup phase done" phase=sweep took=46.824ms
time=2026-11-24T15:10:31.539Z level=INFO msg="startup phase" phase=credentials
time=2026-11-24T15:10:31.539Z level=INFO msg="startup phase done" phase=credentials took=113µs
time=2026-11-24T15:10:31.539Z level=INFO msg="startup phase" phase=open_state
time=2026-11-24T15:10:31.592Z level=INFO msg="startup phase done" phase=open_state took=53.778ms
time=2026-11-24T15:10:31.593Z level=WARN msg="no seal key: token connections cannot be added" err=*fs.PathError
time=2026-11-24T15:10:31.594Z level=INFO msg=connecting host=127.0.0.1:33529 protocol=29
time=2026-11-24T15:10:31.598Z level=INFO msg=connected host=127.0.0.1:33529 took=4.398ms
time=2026-11-24T15:10:31.599Z level=INFO msg="capabilities gathering"
time=2026-11-24T15:10:31.602Z level=INFO msg="capabilities gathered" took=3.464ms tags=linux,claude,go
time=2026-11-24T15:10:31.604Z level=INFO msg="hello sent" protocol=29
time=2026-11-24T15:10:31.611Z level=INFO msg=welcome protocol=29 role=primary generation=1
browser_copy_test.go:90: waiting for !document.querySelector('[data-copy-continue]'): context deadline exceeded (last evaluation: context deadline exceeded)
--- FAIL: TestBrowserCopyContinue (6.48s)
--- FAIL amadan.net/oficina/equipo/internal/headless (package output)
FAIL
rastrillo-budget/v1 ran 1m34.083s
FAIL amadan.net/oficina/equipo/internal/headless 94.258s
receipt: test step 1m35.595s 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 1m34.083s amadan.net/oficina/equipo/internal/headless
receipt: slow test 14.87s amadan.net/oficina/equipo/internal/headless TestBrowserThinkingAndCards
receipt: slow test 11.46s amadan.net/oficina/equipo/internal/headless TestBrowserStalePageReloads
receipt: slow test 10.78s amadan.net/oficina/equipo/internal/headless TestBrowserWaitingTurns
receipt: slow test 9.61s amadan.net/oficina/equipo/internal/headless TestBrowserMoveIn
receipt: slow test 7.61s amadan.net/oficina/equipo/internal/headless TestBrowserNotebookLook
rastrillo: budget test: go test failed
exit status 1
+ go test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAskAfterMerge|TestBrowserChat|TestBrowserChatSendStaysOnPage|TestBrowserComposer|TestBrowserComposerDock|TestBrowserComposerFocus|TestBrowserComposerReconcile|TestBrowserConnectionsAdd|TestBrowserConnectionsAddPage|TestBrowserConnectionsConversation|TestBrowserConnectionsCopyLink|TestBrowserConnectionsEndedNote|TestBrowserConnectionsMeteredLimitRequired|TestBrowserConnectionsOpenCodeGoLimitRequired|TestBrowserConnectionsSignIn|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 c3b543a904da2e3905188115fc8b828f1a087f3e 6.48s 60.33
##############################################################################
failed, then passed on its one retry: the step stays green and the flake is on record
machine: 32 CPUs, load 57.02, cpu waiting 37.87%, memory waiting 0.00%, io waiting 0.40%
--- shard 22 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
timing budgets: reported, not enforced: a shared runner's load is not this change's time (set EQUIPO_CI_DEDICATED=1 on a dedicated runner)
browser: /opt/chromium-156.0.8078.79-1_deb13u1/chrome: Chromium 156.0.8078.79
browser lane browser-rest: ./internal/equipo
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserPreviewBlocksNavigation)$' ./internal/equipo
receipt: test step 2.484s 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 643ms amadan.net/oficina/equipo/internal/equipo
receipt: slow test 640ms 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
receipt: test step 11.206s 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 9.988s amadan.net/oficina/equipo/internal/idtest
receipt: slow test 7.9s amadan.net/oficina/equipo/internal/idtest TestBrowserSmartDoor
receipt: slow test 2.09s 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.698s 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.207s amadan.net/oficina/equipo/internal/plan3test
receipt: slow test 2.21s amadan.net/oficina/equipo/internal/plan3test TestTeamsHierarchyBrowser
browser lane browser-rest: ./internal/thintest
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -tags browser,testbuild -timeout 15m -run '^(TestBrowserAccessEmojiByline|TestBrowserAccessFinalOutcomes|TestBrowserAccessRequest|TestBrowserAccessReview|TestBrowserActivitySubjects|TestBrowserAutonomySettings|TestBrowserCoordinatorQueue|TestBrowserEmptyConversation|TestBrowserEndedNoteStaysGone|TestBrowserHousekeeping|TestBrowserInnerGallery|TestBrowserInnerScreens|TestBrowserInstantThinking|TestBrowserInstantThinkingQueued|TestBrowserMachines|TestBrowserPausedWork|TestBrowserPhoneIndex|TestBrowserPlacementQuestionAndPending|TestBrowserProjectPlacement|TestBrowserProjectsList|TestBrowserReportActionFeedback|TestBrowserReportNextSteps|TestBrowserReportThread|TestBrowserRhythm|TestBrowserRollup|TestBrowserRosterAlignment|TestBrowserRosterDecisionStates|TestBrowserRosterQuietDay|TestBrowserRosterReports|TestBrowserRosterSetAside|TestBrowserRosterSubchat|TestBrowserRosterThinking|TestBrowserRosterVisual|TestBrowserSettingsHousekeepingGroups|TestBrowserSettingsMenu|TestBrowserSettingsRail|TestBrowserSettingsSaveBar|TestBrowserSettingsShots|TestBrowserSettingsStayOnPage|TestBrowserSettingsTeams|TestBrowserShipsButtons|TestBrowserSpecialistRows|TestBrowserSpendFollowsAnswers|TestBrowserTaskRows|TestBrowserTeamPanel|TestBrowserThinkingCycles|TestBrowserThinkingLinesClear|TestBrowserThinkingSteady|TestBrowserThinkingWords|TestBrowserTokenRowEmail|TestBrowserTrackPulse|TestBrowserTrackStarCentre|TestBrowserTryAgain)$' ./internal/thintest
rastrillo: budget test: go test failed
--- FAIL amadan.net/oficina/equipo/internal/thintest TestBrowserRollup
=== RUN TestBrowserRollup
--- FAIL: TestBrowserRollup (1.71s)
--- FAIL amadan.net/oficina/equipo/internal/thintest TestBrowserRollup/1280-dark
=== RUN TestBrowserRollup/1280-dark
rollup_browser_test.go:32: the boundary moved: yesterday shown or today rolled up
--- FAIL: TestBrowserRollup/1280-dark (0.28s)
--- FAIL amadan.net/oficina/equipo/internal/thintest TestBrowserRollup/390-light
=== RUN TestBrowserRollup/390-light
rollup_browser_test.go:32: the boundary moved: yesterday shown or today rolled up
--- FAIL: TestBrowserRollup/390-light (0.29s)
--- FAIL amadan.net/oficina/equipo/internal/thintest TestBrowserRollup/390-dark
=== RUN TestBrowserRollup/390-dark
rollup_browser_test.go:32: the boundary moved: yesterday shown or today rolled up
--- FAIL: TestBrowserRollup/390-dark (0.29s)
--- FAIL amadan.net/oficina/equipo/internal/thintest (package output)
FAIL
rastrillo-budget/v1 ran 3m37.662s
FAIL amadan.net/oficina/equipo/internal/thintest 217.865s
receipt: test step 3m39.214s 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 3m37.662s amadan.net/oficina/equipo/internal/thintest
receipt: slow test 23.02s amadan.net/oficina/equipo/internal/thintest TestBrowserAccessRequest
receipt: slow test 14.4s amadan.net/oficina/equipo/internal/thintest TestBrowserSettingsTeams
receipt: slow test 12.01s amadan.net/oficina/equipo/internal/thintest TestBrowserThinkingCycles
receipt: slow test 10.76s amadan.net/oficina/equipo/internal/thintest TestBrowserPlacementQuestionAndPending
receipt: slow test 9.14s amadan.net/oficina/equipo/internal/thintest TestBrowserRhythm
exit status 1
+ go 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)$' -v -run '^TestBrowserRollup$/^1280\-dark$|^TestBrowserRollup$/^390\-dark$|^TestBrowserRollup$/^390\-light$' -count=1 ./internal/thintest (retry, once)
FAILED TWICE ./internal/thintest:TestBrowserRollup/1280-dark browser-rest
FAILED TWICE ./internal/thintest:TestBrowserRollup/390-dark browser-rest
FAILED TWICE ./internal/thintest:TestBrowserRollup/390-light browser-rest
=== RUN TestBrowserRollup
=== RUN TestBrowserRollup/1280-dark
=== RUN TestBrowserRollup/390-light
rollup_browser_test.go:32: the boundary moved: yesterday shown or today rolled up
=== RUN TestBrowserRollup/390-dark
rollup_browser_test.go:32: the boundary moved: yesterday shown or today rolled up
--- FAIL: TestBrowserRollup (2.49s)
--- PASS: TestBrowserRollup/1280-dark (0.51s)
--- FAIL: TestBrowserRollup/390-light (0.29s)
--- FAIL: TestBrowserRollup/390-dark (0.28s)
FAIL
rastrillo-budget/v1 ran 2.489s
FAIL amadan.net/oficina/equipo/internal/thintest 2.647s
FAIL
machine: 32 CPUs, load 8.05, cpu waiting 3.81%, memory waiting 0.00%, io waiting 0.03%
make: *** [Makefile:113: ci-shard] Error 1
amadan: step check shard 22 of 29 failed: exit status 2
--- shard 23 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
shard 23: make test-quarantine
python3 scripts/ci-test.py quarantine
quarantine: 12 tests from scripts/ci-quarantine.txt; a failure is retried once, and a pass on the retry is reported as a flake
+ go test -tags testbuild -timeout 15m -v -run '^TestHeadlessConnections$/^A5_cancel_and_sign_out$|^TestHeadlessConnections$/^C4_claude_sign_in$|^TestHeadlessConnections$/^C5_engineering_failover$|^TestHeadlessConnections$/^C5_engineering_to_codex$|^TestHeadlessConnections$/^C5_engineering_waits$' ./internal/headless (52s)
ok ./internal/headless TestHeadlessConnections/A5_cancel_and_sign_out 4.68s
ok ./internal/headless TestHeadlessConnections/C4_claude_sign_in 1.22s
ok ./internal/headless TestHeadlessConnections/C5_engineering_failover 8.14s
ok ./internal/headless TestHeadlessConnections/C5_engineering_to_codex 8.20s
ok ./internal/headless TestHeadlessConnections/C5_engineering_waits 26.76s
+ 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 (63s)
ok ./internal/headless TestHeadlessConnections/C5_review_auth 14.85s
ok ./internal/headless TestHeadlessConnections/C5_review_failover 11.01s
ok ./internal/headless TestHeadlessConnections/C5_review_on_codex 19.14s
ok ./internal/headless TestHeadlessConnections/C5_review_other_family_first 15.99s
+ go test -tags testbuild -timeout 15m -v -run '^TestMixedVersions$' ./internal/headless (20s)
ok ./internal/headless TestMixedVersions 18.04s
+ go test -tags testbuild -timeout 15m -v -run '^TestCheckSandboxDeniedPathsTampering$' ./internal/runner/checks (2s)
ok ./internal/runner/checks TestCheckSandboxDeniedPathsTampering 0.79s
+ go test -tags testbuild -timeout 15m -v -run '^TestRunnerCancelAndSupersede$' ./internal/runner/thin (2s)
ok ./internal/runner/thin TestRunnerCancelAndSupersede 0.05s
quarantine: 0 flaked (passed on the retry), 0 failed
machine: 32 CPUs, load 68.23, cpu waiting 40.21%, memory waiting 0.00%, io waiting 0.76%
--- 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.825s against a 60s target (the gate's other steps are not in this figure)
receipt: 4 packages ran, 0 cached, 4 without tests, 0 failed
receipt: slow package 8.268s amadan.net/oficina/equipo/internal/runner/checks
receipt: slow package 256ms amadan.net/oficina/equipo/internal/runner/provider/claude
receipt: slow package 158ms amadan.net/oficina/equipo/internal/runner/provider/codex
receipt: slow package 1ms amadan.net/oficina/equipo/internal/runner/provider
receipt: slow package 0s amadan.net/oficina/equipo/internal/runner/provider/claude/realcli
receipt: slow test 5.92s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsGoFixture
receipt: slow test 1.82s amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPaths
receipt: slow test 410ms amadan.net/oficina/equipo/internal/runner/checks TestCheckSandboxDeniedPathsCache
receipt: slow test 260ms amadan.net/oficina/equipo/internal/runner/provider/claude TestDirectJournalAdapterBarrier
receipt: slow test 90ms amadan.net/oficina/equipo/internal/runner/provider/codex TestDirectJournalAdapterBarrier
CGO_ENABLED=0 RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py retried runner-host -run '^TestNamespace' -count=1 ./internal/runner/containment
+ go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -no-time -run '^TestNamespace' -count=1 ./internal/runner/containment
receipt: test step 3.612s 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.153s amadan.net/oficina/equipo/internal/runner/containment
receipt: slow test 340ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReadOnlyScratch
receipt: slow test 190ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryUnavailableProof
receipt: slow test 150ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceRecoveryReusedPID
receipt: slow test 140ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceDirectPolicyAdmission
receipt: slow test 110ms amadan.net/oficina/equipo/internal/runner/containment TestNamespaceReapsOrphans
machine: 32 CPUs, load 19.14, cpu waiting 10.69%, memory waiting 0.00%, io waiting 1.64%
--- 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.2%, load 25.00
shard 25: make runner-dead-references lanes-check build vet fmt-check spacing budget migration-check
python3 scripts/runner-dead-references.py
reference scan: 2699 text files, 3210 matches, 0 failures
python3 scripts/ci-test.py check
lanes: 18 lanes and 5 browser lanes run every test once; 20-check@29
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o /dev/null ./cmd/equipo-runner
go vet ./...
go vet -tags testbuild ./internal/runner/thin ./internal/headless
GOOS=darwin GOARCH=arm64 go vet ./cmd/equipo-runner/... ./internal/runner/... ./internal/wire/... ./internal/release/...
go tool fiesta spacing -skip tokens.css internal/equipo/static
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size
budget size: 92 directories within budget
CGO_ENABLED=0 go test ./internal/equipo -run '^TestMigrationModels$' -count=1
ok amadan.net/oficina/equipo/internal/equipo 2.548s
machine: 32 CPUs, load 65.67, cpu waiting 41.23%, memory waiting 0.00%, io waiting 0.62%
--- 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.2%, load 25.00
shard 26: make staticcheck
go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 -tags browser,perf,testbuild ./...
machine: 32 CPUs, load 62.24, cpu waiting 36.72%, memory waiting 0.00%, io waiting 0.87%
--- shard 27 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: govulncheck started 30s late; cpu waiting 40.2%, load 25.00
shard 27: make govulncheck
go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./...
=== Symbol Results ===
No vulnerabilities found.
Your code is affected by 0 vulnerabilities.
This scan also found 0 vulnerabilities in packages you import and 3
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
machine: 32 CPUs, load 33.65, cpu waiting 22.89%, memory waiting 0.00%, io waiting 1.17%
--- shard 28 of 29 ---
RASTRILLO='go run amadan.net/rastrillo/rastrillo/cmd/rastrillo' python3 scripts/ci-test.py shard
stagger: gitleaks started 30s late; cpu waiting 40.2%, load 25.00
shard 28: make gitleaks
[90m3:10PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net
[90m3:10PM[0m [32mINF[0m [1m1149 commits scanned.[0m
[90m3:10PM[0m [32mINF[0m [1mscanned ~65763150 bytes (65.76 MB) in 25.3s[0m
[90m3:10PM[0m [32mINF[0m [1mno leaks found[0m
machine: 32 CPUs, load 62.24, cpu waiting 36.72%, memory waiting 0.00%, io waiting 0.87%
amadan: job failed at step check shards 17, 22 of 29 — its output is above, not at the tail of this log
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index f8835f5f..d39bbd6a 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 22528 - Paused work: the report card and task page lead, stop and Run now, in the person's zone (2026-11-24); measured 22528 source lines. |
| -size internal/wire 6905 - StepPaused, RunNowOffer, the paused job state, CarryOn and TimeZone for paused work (2026-11-24); measured 6905 source lines. |
| +size internal/equipo 22548 - Paused work: the report card and task page lead, stop and Run now, in the person's zone (2026-11-24, review fixes); measured 22548 source lines. |
| +size internal/wire 6936 - StepPaused, RunNowOffer, the paused job state, CarryOn, TimeZone and protocol 29's pinned release (2026-11-24); measured 6936 source lines. |
| size internal/equipotest - 12017 Task 21 repairs historical migration and conversation fixtures after Plan 3, and the Rastrillo upgrade contract comparing served assets with what Assets serves; measured 0/12017 source/test lines. |
| time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded); |
| time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s). |
| @@ -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 28446 22619 Forge review fixes, real fileForge router coverage, authority and proposal regressions; measured 28446 source and 22619 test lines. |
| +size internal/runner/thin 28478 22691 Forge review fixes, real fileForge router coverage, authority and proposal regressions, and protocol 29's pinned release with its tests (paused work, 2026-11-24); measured 28478 source and 22691 test lines. |
| 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 34310 9102 Paused work: the person's zone, the Run now prediction and the paused job card with Carry on now and only_if_unset (2026-11-24); measured 34310/9102. |
| +size internal/equipo/chat 34457 9380 Paused work: the person's zone, the Run now prediction with the runner's inputs and the pinned release, the paused job card with Carry on now and only_if_unset, and the per-card sweep (2026-11-24, review B1/S1/S2); measured 34457/9380. |
| 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 - 34612 Paused work: the Assistant's paused job contract and the paused report card in the browser (2026-11-24); measured 34612 test lines. |
| +size internal/thintest - 34631 Paused work: the Assistant's paused job contract, the paused report card in the browser, and the housekeeping and day-box tests on Madrid's clock (2026-11-24); measured 34631 test lines. |
| 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 4bce5309..7f4d3134 100644 |
| --- a/docs/api/equipo-v1.openapi.json |
| +++ b/docs/api/equipo-v1.openapi.json |
| @@ -14304,7 +14304,8 @@ |
| "attachment_limit", |
| "turn_ended", |
| "question_ended", |
| - "host_not_allowed" |
| + "host_not_allowed", |
| + "already_running" |
| ] |
| }, |
| "copy_key": { |
| @@ -14354,7 +14355,8 @@ |
| "roster.revision_conflict", |
| "budgets.invalid_input", |
| "budgets.forbidden", |
| - "budgets.revision_conflict" |
| + "budgets.revision_conflict", |
| + "api.already_running" |
| ] |
| }, |
| "request_id": { |
| @@ -24016,14 +24018,11 @@ |
| "left_percent": { |
| "type": "integer", |
| "format": "int64" |
| + }, |
| + "plain": { |
| + "type": "boolean" |
| } |
| }, |
| - "required": [ |
| - "connection", |
| - "provider", |
| - "name", |
| - "billing" |
| - ], |
| "additionalProperties": false, |
| "x-go-type": "wire.RunNowOffer" |
| }, |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index 7e0fdaa9..4d707e58 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -6865,7 +6865,7 @@ records remain unchanged. |
| | `work.pause.next.by_itself` | It carries on by itself then. | Paused work: report card, task page and Base job card (spec 2026-11-24) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) | |
| | `work.pause.next.budget` | It carries on by itself when the budget resets. | Paused work: report card, task page and Base job card (spec 2026-11-24) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) | |
| | `work.pause.next.busy` | It starts by itself as soon as that step finishes. | Paused work: report card, task page and Base job card (spec 2026-11-24) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) | |
| -| `work.pause.next.online` | It carries on by itself when the Mac is back online. | Paused work: report card, task page and Base job card (spec 2026-11-24) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) | |
| +| `work.pause.next.online` | It carries on by itself when %s is back online. | Paused work: report card, task page and Base job card (spec 2026-11-24) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) | |
| | `work.pause.next.choose` | Nothing happens until you choose. | Paused work: report card, task page and Base job card (spec 2026-11-24) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) | |
| | `work.pause.next.try_again` | Nothing more happens until you try again. | Paused work: report card, task page and Base job card (spec 2026-11-24) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) | |
| | `work.pause.next.update` | It carries on by itself once the runner is updated. | Paused work: report card, task page and Base job card (spec 2026-11-24) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) | |
| @@ -6901,6 +6901,7 @@ records remain unchanged. |
| | `api.not_paused` | This work is not paused now. Check its latest status. | Paused work: report card, task page and Base job card (spec 2026-11-24) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) | |
| | `docs/api/equipo-v1.md / Talk to the Assistant: paused jobs` | Each job has one `job` card, updated in place as the work goes on, so the same card `id` comes again in `card` events with a higher `revision`. Its `question` is the job’s title, `result` its short status, `detail` adds one sentence, and `started_at` gives the start time. Its state is `working`, `asking`, `ready`, `done`, `stopped` or `paused`. A paused job waits and will carry on by itself, for example when a plan’s limit resets. Its `result` says when that will be, in your time zone, such as “Paused until 21:00”, or says “Paused” if the time is unknown. Its `detail` explains why it paused and when it will carry on. A paused card has `carry_on: true` when “Carry on now” is available because another of your plans has room at no extra cost; otherwise `carry_on` is left out. To carry on, call `POST /api/v1/assistant/cards/{id}/carry_on` with the card’s revision and a key of your choosing, 1 to 128 bytes:<br><br>```json<br>{"revision":7,"idempotency_key":"<a new key for each tap>"}<br>```<br><br>The answer is `200` with the card as it is now in `card`; the same key again gives the same answer. A stale revision is `409 card_stale`, a card that is not paused is `409 not_paused`, and a paused card without `carry_on` is `409 carry_on_unavailable`. Each `409` body carries the card as it is now in `card`.<br><br>A job card takes no answer: answering one is `404 not_found`. Its links may include something to try, the published site, and the job's page in Equipo. A go-ahead or Publish card for a job carries `job`, the job card's `id`. `job`, `detail` and `started_at` are left out when they do not apply.<br><br>`paused` is sent only to a client that asks for it: add `job_states=paused` to `GET /api/v1/assistant/snapshot` and `GET /api/v1/assistant/events`. Without it a paused job card comes as `working`, with the same `result` and `detail` and no `carry_on`.<br><br>Times in `result` and `detail` use your time zone. Equipo uses `Europe/Dublin` unless you set a different one. Set it with `PUT /api/v1/assistant/time-zone` and an IANA time-zone name:<br><br>```json<br>{"time_zone":"Europe/Madrid"}<br>```<br><br>The response is `200` with `time_zone`. If Equipo does not recognise the time zone, the response is `422 invalid_input`. A device can set its time zone with `PUT /api/v1/time-zone`. | Paused job cards, carry_on and the time zone for Base (spec 2026-11-24; Luna, with the controller's Equipo correction) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) | |
| | `docs/api/equipo-v1.md / Talk to the Assistant: only_if_unset` | To set the person's time zone only if they haven't set one, add `"only_if_unset": true`. The response's `time_zone` is the one in effect. | Base's team zone never overrides the person's own (controller ruling, 2026-11-24) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) | |
| +| `api.already_running` | A request to run this work is already in progress. | A second Run now for the same hold (paused work review S2) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) | |
| ## Task 21 |
| @@ -8100,3 +8101,15 @@ Guards observed failing by breaking what they protect, then restored: |
| - native TaskReport.track ignoring the pause -> FAIL PausedTests.paulsCaseIsPausedNotGreen; restored -> 5 passed. |
| Local gates on macOS (GOTOOLCHAIN=go1.26.11, CGO_ENABLED=0): vet and staticcheck analysed as linux, clean; govulncheck (linux) no reachable vulnerabilities; gitleaks no leaks; spacing, budget, lanes-check, migration-check pass; fmt-check clean with the pinned gofmt (the system go1.27 gofmt realigns copy.go and flags headline_test.go on main too). copy-release-check passes (every new string and the API prose accepted by Luna's delegated review). Packages: equipo, equipo/chat, equipo/pause, wire, schedule, thintest and the paused browser test (Chrome for Testing 1255, light and dark, desktop and phone) pass. Native: `native/scripts/check-native.sh` passes (204 tests, EquipoMac, iPhone Simulator). Failing locally and on origin/main alike (each checked in a worktree at origin/main), so the macOS environment and not this branch: equipo/team TestPublishCoreAuthorizationContract; headless (linux-only tool proxy); equipotest runner startup, provider_uncertain and release packaging; plan3test TestCoordinatorAcceptance3B. Hub CI is the Linux gate. |
| + |
| +### Paused work: Fable's review at 4df616bc (CHANGES REQUESTED), fixed |
| + |
| +B1: Run now's release is pinned to the predicted connection (protocol 29, `ReleaseCommand.connection`, a dispatch's `release_connection`); the runner decides without the leave first, then admits the leave on the pinned connection alone (`schedule.DecidePinned`), else keeps its hold. The instance predicts with the runner's inputs (Review's Engineer, Research's first pass, a fix round's kept session). Runners below 29 get plain "Run it now anyway" and no `carry_on`; Encode refuses a pinned release frame below 29 and drops a pinned dispatch's release. S1: the sweep projects each job card in its own transaction, logging and skipping a failing one. S2: no Run now once one is written for the hold; a second tap is 409 `already_running` (Luna's text). S3: `work.pause.next.online` names the runner (Luna). S4: Luna's review 3 keeps the five strings. S5: the quiet-hours, digest and day-box tests run on Madrid's clock and hold on any date; new tests put the sweep and digest on Dublin's clock across both DST Sundays and a zone change. Guards observed failing, then restored: |
| + |
| +- runner decide ignoring the pin (schedule.Decide) -> FAIL TestSchedulePinnedReleaseRunsOnlyThere/NeverFallsBack (ran on TensorX); restored -> ok. |
| +- refreshJobs stopping at the first failing card -> FAIL TestRefreshJobsSkipsAFailingCard "the card after a failing one was not refreshed"; restored -> ok. |
| +- AtHour as midnight plus hours (the old digest/sweep formula) -> FAIL TestSweepAtThreeLocalAcrossDSTAndAZoneChange (spring forward 02:00Z) and TestHousekeepingClockInDublin (sweep/digest on the DST days); restored -> ok. |
| +- predictRunNow offering again after a release (S2 check removed) -> FAIL TestRunNowOnceAndPinned "offered again after the release"; restored -> ok. |
| +- instance prediction without Review's Engineer -> FAIL TestRunNowPredictsReviewsFamilyRule (predicted Claude, the runner takes TensorX); restored -> ok. |
| + |
| +Nits fixed: N1 (AtHour), N5, N6 (comments; the needs-person gap is in the spec), N9, N10 (native too-old, eyebrow, literal keys), N11, N12. Left, with reasons: N2 (Luna's text, no full stop on the stopped lead), N3 (the designer's call on Wait), N4 (already recorded in the inventory row's context), N7 (a live relative clock on an open page is new behaviour; the page redraws on events), N8 (no reviewed sentence for a pause with no time), N10's silent native refusal (the button goes once Run now is written), N13 (Base's four labels are Luna-reviewed and Base's to draw; `Store.Zone` callers have no context and read outside transactions; the budget day is the runner's UTC accounting; the first page before zone.js posts). |
diff --git a/docs/superpowers/specs/2026-11-24-paused-work-design.md b/docs/superpowers/specs/2026-11-24-paused-work-design.md| index 0d401a9d..9b02959f 100644 |
| --- a/docs/superpowers/specs/2026-11-24-paused-work-design.md |
| +++ b/docs/superpowers/specs/2026-11-24-paused-work-design.md |
| @@ -54,9 +54,26 @@ said that Codex had room, and Run it now anyway lived only on the task page. |
| - a metered connection: "Run it now with TensorX", "TensorX bills per use"; |
| - a hold even with leave, or a prediction it cannot make: no Run now. |
| - The prediction rides on the task's read shape (`steps[].run_now`), so the |
| - web, native and Base use one answer. The same action is on the |
| + The prediction rides on the task's read shape (`steps[].paused.run_now`), |
| + so the web, native and Base use one answer. The same action is on the |
| conversation's report card, not only the task page. |
| + |
| + **The promise is kept (review B1, controller ruling).** The prediction |
| + uses the runner's own inputs: Review's Engineer (the family rule), |
| + Research's first pass on the coordinator's family, and a fix round's |
| + kept session. Run now's release is pinned to the predicted connection |
| + (protocol 29: `ReleaseCommand.connection`, a dispatch's |
| + `release_connection`). The runner decides without the leave first; if |
| + that holds, it admits the leave on the pinned connection alone |
| + (`schedule.DecidePinned`), never another family or a metered connection; |
| + if that cannot run either, the step keeps the hold it had (a stale |
| + reading included) and the release waits. Once Run now is written for a |
| + hold it is not offered again, and a second tap answers 409 |
| + `already_running` ("A request to run this work is already in progress."). |
| + A runner below protocol 29 cannot be held to a connection: Encode |
| + refuses a pinned release frame and drops a pinned dispatch's release, |
| + and the instance offers it plain "Run it now anyway" (`run_now.plain`), |
| + naming nothing, with no `carry_on`. |
| 3. **Indigo** from Equipo's palette (`--equipo-tone-paused-*`), AA contrast in |
| light and dark (checked in a test). |
| 4. **Time zone per person**, default `Europe/Dublin` (Paul, 2026-11-13). |
| @@ -113,6 +130,17 @@ report already reaches it (saveTask, taskChanged). The housekeeping minute |
| zone change follow without a report, and the card moves only when its words |
| change. |
| +## Known gaps |
| + |
| +- A hold that needs the person (spend unknown, nothing that can run it, |
| + the deadline check) reads as working on Base's job card: its held card is |
| + not a question card, so the job is not asking. Base's contract does not |
| + ask for more today. |
| +- A paused job with no known resume time has `result` "Paused" and no |
| + `detail`: there is no reviewed sentence for it. |
| +- On an open web page the relative part ("in 9 hours") moves only when the |
| + page redraws on an event; Base's card is reprojected every minute. |
| + |
| ## Not in this change |
| The runner's own scheduling, Copy's hold card, placement lines, a person- |
diff --git a/internal/equipo/chat/days.go b/internal/equipo/chat/days.go| index 3a05803a..687a473b 100644 |
| --- a/internal/equipo/chat/days.go |
| +++ b/internal/equipo/chat/days.go |
| @@ -20,8 +20,9 @@ import ( |
| // Now is the store's clock (tests move it). |
| func (s *Store) Now() time.Time { return s.now() } |
| -// Zone is the person's time zone, the one their days end in: the |
| -// housekeeping loop's, UTC until a person's zone is known. |
| +// Zone is the person's time zone, the one their days end in and the |
| +// housekeeping loop's (zone.go): what their browser, device or Base last |
| +// said, Europe/Dublin until one has. |
| func (s *Store) Zone(person string) *time.Location { return (&txn{s: s}).zone(person) } |
| // DayStart is the start of at's day in loc, in UTC. |
diff --git a/internal/equipo/chat/housekeeping_control.go b/internal/equipo/chat/housekeeping_control.go| index 7854f88f..442be0af 100644 |
| --- a/internal/equipo/chat/housekeeping_control.go |
| +++ b/internal/equipo/chat/housekeeping_control.go |
| @@ -473,9 +473,7 @@ func (s *Store) HousekeepingTick(ctx context.Context) error { |
| } |
| // A paused job's words follow the clock, the zone and a runner that |
| // went offline. |
| - if err := s.tx(ctx, func(t *txn) error { return t.refreshJobs() }); err != nil { |
| - return err |
| - } |
| + s.refreshJobs(ctx) |
| // A legacy hand-off's mirrored question nobody will answer now. |
| if err := s.tx(ctx, func(t *txn) error { return t.settleStaleLegacyQuestions() }); err != nil { |
| return err |
| @@ -547,7 +545,7 @@ func (s *Store) sweepDue(ctx context.Context) (due bool, err error) { |
| continue |
| } |
| loc := t.zone(p) |
| - at := housekeeping.DayStart(now, loc).Add(housekeeping.SweepHour * time.Hour) |
| + at := housekeeping.AtHour(now, loc, housekeeping.SweepHour) |
| if !now.Before(at) && (set.LastSweepAt == nil || set.LastSweepAt.Before(at)) { |
| set.LastSweepAt = &now |
| if err := t.saveSettings(&set); err != nil { |
| @@ -577,7 +575,7 @@ func (t *txn) digest(person string) error { |
| } |
| now := t.hkNow() |
| loc := t.zone(person) |
| - from := housekeeping.DayStart(now, loc).Add(time.Duration(set.quiet().Morning()) * time.Hour) |
| + from := housekeeping.AtHour(now, loc, set.quiet().Morning()) |
| if now.Before(from) || set.LastDigestAt != nil && !set.LastDigestAt.Before(from) { |
| return nil |
| } |
diff --git a/internal/equipo/chat/http.go b/internal/equipo/chat/http.go| index 6d1c2e3d..8beb3ae1 100644 |
| --- a/internal/equipo/chat/http.go |
| +++ b/internal/equipo/chat/http.go |
| @@ -418,6 +418,8 @@ func (h *HTTP) fail(w http.ResponseWriter, r *http.Request, err error) { |
| personapi.WriteError(w, r, 422, "confirmation_required", nil) |
| case errors.Is(err, ErrHoldBar): |
| personapi.WriteError(w, r, http.StatusConflict, "hold_bar", nil) |
| + case errors.Is(err, ErrAlreadyReleased): |
| + personapi.WriteError(w, r, http.StatusConflict, "already_running", nil) |
| case errors.Is(err, ErrRunnerTooOld): |
| personapi.WriteError(w, r, 409, "runner_too_old", nil) |
| case errors.Is(err, ErrNoRunner): |
diff --git a/internal/equipo/chat/job_paused.go b/internal/equipo/chat/job_paused.go| index 02d978f7..6a8bb873 100644 |
| --- a/internal/equipo/chat/job_paused.go |
| +++ b/internal/equipo/chat/job_paused.go |
| @@ -15,8 +15,11 @@ import ( |
| // task it follows that is still open waits and carries on by itself: its |
| // step held for a plan's limit (headroom) or a spending limit (budget) |
| // with nothing asked of the person, or waiting for its runner while that |
| -// runner is offline. A brief wait for a busy slot is still working, and a |
| -// hold that needs the person is the person's to answer (asking). |
| +// runner is offline. A brief wait for a busy slot is still working. A |
| +// hold that needs the person (spend unknown, nothing that can run it, the |
| +// deadline check) is not paused either, and not asking: its held card is |
| +// in the person's conversation, not a question card, so the job reads as |
| +// working until the person answers (a known gap, in the spec). |
| // Why a job is paused: the words Base shows. |
| const ( |
| @@ -142,25 +145,40 @@ func (t *txn) pausedWords(person string, p *jobPause) (result, detail string) { |
| // refreshJobs brings each working or paused job card up to date (the |
| // housekeeping minute): a runner that went offline, a pause's relative |
| // words and the person's zone change without a report. A card moves |
| -// only when its words do. |
| -func (t *txn) refreshJobs() error { |
| +// only when its words do. Each card is its own transaction, and one that |
| +// cannot be projected is logged and skipped (review S1): it never stops |
| +// the rest of the minute, or the cards after it. |
| +func (s *Store) refreshJobs(ctx context.Context) { |
| var cards []cardRecord |
| - if err := t.db.Where("lane = ? AND kind = ? AND state IN ?", wire.LaneAssistant, wire.CardJob, []string{wire.JobWorking, wire.JobPaused}).Order("created_at, id").Find(&cards).Error; err != nil { |
| - return err |
| + err := s.read(ctx, func(tx *gorm.DB) error { |
| + return tx.Select("id", "handoff_id", "person").Where("lane = ? AND kind = ? AND state IN ?", wire.LaneAssistant, wire.CardJob, []string{wire.JobWorking, wire.JobPaused}).Order("created_at, id").Find(&cards).Error |
| + }) |
| + if err != nil { |
| + s.logJobRefresh("", err) |
| + return |
| } |
| for _, c := range cards { |
| - var h handoffRecord |
| - if err := t.db.Where("id = ? AND person = ?", c.HandoffID, c.Person).Limit(1).Find(&h).Error; err != nil { |
| - return err |
| - } |
| - if h.ID == "" { |
| - continue |
| - } |
| - if err := t.projectJob(h); err != nil { |
| - return err |
| + err := s.tx(ctx, func(t *txn) error { |
| + var h handoffRecord |
| + if err := t.db.Where("id = ? AND person = ?", c.HandoffID, c.Person).Limit(1).Find(&h).Error; err != nil || h.ID == "" { |
| + return err |
| + } |
| + return projectJobFor(t, h) |
| + }) |
| + if err != nil { |
| + s.logJobRefresh(c.ID, err) |
| } |
| } |
| - return nil |
| +} |
| + |
| +// projectJobFor is projectJob, a seam for the sweep's test. |
| +var projectJobFor = func(t *txn, h handoffRecord) error { return t.projectJob(h) } |
| + |
| +// logJobRefresh reports a job card the sweep could not bring up to date. |
| +func (s *Store) logJobRefresh(card string, err error) { |
| + if l := s.logger.Load(); l != nil { |
| + l.Warn("job card refresh", "card", card, "err", err) |
| + } |
| } |
| // ErrNotPaused: Carry on now for a job card that is not paused. |
diff --git a/internal/equipo/chat/paused.go b/internal/equipo/chat/paused.go| index f5ca92ff..b83db3d9 100644 |
| --- a/internal/equipo/chat/paused.go |
| +++ b/internal/equipo/chat/paused.go |
| @@ -121,25 +121,68 @@ func roleOf(specialist string) string { |
| return "" |
| } |
| -// runNowOffer is what Run now would do for the held step (decision 2): |
| -// Decide with a release over the creator's connections on its runner, as |
| -// last read. Nil when Run now cannot pass the hold (a spending bar, |
| -// housekeeping's own attempt, a runner below the scheduler), when the |
| -// step's role is not scheduled, or when Decide would hold it anyway. |
| +// runNowOffer is what Run now would do for the held step (decision 2). |
| +// Nil when Run now cannot pass the hold (a spending bar, housekeeping's |
| +// own attempt, a runner below the scheduler), when the step's role is not |
| +// scheduled, when a Run now for this hold was already written (S2: it is |
| +// on its way, or the runner could not honour it), or when Decide would |
| +// hold it anyway. A runner below protocol 29 cannot be held to a |
| +// connection, so it is offered plain Run now, naming nothing (Plain). |
| func (t *txn) runNowOffer(k taskRecord, s stepRecord, h *wire.StepHold, mine []connectionRecord) *wire.RunNowOffer { |
| + o, _ := t.predictRunNow(k, s, h, mine) |
| + return o |
| +} |
| + |
| +// predictRunNow is runNowOffer and the runner's local id of the |
| +// connection it names, which pins the release (protocol 29). |
| +func (t *txn) predictRunNow(k taskRecord, s stepRecord, h *wire.StepHold, mine []connectionRecord) (*wire.RunNowOffer, string) { |
| role := roleOf(s.Specialist) |
| if role == "" || h.Reason == wire.HoldBudget || h.Reason == wire.HoldSpendUnknown || housekeepingAttempt(s) { |
| - return nil |
| + return nil, "" |
| } |
| - if proto, err := t.runnerProtocol(s.Person, s.RunnerID); err != nil || proto < wire.ProtocolScheduler { |
| - return nil |
| + var prior releaseRecord |
| + if err := t.db.Where("step_id = ? AND step_revision = ?", s.ID, h.StepRevision).Limit(1).Find(&prior).Error; err != nil || prior.ID != "" { |
| + return nil, "" |
| + } |
| + proto, err := t.runnerProtocol(s.Person, s.RunnerID) |
| + switch { |
| + case err != nil || proto < wire.ProtocolScheduler: |
| + return nil, "" |
| + case proto < wire.ProtocolPinnedRelease: |
| + return &wire.RunNowOffer{Plain: true}, "" |
| + } |
| + in, by, err := t.scheduleInput(k, s, role, mine) |
| + if err != nil { |
| + return nil, "" |
| + } |
| + d := decideRelease(in, role, t.coordinatorFamily(s.Person, mine)) |
| + r, ok := by[d.Connection] |
| + if !d.Run || !ok { |
| + return nil, "" |
| } |
| + o := &wire.RunNowOffer{Connection: r.ID, Provider: r.Provider, Name: ProviderName(r.Provider), Billing: wire.BillingSubscription, Same: r.LocalID == h.Connection} |
| + if r.Kind == wire.KindAPIKey { |
| + o.Billing = wire.BillingMetered |
| + } |
| + if o.Same && o.Billing == wire.BillingSubscription { |
| + if used, ok := usedPercent(r); ok { |
| + o.LeftPercent = max(0, 100-used) |
| + } |
| + } |
| + return o, r.LocalID |
| +} |
| + |
| +// scheduleInput is the step's Decide input with Run now's leave, built |
| +// from what the instance holds the way the runner builds its own |
| +// (thin/schedule.go stepInput): the connections on the step's runner, |
| +// the preference, and the step's own facts: Review's Engineer (the family |
| +// rule), and an Engineering fix round's kept session. |
| +func (t *txn) scheduleInput(k taskRecord, s stepRecord, role string, mine []connectionRecord) (schedule.Input, map[string]connectionRecord, error) { |
| pref, err := t.preferenceOf(s.Person) |
| if err != nil { |
| - return nil |
| + return schedule.Input{}, nil, err |
| } |
| - now := t.now() |
| - in := schedule.Input{Version: schedule.Version, Now: now, Preference: schedule.Preference{Provider: pref.Provider, Until: pref.Until}, |
| + in := schedule.Input{Version: schedule.Version, Now: t.now(), Preference: schedule.Preference{Provider: pref.Provider, Until: pref.Until}, |
| Step: schedule.Step{Role: role, Priority: k.Priority, By: k.DueBy, DeadlineNotified: true, Release: "run_now"}} |
| by := map[string]connectionRecord{} |
| for _, r := range mine { |
| @@ -150,21 +193,74 @@ func (t *txn) runNowOffer(k taskRecord, s stepRecord, h *wire.StepHold, mine []c |
| in.Conns = append(in.Conns, c) |
| by[c.ID] = r |
| } |
| - d := schedule.Decide(in) |
| - r, ok := by[d.Connection] |
| - if !d.Run || !ok { |
| - return nil |
| + steps, err := t.steps(k.ID) |
| + if err != nil { |
| + return schedule.Input{}, nil, err |
| } |
| - o := &wire.RunNowOffer{Connection: r.ID, Provider: r.Provider, Name: ProviderName(r.Provider), Billing: wire.BillingSubscription, Same: r.LocalID == h.Connection} |
| - if r.Kind == wire.KindAPIKey { |
| - o.Billing = wire.BillingMetered |
| + switch s.Specialist { |
| + case wire.SpecialistReview: |
| + // Engineering's connection, as the dispatch names it (AvoidAccount |
| + // is the review step's Account), and the families pushed before. |
| + if s.Account != "" { |
| + e := &schedule.Engineer{ID: s.Account} |
| + for _, c := range in.Conns { |
| + if c.ID == s.Account { |
| + e.Family, e.Account = c.Family, c.Account |
| + } |
| + } |
| + for _, st := range steps { |
| + if st.Specialist == wire.SpecialistEngineering && st.Account == s.Account && st.Family != "" { |
| + e.Family = st.Family |
| + } |
| + } |
| + in.Step.Engineer = e |
| + } |
| + case wire.SpecialistEngineering: |
| + // A fix round resumes the session the round before ran on. |
| + if s.Round > 0 { |
| + for _, st := range steps { |
| + if st.Specialist == wire.SpecialistEngineering && st.Idx < s.Idx && st.Account != "" { |
| + in.Step.Kept, in.Step.KeptModel = st.Account, st.Model |
| + } |
| + } |
| + } |
| } |
| - if o.Same && o.Billing == wire.BillingSubscription { |
| - if used, ok := usedPercent(r); ok { |
| - o.LeftPercent = max(0, 100-used) |
| + return in, by, nil |
| +} |
| + |
| +// decideRelease is what a release would do (the runner's own order): |
| +// Research first with every connection of another family than the |
| +// coordinator's avoided, then with none; anything else, Decide. |
| +func decideRelease(in schedule.Input, role, family string) schedule.Decision { |
| + if role != schedule.RoleResearch || family == "" { |
| + return schedule.Decide(in) |
| + } |
| + first := in |
| + first.Step.Avoid = nil |
| + for _, c := range in.Conns { |
| + if c.Family != family { |
| + first.Step.Avoid = append(first.Step.Avoid, c.ID) |
| } |
| } |
| - return o |
| + if d := schedule.Decide(first); d.Run { |
| + return d |
| + } |
| + return schedule.Decide(in) |
| +} |
| + |
| +// coordinatorFamily is the family of the connection the person's |
| +// coordinator last answered on ("" unknown), Research's first choice. |
| +func (t *txn) coordinatorFamily(person string, mine []connectionRecord) string { |
| + var r turnRecord |
| + if t.db.Where("person = ? AND coalesce(connection, '') <> ''", person).Order("created_at DESC, id DESC").Limit(1).Find(&r).Error != nil { |
| + return "" |
| + } |
| + for _, c := range mine { |
| + if c.LocalID == r.Connection && c.Kind != wire.KindAPIKey { |
| + return c.Provider |
| + } |
| + } |
| + return "" |
| } |
| // scheduleConn is one connection as Decide reads it, from what the |
| @@ -174,7 +270,7 @@ func scheduleConn(r connectionRecord, role string) (schedule.Conn, bool) { |
| if r.State != wire.ConnHealthy && r.State != wire.ConnLimited { |
| return schedule.Conn{}, false |
| } |
| - c := schedule.Conn{ID: r.LocalID, Provider: r.Provider, Account: r.Label, State: r.State, Billing: schedule.Subscription, Capable: connect.Capable(r.Provider, role), Windows: windowsOfRecord(r)} |
| + c := schedule.Conn{ID: r.LocalID, Provider: r.Provider, Family: r.Provider, Account: r.Label, State: r.State, Billing: schedule.Subscription, Capable: connect.Capable(r.Provider, role), Windows: windowsOfRecord(r)} |
| if r.State == wire.ConnLimited { |
| var h wire.Headroom |
| if json.Unmarshal([]byte(r.Headroom), &h) == nil && h.ResetsAt != nil { |
| @@ -185,7 +281,7 @@ func scheduleConn(r connectionRecord, role string) (schedule.Conn, bool) { |
| return c, true |
| } |
| v := connectionView(r) |
| - c.Billing, c.Capable, c.Windows = schedule.Metered, connect.Capable(r.Harness, role), nil |
| + c.Billing, c.Capable, c.Windows, c.Family = schedule.Metered, connect.Capable(r.Harness, role), nil, "" |
| if v.Budget == nil || v.Spend == nil { |
| // A metered connection with no budget or spend read takes |
| // nothing (the runner's guard). |
diff --git a/internal/equipo/chat/paused_test.go b/internal/equipo/chat/paused_test.go| index c5895365..dfd96ff8 100644 |
| --- a/internal/equipo/chat/paused_test.go |
| +++ b/internal/equipo/chat/paused_test.go |
| @@ -2,6 +2,8 @@ package chat |
| import ( |
| "context" |
| + "errors" |
| + "strings" |
| "testing" |
| "time" |
| @@ -12,6 +14,12 @@ import ( |
| // creator's connections as given. Its clock is Paul's: Tuesday 24 |
| // November 2026, noon in Dublin. |
| func pausedRig(t *testing.T, hold wire.StepHold, conns ...connectionRecord) (*meteredRig, time.Time) { |
| + return pausedRigAt(t, wire.ProtocolPinnedRelease, wire.SpecialistEngineering, hold, conns...) |
| +} |
| + |
| +// pausedRigAt is pausedRig with the runner at protocol, holding a step of |
| +// specialist. |
| +func pausedRigAt(t *testing.T, protocol int, specialist string, hold wire.StepHold, conns ...connectionRecord) (*meteredRig, time.Time) { |
| t.Helper() |
| r := newMeteredRig(t) |
| now := time.Date(2026, 11, 24, 12, 0, 0, 0, time.UTC) |
| @@ -34,7 +42,7 @@ func pausedRig(t *testing.T, hold wire.StepHold, conns ...connectionRecord) (*me |
| t.Fatal(err) |
| } |
| held := now.Add(-3 * time.Hour) |
| - if err := g.Create(&stepRecord{ID: "s1", TaskID: "tk1", Idx: 1, Specialist: wire.SpecialistEngineering, Person: "owner@example.com", RunnerID: "RUNNER1", State: wire.StepRunning, Attempt: 1, Hold: asJSON(hold), HeldAt: &held, Revision: 1, CreatedAt: now, UpdatedAt: now}).Error; err != nil { |
| + if err := g.Create(&stepRecord{ID: "s1", TaskID: "tk1", Idx: 1, Specialist: specialist, Person: "owner@example.com", RunnerID: "RUNNER1", State: wire.StepRunning, Attempt: 1, Hold: asJSON(hold), HeldAt: &held, Revision: 1, CreatedAt: now, UpdatedAt: now}).Error; err != nil { |
| t.Fatal(err) |
| } |
| if err := g.Exec("CREATE TABLE IF NOT EXISTS runners (id text PRIMARY KEY, person text, role text, label text, removing_at datetime, tainted_at datetime, revoked_at datetime)").Error; err != nil { |
| @@ -43,7 +51,7 @@ func pausedRig(t *testing.T, hold wire.StepHold, conns ...connectionRecord) (*me |
| if err := g.Exec("INSERT INTO runners(id, person, role, label) VALUES ('RUNNER1', 'owner@example.com', 'primary', 'Paul’s Mac mini')").Error; err != nil { |
| t.Fatal(err) |
| } |
| - if err := g.Create(&runnerSessionRecord{RunnerID: "RUNNER1", Connected: true, SeenAt: now, Protocol: wire.ProtocolScheduler}).Error; err != nil { |
| + if err := g.Create(&runnerSessionRecord{RunnerID: "RUNNER1", Connected: true, SeenAt: now, Protocol: protocol}).Error; err != nil { |
| t.Fatal(err) |
| } |
| return r, now |
| @@ -165,3 +173,214 @@ func TestPausedWhileTheRunnerIsOffline(t *testing.T) { |
| t.Fatalf("online %+v", p) |
| } |
| } |
| + |
| +func tensorxConn() connectionRecord { |
| + return connectionRecord{ID: "cn_tx", LocalID: "tensorx-1", Provider: wire.ProviderTensorX, Kind: wire.KindAPIKey, Harness: "pi", State: wire.ConnHealthy, Billing: wire.BillingMetered, |
| + Budget: `{"day":1000000,"month":10000000,"currency":"USD","revision":1}`, BudgetApplied: 1, Spend: `{"day":0,"month":0,"currency":"USD","unknown":false,"running":false}`, |
| + Models: `["z-ai/glm-5.3"]`, ModelsListed: `[{"id":"z-ai/glm-5.3","eligible":true,"family":"glm","tier":"strong"}]`} |
| +} |
| + |
| +// Fable's scenario (review B1): Engineering ran on Claude; Review is held; |
| +// Codex is at its limit, Claude is 85% used, TensorX has budget. The |
| +// family rule with leave puts TensorX first, so the instance says so |
| +// (bills per use, no carry_on), never "Claude has room now". |
| +func TestRunNowPredictsReviewsFamilyRule(t *testing.T) { |
| + reset := time.Date(2026, 11, 24, 18, 0, 0, 0, time.UTC) |
| + r, _ := pausedRigAt(t, wire.ProtocolPinnedRelease, wire.SpecialistReview, wire.StepHold{Reason: wire.HoldHeadroom, Connection: "codex-1", Provider: wire.ProviderCodex, ResetsAt: &reset, StepRevision: 1}, |
| + connectionRecord{ID: "cn_claude", LocalID: "claude-1", Provider: wire.ProviderClaude, Kind: wire.KindToken, State: wire.ConnHealthy, Headroom: headroom(85, reset)}, |
| + connectionRecord{ID: "cn_codex", LocalID: "codex-1", Provider: wire.ProviderCodex, Kind: wire.KindToken, State: wire.ConnLimited, Headroom: headroom(100, reset)}, |
| + tensorxConn(), |
| + ) |
| + if err := r.s.db.G.Exec("UPDATE chat_steps SET account = 'claude-1' WHERE id = 's1'").Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := r.s.db.G.Create(&stepRecord{ID: "s0", TaskID: "tk1", Idx: 0, Specialist: wire.SpecialistEngineering, Person: "owner@example.com", RunnerID: "RUNNER1", State: wire.StepDone, Attempt: 1, Account: "claude-1", Family: "claude", Pushed: true, Revision: 1, CreatedAt: reset, UpdatedAt: reset}).Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + p := pausedOf(t, r) |
| + if p == nil || p.RunNow == nil || p.RunNow.Connection != "cn_tx" || p.RunNow.Billing != wire.BillingMetered { |
| + t.Fatalf("Review's prediction: %+v", p.RunNow) |
| + } |
| +} |
| + |
| +// A fix round resumes its kept metered session with leave: the |
| +// prediction says TensorX, as the runner would, not Codex. |
| +func TestRunNowPredictsAKeptSession(t *testing.T) { |
| + reset := time.Date(2026, 11, 24, 18, 0, 0, 0, time.UTC) |
| + r, _ := pausedRig(t, wire.StepHold{Reason: wire.HoldHeadroom, Connection: "claude-1", Provider: wire.ProviderClaude, ResetsAt: &reset, StepRevision: 1}, |
| + connectionRecord{ID: "cn_codex", LocalID: "codex-1", Provider: wire.ProviderCodex, Kind: wire.KindToken, State: wire.ConnHealthy, Headroom: headroom(10, reset)}, |
| + tensorxConn(), |
| + ) |
| + if err := r.s.db.G.Exec("UPDATE chat_steps SET round = 1, idx = 2 WHERE id = 's1'").Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := r.s.db.G.Create(&stepRecord{ID: "s0", TaskID: "tk1", Idx: 1, Specialist: wire.SpecialistEngineering, Person: "owner@example.com", RunnerID: "RUNNER1", State: wire.StepDone, Attempt: 1, Account: "tensorx-1", Model: "z-ai/glm-5.3", Revision: 1, CreatedAt: reset, UpdatedAt: reset}).Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + if p := pausedOf(t, r); p == nil || p.RunNow == nil || p.RunNow.Connection != "cn_tx" { |
| + t.Fatalf("a kept session's prediction: %+v", p.RunNow) |
| + } |
| +} |
| + |
| +// A runner below protocol 29 cannot be held to one connection: Run now |
| +// promises nothing (plain), and names no model. |
| +func TestRunNowIsPlainForAnOlderRunner(t *testing.T) { |
| + reset := time.Date(2026, 11, 24, 21, 0, 0, 0, time.UTC) |
| + r, _ := pausedRigAt(t, wire.Protocol28, wire.SpecialistEngineering, wire.StepHold{Reason: wire.HoldHeadroom, Connection: "claude-1", Provider: wire.ProviderClaude, ResetsAt: &reset, StepRevision: 1}, |
| + connectionRecord{ID: "cn_codex", LocalID: "codex-1", Provider: wire.ProviderCodex, Kind: wire.KindToken, State: wire.ConnHealthy, Headroom: headroom(10, reset)}, |
| + ) |
| + p := pausedOf(t, r) |
| + if p == nil || p.RunNow == nil || !p.RunNow.Plain || p.RunNow.Name != "" || p.RunNow.Connection != "" { |
| + t.Fatalf("an older runner's offer: %+v", p.RunNow) |
| + } |
| +} |
| + |
| +// S2: once Run now is written for the hold, it is not offered again, and |
| +// a second tap says it is already on its way. The release is pinned to |
| +// the connection the person was shown. |
| +func TestRunNowOnceAndPinned(t *testing.T) { |
| + reset := time.Date(2026, 11, 24, 21, 0, 0, 0, time.UTC) |
| + r, _ := pausedRig(t, wire.StepHold{Reason: wire.HoldHeadroom, Connection: "claude-1", Provider: wire.ProviderClaude, ResetsAt: &reset, StepRevision: 1}, |
| + connectionRecord{ID: "cn_claude", LocalID: "claude-1", Provider: wire.ProviderClaude, Kind: wire.KindToken, State: wire.ConnLimited, Headroom: headroom(100, reset)}, |
| + connectionRecord{ID: "cn_codex", LocalID: "codex-1", Provider: wire.ProviderCodex, Kind: wire.KindToken, State: wire.ConnHealthy, Headroom: headroom(10, reset)}, |
| + ) |
| + ctx := context.Background() |
| + if _, err := r.s.RunNow(ctx, "owner@example.com", "tk1", wire.RunNow{Step: "s1", StepRevision: 1}); err != nil { |
| + t.Fatal(err) |
| + } |
| + var rel releaseRecord |
| + if err := r.s.db.G.Where("step_id = 's1'").First(&rel).Error; err != nil || rel.Connection != "codex-1" { |
| + t.Fatalf("release %+v %v", rel, err) |
| + } |
| + var body string |
| + r.s.db.G.Raw("SELECT body FROM runner_commands WHERE kind = ?", wire.FrameRelease).Scan(&body) |
| + if !strings.Contains(body, `"connection":"codex-1"`) { |
| + t.Fatalf("the release frame is not pinned: %s", body) |
| + } |
| + if p := pausedOf(t, r); p == nil || p.RunNow != nil { |
| + t.Fatalf("offered again after the release: %+v", p) |
| + } |
| + if _, err := r.s.RunNow(ctx, "owner@example.com", "tk1", wire.RunNow{Step: "s1", StepRevision: 1}); !errors.Is(err, ErrAlreadyReleased) { |
| + t.Fatalf("a second tap: %v", err) |
| + } |
| +} |
| + |
| +// S1: one job card that cannot be projected never stops the minute's |
| +// sweep: it is logged and skipped, and the next card is brought up to |
| +// date in its own transaction. |
| +func TestRefreshJobsSkipsAFailingCard(t *testing.T) { |
| + r := newMeteredRig(t) |
| + now := r.s.now() |
| + g := r.s.db.G |
| + for i, id := range []string{"h_bad", "h_good"} { |
| + if err := g.Create(&handoffRecord{ID: id, Person: "owner@example.com", LedgerKey: id, State: handoffOpen, Lane: wire.JobLane(id), CreatedAt: now, UpdatedAt: now}).Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := g.Create(&cardRecord{ID: "c_" + id, Person: "owner@example.com", Kind: wire.CardJob, State: wire.JobWorking, Lane: wire.LaneAssistant, HandoffID: id, Options: "[]", Links: "[]", Result: "stale words", Revision: 1, CreatedAt: now.Add(time.Duration(i) * time.Second), UpdatedAt: now}).Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + project := projectJobFor |
| + t.Cleanup(func() { projectJobFor = project }) |
| + projectJobFor = func(t *txn, h handoffRecord) error { |
| + if h.ID == "h_bad" { |
| + return errors.New("a card that cannot be projected") |
| + } |
| + return project(t, h) |
| + } |
| + r.s.refreshJobs(context.Background()) |
| + var good cardRecord |
| + if err := g.Where("id = 'c_h_good'").First(&good).Error; err != nil || good.Result == "stale words" { |
| + t.Fatalf("the card after a failing one was not refreshed: %+v %v", good, err) |
| + } |
| +} |
| + |
| +// pausedJob follows the rig's task with a hand-off and projects its job |
| +// card, as Base would read it. |
| +func pausedJob(t *testing.T, r *meteredRig) wire.AssistantCard { |
| + t.Helper() |
| + now := r.s.now() |
| + g := r.s.db.G |
| + h := handoffRecord{ID: "h_job1", Person: "owner@example.com", LedgerKey: "h_job1", State: handoffOpen, Lane: wire.JobLane("h_job1"), Title: "Bakery website", CreatedAt: now, UpdatedAt: now} |
| + if err := g.Create(&h).Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := g.Create(&handoffTaskRecord{HandoffID: h.ID, TaskID: "tk1"}).Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + r.s.refreshJobs(context.Background()) |
| + var out wire.AssistantCard |
| + if err := r.s.tx(context.Background(), func(tx *txn) error { |
| + if err := tx.projectJob(h); err != nil { |
| + return err |
| + } |
| + c, ok, err := tx.jobCard(h) |
| + if err != nil || !ok { |
| + return errors.Join(err, errors.New("no job card")) |
| + } |
| + out, err = tx.assistantCardView(c) |
| + return err |
| + }); err != nil { |
| + t.Fatal(err) |
| + } |
| + return out |
| +} |
| + |
| +// Carry on now's edges (review N12): another person's job card is not |
| +// found; a prediction on a metered connection offers no Carry on now (it |
| +// is not "at no extra cost"); and once Run now was written, two minutes |
| +// on the card is paused again without it. |
| +func TestCarryOnEdges(t *testing.T) { |
| + reset := time.Date(2026, 11, 24, 21, 0, 0, 0, time.UTC) |
| + ctx := context.Background() |
| + r, now := pausedRig(t, wire.StepHold{Reason: wire.HoldHeadroom, Connection: "claude-1", Provider: wire.ProviderClaude, ResetsAt: &reset, WakeAt: &reset, StepRevision: 1}, |
| + connectionRecord{ID: "cn_claude", LocalID: "claude-1", Provider: wire.ProviderClaude, Kind: wire.KindToken, State: wire.ConnLimited, Headroom: headroom(100, reset)}, |
| + connectionRecord{ID: "cn_codex", LocalID: "codex-1", Provider: wire.ProviderCodex, Kind: wire.KindToken, State: wire.ConnHealthy, Headroom: headroom(10, reset)}, |
| + ) |
| + card := pausedJob(t, r) |
| + if card.State != wire.JobPaused || !card.CarryOn { |
| + t.Fatalf("the job card %+v", card) |
| + } |
| + if _, err := r.s.CarryOn(ctx, "other@example.com", card.ID, wire.CarryOn{Revision: card.Revision, IdempotencyKey: "k"}); !errors.Is(err, ErrNotFound) { |
| + t.Fatalf("another person's card: %v", err) |
| + } |
| + // Run now was written three minutes ago and the runner still holds |
| + // the step: paused again, with no Carry on now. |
| + if err := r.s.db.G.Create(&releaseRecord{ID: "rl_old", TaskID: "tk1", StepID: "s1", StepRevision: 1, Person: "owner@example.com", RunnerID: "RUNNER1", Connection: "codex-1", CreatedAt: now.Add(-3 * time.Minute)}).Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + r.s.refreshJobs(ctx) |
| + after := pausedJob2(t, r, card.ID) |
| + if after.State != wire.JobPaused || after.CarryOn { |
| + t.Fatalf("after an old release: %+v", after) |
| + } |
| + if _, err := r.s.CarryOn(ctx, "owner@example.com", card.ID, wire.CarryOn{Revision: after.Revision, IdempotencyKey: "k2"}); !errors.Is(err, ErrCarryOnUnavailable) { |
| + t.Fatalf("carry on after an old release: %v", err) |
| + } |
| +} |
| + |
| +// pausedJob2 reads one job card as Base would. |
| +func pausedJob2(t *testing.T, r *meteredRig, id string) (out wire.AssistantCard) { |
| + t.Helper() |
| + if err := r.s.tx(context.Background(), func(tx *txn) error { |
| + var err error |
| + out, err = tx.assistantCardOf(id) |
| + return err |
| + }); err != nil { |
| + t.Fatal(err) |
| + } |
| + return out |
| +} |
| + |
| +// A metered prediction is no Carry on now: it bills. |
| +func TestCarryOnNeverForMetered(t *testing.T) { |
| + reset := time.Date(2026, 11, 24, 21, 0, 0, 0, time.UTC) |
| + r, _ := pausedRig(t, wire.StepHold{Reason: wire.HoldHeadroom, Connection: "claude-1", Provider: wire.ProviderClaude, ResetsAt: &reset, WakeAt: &reset, StepRevision: 1}, |
| + connectionRecord{ID: "cn_claude", LocalID: "claude-1", Provider: wire.ProviderClaude, Kind: wire.KindToken, State: wire.ConnLimited, Headroom: headroom(100, reset)}, |
| + tensorxConn(), |
| + ) |
| + card := pausedJob(t, r) |
| + if card.State != wire.JobPaused || card.CarryOn { |
| + t.Fatalf("a metered prediction offered Carry on now: %+v", card) |
| + } |
| +} |
diff --git a/internal/equipo/chat/schedule.go b/internal/equipo/chat/schedule.go| index 30420b97..10011b5c 100644 |
| --- a/internal/equipo/chat/schedule.go |
| +++ b/internal/equipo/chat/schedule.go |
| @@ -32,11 +32,19 @@ type releaseRecord struct { |
| StepRevision int64 `gorm:"uniqueIndex:chat_release_step,priority:2"` |
| Person string |
| RunnerID string |
| - CreatedAt time.Time |
| + // Connection pins it (protocol 29): the runner's local id of the one |
| + // connection the person was told Run now would use; "" is leave on |
| + // any (an older runner, or a Run now nobody was promised anything for). |
| + Connection string |
| + CreatedAt time.Time |
| } |
| func (releaseRecord) TableName() string { return "chat_releases" } |
| +// ErrAlreadyReleased: Run now was already written for this hold; it is |
| +// on its way (or the runner could not honour it, and the step waits). |
| +var ErrAlreadyReleased = errors.New("chat: run now is already on its way") |
| + |
| // ErrHoldBar: Run now cannot pass a spending bar (the budget, the spend |
| // unknown); the hold offers Raise the budget or Resume instead. |
| var ErrHoldBar = errors.New("chat: run now cannot pass this hold") |
| @@ -259,6 +267,14 @@ func (s *Store) RunNow(ctx context.Context, person, id string, in wire.RunNow) ( |
| if wire.FinalStage(k.Stage) || k.CancelRequested { |
| return ErrTaskEnded |
| } |
| + var prior int64 |
| + if err := t.db.Model(&releaseRecord{}).Where("step_id = ? AND step_revision = ?", in.Step, in.StepRevision).Count(&prior).Error; err != nil { |
| + return err |
| + } |
| + if prior > 0 { |
| + // S2: a second tap is told, not answered with the first. |
| + return ErrAlreadyReleased |
| + } |
| rel, err := t.release(k, person, in.Step, in.StepRevision) |
| out.Release = rel |
| return err |
| @@ -299,7 +315,23 @@ func (t *txn) release(k taskRecord, person, step string, revision int64) (string |
| if proto < wire.ProtocolScheduler { |
| return "", ErrRunnerTooOld |
| } |
| - r := releaseRecord{ID: newID("rl_"), TaskID: k.ID, StepID: st.ID, StepRevision: revision, Person: person, RunnerID: st.RunnerID, CreatedAt: t.now()} |
| + // Pinned to what the person was shown (protocol 29): the same |
| + // prediction the pages and Base offered, read now. |
| + pin := "" |
| + if proto >= wire.ProtocolPinnedRelease { |
| + if recs, err := t.connections(st.Person); err == nil { |
| + var mine []connectionRecord |
| + for _, r := range recs { |
| + if r.RunnerID == st.RunnerID && r.LocalID != "" && labelled(connectionView(r)) { |
| + mine = append(mine, r) |
| + } |
| + } |
| + if o, local := t.predictRunNow(k, st, h, mine); o != nil && !o.Plain { |
| + pin = local |
| + } |
| + } |
| + } |
| + r := releaseRecord{ID: newID("rl_"), TaskID: k.ID, StepID: st.ID, StepRevision: revision, Person: person, RunnerID: st.RunnerID, Connection: pin, CreatedAt: t.now()} |
| if err := t.db.Create(&r).Error; err != nil { |
| return "", err |
| } |
| @@ -310,7 +342,7 @@ func (t *txn) release(k taskRecord, person, step string, revision int64) (string |
| if err := t.closeHeldCards(k.ID, ChoiceRunNow); err != nil { |
| return "", err |
| } |
| - return r.ID, t.commandTo(st.RunnerID, st.Person, wire.FrameRelease, wire.ReleaseCommand{ID: r.ID, Person: st.Person, TaskID: k.ID, StepID: st.ID, StepRevision: revision}) |
| + return r.ID, t.commandTo(st.RunnerID, st.Person, wire.FrameRelease, wire.ReleaseCommand{ID: r.ID, Person: st.Person, TaskID: k.ID, StepID: st.ID, StepRevision: revision, Connection: pin}) |
| } |
| // schedulerFields puts the scheduler's facts on a step's dispatch (protocol |
| @@ -326,7 +358,7 @@ func (t *txn) schedulerFields(k taskRecord, s stepRecord, cmd *wire.DispatchComm |
| return nil |
| } |
| var err error |
| - cmd.Release, err = t.openRelease(s) |
| + cmd.Release, cmd.ReleaseConnection, err = t.openRelease(s) |
| return err |
| } |
| @@ -338,13 +370,13 @@ func housekeepingAttempt(s stepRecord) bool { |
| // openRelease is an unconsumed release the instance wrote for the step's |
| // dispatched attempt (a step placed again carries it). |
| -func (t *txn) openRelease(s stepRecord) (string, error) { |
| +func (t *txn) openRelease(s stepRecord) (string, string, error) { |
| var r releaseRecord |
| err := t.db.Where("step_id = ? AND step_revision = ?", s.ID, s.Attempt).First(&r).Error |
| if errors.Is(err, gorm.ErrRecordNotFound) { |
| - return "", nil |
| + return "", "", nil |
| } |
| - return r.ID, err |
| + return r.ID, r.Connection, err |
| } |
| // heldCard asks the task's creator about a held step where their input |
diff --git a/internal/equipo/chat/zone_test.go b/internal/equipo/chat/zone_test.go| index bc2a8e76..740fd631 100644 |
| --- a/internal/equipo/chat/zone_test.go |
| +++ b/internal/equipo/chat/zone_test.go |
| @@ -4,6 +4,7 @@ import ( |
| "context" |
| "errors" |
| "testing" |
| + "time" |
| ) |
| // A person's time zone (paused work, decision 4): Europe/Dublin until |
| @@ -80,3 +81,61 @@ func TestBaseZoneNeverOverridesTheDevice(t *testing.T) { |
| t.Fatalf("unknown: %v", err) |
| } |
| } |
| + |
| +// The daily sweep is at 03:00 on the person's own clock, once a local |
| +// day (review N1, S5): on the Sunday Dublin springs forward (03:00 IST |
| +// is 02:00 UTC, not midnight plus three hours), on the Sunday it falls |
| +// back, and when the person moves west mid-day, whose day then has its |
| +// own 03:00 still to come. |
| +func TestSweepAtThreeLocalAcrossDSTAndAZoneChange(t *testing.T) { |
| + r := newMeteredRig(t) |
| + ctx := context.Background() |
| + g := r.s.db.G |
| + if err := g.Exec("CREATE TABLE IF NOT EXISTS members (address text, active numeric)").Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := g.Exec("INSERT INTO members(address, active) VALUES ('owner@example.com', 1) ON CONFLICT DO NOTHING").Error; err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := r.s.SetZone(ctx, "owner@example.com", "Europe/Dublin"); err != nil { |
| + t.Fatal(err) |
| + } |
| + var now time.Time |
| + r.s.SetHousekeepingClock(func() time.Time { return now }) |
| + due := func(at string) bool { |
| + t.Helper() |
| + var err error |
| + if now, err = time.Parse(time.RFC3339, at); err != nil { |
| + t.Fatal(err) |
| + } |
| + d, err := r.s.sweepDue(ctx) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + return d |
| + } |
| + for _, c := range []struct { |
| + at string |
| + want bool |
| + }{ |
| + {"2027-03-28T01:59:00Z", false}, // 02:59 IST, after the jump |
| + {"2027-03-28T02:00:00Z", true}, // 03:00 IST |
| + {"2027-03-28T02:30:00Z", false}, // once a day |
| + {"2027-10-31T02:59:00Z", false}, // 02:59 GMT, after falling back |
| + {"2027-10-31T03:00:00Z", true}, // 03:00 GMT |
| + {"2027-10-31T04:00:00Z", false}, |
| + } { |
| + if got := due(c.at); got != c.want { |
| + t.Errorf("sweep due at %s: %v, want %v", c.at, got, c.want) |
| + } |
| + } |
| + // Moving west: at 05:00 UTC it is 01:00 in New York (still summer |
| + // time there), whose 03:00 (07:00 UTC) is still to come; its day gets |
| + // its sweep then, once. |
| + if _, err := r.s.SetZone(ctx, "owner@example.com", "America/New_York"); err != nil { |
| + t.Fatal(err) |
| + } |
| + if due("2027-10-31T05:00:00Z") || !due("2027-10-31T07:00:00Z") || due("2027-10-31T09:00:00Z") { |
| + t.Error("the sweep in New York's day after the move") |
| + } |
| +} |
diff --git a/internal/equipo/chat_page.go b/internal/equipo/chat_page.go| index 8c45e0b6..c8a3b8fe 100644 |
| --- a/internal/equipo/chat_page.go |
| +++ b/internal/equipo/chat_page.go |
| @@ -800,7 +800,7 @@ func (a *application) chatNotebookReset(w http.ResponseWriter, r *http.Request) |
| } |
| func chatError(err error) error { |
| - for from, to := range map[error]error{chat.ErrBusy: ErrConflict, chat.ErrInvalid: ErrInvalid, chat.ErrConflict: ErrConflict, chat.ErrNotFound: ErrNotFound, chat.ErrForbidden: ErrForbidden, chat.ErrNotAllowed: ErrInvalid, chat.ErrTaskEnded: ErrConflict, chat.ErrNotRetryable: ErrConflict, chat.ErrMerging: ErrConflict, chat.ErrNotMergeable: ErrConflict, chat.ErrNotAskable: ErrConflict, chat.ErrRevision: ErrConflict} { |
| + for from, to := range map[error]error{chat.ErrBusy: ErrConflict, chat.ErrInvalid: ErrInvalid, chat.ErrConflict: ErrConflict, chat.ErrNotFound: ErrNotFound, chat.ErrForbidden: ErrForbidden, chat.ErrNotAllowed: ErrInvalid, chat.ErrTaskEnded: ErrConflict, chat.ErrNotRetryable: ErrConflict, chat.ErrMerging: ErrConflict, chat.ErrNotMergeable: ErrConflict, chat.ErrNotAskable: ErrConflict, chat.ErrRevision: ErrConflict, chat.ErrAlreadyReleased: ErrAlreadyRunning} { |
| if errors.Is(err, from) { |
| return to |
| } |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index 12c06456..e877eae8 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -2371,7 +2371,7 @@ var pageCopy = map[string]string{ |
| "work.pause.next.by_itself": "It carries on by itself then.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| "work.pause.next.budget": "It carries on by itself when the budget resets.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| "work.pause.next.busy": "It starts by itself as soon as that step finishes.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| - "work.pause.next.online": "It carries on by itself when the Mac is back online.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| + "work.pause.next.online": "It carries on by itself when %s is back online.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| "work.pause.next.choose": "Nothing happens until you choose.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| "work.pause.next.try_again": "Nothing more happens until you try again.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| "work.pause.next.update": "It carries on by itself once the runner is updated.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| @@ -2405,6 +2405,7 @@ var pageCopy = map[string]string{ |
| "time.in_days": "in %d days", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| "time.when_in": "%s (%s)", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| "api.not_paused": "This work is not paused now. Check its latest status.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| + "api.already_running": "A request to run this work is already in progress.", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24) |
| } |
| // pasteLabels are the paste box's words, for the shared renderer, and |
diff --git a/internal/equipo/handlers.go b/internal/equipo/handlers.go| index 21eae397..42d4615b 100644 |
| --- a/internal/equipo/handlers.go |
| +++ b/internal/equipo/handlers.go |
| @@ -145,6 +145,8 @@ func (a *application) failure(w http.ResponseWriter, r *http.Request, err error) |
| status, key = 403, "form.forbidden" |
| case errors.Is(err, ErrNotFound): |
| status, key = 404, "form.not-found" |
| + case errors.Is(err, ErrAlreadyRunning): |
| + status, key = 409, "api.already_running" |
| } |
| // Error pages do not repeat database reads that may have just failed. |
| back := "/work" |
diff --git a/internal/equipo/housekeeping/policy.go b/internal/equipo/housekeeping/policy.go| index a36a0cbc..115d42c7 100644 |
| --- a/internal/equipo/housekeeping/policy.go |
| +++ b/internal/equipo/housekeeping/policy.go |
| @@ -143,3 +143,11 @@ func DayStart(at time.Time, loc *time.Location) time.Time { |
| l := at.In(loc) |
| return time.Date(l.Year(), l.Month(), l.Day(), 0, 0, 0, 0, loc).UTC() |
| } |
| + |
| +// AtHour is hour o'clock on at's day in loc, in UTC: the clock's own hour |
| +// on a day that springs forward or falls back, never midnight plus hours |
| +// (paused work review N1). |
| +func AtHour(at time.Time, loc *time.Location, hour int) time.Time { |
| + l := at.In(loc) |
| + return time.Date(l.Year(), l.Month(), l.Day(), hour, 0, 0, 0, loc).UTC() |
| +} |
diff --git a/internal/equipo/housekeeping/zone_test.go b/internal/equipo/housekeeping/zone_test.go| new file mode 100644 |
| index 00000000..1c66fc71 |
| --- /dev/null |
| +++ b/internal/equipo/housekeeping/zone_test.go |
| @@ -0,0 +1,60 @@ |
| +package housekeeping |
| + |
| +import ( |
| + "testing" |
| + "time" |
| +) |
| + |
| +// The housekeeping clock in a person's zone (paused work review N1, S5): |
| +// Europe/Dublin in summer, and on the two days its clocks change (last |
| +// Sunday of March, 01:00 UTC forward; last Sunday of October, 01:00 UTC |
| +// back). The day, the sweep's 03:00 and the digest's 08:00 are the |
| +// clock's own hours on that day, never midnight plus hours. |
| +func TestHousekeepingClockInDublin(t *testing.T) { |
| + dublin, err := time.LoadLocation("Europe/Dublin") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + utc := func(s string) time.Time { |
| + v, err := time.Parse(time.RFC3339, s) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + return v |
| + } |
| + for _, c := range []struct { |
| + name, now, day, sweep, digest string |
| + }{ |
| + {"summer", "2027-07-14T12:00:00Z", "2027-07-13T23:00:00Z", "2027-07-14T02:00:00Z", "2027-07-14T07:00:00Z"}, |
| + {"spring forward", "2027-03-28T12:00:00Z", "2027-03-28T00:00:00Z", "2027-03-28T02:00:00Z", "2027-03-28T07:00:00Z"}, |
| + {"fall back", "2027-10-31T12:00:00Z", "2027-10-30T23:00:00Z", "2027-10-31T03:00:00Z", "2027-10-31T08:00:00Z"}, |
| + {"winter", "2027-11-24T12:00:00Z", "2027-11-24T00:00:00Z", "2027-11-24T03:00:00Z", "2027-11-24T08:00:00Z"}, |
| + } { |
| + now := utc(c.now) |
| + if got := DayStart(now, dublin); !got.Equal(utc(c.day)) { |
| + t.Errorf("%s: day starts %v, want %s", c.name, got, c.day) |
| + } |
| + if got := AtHour(now, dublin, SweepHour); !got.Equal(utc(c.sweep)) { |
| + t.Errorf("%s: sweep %v, want %s", c.name, got, c.sweep) |
| + } |
| + if got := AtHour(now, dublin, QuietUntil); !got.Equal(utc(c.digest)) { |
| + t.Errorf("%s: digest %v, want %s", c.name, got, c.digest) |
| + } |
| + if got := AtHour(now, dublin, SweepHour).In(dublin).Hour(); got != SweepHour { |
| + t.Errorf("%s: the sweep is at %d local", c.name, got) |
| + } |
| + } |
| + // Quiet hours (22:00 to 08:00) in Dublin's summer: 07:30 local is |
| + // 06:30 UTC and still quiet; the receipt shows at 08:00 local. |
| + q := QuietHours{From: 22, Until: 8} |
| + at := utc("2027-07-14T06:30:00Z") |
| + if !q.Quiet(at, dublin) { |
| + t.Fatal("07:30 in Dublin is not quiet") |
| + } |
| + if v := q.VisibleAt(at, dublin); v == nil || !v.Equal(utc("2027-07-14T07:00:00Z")) { |
| + t.Fatalf("visible at %v", v) |
| + } |
| + if q.Quiet(utc("2027-07-14T07:30:00Z"), dublin) { |
| + t.Fatal("08:30 in Dublin is quiet") |
| + } |
| +} |
diff --git a/internal/equipo/labels_test.go b/internal/equipo/labels_test.go| index 9ac6f02d..3cfd14e5 100644 |
| --- a/internal/equipo/labels_test.go |
| +++ b/internal/equipo/labels_test.go |
| @@ -195,7 +195,7 @@ func TestLabelAdviceAndHoldLines(t *testing.T) { |
| if v.Hold == nil || !strings.HasPrefix(v.Hold.Line, "Waiting for your Claude allowance") { |
| t.Fatalf("before naming %+v", v.Hold) |
| } |
| - holdNamed(&v, conns, labels) |
| + holdNamed(&v, conns, labels, defaultZone()) |
| if want := "Waiting for your Claude (signed in by link, 2) allowance to reset " + resetText(reset, defaultZone()); v.Hold.Line != want || v.StageLine != want || v.Hold.Tag == nil || v.Hold.Tag.ID != "cn_tok_b" { |
| t.Fatalf("hold %+v, stage %q", v.Hold, v.StageLine) |
| } |
| @@ -207,7 +207,7 @@ func TestLabelAdviceAndHoldLines(t *testing.T) { |
| s := step |
| h := *step.Hold |
| h.Reason, s.Hold = reason, &h |
| - if got := holdOf(s, true, chat.HoldLabel(conns, labels, s.RunnerID, h.Connection, h.Provider)).Line; got != want { |
| + if got := holdOf(s, true, chat.HoldLabel(conns, labels, s.RunnerID, h.Connection, h.Provider), defaultZone()).Line; got != want { |
| t.Fatalf("%s: %q", reason, got) |
| } |
| } |
diff --git a/internal/equipo/migrations/0106_release_connection.sql b/internal/equipo/migrations/0106_release_connection.sql| new file mode 100644 |
| index 00000000..54638cd2 |
| --- /dev/null |
| +++ b/internal/equipo/migrations/0106_release_connection.sql |
| @@ -0,0 +1,3 @@ |
| +-- Run now pinned to the connection the person was told it would use |
| +-- (protocol 29, paused work review B1); '' is leave on any connection. |
| +ALTER TABLE chat_releases ADD COLUMN connection text; |
diff --git a/internal/equipo/migrations/schema.sql b/internal/equipo/migrations/schema.sql| index 9098c88c..8130c4f2 100644 |
| --- a/internal/equipo/migrations/schema.sql |
| +++ b/internal/equipo/migrations/schema.sql |
| @@ -774,3 +774,4 @@ ALTER TABLE chat_projects ADD COLUMN description_set numeric; |
| UPDATE chat_projects SET title_set = metadata_set, description_set = metadata_set; |
| CREATE TABLE chat_person_zones (person text PRIMARY KEY, zone text NOT NULL, source text, updated_at datetime); |
| ALTER TABLE chat_cards ADD COLUMN carry_on numeric; |
| +ALTER TABLE chat_releases ADD COLUMN connection text; |
diff --git a/internal/equipo/pause_view.go b/internal/equipo/pause_view.go| index 7201703b..868db46a 100644 |
| --- a/internal/equipo/pause_view.go |
| +++ b/internal/equipo/pause_view.go |
| @@ -2,6 +2,7 @@ package equipo |
| import ( |
| "context" |
| + "errors" |
| "fmt" |
| "net/http" |
| "strings" |
| @@ -85,7 +86,9 @@ func pauseOf(t wire.Task, viewer string, now time.Time, loc *time.Location) *pau |
| p.Strong, p.Rest = pause.Lead(copyText, "work.pause.moment", reason) |
| } |
| } |
| - p.Next = copyText("work.pause.next.online") |
| + if s.RunnerLabel != "" { |
| + p.Next = fmt.Sprintf(copyText("work.pause.next.online"), s.RunnerLabel) |
| + } |
| if mine { |
| p.Actions = []pauseAction{{Label: copyText("work.pause.check_machine"), Href: pauseMachines, Kind: "machine"}} |
| } |
| @@ -194,6 +197,9 @@ func runNow(t wire.Task, s wire.Step, o *wire.RunNowOffer, p *pauseLine, primary |
| } |
| a := pauseAction{Post: "/conversation/tasks/" + t.ID + "/run-now", Kind: "run-now", Step: s.ID, Revision: s.Hold.StepRevision, Primary: primary} |
| switch { |
| + case o.Plain: |
| + // An older runner cannot be held to one connection: no promise. |
| + a.Label = copyText("work.hold.run_now") |
| case o.Billing == wire.BillingMetered: |
| a.Label, p.Note = fmt.Sprintf(copyText("work.pause.run_now_with"), o.Name), fmt.Sprintf(copyText("work.pause.run_now_metered"), o.Name) |
| case o.Same: |
| @@ -322,3 +328,7 @@ func pauseReading(v *taskLine, conns []wire.Connection, now time.Time) { |
| } |
| } |
| } |
| + |
| +// ErrAlreadyRunning: Run now was already asked for this hold (S2); the |
| +// page says so rather than answering as if it were new. |
| +var ErrAlreadyRunning = errors.New("run now is already on its way") |
diff --git a/internal/equipo/pause_view_test.go b/internal/equipo/pause_view_test.go| index a6bba2a0..42639aea 100644 |
| --- a/internal/equipo/pause_view_test.go |
| +++ b/internal/equipo/pause_view_test.go |
| @@ -90,7 +90,7 @@ func TestPauseTones(t *testing.T) { |
| }{ |
| {"budget", pausedTask(wire.StepHold{Reason: wire.HoldBudget, Connection: "tx", Provider: wire.ProviderTensorX, WakeAt: &midnight}, nil), "paused", "Paused", "Paused until midnight", "It carries on by itself when the budget resets.", "Raise the budget"}, |
| {"busy", pausedTask(wire.StepHold{Reason: wire.HoldBusy, Connection: "tx", Provider: wire.ProviderTensorX}, nil), "paused", "Paused", "Paused for a moment:", "It starts by itself as soon as that step finishes.", ""}, |
| - {"offline", wire.Task{ID: "tk1", Stage: wire.StageInProgress, Creator: "paul@example.com", Steps: []wire.Step{{ID: "s1", Specialist: wire.SpecialistEngineering, State: wire.StepQueued, RunnerLabel: "Paul’s Mac mini", Paused: &wire.StepPaused{Offline: true, Since: &since}}}}, "paused", "Paused", "Paused since 11:20:", "It carries on by itself when the Mac is back online.", "Check the machine"}, |
| + {"offline", wire.Task{ID: "tk1", Stage: wire.StageInProgress, Creator: "paul@example.com", Steps: []wire.Step{{ID: "s1", Specialist: wire.SpecialistEngineering, State: wire.StepQueued, RunnerLabel: "Paul’s Mac mini", Paused: &wire.StepPaused{Offline: true, Since: &since}}}}, "paused", "Paused", "Paused since 11:20:", "It carries on by itself when Paul’s Mac mini is back online.", "Check the machine"}, |
| {"spend unknown", pausedTask(wire.StepHold{Reason: wire.HoldSpendUnknown, Connection: "tx", Provider: wire.ProviderTensorX}, nil), "warning", "Needs you", "Paused:", "Check your spending on TensorX, then resume. Nothing runs on TensorX until you do.", "Resume"}, |
| {"no connection", pausedTask(wire.StepHold{Reason: wire.HoldNoConnection, NeedsPerson: wire.HoldNeedsNoConnection}, &wire.StepPaused{RunNow: &wire.RunNowOffer{Name: "TensorX", Billing: wire.BillingMetered}}), "warning", "Needs you", "Waiting:", "Nothing happens until you choose.", "Run it now with TensorX"}, |
| {"too old", wire.Task{ID: "tk1", Stage: wire.StageInProgress, Creator: "paul@example.com", NeedsYou: wire.NeedsRetry, Steps: []wire.Step{{ID: "s1", Specialist: wire.SpecialistEngineering, State: wire.StepFailed, Reason: "runner_outdated", RunnerLabel: "Paul’s Mac mini", FinishedAt: &finished}}}, "warning", "Needs you", "Waiting for an update:", "It carries on by itself once the runner is updated.", "Update the runner"}, |
| @@ -124,3 +124,16 @@ func TestNoPauseWhileWorking(t *testing.T) { |
| t.Fatalf("%+v", track[0]) |
| } |
| } |
| + |
| +// An older runner (below protocol 29) gets plain Run now: no model named, |
| +// no "has room now". |
| +func TestPlainRunNowForAnOlderRunner(t *testing.T) { |
| + reset := time.Date(2026, 11, 24, 21, 0, 0, 0, time.UTC) |
| + used := 100 |
| + task := pausedTask(wire.StepHold{Reason: wire.HoldHeadroom, Connection: "claude-1", Provider: wire.ProviderClaude, ResetsAt: &reset, StepRevision: 4}, |
| + &wire.StepPaused{UsedPercent: &used, RunNow: &wire.RunNowOffer{Plain: true}}) |
| + p := pauseOf(task, "paul@example.com", paulNow, dublinLoc(t)) |
| + if len(p.Actions) != 1 || p.Actions[0].Label != "Run it now anyway" || p.Note != "" { |
| + t.Fatalf("%+v note %q", p.Actions, p.Note) |
| + } |
| +} |
diff --git a/internal/equipo/usage_page_test.go b/internal/equipo/usage_page_test.go| index 36681455..71dbf862 100644 |
| --- a/internal/equipo/usage_page_test.go |
| +++ b/internal/equipo/usage_page_test.go |
| @@ -148,7 +148,7 @@ func TestHoldLineSaysTheReadingsAge(t *testing.T) { |
| reset := usageNow.Add(70 * time.Hour) |
| step := wire.Step{ID: "s1", Hold: &wire.StepHold{Reason: wire.HoldHeadroom, Connection: "claude-1", Provider: wire.ProviderClaude, ResetsAt: &reset, StepRevision: 1}} |
| v := taskLine{Step: &step} |
| - v.Hold = holdOf(step, true, chat.HoldLabel(usageConns(), connLabels(usageConns(), nil), "", step.Hold.Connection, step.Hold.Provider)) |
| + v.Hold = holdOf(step, true, chat.HoldLabel(usageConns(), connLabels(usageConns(), nil), "", step.Hold.Connection, step.Hold.Provider), defaultZone()) |
| v.StageLine = v.Hold.Line |
| holdReading(&v, usageConns(), usageNow) |
| if !strings.HasPrefix(v.Hold.Line, "Waiting for your Claude allowance to reset") || !strings.HasSuffix(v.Hold.Line, " · last reported "+ago(usageNow, usageNow.Add(-5*time.Hour))) || v.StageLine != v.Hold.Line { |
| @@ -156,7 +156,7 @@ func TestHoldLineSaysTheReadingsAge(t *testing.T) { |
| } |
| step.Hold.Connection, step.Hold.Provider = "codex-2", wire.ProviderCodex |
| v = taskLine{Step: &step} |
| - v.Hold = holdOf(step, true, chat.HoldLabel(usageConns(), connLabels(usageConns(), nil), "", step.Hold.Connection, step.Hold.Provider)) |
| + v.Hold = holdOf(step, true, chat.HoldLabel(usageConns(), connLabels(usageConns(), nil), "", step.Hold.Connection, step.Hold.Provider), defaultZone()) |
| before := v.Hold.Line |
| holdReading(&v, usageConns(), usageNow) |
| if v.Hold.Line != before { |
diff --git a/internal/equipo/work_pages.go b/internal/equipo/work_pages.go| index 49d130e9..8505bf1d 100644 |
| --- a/internal/equipo/work_pages.go |
| +++ b/internal/equipo/work_pages.go |
| @@ -237,7 +237,7 @@ func taskLineOf(t wire.Task, viewer string) taskLine { |
| v.Merge = t.MergeOffered |
| v.Priority = priorityOf(t, t.Creator == viewer) |
| if v.Step != nil && v.Step.Hold != nil && !wire.FinalStage(t.Stage) { |
| - v.Hold = holdOf(*v.Step, t.Creator == viewer, chat.HoldLabel(nil, nil, "", "", v.Step.Hold.Provider)) |
| + v.Hold = holdOf(*v.Step, t.Creator == viewer, chat.HoldLabel(nil, nil, "", "", v.Step.Hold.Provider), defaultZone()) |
| v.StageLine = v.Hold.Line |
| } |
| if t.Creator != viewer { |
| @@ -265,7 +265,7 @@ type holdLine struct { |
| // holdOf is the hold's words, naming its connection by tag, and, for |
| // the creator, its action. |
| -func holdOf(s wire.Step, mine bool, tag chat.ConnLabel) *holdLine { |
| +func holdOf(s wire.Step, mine bool, tag chat.ConnLabel, loc *time.Location) *holdLine { |
| h := s.Hold |
| name := tag.Text |
| l := &holdLine{Step: s.ID, Revision: h.StepRevision} |
| @@ -280,7 +280,7 @@ func holdOf(s wire.Step, mine bool, tag chat.ConnLabel) *holdLine { |
| case wire.HoldHeadroom: |
| l.Line = fmt.Sprintf(copyText("work.hold.headroom"), name) |
| if h.ResetsAt != nil { |
| - l.Line = fmt.Sprintf(copyText("work.hold.headroom_reset"), name, resetText(*h.ResetsAt, defaultZone())) |
| + l.Line = fmt.Sprintf(copyText("work.hold.headroom_reset"), name, resetText(*h.ResetsAt, loc)) |
| } |
| case wire.HoldBudget: |
| l.Line, l.Budget = fmt.Sprintf(copyText("work.hold.budget"), name), mine |
| @@ -564,7 +564,14 @@ func (a *application) richTasks(ctx context.Context, viewer string, list []wire. |
| v.MergeDropped = dropped |
| v.richOf(t, viewer, card, now) |
| if t.Creator == viewer { |
| - holdNamed(&v, conns, labels) |
| + holdNamed(&v, conns, labels, loc) |
| + } else if v.Hold != nil && v.Step != nil && v.Step.Hold != nil { |
| + // The viewer's own clock (review N9). |
| + was := v.Hold.Line |
| + v.Hold = holdOf(*v.Step, false, chat.HoldLabel(nil, nil, "", "", v.Step.Hold.Provider), loc) |
| + if v.StageLine == was { |
| + v.StageLine = v.Hold.Line |
| + } |
| } |
| holdReading(&v, conns, now) |
| if v.Hold != nil && v.StageLine == v.Hold.Line { |
| @@ -579,13 +586,13 @@ func (a *application) richTasks(ctx context.Context, viewer string, list []wire. |
| // holdNamed names the connection a hold waits on by its shared label: |
| // the creator's own connection, so only on the creator's pages. |
| -func holdNamed(v *taskLine, conns []wire.Connection, labels map[string]chat.ConnLabel) { |
| +func holdNamed(v *taskLine, conns []wire.Connection, labels map[string]chat.ConnLabel, loc *time.Location) { |
| if v.Hold == nil || v.Step == nil || v.Step.Hold == nil { |
| return |
| } |
| h := v.Step.Hold |
| was := v.Hold.Line |
| - v.Hold = holdOf(*v.Step, true, chat.HoldLabel(conns, labels, v.Step.RunnerID, h.Connection, h.Provider)) |
| + v.Hold = holdOf(*v.Step, true, chat.HoldLabel(conns, labels, v.Step.RunnerID, h.Connection, h.Provider), loc) |
| if v.StageLine == was { |
| v.StageLine = v.Hold.Line |
| } |
diff --git a/internal/plan3test/plan3_release_test.go b/internal/plan3test/plan3_release_test.go| index a6ca3b80..0bcb86b6 100644 |
| --- a/internal/plan3test/plan3_release_test.go |
| +++ b/internal/plan3test/plan3_release_test.go |
| @@ -248,4 +248,4 @@ func plan3CopyInventory(t *testing.T) { |
| // pausedCopyKeys are the paused-work strings and API prose Luna reviewed |
| // (2026-11-24). |
| -var pausedCopyKeys = []string{"work.stage.paused", "work.stage.stopped", "work.stage.needs_you", "work.pause.until", "work.pause.since", "work.pause.moment", "time.tonight", "time.today_at", "time.tomorrow_at", "time.midnight", "time.in_hours", "work.pause.reason.headroom_out", "work.pause.reason.headroom_saving", "work.pause.reason.budget", "work.pause.reason.busy", "work.pause.reason.offline", "work.pause.next.by_itself", "work.pause.next.budget", "work.pause.next.busy", "work.pause.next.online", "work.pause.next.choose", "work.pause.next.try_again", "work.pause.next.update", "work.pause.next.spend_unknown", "work.pause.run_now_with", "work.pause.run_now_on", "work.pause.run_now_room", "work.pause.run_now_last", "work.pause.run_now_metered", "work.pause.check_machine", "work.pause.update_runner", "work.pause.connect", "work.pause.try_again", "work.pause.lead.spend_unknown", "work.pause.lead.no_connection", "work.pause.lead.too_old", "work.pause.lead.stopped", "assistant.job.paused", "assistant.job.paused_view", "assistant.job.detail.paused_allowance", "assistant.job.detail.paused_limit", "assistant.job.detail.paused_offline", "assistant.job.carry_on", "assistant.job.carry_on_note", "assistant.job.change_limit", "time.in_hours.one", "time.in_days.one", "api.carry_on_unavailable", "time.in_minutes", "time.in_minutes.one", "time.in_days", "time.when_in", "api.not_paused", "docs/api/equipo-v1.md / Talk to the Assistant: paused jobs", "docs/api/equipo-v1.md / Talk to the Assistant: only_if_unset"} |
| +var pausedCopyKeys = []string{"work.stage.paused", "work.stage.stopped", "work.stage.needs_you", "work.pause.until", "work.pause.since", "work.pause.moment", "time.tonight", "time.today_at", "time.tomorrow_at", "time.midnight", "time.in_hours", "work.pause.reason.headroom_out", "work.pause.reason.headroom_saving", "work.pause.reason.budget", "work.pause.reason.busy", "work.pause.reason.offline", "work.pause.next.by_itself", "work.pause.next.budget", "work.pause.next.busy", "work.pause.next.online", "work.pause.next.choose", "work.pause.next.try_again", "work.pause.next.update", "work.pause.next.spend_unknown", "work.pause.run_now_with", "work.pause.run_now_on", "work.pause.run_now_room", "work.pause.run_now_last", "work.pause.run_now_metered", "work.pause.check_machine", "work.pause.update_runner", "work.pause.connect", "work.pause.try_again", "work.pause.lead.spend_unknown", "work.pause.lead.no_connection", "work.pause.lead.too_old", "work.pause.lead.stopped", "assistant.job.paused", "assistant.job.paused_view", "assistant.job.detail.paused_allowance", "assistant.job.detail.paused_limit", "assistant.job.detail.paused_offline", "assistant.job.carry_on", "assistant.job.carry_on_note", "assistant.job.change_limit", "time.in_hours.one", "time.in_days.one", "api.carry_on_unavailable", "time.in_minutes", "time.in_minutes.one", "time.in_days", "time.when_in", "api.not_paused", "docs/api/equipo-v1.md / Talk to the Assistant: paused jobs", "docs/api/equipo-v1.md / Talk to the Assistant: only_if_unset", "api.already_running"} |
diff --git a/internal/runner/thin/pinned_release_test.go b/internal/runner/thin/pinned_release_test.go| new file mode 100644 |
| index 00000000..9637fa5a |
| --- /dev/null |
| +++ b/internal/runner/thin/pinned_release_test.go |
| @@ -0,0 +1,72 @@ |
| +package thin |
| + |
| +import ( |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// A pinned Run now (protocol 29, paused work B1): the person was told it |
| +// would run on one connection, at no extra cost. Claude is 85% used (a |
| +// normal step holds), the other Claude account is full, and TensorX has budget: unpinned |
| +// leave would bill TensorX. Pinned to Claude it runs on Claude. |
| +func TestSchedulePinnedReleaseRunsOnlyThere(t *testing.T) { |
| + r := newSchedRig(t, "claude-a", "claude-b") |
| + r.tensorx(bigBudget) |
| + r.reading("claude-a", 0.85, time.Now().Add(9*time.Hour)) |
| + r.reading("claude-b", 1.0, time.Now().Add(9*time.Hour)) |
| + r.start() |
| + r.dispatch("p1", wire.PriorityNormal) |
| + r.until(5*time.Second, "the hold", func() bool { return len(r.reports("p1")) > 0 }) |
| + if kept, err := r.state.Release(r.ctx, "fr-p1", wire.ReleaseCommand{ID: "rl_p1", Person: connPerson, TaskID: "tk-p1", StepID: "p1", StepRevision: 1, Connection: "claude-a"}); err != nil || !kept { |
| + t.Fatalf("release %v %v", kept, err) |
| + } |
| + r.steps.MeteredChanged() |
| + r.until(5*time.Second, "the released step", func() bool { _, ok := r.final("p1"); return ok }) |
| + if on := r.ranOn("p1", 1); on != "claude-a" { |
| + t.Fatalf("a release pinned to Claude ran on %q", on) |
| + } |
| +} |
| + |
| +// The reading was stale: the pinned connection filled before the runner |
| +// decided. The step keeps holding, on its own connection's reset, and |
| +// TensorX is never billed in its place; a failover inside a pinned grant |
| +// holds too rather than moving to a metered connection. |
| +func TestSchedulePinnedReleaseNeverFallsBack(t *testing.T) { |
| + r := newSchedRig(t, "claude-a", "claude-b") |
| + r.tensorx(bigBudget) |
| + r.reading("claude-a", 0.85, time.Now().Add(9*time.Hour)) |
| + r.reading("claude-b", 1.0, time.Now().Add(9*time.Hour)) |
| + r.start() |
| + r.dispatch("p2", wire.PriorityNormal) |
| + r.until(5*time.Second, "the hold", func() bool { return len(r.reports("p2")) > 0 }) |
| + if _, err := r.state.Release(r.ctx, "fr-p2", wire.ReleaseCommand{ID: "rl_p2", Person: connPerson, TaskID: "tk-p2", StepID: "p2", StepRevision: 1, Connection: "claude-b"}); err != nil { |
| + t.Fatal(err) |
| + } |
| + r.steps.MeteredChanged() |
| + time.Sleep(300 * time.Millisecond) |
| + if _, done := r.final("p2"); done || r.ranOn("p2", 1) != "" { |
| + t.Fatalf("a release pinned to a full Claude account ran on %q", r.ranOn("p2", 1)) |
| + } |
| + var state string |
| + r.state.db.QueryRow("SELECT state FROM releases WHERE id='rl_p2'").Scan(&state) |
| + if state != releasePending { |
| + t.Fatalf("the pinned release is %q, not still pending", state) |
| + } |
| + |
| + // A failover inside a pinned grant: Claude refuses on quota; the next |
| + // attempt may not go to TensorX. |
| + r.fail["claude-a"] = true |
| + r.dispatch("p3", wire.PriorityNormal) |
| + r.until(5*time.Second, "the third hold", func() bool { return len(r.reports("p3")) > 0 }) |
| + if _, err := r.state.Release(r.ctx, "fr-p3", wire.ReleaseCommand{ID: "rl_p3", Person: connPerson, TaskID: "tk-p3", StepID: "p3", StepRevision: 1, Connection: "claude-a"}); err != nil { |
| + t.Fatal(err) |
| + } |
| + r.steps.MeteredChanged() |
| + r.until(5*time.Second, "the first attempt", func() bool { return r.ranOn("p3", 1) == "claude-a" }) |
| + time.Sleep(300 * time.Millisecond) |
| + if on := r.ranOn("p3", 2); on == piLocal { |
| + t.Fatal("a failover inside a pinned grant billed TensorX") |
| + } |
| +} |
diff --git a/internal/runner/thin/schedule.go b/internal/runner/thin/schedule.go| index 6ce0c4c7..3aae3d0d 100644 |
| --- a/internal/runner/thin/schedule.go |
| +++ b/internal/runner/thin/schedule.go |
| @@ -102,6 +102,9 @@ type stepFacts struct { |
| // ("" none); pending: not consumed yet. |
| release string |
| pending bool |
| + // pin is the connection the release is pinned to (protocol 29), "" |
| + // for leave on any connection. |
| + pin string |
| } |
| type querier interface { |
| @@ -132,9 +135,9 @@ func readStepFacts(ctx context.Context, q querier, r stepRow) (stepFacts, error) |
| if f.revision == 0 { |
| f.revision = r.Attempt |
| } |
| - err = q.QueryRowContext(ctx, "SELECT release_id FROM grants WHERE step_id=? AND step_revision=?", r.StepID, f.revision).Scan(&f.release) |
| + err = q.QueryRowContext(ctx, "SELECT g.release_id, coalesce(r.connection, '') FROM grants g LEFT JOIN releases r ON r.id = g.release_id WHERE g.step_id=? AND g.step_revision=?", r.StepID, f.revision).Scan(&f.release, &f.pin) |
| if errors.Is(err, sql.ErrNoRows) { |
| - err = q.QueryRowContext(ctx, "SELECT id FROM releases WHERE step_id=? AND step_revision=? AND state=? ORDER BY at, id LIMIT 1", r.StepID, f.revision, releasePending).Scan(&f.release) |
| + err = q.QueryRowContext(ctx, "SELECT id, connection FROM releases WHERE step_id=? AND step_revision=? AND state=? ORDER BY at, id LIMIT 1", r.StepID, f.revision, releasePending).Scan(&f.release, &f.pin) |
| f.pending = err == nil |
| if errors.Is(err, sql.ErrNoRows) { |
| err = nil |
| @@ -354,7 +357,7 @@ func (c *Conns) decide(ctx context.Context, r stepRow, role string, kept keptRef |
| if err != nil { |
| return d, err |
| } |
| - d.d = schedule.Decide(d.in) |
| + d.d = decidePinned(d.in, d.step.pin) |
| if d.d.Run { |
| // A metered connection runs the pair's model (§16.3). |
| d.binding = withModel(d.by[d.d.Connection], d.d.Model, d.d.Family) |
| @@ -605,7 +608,7 @@ func (s *State) Release(ctx context.Context, frameID string, cmd wire.ReleaseCom |
| if n > 0 && granted == 0 { |
| state, kept = releasePending, true |
| } |
| - _, err = t.ExecContext(ctx, "INSERT INTO releases(id, person, task_id, step_id, step_revision, state, at) VALUES(?,?,?,?,?,?,?) ON CONFLICT(id) DO NOTHING", cmd.ID, cmd.Person, cmd.TaskID, cmd.StepID, cmd.StepRevision, state, now()) |
| + _, err = t.ExecContext(ctx, "INSERT INTO releases(id, person, task_id, step_id, step_revision, state, at, connection) VALUES(?,?,?,?,?,?,?,?) ON CONFLICT(id) DO NOTHING", cmd.ID, cmd.Person, cmd.TaskID, cmd.StepID, cmd.StepRevision, state, now(), cmd.Connection) |
| return err |
| }) |
| return kept, err |
| @@ -682,7 +685,7 @@ func acceptScheduled(t *sql.Tx, d wire.DispatchCommand) error { |
| if granted > 0 { |
| state = releaseIgnored |
| } |
| - _, err = t.Exec("INSERT INTO releases(id, person, task_id, step_id, step_revision, state, at) VALUES(?,?,?,?,?,?,?) ON CONFLICT(id) DO NOTHING", d.Release, d.Person, d.TaskID, d.StepID, d.Attempt, state, now()) |
| + _, err = t.Exec("INSERT INTO releases(id, person, task_id, step_id, step_revision, state, at, connection) VALUES(?,?,?,?,?,?,?,?) ON CONFLICT(id) DO NOTHING", d.Release, d.Person, d.TaskID, d.StepID, d.Attempt, state, now(), d.ReleaseConnection) |
| return err |
| } |
| @@ -709,3 +712,26 @@ func (c *Conns) preferenceIn(ctx context.Context, q querier, person string) (wir |
| } |
| return p, nil |
| } |
| + |
| +// decidePinned is Decide for a step whose Run now is pinned (protocol |
| +// 29): what the step would do without the leave first; if that holds, |
| +// the leave on the pinned connection alone (schedule.DecidePinned); if |
| +// that holds too, the step keeps the hold it would have had, so it still |
| +// waits for its own connection's reset and the person's other plans are |
| +// never billed in its place. A release with no pin is leave anywhere, as |
| +// before. |
| +func decidePinned(in schedule.Input, pin string) schedule.Decision { |
| + if pin == "" || in.Step.Release == "" { |
| + return schedule.Decide(in) |
| + } |
| + without := in |
| + without.Step.Release = "" |
| + held := schedule.Decide(without) |
| + if held.Run { |
| + return held |
| + } |
| + if d := schedule.DecidePinned(in, pin); d.Run { |
| + return d |
| + } |
| + return held |
| +} |
diff --git a/internal/runner/thin/schedule_test.go b/internal/runner/thin/schedule_test.go| index c9d2a3a2..4c527a47 100644 |
| --- a/internal/runner/thin/schedule_test.go |
| +++ b/internal/runner/thin/schedule_test.go |
| @@ -49,7 +49,7 @@ func newSchedRig(t *testing.T, subs ...string) *schedRig { |
| var bs []map[string]any |
| for _, id := range subs { |
| provider := id[:len(id)-2] |
| - bs = append(bs, map[string]any{"id": id, "local_id": id, "label": id, "person_id": connPerson, "provider": provider, "family": provider, "model": "m", "account_id": id + "@example.com", "provider_home": filepath.Join(root, id), "kind": "subscription", "expected_identity": map[string]string{"account_id": id + "@example.com", "home_id": "h", "provider_version": "1"}}) |
| + bs = append(bs, map[string]any{"id": id, "local_id": id, "label": id, "person_id": connPerson, "provider": provider, "family": provider, "model": "m", "account_id": id + "@example.com", "provider_home": filepath.Join(root, id), "kind": "subscription", "expected_identity": map[string]string{"account_id": id + "@example.com", "home_id": "h-" + id, "provider_version": "1"}}) |
| } |
| raw, _ := json.Marshal(bs) |
| bindings := filepath.Join(root, "bindings.json") |
diff --git a/internal/runner/thin/state.go b/internal/runner/thin/state.go| index e215ddc2..62cdf0d4 100644 |
| --- a/internal/runner/thin/state.go |
| +++ b/internal/runner/thin/state.go |
| @@ -89,6 +89,12 @@ func OpenState(ctx context.Context, dir string) (*State, error) { |
| // Added in slice 3 review: a step's namespace and the ending it |
| // reported while its termination is still to be proven. |
| // Added in slice 4 review: the task branch head last reported. |
| + // A Run now's pinned connection (protocol 29, paused work): "" is |
| + // leave on any connection, as every release before it. |
| + if _, err = d.ExecContext(ctx, "ALTER TABLE releases ADD COLUMN connection TEXT NOT NULL DEFAULT ''"); err != nil && !strings.Contains(err.Error(), "duplicate column") { |
| + d.Close() |
| + return nil, err |
| + } |
| if _, err = d.ExecContext(ctx, "ALTER TABLE watches ADD COLUMN seen_head TEXT NOT NULL DEFAULT ''"); err != nil && !strings.Contains(err.Error(), "duplicate column") { |
| d.Close() |
| return nil, err |
diff --git a/internal/schedule/pinned_test.go b/internal/schedule/pinned_test.go| new file mode 100644 |
| index 00000000..795bdf89 |
| --- /dev/null |
| +++ b/internal/schedule/pinned_test.go |
| @@ -0,0 +1,51 @@ |
| +package schedule |
| + |
| +import ( |
| + "testing" |
| + "time" |
| +) |
| + |
| +// A pinned release (paused work, B1): Run now's leave on the one |
| +// connection the person was told it would use. Fable's scenario: Review |
| +// is held (Engineering ran on Claude), Codex is at its limit, Claude is |
| +// 85% used, and TensorX has budget. Unpinned leave takes TensorX (another |
| +// family, metered) and bills; pinned to Claude it runs on Claude, and |
| +// pinned to a connection that cannot take it, it holds: never another. |
| +func TestDecidePinned(t *testing.T) { |
| + eng := &Engineer{ID: "claude-1", Family: "claude", Account: "claude-1"} |
| + codex := sub("codex-1", "codex", 1.0) |
| + codex.State, codex.LimitedUntil = StateLimited, *at(9 * time.Hour) |
| + review := Step{Role: RoleReview, Engineer: eng, Release: "r"} |
| + conns := []Conn{sub("claude-1", "claude", 0.85), codex, meter("tensorx-1", 0, 0)} |
| + if d := Decide(in(review, conns...)); d.Connection != "tensorx-1" || d.Reason != ReasonMeteredRelease { |
| + t.Fatalf("unpinned leave: %+v", d) |
| + } |
| + if d := DecidePinned(in(review, conns...), "claude-1"); !d.Run || d.Connection != "claude-1" { |
| + t.Fatalf("pinned to Claude: %+v", d) |
| + } |
| + // Pinned to a connection that has no room even with leave (stale |
| + // reading: it filled since): held, not moved to TensorX. |
| + full := sub("claude-1", "claude", 1.0) |
| + full.State, full.LimitedUntil = StateLimited, *at(2 * time.Hour) |
| + if d := DecidePinned(in(review, full, codex, meter("tensorx-1", 0, 0)), "claude-1"); d.Run { |
| + t.Fatalf("pinned to a full connection ran: %+v", d) |
| + } |
| + // A kept metered session is not kept when the pin names another. |
| + fix := Step{Role: RoleEngineering, Kept: "tensorx-1", KeptModel: glm53.ID, Release: "r"} |
| + if d := DecidePinned(in(fix, sub("claude-1", "claude", 0.85), meter("tensorx-1", 0, 0)), "claude-1"); d.Connection != "claude-1" { |
| + t.Fatalf("pinned past a kept metered session: %+v", d) |
| + } |
| + // Pinned to a metered connection: it runs there with its model, the |
| + // bars applying. |
| + if d := DecidePinned(in(fix, sub("claude-1", "claude", 1.0), meter("tensorx-1", 0, 0)), "tensorx-1"); d.Connection != "tensorx-1" || d.Model != glm53.ID { |
| + t.Fatalf("pinned metered: %+v", d) |
| + } |
| + if d := DecidePinned(in(fix, meter("tensorx-1", 2_000_000, 0)), "tensorx-1"); d.Run || d.Reason != ReasonBudget { |
| + t.Fatalf("pinned metered at its budget: %+v", d) |
| + } |
| + // An avoided pin is not taken (failover keeps its bar). |
| + avoided := Step{Role: RoleEngineering, Release: "r", Avoid: []string{"claude-1"}} |
| + if d := DecidePinned(in(avoided, sub("claude-1", "claude", 0.1), meter("tensorx-1", 0, 0)), "claude-1"); d.Run { |
| + t.Fatalf("pinned to an avoided connection ran: %+v", d) |
| + } |
| +} |
diff --git a/internal/schedule/schedule.go b/internal/schedule/schedule.go| index fbd912ba..eb7074ea 100644 |
| --- a/internal/schedule/schedule.go |
| +++ b/internal/schedule/schedule.go |
| @@ -824,3 +824,26 @@ func nonNil(t *time.Time) []time.Time { |
| } |
| return []time.Time{*t} |
| } |
| + |
| +// DecidePinned is Run now's leave pinned to one connection (paused work, |
| +// 2026-11-24): the person was told it would run on pin, so it runs there |
| +// or nowhere. Decide reads only that connection, with the release's leave; |
| +// a kept session on another connection is not kept, and the bars (usable, |
| +// avoided, a metered connection's spend, budget and slot) still apply. |
| +// Every other rule of Decide is unchanged. |
| +func DecidePinned(in Input, pin string) Decision { |
| + var only []Conn |
| + for _, c := range in.Conns { |
| + if c.ID == pin { |
| + only = append(only, c) |
| + } |
| + } |
| + in.Conns = only |
| + if in.Step.Kept != pin { |
| + in.Step.Kept, in.Step.KeptModel = "", "" |
| + } |
| + if in.Step.Release == "" { |
| + in.Step.Release = "pinned" |
| + } |
| + return Decide(in) |
| +} |
diff --git a/internal/thintest/assistant_paused_contract_test.go b/internal/thintest/assistant_paused_contract_test.go| index 666e8c7c..336c1ae6 100644 |
| --- a/internal/thintest/assistant_paused_contract_test.go |
| +++ b/internal/thintest/assistant_paused_contract_test.go |
| @@ -63,6 +63,13 @@ func (o *teamRig) jobKnowing(request, what string, match func(wire.AssistantCard |
| func TestContractPausedJob(t *testing.T) { |
| o := newTeamRigAt(t, wire.ProtocolCurrent) |
| reset := time.Now().Add(9*time.Hour + 30*time.Second).UTC().Truncate(time.Minute) |
| + // Never on local midnight, which reads "midnight" (review N11). |
| + for _, zone := range []string{"Europe/Dublin", "Asia/Tokyo"} { |
| + loc, _ := time.LoadLocation(zone) |
| + if l := reset.In(loc); l.Hour() == 0 && l.Minute() == 0 { |
| + reset = reset.Add(time.Minute) |
| + } |
| + } |
| o.pausedConnections(reset) |
| request, id, d := o.startedInThread("pz") |
| o.reply(o.handoffTurn(request)) |
diff --git a/internal/thintest/housekeeping_contract_test.go b/internal/thintest/housekeeping_contract_test.go| index fbc39bd3..51bd22aa 100644 |
| --- a/internal/thintest/housekeeping_contract_test.go |
| +++ b/internal/thintest/housekeeping_contract_test.go |
| @@ -410,14 +410,16 @@ func TestContractHousekeepingAutoDisable(t *testing.T) { |
| // the person's first message. |
| func TestContractHousekeepingQuietHours(t *testing.T) { |
| r := newToolRig(t) |
| - day := time.Now().UTC().Truncate(24 * time.Hour) |
| - r.clock(day.Add(2 * time.Hour)) |
| + // In Madrid (an hour ahead of UTC, two in summer), on the local clock, |
| + // so it holds on any date (review S5). |
| + l := zoneClock(t, r.client, r.ctx, "Europe/Madrid") |
| + r.clock(l.at(0, 2, 0)) |
| _, fold := r.pair("q1", "Swipe back from the edge doesn't work") |
| if n := r.tidy(); n != 1 { |
| t.Fatalf("combined %d", n) |
| } |
| a := r.action(fold) |
| - if a.VisibleAt == nil || !a.VisibleAt.Equal(day.Add(8*time.Hour)) { |
| + if a.VisibleAt == nil || !a.VisibleAt.Equal(l.at(0, 8, 0)) { |
| t.Fatalf("visible at %v", a.VisibleAt) |
| } |
| receipt := func() *wire.Card { |
| @@ -431,12 +433,12 @@ func TestContractHousekeepingQuietHours(t *testing.T) { |
| if receipt() != nil { |
| t.Fatal("the receipt showed during quiet hours") |
| } |
| - r.clock(day.Add(7*time.Hour + 59*time.Minute)) |
| + r.clock(l.at(0, 7, 59)) |
| r.tick() |
| if receipt() != nil { |
| t.Fatal("the receipt showed before 08:00") |
| } |
| - r.clock(day.Add(8 * time.Hour)) |
| + r.clock(l.at(0, 8, 0)) |
| r.tick() |
| c := receipt() |
| if c == nil { |
| @@ -446,13 +448,13 @@ func TestContractHousekeepingQuietHours(t *testing.T) { |
| r.wait("receipt event", func(cv *Conversation) bool { return cv.Cards[c.ID].ID != "" }) |
| // At 23:00: the person's first message shows it. |
| - r.clock(day.Add(23 * time.Hour)) |
| + r.clock(l.at(0, 23, 0)) |
| _, fold2 := r.pair("q2", "Timeline jumps when images load") |
| if n := r.tidy(); n != 1 { |
| t.Fatalf("second combined %d", n) |
| } |
| a2 := r.action(fold2) |
| - if a2.VisibleAt == nil || !a2.VisibleAt.Equal(day.Add(32*time.Hour)) { |
| + if a2.VisibleAt == nil || !a2.VisibleAt.Equal(l.at(1, 8, 0)) { |
| t.Fatalf("second visible at %v", a2.VisibleAt) |
| } |
| for _, c := range r.snapshotCards() { |
| @@ -481,17 +483,17 @@ func TestContractHousekeepingQuietHours(t *testing.T) { |
| if _, err := r.client.SetQuiet(r.ctx, false, 24, 3, h.Revision); Status(err) != 422 { |
| t.Fatalf("an hour past 23: %v", err) |
| } |
| - r.clock(day.Add(37 * time.Hour)) |
| + r.clock(l.at(1, 13, 0)) |
| _, fold3 := r.pair("q3", "Compose sheet keyboard covers the send button") |
| r.tidy() |
| - if a3 := r.action(fold3); a3.VisibleAt == nil || !a3.VisibleAt.Equal(day.Add(38*time.Hour)) { |
| + if a3 := r.action(fold3); a3.VisibleAt == nil || !a3.VisibleAt.Equal(l.at(1, 14, 0)) { |
| t.Fatalf("own window: %v", a3.VisibleAt) |
| } |
| // None: From equal to Until. |
| if _, err := r.client.SetQuiet(r.ctx, false, 0, 0, r.housekeeping().Revision); err != nil { |
| t.Fatal(err) |
| } |
| - r.clock(day.Add(50 * time.Hour)) |
| + r.clock(l.at(2, 2, 0)) |
| _, fold4 := r.pair("q4", "Crash on launch after the update") |
| r.tidy() |
| if a4 := r.action(fold4); a4.VisibleAt != nil { |
| @@ -600,35 +602,36 @@ func TestContractHousekeepingPauseHoldsReceipts(t *testing.T) { |
| // them to end, as receipts do, and is posted once. |
| func TestContractHousekeepingDigestSchedule(t *testing.T) { |
| r := newToolRig(t) |
| - day := time.Now().UTC().Truncate(24 * time.Hour) |
| - r.clock(day.Add(8*time.Hour + 30*time.Minute)) |
| + // In Madrid, on the local clock (review S5). |
| + l := zoneClock(t, r.client, r.ctx, "Europe/Madrid") |
| + r.clock(l.at(0, 8, 30)) |
| r.tick() |
| if d := r.digests(); len(d) != 0 { |
| t.Fatalf("a digest with nothing to say: %+v", d) |
| } |
| - r.clock(day.Add(9 * time.Hour)) |
| + r.clock(l.at(0, 9, 0)) |
| r.pair("d1", "Swipe back from the edge doesn't work") |
| r.tidy() |
| - r.clock(day.Add(9*time.Hour + 30*time.Minute)) |
| + r.clock(l.at(0, 9, 30)) |
| r.tick() |
| if d := r.digests(); len(d) != 1 || !strings.Contains(d[0].Question, "Tidied 1 thing.") { |
| t.Fatalf("the empty morning used up the day: %+v", d) |
| } |
| // The next day, nothing ticks until 23:00, after an action at 22:30: |
| // the digest waits for 08:00. |
| - r.clock(day.Add(46*time.Hour + 30*time.Minute)) |
| + r.clock(l.at(1, 22, 30)) |
| r.pair("d2", "Timeline jumps when images load") |
| r.tidy() |
| - r.clock(day.Add(47 * time.Hour)) |
| + r.clock(l.at(1, 23, 0)) |
| r.tick() |
| if d := r.digests(); len(d) != 1 { |
| t.Fatalf("a digest in quiet hours: %+v", d) |
| } |
| - r.clock(day.Add(56 * time.Hour)) |
| + r.clock(l.at(2, 8, 0)) |
| r.tick() |
| r.tick() |
| d := r.digests() |
| - if len(d) != 2 || d[1].VisibleAt == nil || !d[1].VisibleAt.Equal(day.Add(56*time.Hour)) { |
| + if len(d) != 2 || d[1].VisibleAt == nil || !d[1].VisibleAt.Equal(l.at(2, 8, 0)) { |
| t.Fatalf("the held digest at 08:00: %+v", d) |
| } |
| } |
diff --git a/internal/thintest/paused_browser_test.go b/internal/thintest/paused_browser_test.go| index f524cfc0..55d1c230 100644 |
| --- a/internal/thintest/paused_browser_test.go |
| +++ b/internal/thintest/paused_browser_test.go |
| @@ -25,8 +25,12 @@ import ( |
| // pause's ground; and Run it now with Codex is on the card and writes |
| // Run now's release. Set EQUIPO_BROWSER_ARTIFACTS for the screenshots. |
| func TestBrowserPausedWork(t *testing.T) { |
| - r := newToolRigAt(t, wire.ProtocolScheduler) |
| + r := newToolRigAt(t, wire.ProtocolCurrent) |
| reset := time.Now().Add(9*time.Hour + 30*time.Second).UTC().Truncate(time.Minute) |
| + // Never on local midnight, which reads "midnight" (review N11). |
| + if madrid, _ := time.LoadLocation("Europe/Madrid"); reset.In(madrid).Hour() == 0 && reset.In(madrid).Minute() == 0 { |
| + reset = reset.Add(time.Minute) |
| + } |
| var runner string |
| if err := r.inst.DB.Writer().QueryRow("SELECT runner_id FROM runner_sessions LIMIT 1").Scan(&runner); err != nil { |
| t.Fatal(err) |
diff --git a/internal/thintest/rollup_pages_test.go b/internal/thintest/rollup_pages_test.go| index c8ee5063..a250910f 100644 |
| --- a/internal/thintest/rollup_pages_test.go |
| +++ b/internal/thintest/rollup_pages_test.go |
| @@ -77,6 +77,7 @@ func cutOut(t *testing.T, page, from, to string) string { |
| type rollupRig struct { |
| *toolRig |
| today, yesterday time.Time |
| + loc *time.Location |
| asked, merged string |
| askCard wire.Card |
| lastWord, firstDay string |
| @@ -85,6 +86,8 @@ type rollupRig struct { |
| func newRollupRig(t *testing.T) *rollupRig { |
| r := &rollupRig{toolRig: newToolRigAt(t, wire.ProtocolInjectionDefences)} |
| ctx := r.ctx |
| + // In Madrid, so the day's edges are not UTC's on any date (review S5). |
| + r.loc = zoneClock(t, r.client, ctx, "Europe/Madrid").loc |
| base := strings.Repeat("1", 40) |
| r.asked = r.judgedTask("w", "Swipe back on iOS", base, strings.Repeat("2", 40), wire.ChecksCannotRun, "needs_macos") |
| r.askCard = r.mergeCardsWait(r.asked) |
| @@ -100,7 +103,7 @@ func newRollupRig(t *testing.T) *rollupRig { |
| r.next("Leave the iOS one until a Mac is free.") |
| // All of that was yesterday, around midday. |
| r.today = chat.DayStart(r.inst.Store.Chat().Now(), r.inst.Store.Chat().Zone(Owner)) |
| - r.yesterday = r.today.AddDate(0, 0, -1) |
| + r.yesterday = chat.DayStart(r.today.Add(-time.Hour), r.loc) |
| r.backdate(r.inst.Store.Chat().Now().Sub(r.yesterday.Add(12 * time.Hour))) |
| r.lastWord = r.messageID("Leave the iOS one until a Mac is free.") |
| r.setAt("chat_messages", "created_at", "id = ?", r.lastWord, r.today.Add(-time.Nanosecond)) |
| @@ -110,7 +113,7 @@ func newRollupRig(t *testing.T) *rollupRig { |
| return r |
| } |
| -func (r *rollupRig) key(d time.Time) string { return d.Format("2006-01-02") } |
| +func (r *rollupRig) key(d time.Time) string { return d.In(r.loc).Format("2006-01-02") } |
| // TestRollupDayBox: once a day is over in the person's zone it is one |
| // day box at its place in the scrollback: its date, what was started, |
| @@ -123,7 +126,7 @@ func TestRollupDayBox(t *testing.T) { |
| r := newRollupRig(t) |
| page := r.get(r.inst.Cookie(), "/conversation", 200) |
| y, today := r.key(r.yesterday), r.key(r.today) |
| - if !strings.Contains(page, `<li equipo-rollup id="day-`+y+`" data-day="`+y+`">`) || !strings.Contains(page, `<time datetime="`+y+`">`+r.yesterday.Format("Monday 2 January")+`</time>`) { |
| + if !strings.Contains(page, `<li equipo-rollup id="day-`+y+`" data-day="`+y+`">`) || !strings.Contains(page, `<time datetime="`+y+`">`+r.yesterday.In(r.loc).Format("Monday 2 January")+`</time>`) { |
| t.Fatalf("no box for yesterday: %s", page) |
| } |
| if strings.Contains(page, `id="day-`+today+`"`) || strings.Count(page, "<li equipo-rollup ") != 1 { |
diff --git a/internal/thintest/scheduler_contract_test.go b/internal/thintest/scheduler_contract_test.go| index 34c37b20..0659f1be 100644 |
| --- a/internal/thintest/scheduler_contract_test.go |
| +++ b/internal/thintest/scheduler_contract_test.go |
| @@ -90,8 +90,9 @@ func TestContractScheduler(t *testing.T) { |
| } |
| pages := &toolRig{rig: r.rig} |
| owner := r.inst.Cookie() |
| - // Paused, with Run now naming what it would use (paused work). |
| - if page := pages.get(owner, "/tasks/"+id, 200); !strings.Contains(page, "<strong>Paused until ") || !strings.Contains(page, "your Claude allowance has run out.") || !strings.Contains(page, `data-pause-act="run-now"`) || !strings.Contains(page, "Run it now on Claude") || !strings.Contains(page, "Low priority") || !strings.Contains(page, "set from your message") || !strings.Contains(page, "data-task-urgent") { |
| + // Paused, with plain Run now: this runner (protocol 14) cannot be held |
| + // to one connection, so nothing is promised (paused work review B1). |
| + if page := pages.get(owner, "/tasks/"+id, 200); !strings.Contains(page, "<strong>Paused until ") || !strings.Contains(page, "your Claude allowance has run out.") || !strings.Contains(page, `data-pause-act="run-now"`) || !strings.Contains(page, "Run it now anyway") || strings.Contains(page, "has room now") || !strings.Contains(page, "Low priority") || !strings.Contains(page, "set from your message") || !strings.Contains(page, "data-task-urgent") { |
| t.Fatal("the task page lacks the pause, Run now or the priority") |
| } |
| // No reset in sight: Needs you, with Equipo's recommendation. |
| @@ -166,8 +167,9 @@ func TestContractScheduler(t *testing.T) { |
| if c := body.(*wire.ReleaseCommand); c.ID != rel.Release || c.StepID != d.StepID || c.StepRevision != 1 || c.TaskID != id || c.Person != Owner { |
| t.Fatalf("release %+v", c) |
| } |
| - if again, err := r.client.RunNow(ctx, id, wire.RunNow{Step: d.StepID, StepRevision: 1}); err != nil || again.Release != rel.Release { |
| - t.Fatalf("a second tap: %+v %v", again, err) |
| + // A second tap is told it is on its way, not answered as new (review S2). |
| + if _, err := r.client.RunNow(ctx, id, wire.RunNow{Step: d.StepID, StepRevision: 1}); Status(err) != 409 || !strings.Contains(err.Error(), "already_running") { |
| + t.Fatalf("a second tap: %v", err) |
| } |
| if n := r.frames(wire.FrameRelease); n != 1 { |
| t.Fatalf("%d releases written", n) |
diff --git a/internal/thintest/zone.go b/internal/thintest/zone.go| new file mode 100644 |
| index 00000000..80adb6e6 |
| --- /dev/null |
| +++ b/internal/thintest/zone.go |
| @@ -0,0 +1,41 @@ |
| +package thintest |
| + |
| +import ( |
| + "context" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// PutTimeZone is PUT /api/v1/time-zone: the person's zone, as their |
| +// device says it. |
| +func (c *Client) PutTimeZone(ctx context.Context, zone string) (out wire.TimeZone, err error) { |
| + return out, c.do(ctx, "PUT", "/api/v1/time-zone", wire.TimeZone{TimeZone: zone}, &out) |
| +} |
| + |
| +// localClock is a person's zone, for tests that must hold on any date: |
| +// at(d, h) is h o'clock d days after today, on the local clock. |
| +type localClock struct { |
| + loc *time.Location |
| + today time.Time |
| +} |
| + |
| +// zoneClock sets the person's zone and reads today's date in it. |
| +func zoneClock(t *testing.T, c *Client, ctx context.Context, zone string) localClock { |
| + t.Helper() |
| + if _, err := c.PutTimeZone(ctx, zone); err != nil { |
| + t.Fatal(err) |
| + } |
| + loc, err := time.LoadLocation(zone) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + n := time.Now().In(loc) |
| + return localClock{loc: loc, today: time.Date(n.Year(), n.Month(), n.Day(), 0, 0, 0, 0, loc)} |
| +} |
| + |
| +// at is h:m o'clock d days after today, on the local clock, in UTC. |
| +func (l localClock) at(d, h, m int) time.Time { |
| + return time.Date(l.today.Year(), l.today.Month(), l.today.Day()+d, h, m, 0, 0, l.loc).UTC() |
| +} |
diff --git a/internal/wire/assistant_test.go b/internal/wire/assistant_test.go| index 055f8a7b..bd7e99ae 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) != 28 || wire.ProtocolCurrent != wire.ProtocolInjectionDefences || 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) != 29 || wire.ProtocolCurrent != wire.ProtocolPinnedRelease || 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/injection_test.go b/internal/wire/injection_test.go| index 7bdcd2a9..ac4325fa 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 != 28 { |
| + if wire.ProtocolInjectionDefences != 28 || wire.ProtocolCurrent != 29 { |
| t.Fatal("injection guarantees require protocol 28") |
| } |
| - for version, want := range map[int]int{26: 26, 27: 27, 28: 28, 99: 28} { |
| + for version, want := range map[int]int{26: 26, 27: 27, 28: 28, 29: 29, 99: 29} { |
| 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 0170ec6d..195b6574 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.Protocol28 { |
| + if wire.ProtocolMetered != wire.Protocol12 || wire.ProtocolResearch != wire.Protocol13 || wire.ProtocolCurrent != wire.Protocol29 { |
| 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 1e2b49ac..8cfe64b0 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.Protocol28 { |
| + if wire.ProtocolModels != wire.Protocol18 || wire.ProtocolCurrent != wire.Protocol29 { |
| 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 2bee58b2..b4806cde 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.Protocol28 { |
| + if wire.ProtocolOpenCode != wire.Protocol17 || wire.ProtocolCurrent != wire.Protocol29 { |
| 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| new file mode 100644 |
| index 00000000..9e602f3c |
| --- /dev/null |
| +++ b/internal/wire/pinned_release_test.go |
| @@ -0,0 +1,45 @@ |
| +package wire_test |
| + |
| +import ( |
| + "errors" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// A pinned Run now (protocol 29, paused work): an older runner would |
| +// honour the leave on any connection, metered included, so it is never |
| +// handed one. A pinned release frame is refused below 29; a dispatch |
| +// 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.Protocol29 { |
| + 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"}) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := wire.Encode(pinned, wire.Protocol28); !errors.Is(err, wire.ErrProtocol) { |
| + t.Fatalf("a pinned release to protocol 28: %v", err) |
| + } |
| + if out, err := wire.Encode(pinned, wire.Protocol29); err != nil || string(out.Data) != string(pinned.Data) { |
| + t.Fatalf("at 29: %s %v", out.Data, err) |
| + } |
| + plain, _ := wire.NewFrame("f2", wire.FrameRelease, wire.ReleaseCommand{ID: "rl_2", Person: "p", TaskID: "tk1", StepID: "s1", StepRevision: 1}) |
| + if out, err := wire.Encode(plain, wire.Protocol28); err != nil || string(out.Data) != string(plain.Data) { |
| + t.Fatalf("an unpinned release to 28: %s %v", out.Data, err) |
| + } |
| + d, _ := wire.NewFrame("f3", wire.FrameDispatch, wire.DispatchCommand{Person: "p", TaskID: "tk1", StepID: "s1", Attempt: 1, Specialist: wire.SpecialistEngineering, Release: "rl_1", ReleaseConnection: "claude-1"}) |
| + out, err := wire.Encode(d, wire.Protocol28) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + body, err := out.Decode() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if v := body.(*wire.DispatchCommand); v.Release != "" || v.ReleaseConnection != "" { |
| + t.Fatalf("a pinned dispatch to 28 kept leave: %+v", v) |
| + } |
| +} |
diff --git a/internal/wire/publish_test.go b/internal/wire/publish_test.go| index fb1f0d1f..129d9f2e 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.Protocol28 { |
| + if wire.ProtocolPublish != wire.Protocol16 || wire.ProtocolCurrent != wire.Protocol29 { |
| 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 4f73d801..1d82a593 100644 |
| --- a/internal/wire/runners.go |
| +++ b/internal/wire/runners.go |
| @@ -54,6 +54,7 @@ const ( |
| Protocol26 = 26 |
| Protocol27 = 27 |
| Protocol28 = 28 |
| + Protocol29 = 29 |
| // ProtocolSpend is the first protocol with a fix round's Feedback and |
| // a usage row's Turns; Encode drops both below it. |
| ProtocolSpend = Protocol3 |
| @@ -178,7 +179,16 @@ const ( |
| ProtocolPlacement = Protocol25 |
| ProtocolAccess = Protocol26 |
| ProtocolInjectionDefences = Protocol28 |
| - ProtocolCurrent = ProtocolInjectionDefences |
| + // ProtocolPinnedRelease is the first protocol whose Run now names the |
| + // connection the person was told it would use (paused work, |
| + // 2026-11-24): ReleaseCommand.Connection and a dispatch's |
| + // ReleaseConnection. The runner admits such a release only there. |
| + // Below it Encode refuses a pinned release frame and drops a pinned |
| + // dispatch's release with its pin: an older runner would honour the |
| + // leave anywhere, metered included, so it is never handed one. The |
| + // instance offers an older runner plain Run now, with no promise. |
| + ProtocolPinnedRelease = Protocol29 |
| + ProtocolCurrent = ProtocolPinnedRelease |
| ) |
| // Runner roles. A person's first runner is the primary: the coordinator, |
| @@ -608,6 +618,15 @@ func Encode(f Frame, protocol int) (Frame, error) { |
| return Frame{}, ErrProtocol |
| } |
| changed := false |
| + if protocol < ProtocolPinnedRelease { |
| + if v, ok := body.(*ReleaseCommand); ok && v.Connection != "" { |
| + return Frame{}, fmt.Errorf("%w: a pinned release at protocol %d", ErrProtocol, protocol) |
| + } |
| + if d, ok := body.(*DispatchCommand); ok && d.ReleaseConnection != "" { |
| + d.Release, d.ReleaseConnection = "", "" |
| + changed = true |
| + } |
| + } |
| if protocol < ProtocolInjectionDefences { |
| // Older runners consume fix-round context from Brief, including runners |
| // that predate the separate Feedback field. Protocol 28 keeps sources apart. |
diff --git a/internal/wire/runners_test.go b/internal/wire/runners_test.go| index 30fc973b..d7f2be8e 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.ProtocolInjectionDefences || 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.ProtocolPinnedRelease || 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.go b/internal/wire/schedule.go| index c97abae7..3ee22164 100644 |
| --- a/internal/wire/schedule.go |
| +++ b/internal/wire/schedule.go |
| @@ -104,12 +104,17 @@ const FrameRelease = "release" |
| // ReleaseCommand is a release. StepRevision is the dispatch it is for: |
| // the attempt the instance sent (failover attempts the runner makes keep |
| // it). |
| +// |
| +// Connection (protocol 29) pins it: the runner's local id of the one |
| +// connection the person was told Run now would use; the runner admits the |
| +// step only there, or keeps holding it. "" is leave on any connection. |
| type ReleaseCommand struct { |
| ID string `json:"id"` |
| Person string `json:"person"` |
| TaskID string `json:"task_id"` |
| StepID string `json:"step_id"` |
| StepRevision int64 `json:"step_revision"` |
| + Connection string `json:"connection,omitempty"` |
| } |
| // FramePriority tells the runner a task's priority or deadline changed |
| @@ -183,10 +188,14 @@ type StepPaused struct { |
| // the hold names, whose last share it would use; LeftPercent is what is |
| // left of that one's fullest window. |
| type RunNowOffer struct { |
| - Connection string `json:"connection"` |
| - Provider string `json:"provider"` |
| - Name string `json:"name"` |
| - Billing string `json:"billing"` |
| + Connection string `json:"connection,omitempty"` |
| + Provider string `json:"provider,omitempty"` |
| + Name string `json:"name,omitempty"` |
| + Billing string `json:"billing,omitempty"` |
| Same bool `json:"same,omitempty"` |
| LeftPercent int `json:"left_percent,omitempty"` |
| + // Plain: the runner is below protocol 29 and cannot be held to one |
| + // connection, so Run now promises nothing (the other fields empty): |
| + // "Run it now anyway". |
| + Plain bool `json:"plain,omitempty"` |
| } |
diff --git a/internal/wire/schedule_test.go b/internal/wire/schedule_test.go| index 68d2b192..12bd0b98 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.Protocol28 { |
| + if wire.ProtocolScheduler != wire.Protocol14 || wire.ProtocolCurrent != wire.Protocol29 { |
| 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/tasks.go b/internal/wire/tasks.go| index 389f8d9c..2d8ed289 100644 |
| --- a/internal/wire/tasks.go |
| +++ b/internal/wire/tasks.go |
| @@ -729,6 +729,9 @@ type DispatchCommand struct { |
| Priority string `json:"priority,omitempty"` |
| By *time.Time `json:"by,omitempty"` |
| Release string `json:"release,omitempty"` |
| + // ReleaseConnection pins Release (protocol 29): the runner admits the |
| + // step on that connection only (ReleaseCommand.Connection). |
| + ReleaseConnection string `json:"release_connection,omitempty"` |
| // PriorityRevision orders the task's priority and deadline: the |
| // runner keeps a priority frame's value only while no dispatch carries |
| // a newer one. Housekeeping marks an attempt housekeeping dispatched: |
diff --git a/internal/wire/usage_test.go b/internal/wire/usage_test.go| index 3653be96..abf8bfa9 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.Protocol28 { |
| + if wire.ProtocolReadings != wire.Protocol15 || wire.ProtocolCurrent != wire.Protocol29 { |
| 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 ace1f756..352c2c00 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.ProtocolInjectionDefences || wire.Spoken(99) != 28 { |
| + if wire.ProtocolWarm != 24 || wire.ProtocolCurrent != wire.ProtocolPinnedRelease || wire.Spoken(99) != 29 { |
| 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/wiretest/testdata/api/task-held.json b/internal/wire/wiretest/testdata/api/task-held.json| index c73d7cf0..959b7066 100644 |
| --- a/internal/wire/wiretest/testdata/api/task-held.json |
| +++ b/internal/wire/wiretest/testdata/api/task-held.json |
| @@ -1 +1 @@ |
| -{"id":"tk0001","revision":5,"project_id":"p_0001","project":"Sample","repo":"amadan.net/oficina/sample","title":"Swipe back from the edge does nothing","brief":"Swiping from the left edge should go back a pane.","stage":"in_progress","branch":"equipo/tk0001-swipe-back-from-the-edge-does-nothing","base_sha":"1111111111111111111111111111111111111111","url":"https://amadan.net/oficina/sample?branch=equipo/tk0001-swipe-back-from-the-edge-does-nothing","creator":"owner@example.com","turn_id":"t_0001","findings":[{"id":"f_0001","headline":"Found it: the edge swipe never reaches the back handler.","text":"The edge-swipe handler returns false, so back never fires.","repo":"amadan.net/oficina/sample","path":"panes/swipe.go","line":4,"at":"2026-11-07T10:00:02Z"}],"steps":[{"id":"s_0001","revision":3,"task_id":"tk0001","index":1,"specialist":"engineering","state":"queued","reason":"","attempt":1,"base_sha":"1111111111111111111111111111111111111111","candidate_sha":"2222222222222222222222222222222222222222","pushed":true,"terminated":true,"summary":"EdgeSwipe now goes back on a swipe from the edge.","headline":"Fixed swipe-back from the edge.","log_tail":"Edit panes/swipe.go\nDone.","started_at":"2026-11-07T10:00:03Z","finished_at":"2026-11-07T10:01:40Z","round":0,"family":"claude","account":"claude-a","verdict":"","review_label":"","findings":[],"checks":"","gate":"","exit_code":null,"askable":true,"rebase":false,"merge_sha":"","into":"","strategy":"","without_checks":false,"switched":null,"activity":[{"kind":"read","subject":"panes/swipe.go","at":"2026-11-07T10:00:20Z"},{"kind":"edit","subject":"panes/swipe.go","at":"2026-11-07T10:01:02Z"},{"kind":"run","subject":"go test ./panes","at":"2026-11-07T10:01:20Z"}],"runner_id":"RUNNER1","runner_label":"","needs":[],"placement":"","publication":"","termination_kind":"namespace","hold":{"reason":"headroom","connection":"claude-a","provider":"claude","resets_at":"2026-11-16T10:00:00Z","wake_at":"2026-11-16T10:00:00Z","needs_person":"no_reset","step_revision":1},"paused":{"since":"2026-11-13T09:00:00Z","run_now":{"connection":"cn_claude_a","provider":"claude","name":"Claude","billing":"subscription","same":true}}}],"thread":[{"id":"e_0001","author":"owner@example.com","text":"It happens on the iPhone only.","at":"2026-11-07T10:00:30Z"}],"created_at":"2026-11-07T10:00:01Z","updated_at":"2026-11-07T10:01:40Z","candidate_sha":"2222222222222222222222222222222222222222","checks":"","checks_reason":"","verdict":"","review_label":"","needs_you":"held","fix_rounds":0,"branch_head":"","questions":[{"id":"q_0001","revision":3,"task_id":"tk0001","step_id":"s_0001","specialist":"engineering","asker":"owner@example.com","text":"What did you change and why?","state":"answered","reason":"","attempt":1,"answer":"I made the edge swipe return true, so a swipe from the left edge goes back a pane. Before, the handler always said no.","created_at":"2026-11-07T10:05:00Z","updated_at":"2026-11-07T10:05:09Z","timing":null}],"merged":null,"reports":0,"ask_open":false,"merge_offered":false,"creator_name":"Owner","source_message_id":"m_0001","source_at":"2026-11-07T09:59:58Z","duplicate_of":null,"coordinator":null,"folded":null,"combined":null,"engineering_runner":"RUNNER1","priority":{"priority":"low","by":"2026-11-20T17:00:00Z","set_by":"coordinator"}} |
| +{"id":"tk0001","revision":5,"project_id":"p_0001","project":"Sample","repo":"amadan.net/oficina/sample","title":"Swipe back from the edge does nothing","brief":"Swiping from the left edge should go back a pane.","stage":"in_progress","branch":"equipo/tk0001-swipe-back-from-the-edge-does-nothing","base_sha":"1111111111111111111111111111111111111111","url":"https://amadan.net/oficina/sample?branch=equipo/tk0001-swipe-back-from-the-edge-does-nothing","creator":"owner@example.com","turn_id":"t_0001","findings":[{"id":"f_0001","headline":"Found it: the edge swipe never reaches the back handler.","text":"The edge-swipe handler returns false, so back never fires.","repo":"amadan.net/oficina/sample","path":"panes/swipe.go","line":4,"at":"2026-11-07T10:00:02Z"}],"steps":[{"id":"s_0001","revision":3,"task_id":"tk0001","index":1,"specialist":"engineering","state":"queued","reason":"","attempt":1,"base_sha":"1111111111111111111111111111111111111111","candidate_sha":"2222222222222222222222222222222222222222","pushed":true,"terminated":true,"summary":"EdgeSwipe now goes back on a swipe from the edge.","headline":"Fixed swipe-back from the edge.","log_tail":"Edit panes/swipe.go\nDone.","started_at":"2026-11-07T10:00:03Z","finished_at":"2026-11-07T10:01:40Z","round":0,"family":"claude","account":"claude-a","verdict":"","review_label":"","findings":[],"checks":"","gate":"","exit_code":null,"askable":true,"rebase":false,"merge_sha":"","into":"","strategy":"","without_checks":false,"switched":null,"activity":[{"kind":"read","subject":"panes/swipe.go","at":"2026-11-07T10:00:20Z"},{"kind":"edit","subject":"panes/swipe.go","at":"2026-11-07T10:01:02Z"},{"kind":"run","subject":"go test ./panes","at":"2026-11-07T10:01:20Z"}],"runner_id":"RUNNER1","runner_label":"","needs":[],"placement":"","publication":"","termination_kind":"namespace","hold":{"reason":"headroom","connection":"claude-a","provider":"claude","resets_at":"2026-11-16T10:00:00Z","wake_at":"2026-11-16T10:00:00Z","needs_person":"no_reset","step_revision":1},"paused":{"since":"2026-11-13T09:00:00Z","run_now":{"plain":true}}}],"thread":[{"id":"e_0001","author":"owner@example.com","text":"It happens on the iPhone only.","at":"2026-11-07T10:00:30Z"}],"created_at":"2026-11-07T10:00:01Z","updated_at":"2026-11-07T10:01:40Z","candidate_sha":"2222222222222222222222222222222222222222","checks":"","checks_reason":"","verdict":"","review_label":"","needs_you":"held","fix_rounds":0,"branch_head":"","questions":[{"id":"q_0001","revision":3,"task_id":"tk0001","step_id":"s_0001","specialist":"engineering","asker":"owner@example.com","text":"What did you change and why?","state":"answered","reason":"","attempt":1,"answer":"I made the edge swipe return true, so a swipe from the left edge goes back a pane. Before, the handler always said no.","created_at":"2026-11-07T10:05:00Z","updated_at":"2026-11-07T10:05:09Z","timing":null}],"merged":null,"reports":0,"ask_open":false,"merge_offered":false,"creator_name":"Owner","source_message_id":"m_0001","source_at":"2026-11-07T09:59:58Z","duplicate_of":null,"coordinator":null,"folded":null,"combined":null,"engineering_runner":"RUNNER1","priority":{"priority":"low","by":"2026-11-20T17:00:00Z","set_by":"coordinator"}} |
diff --git a/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings b/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings| index f43a48f4..550d5af0 100644 |
| --- a/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings |
| +++ b/native/apple/Sources/EquipoActivity/Resources/Localizable.xcstrings |
| @@ -2466,6 +2466,17 @@ |
| } |
| } |
| }, |
| + "work.hold.run_now": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Run it now anyway" |
| + } |
| + } |
| + } |
| + }, |
| "work.pause.lead.no_connection": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -2488,6 +2499,17 @@ |
| } |
| } |
| }, |
| + "work.pause.lead.too_old": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Waiting for an update: the runner on %@ is too old for this step." |
| + } |
| + } |
| + } |
| + }, |
| "work.pause.moment": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -2549,7 +2571,7 @@ |
| "en": { |
| "stringUnit": { |
| "state": "translated", |
| - "value": "It carries on by itself when the Mac is back online." |
| + "value": "It carries on by itself when %@ is back online." |
| } |
| } |
| } |
| @@ -2576,6 +2598,17 @@ |
| } |
| } |
| }, |
| + "work.pause.next.update": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "It carries on by itself once the runner is updated." |
| + } |
| + } |
| + } |
| + }, |
| "work.pause.reason.budget": { |
| "extractionState": "manual", |
| "localizations": { |
diff --git a/native/apple/Sources/EquipoKit/API/Thin.swift b/native/apple/Sources/EquipoKit/API/Thin.swift| index 74cb4143..fb68ad4d 100644 |
| --- a/native/apple/Sources/EquipoKit/API/Thin.swift |
| +++ b/native/apple/Sources/EquipoKit/API/Thin.swift |
| @@ -122,12 +122,14 @@ public struct ThinPaused: Codable, Sendable, Equatable { |
| /// What Run now would use, as the instance predicts it. |
| public struct ThinRunNow: Codable, Sendable, Equatable { |
| - public var connection: String |
| - public var provider: String |
| - public var name: String |
| - public var billing: String |
| + public var connection: String? |
| + public var provider: String? |
| + public var name: String? |
| + public var billing: String? |
| public var same: Bool? |
| public var leftPercent: Int? |
| + /// The runner cannot be held to one connection: "Run it now anyway". |
| + public var plain: Bool? |
| } |
| public struct ThinTask: Codable, Sendable, Identifiable, Equatable { |
diff --git a/native/apple/Sources/EquipoKit/Presentation/Pause.swift b/native/apple/Sources/EquipoKit/Presentation/Pause.swift| index 15a035e3..8b2a670b 100644 |
| --- a/native/apple/Sources/EquipoKit/Presentation/Pause.swift |
| +++ b/native/apple/Sources/EquipoKit/Presentation/Pause.swift |
| @@ -38,20 +38,25 @@ extension TaskPause { |
| if !task.needsYou.isEmpty && !["retry", "held"].contains(task.needsYou) { return nil } |
| let words = TimeWords(now: now, zone: zone, locale: locale) |
| if step.state == "failed" { |
| - // Stopped, in red. The stop reasons' words are the web's; the |
| - // task page there says which. |
| + // A runner too old for the step waits for its update (amber), |
| + // as on the web; anything else stopped, in red. The stop |
| + // reasons' words are the web's; the task page there says which. |
| + if ["runner_outdated", "runner_too_old", "copy_update_required", "research_unsupported"].contains(step.reason), let machine = step.runnerLabel, !machine.isEmpty { |
| + self.init(tone: .warning, stop: EquipoStrings.text("work.stage.needs_you"), lead: Self.format(EquipoStrings.text("work.pause.lead.too_old"), machine), next: EquipoStrings.text("work.pause.next.update")) |
| + return |
| + } |
| self.init(tone: .negative, stop: EquipoStrings.text("work.stage.stopped"), lead: "", next: EquipoStrings.text("work.pause.next.try_again")) |
| return |
| } |
| guard ["queued", "running"].contains(step.state) else { return nil } |
| if step.paused?.offline == true { |
| guard let machine = step.runnerLabel, !machine.isEmpty else { |
| - self.init(tone: .paused, stop: EquipoStrings.text("work.stage.paused"), lead: "", next: EquipoStrings.text("work.pause.next.online")) |
| + self.init(tone: .paused, stop: EquipoStrings.text("work.stage.paused"), lead: "", next: "") |
| return |
| } |
| let reason = String(format: EquipoStrings.text("work.pause.reason.offline"), machine) |
| - let lead = step.paused?.since.map { Self.format("work.pause.since", words.clockOrDay($0), reason) } ?? Self.format("work.pause.moment", reason) |
| - self.init(tone: .paused, stop: EquipoStrings.text("work.stage.paused"), lead: lead, next: EquipoStrings.text("work.pause.next.online")) |
| + let lead = step.paused?.since.map { Self.format(EquipoStrings.text("work.pause.since"), words.clockOrDay($0), reason) } ?? Self.format(EquipoStrings.text("work.pause.moment"), reason) |
| + self.init(tone: .paused, stop: EquipoStrings.text("work.stage.paused"), lead: lead, next: String(format: EquipoStrings.text("work.pause.next.online"), machine)) |
| return |
| } |
| guard let hold = step.hold else { return nil } |
| @@ -62,7 +67,7 @@ extension TaskPause { |
| self.init(tone: .warning, stop: needs, lead: EquipoStrings.text("work.pause.lead.no_connection"), next: EquipoStrings.text("work.pause.next.choose")) |
| case "spend_unknown": |
| let next = String(format: EquipoStrings.text("work.pause.next.spend_unknown"), name, name) |
| - self.init(tone: .warning, stop: needs, lead: Self.format("work.pause.lead.spend_unknown", name), next: next) |
| + self.init(tone: .warning, stop: needs, lead: Self.format(EquipoStrings.text("work.pause.lead.spend_unknown"), name), next: next) |
| return |
| case _ where !(hold.needsPerson ?? "").isEmpty: |
| self.init(tone: .warning, stop: needs, lead: "", next: EquipoStrings.text("work.pause.next.choose")) |
| @@ -70,7 +75,7 @@ extension TaskPause { |
| self.init(tone: .paused, stop: paused, lead: Self.until(hold.wakeAt, since: step.paused?.since, reason: String(format: EquipoStrings.text("work.pause.reason.budget"), name), words: words), next: EquipoStrings.text("work.pause.next.budget")) |
| return |
| case "busy": |
| - self.init(tone: .paused, stop: paused, lead: Self.format("work.pause.moment", String(format: EquipoStrings.text("work.pause.reason.busy"), name)), next: EquipoStrings.text("work.pause.next.busy")) |
| + self.init(tone: .paused, stop: paused, lead: Self.format(EquipoStrings.text("work.pause.moment"), String(format: EquipoStrings.text("work.pause.reason.busy"), name)), next: EquipoStrings.text("work.pause.next.busy")) |
| return |
| default: |
| var reason = String(format: EquipoStrings.text("work.pause.reason.headroom_out"), name) |
| @@ -83,16 +88,19 @@ extension TaskPause { |
| } |
| if mine, let offer = step.paused?.runNow { |
| let label: String |
| - switch (offer.billing, offer.same ?? false) { |
| + switch (offer.billing ?? "", offer.same ?? false) { |
| + case _ where offer.plain == true: |
| + // An older runner cannot be held to one connection: no promise. |
| + label = EquipoStrings.text("work.hold.run_now") |
| case ("metered", _): |
| - label = String(format: EquipoStrings.text("work.pause.run_now_with"), offer.name) |
| - note = String(format: EquipoStrings.text("work.pause.run_now_metered"), offer.name) |
| + label = String(format: EquipoStrings.text("work.pause.run_now_with"), offer.name ?? "") |
| + note = String(format: EquipoStrings.text("work.pause.run_now_metered"), offer.name ?? "") |
| case (_, true): |
| - label = String(format: EquipoStrings.text("work.pause.run_now_on"), offer.name) |
| + label = String(format: EquipoStrings.text("work.pause.run_now_on"), offer.name ?? "") |
| if let left = offer.leftPercent, left > 0 { note = String(format: EquipoStrings.text("work.pause.run_now_last"), Int32(left)) } |
| default: |
| - label = String(format: EquipoStrings.text("work.pause.run_now_with"), offer.name) |
| - note = String(format: EquipoStrings.text("work.pause.run_now_room"), offer.name) |
| + label = String(format: EquipoStrings.text("work.pause.run_now_with"), offer.name ?? "") |
| + note = String(format: EquipoStrings.text("work.pause.run_now_room"), offer.name ?? "") |
| } |
| runNow = RunNow(label: label, step: step.id, revision: hold.stepRevision) |
| } |
| @@ -108,15 +116,14 @@ extension TaskPause { |
| /// "Paused until 21:00 tonight (in 9 hours): …", else since when it |
| /// was held, else for a moment. |
| private static func until(_ at: Date?, since: Date?, reason: String, words: TimeWords) -> (String, String) { |
| - if let at, at > words.now { return format("work.pause.until", words.when(at), words.inWords(at.timeIntervalSince(words.now)), reason) } |
| - if let since { return format("work.pause.since", words.clockOrDay(since), reason) } |
| - return format("work.pause.moment", reason) |
| + if let at, at > words.now { return format(EquipoStrings.text("work.pause.until"), words.when(at), words.inWords(at.timeIntervalSince(words.now)), reason) } |
| + if let since { return format(EquipoStrings.text("work.pause.since"), words.clockOrDay(since), reason) } |
| + return format(EquipoStrings.text("work.pause.moment"), reason) |
| } |
| /// The copy at key with args, split where its bold part ends: at its |
| /// first colon (kept) or its first " (" (not kept), as pause.Lead does. |
| - static func format(_ key: String, _ args: String...) -> (String, String) { |
| - let template = EquipoStrings.text(String.LocalizationValue(key)) |
| + static func format(_ template: String, _ args: String...) -> (String, String) { |
| var cut = template.endIndex, keep = false |
| if let colon = template.firstIndex(of: ":") { cut = colon; keep = true } |
| if let paren = template.range(of: " (")?.lowerBound, paren < cut { cut = paren; keep = false } |
diff --git a/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings b/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings| index f43a48f4..550d5af0 100644 |
| --- a/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings |
| +++ b/native/apple/Sources/EquipoKit/Resources/Localizable.xcstrings |
| @@ -2466,6 +2466,17 @@ |
| } |
| } |
| }, |
| + "work.hold.run_now": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Run it now anyway" |
| + } |
| + } |
| + } |
| + }, |
| "work.pause.lead.no_connection": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -2488,6 +2499,17 @@ |
| } |
| } |
| }, |
| + "work.pause.lead.too_old": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "Waiting for an update: the runner on %@ is too old for this step." |
| + } |
| + } |
| + } |
| + }, |
| "work.pause.moment": { |
| "extractionState": "manual", |
| "localizations": { |
| @@ -2549,7 +2571,7 @@ |
| "en": { |
| "stringUnit": { |
| "state": "translated", |
| - "value": "It carries on by itself when the Mac is back online." |
| + "value": "It carries on by itself when %@ is back online." |
| } |
| } |
| } |
| @@ -2576,6 +2598,17 @@ |
| } |
| } |
| }, |
| + "work.pause.next.update": { |
| + "extractionState": "manual", |
| + "localizations": { |
| + "en": { |
| + "stringUnit": { |
| + "state": "translated", |
| + "value": "It carries on by itself once the runner is updated." |
| + } |
| + } |
| + } |
| + }, |
| "work.pause.reason.budget": { |
| "extractionState": "manual", |
| "localizations": { |
diff --git a/native/apple/Sources/EquipoKit/UI/Screens/TaskScreens.swift b/native/apple/Sources/EquipoKit/UI/Screens/TaskScreens.swift| index e505a03d..dbc4ae61 100644 |
| --- a/native/apple/Sources/EquipoKit/UI/Screens/TaskScreens.swift |
| +++ b/native/apple/Sources/EquipoKit/UI/Screens/TaskScreens.swift |
| @@ -159,7 +159,8 @@ public struct TaskScreen: View { |
| Spacer() |
| if report.needsYou { NeedsChip() } |
| } |
| - Text(report.eyebrow).font(Typo.eyebrow).foregroundStyle(report.tone.eyebrow) |
| + // A pause says it in its lead and its stop. |
| + if report.pause == nil { Text(report.eyebrow).font(Typo.eyebrow).foregroundStyle(report.tone.eyebrow) } |
| Text(task.title).font(Typo.reportTitle).foregroundStyle(Palette.text).fixedSize(horizontal: false, vertical: true) |
| } |
| if let pause = report.pause { PauseLead(pause: pause) { run in Task { await session.runNow(task: task.id, run) } } } |
diff --git a/native/apple/Tests/EquipoKitTests/PausedTests.swift b/native/apple/Tests/EquipoKitTests/PausedTests.swift| index a539f289..71335f7c 100644 |
| --- a/native/apple/Tests/EquipoKitTests/PausedTests.swift |
| +++ b/native/apple/Tests/EquipoKitTests/PausedTests.swift |
| @@ -70,4 +70,28 @@ import Testing |
| let f = try #require(TaskPause(try task(failed), mine: true, now: noon, zone: dublin, locale: britain)) |
| #expect(f.tone == .negative && f.stop == "Stopped") |
| } |
| + |
| + @Test func aRunnerTooOldWaitsForItsUpdate() throws { |
| + let old = """ |
| + {"id":"s1","specialist":"engineering","state":"failed","reason":"runner_outdated","summary":"","headline":"","verdict":"","review_label":"","checks":"","gate":"","runner_label":"DOCS-T1"} |
| + """ |
| + let p = try #require(TaskPause(try task(old), mine: true, now: noon, zone: dublin, locale: britain)) |
| + #expect(p.tone == .warning && p.stop == "Needs you" && p.strong == "Waiting for an update:" && p.rest == " the runner on DOCS-T1 is too old for this step.") |
| + #expect(p.next == "It carries on by itself once the runner is updated.") |
| + } |
| + |
| + @Test func anOlderRunnerGetsPlainRunNow() throws { |
| + let plain = held.replacingOccurrences(of: "\"run_now\":{\"connection\":\"cn_codex\",\"provider\":\"codex\",\"name\":\"Codex\",\"billing\":\"subscription\"}", with: "\"run_now\":{\"plain\":true}") |
| + let p = try #require(TaskPause(try task(plain), mine: true, now: noon, zone: dublin, locale: britain)) |
| + #expect(p.runNow?.label == "Run it now anyway" && p.note == nil) |
| + } |
| + |
| + @Test func anOfflineRunnerIsNamed() throws { |
| + let offline = """ |
| + {"id":"s1","specialist":"engineering","state":"queued","reason":"","summary":"","headline":"","verdict":"","review_label":"","checks":"","gate":"","runner_label":"DOCS-T1","paused":{"offline":true,"since":"2026-11-24T11:20:00Z"}} |
| + """ |
| + let p = try #require(TaskPause(try task(offline), mine: true, now: noon, zone: dublin, locale: britain)) |
| + #expect(p.strong == "Paused since 11:20:" && p.next == "It carries on by itself when DOCS-T1 is back online.") |
| + } |
| } |
| + |
diff --git a/native/scripts/check-parity.py b/native/scripts/check-parity.py| index bc174799..19c16832 100755 |
| --- a/native/scripts/check-parity.py |
| +++ b/native/scripts/check-parity.py |
| @@ -19,7 +19,7 @@ for pattern in (r'chat\.card\.merge_chose_\w+', r'chat\.card\.ships_chose_\w+'): |
| if key not in strings: |
| problems.append(f'{key}: the web has this outcome; native has no words for it') |
| for key, text in sorted(strings.items()): |
| - if not key.startswith(('chat.card.', 'chat.paste.', 'work.tl.', 'roster.', 'projects.', 'work.star.', 'api.', 'nav.projects', 'chat.connections.connected', 'counts.unavailable', 'work.pause.', 'work.stage.', 'time.')): |
| + if not key.startswith(('chat.card.', 'chat.paste.', 'work.tl.', 'roster.', 'projects.', 'work.star.', 'api.', 'nav.projects', 'chat.connections.connected', 'counts.unavailable', 'work.pause.', 'work.stage.', 'time.', 'work.hold.run_now')): |
| continue |
| found = re.findall(r'"' + re.escape(key) + r'":\s*"((?:[^"\\]|\\.)*)"', copy) |
| if len(found) != 1: |
diff --git a/native/scripts/strings.json b/native/scripts/strings.json| index bca2571e..eee527f0 100644 |
| --- a/native/scripts/strings.json |
| +++ b/native/scripts/strings.json |
| @@ -223,16 +223,19 @@ |
| "time.tonight": "%@ tonight", |
| "track.position %@ %@": "%1$@ of %2$@", |
| "track.spoken %@": "Stage: %@", |
| + "work.hold.run_now": "Run it now anyway", |
| "work.pause.lead.no_connection": "Waiting: nothing you’ve connected can run this without paying per use.", |
| "work.pause.lead.spend_unknown": "Paused: Equipo can’t tell how much %@ has spent.", |
| + "work.pause.lead.too_old": "Waiting for an update: the runner on %@ is too old for this step.", |
| "work.pause.moment": "Paused for a moment: %@.", |
| "work.pause.next.budget": "It carries on by itself when the budget resets.", |
| "work.pause.next.busy": "It starts by itself as soon as that step finishes.", |
| "work.pause.next.by_itself": "It carries on by itself then.", |
| "work.pause.next.choose": "Nothing happens until you choose.", |
| - "work.pause.next.online": "It carries on by itself when the Mac is back online.", |
| + "work.pause.next.online": "It carries on by itself when %@ is back online.", |
| "work.pause.next.spend_unknown": "Check your spending on %@, then resume. Nothing runs on %@ until you do.", |
| "work.pause.next.try_again": "Nothing more happens until you try again.", |
| + "work.pause.next.update": "It carries on by itself once the runner is updated.", |
| "work.pause.reason.budget": "%@ has reached today’s budget", |
| "work.pause.reason.busy": "%@ is busy with another step for you", |
| "work.pause.reason.headroom_out": "your %@ allowance has run out", |