oficina / equipo Public

S3: progress file, copy inventory rows, budget lines

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev d3d889335fba13235acf8487b769457d0d41f426 parent d81be1c
3 files changed, +290 −4
  • .rastrillo/budgets.txt +5 −4
  • docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md +25 −0
  • docs/superpowers/plans/S3-SCHEDULER-PROGRESS.md +260 −0
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index 3f73a19c..ca818445 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -14,7 +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 18487 - The instance web layer: pages, handlers, templates and copy for every screen. Measured 18487 source lines.
+size internal/equipo 18647 - The instance web layer: pages, handlers, templates and copy for every screen. Measured 18647 source lines.
+size internal/wire 5032 - The runner and person API protocol: every frame, resource and its downgrade up to protocol 14 (the scheduler), one package so Encode sees every type. Measured 5032 source lines.
size internal/equipotest - 13400 Task 21 repairs historical migration and conversation fixtures after Plan 3. Measured 13024 test lines; the 300s time ceiling is unchanged.
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).
@@ -35,7 +36,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 21232 12575 The thin runner: steps, link, coordinator, Mac worker, previews, merges, metered connections and Research. Measured 21232 source and 12575 test lines.
+size internal/runner/thin 21999 13058 The thin runner: steps, link, coordinator, Mac worker, previews, merges, metered connections, Research and the scheduler. Measured 21999 source and 13058 test lines.
time internal/thintest 180s Contract tests for Mac runners, transitions and the thin core share one instance harness; loaded CI needs 180s.
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).
@@ -50,7 +51,7 @@ perf GET /api/v1/notebook skip Thin v1 person API: bearer-only JSON for devices;
perf GET /api/v1/thinking skip Thin v1 person API: bearer-only JSON for devices; the browser reads thinking words on /settings/thinking.
perf GET /api/v1/tasks skip Thin v1 person API: bearer-only JSON for devices; the browser reads tasks through /tasks.
perf GET /api/v1/tasks/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads a task through /tasks/{id}.
-size internal/equipo/chat 19708 - The instance store: tasks, steps, cards, merge authority, housekeeping, placement, metered connections and Research. Measured 19708 source lines.
+size internal/equipo/chat 20342 - The instance store: tasks, steps, cards, merge authority, housekeeping, placement, metered connections, Research and the scheduler. Measured 20342 source lines.
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.
@@ -65,5 +66,5 @@ 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 - 9766 End-to-end scenarios through a real runner and instance, plus browser drives. Measured 9766 test lines.
-size internal/thintest - 19836 Thin v1 contract and page tests; one package keeps one instance harness. Measured 19836 test lines.
+size internal/thintest - 20055 Thin v1 contract and page tests; one package keeps one instance harness. Measured 20055 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}.
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
index 3028a579..138d7553 100644
--- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
+++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
@@ -6132,6 +6132,31 @@ records remain unchanged.
| `work.ask.held.busy` | Waiting: this connection is busy | Metered connections S1: a question held by the metered guard, the slot busy (spec 7) | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| `work.ask.held.budget` | Waiting: this connection has reached its budget | Metered connections S1: a question held by the metered guard, the budget reached (spec 7, 8) | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| `work.ask.held.spend_unknown` | Waiting: this connection’s spend is unknown. Check your spending with the provider, then choose Resume | Metered connections S1: a question held by the metered guard, spend unknown (spec 7, 8) | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
+| `work.hold.headroom` | Waiting for headroom on %s | Scheduler S3: a held step's line on the task card and page (spec 8), no reset reported; %s is the provider (Claude) | Runtime; COPY REVIEW REQUIRED |
+| `work.hold.headroom_reset` | Waiting for headroom on %s, resets %s | Scheduler S3: a held step's line, waiting for headroom (spec 8); %s the provider, %s its reset (Thu 10:00 UTC) | Runtime; COPY REVIEW REQUIRED |
+| `work.hold.budget` | Waiting: %s has reached today’s budget | Scheduler S3: a step held by a metered connection's budget (spec 8); %s the provider (TensorX); offers Raise the budget | Runtime; COPY REVIEW REQUIRED |
+| `work.hold.spend_unknown` | Waiting: %s spend unknown, check it, then Resume | Scheduler S3: a step held while the metered connection's spend is unknown (spec 8); %s the provider; offers Resume | Runtime; COPY REVIEW REQUIRED |
+| `work.hold.busy` | Waiting: %s is running another step | Scheduler S3: a step held because its kept metered session's connection runs another step (spec 7 rule 1); %s the provider | Runtime; COPY REVIEW REQUIRED |
+| `work.hold.no_connection` | Waiting: nothing you connected can run it without spending | Scheduler S3: a step held with nothing that can run it without leave to spend (spec 7 rule 5) | Runtime; COPY REVIEW REQUIRED |
+| `work.hold.run_now` | Run it now anyway | Scheduler S3: the creator's button on a held step (spec 8, Run now) | Runtime; COPY REVIEW REQUIRED |
+| `work.hold.raise_budget` | Raise the budget | Scheduler S3: the link on a budget hold to the Connections page (spec 8) | Runtime; COPY REVIEW REQUIRED |
+| `work.hold.resume` | Resume | Scheduler S3: the link on a spend-unknown hold to the Connections page, where Resume is (spec 8) | Runtime; COPY REVIEW REQUIRED |
+| `work.priority.urgent` | Urgent | Scheduler S3: the task's priority on the task card and page (spec 6) | Runtime; COPY REVIEW REQUIRED |
+| `work.priority.normal` | Normal priority | Scheduler S3: the task's priority, normal with a deadline set (spec 6) | Runtime; COPY REVIEW REQUIRED |
+| `work.priority.low` | Low priority | Scheduler S3: the task's priority, low (spec 6) | Runtime; COPY REVIEW REQUIRED |
+| `work.priority.by` | By %s | Scheduler S3: the task's deadline (spec 6); %s is the day (Fri 20 Nov) | Runtime; COPY REVIEW REQUIRED |
+| `work.priority.from_message` | set from your message | Scheduler S3: says the coordinator set the priority or deadline from the person's message (spec 6) | Runtime; COPY REVIEW REQUIRED |
+| `work.priority.mark_urgent` | Mark urgent | Scheduler S3: the creator's button that makes a task urgent (spec 6, decision 5: leave to spend) | Runtime; COPY REVIEW REQUIRED |
+| `work.priority.make_normal` | Not urgent | Scheduler S3: the creator's button that takes an urgent task back to normal | Runtime; COPY REVIEW REQUIRED |
+| `chat.held.wait.before` | I’d wait: %s resets %s, before %s. | Scheduler S3: the Needs you card's recommendation (spec 8, merge authority 4.1); %s provider, %s reset, %s the task's deadline day | Runtime; COPY REVIEW REQUIRED |
+| `chat.held.wait.reset` | I’d wait: %s resets %s. | Scheduler S3: the card's recommendation to wait for a reset in time; %s provider, %s reset | Runtime; COPY REVIEW REQUIRED |
+| `chat.held.run.after_by` | I’d run it now: %s resets %s, after %s. | Scheduler S3: the card's recommendation when the reset comes after the deadline; %s provider, %s reset, %s deadline day | Runtime; COPY REVIEW REQUIRED |
+| `chat.held.run.no_reset` | I’d run it now: %s has no reset in the next three days. | Scheduler S3: the card's recommendation with no reset in sight (none, or over 72 hours); %s provider | Runtime; COPY REVIEW REQUIRED |
+| `chat.held.run.no_connection` | I’d run it now: only a metered connection can run it. | Scheduler S3: the card's recommendation when only a metered connection could run the step | Runtime; COPY REVIEW REQUIRED |
+| `chat.held.spend_unknown` | %s spend is unknown. Check it, then Resume. | Scheduler S3: the card for a step held on spend unknown (Wait only; Resume is on Connections); %s provider | Runtime; COPY REVIEW REQUIRED |
+| `chat.held.budget` | %s has reached its budget. Raise it, or wait for tomorrow. | Scheduler S3: the card for a step held on a budget (Wait only; Raise the budget is on Connections); %s provider | Runtime; COPY REVIEW REQUIRED |
+| `chat.card.wait_reset` | Wait | Scheduler S3: the held card's Wait button | Runtime; COPY REVIEW REQUIRED |
+| `chat.card.run_now` | Run it now | Scheduler S3: the held card's Run it now button | Runtime; COPY REVIEW REQUIRED |
| `work.row.step` | Step %d of %d | Tasks rows redesign (2026-11-12): the stepper's label for screen readers | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| `work.done_more` | Show %d more | Tasks rows redesign (2026-11-12): Done's fold | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
| `chat.card.research_for` | For %s | Research task page (R5, 2026-11-12): the sources card; %s is the task's title | Runtime; COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12) |
diff --git a/docs/superpowers/plans/S3-SCHEDULER-PROGRESS.md b/docs/superpowers/plans/S3-SCHEDULER-PROGRESS.md
new file mode 100644
index 00000000..6da003f7
--- /dev/null
+++ b/docs/superpowers/plans/S3-SCHEDULER-PROGRESS.md
@@ -0,0 +1,260 @@
+# S3 progress: the scheduler
+
+Branch `connections-s3-scheduler` from main 379fe0d2 (S1 and S2 merged).
+Spec: `docs/superpowers/specs/2026-11-12-equipo-connectors-and-token-scheduling.md`
+revision 3.1 (on `connections-slice2-design`), §11 row S3: §0 decisions
+5 and 6, §6, §7, §8, §10 (S3's wire, API and fixtures) and §15 round 3
+rows 4, 6 and 7. No real key, sign-in or provider: fakes only.
+
+## Done
+
+1. `internal/schedule`: the pure `Decide(Input) Decision` (§7). Bars
+ (usable, not avoided, capable; metered: urgent or a release, slot
+ free, spend known, under both budgets), thresholds 0.60/0.80/1.0 on
+ the effective priority (a release is urgent), windows past their
+ reset not reported, the fixed room precedence for subscriptions and
+ for metered connections, the rules in order (kept session, preference,
+ subscription, metered, hold), the hold naming the subscription whose
+ reset comes first or the most actionable spending bar, wake-ups
+ strictly after now (every capable connection's resets, the next budget
+ day or month when the step has leave, the preference's end, `by`
+ minus 24 h unless `deadline_notified`), and Needs you (deadline, no
+ reset in 72 h, no_connection). Review's family rule is applied as
+ tiers: another family, then another account, then Engineering's own.
+2. Wire, protocol 14 (`ProtocolScheduler`): dispatch `priority`, `by`,
+ `release`; a step report's `hold` (`StepHold`: reason, connection,
+ provider, resets_at, wake_at, needs_person, step_revision); frames
+ `release` and `priority` (durable); `Preferences.until` and
+ `PreferenceCommand.until`; record_task and start_task arguments
+ `priority` and `by`. Below 14 Encode refuses the two frames, a held
+ report and a preference with an end, and drops the dispatch fields and
+ the tool arguments. Fixtures `frames/release.json`,
+ `frames/priority.json`, `frames/step-held.json`,
+ `frames/preference-until.json`, `frames/dispatch-urgent.json`,
+ `api/task-held.json`, `api/card-held.json`, `api/priority-request.json`,
+ `api/run-now-request.json`, `api/run-now-accepted.json`; the secret
+ guards cover every new type and fixture.
+3. The runner (`thin/schedule.go`): every Engineering, Review and
+ Research attempt, failover included, is admitted through Decide.
+ Readings are refreshed before the call (an unchecked connection is
+ checked; a reading over 15 minutes old goes through `Conns.Reading`,
+ at most once per 15 minutes). The admission is one thin.db transaction
+ that reads the facts again and decides again if they moved; a pending
+ release is consumed there and kept as a grant for (step,
+ step_revision); a metered admission commits in S1's guard transaction
+ (`Meter.RunAdmitted`). Holds are kept with `wake_at` (or until a
+ change), reported once per hold, woken at `wake_at` and on any reading,
+ step end, budget, Resume, preference, priority or release. The release
+ order (`nextStep`): urgent, earliest `by`, normal, low, oldest, step
+ id. Questions stay off Decide and keep S1's guard. A kept metered
+ session under a spending bar is held there; without leave it starts
+ afresh on a subscription (S2's rule, kept).
+4. Leave to spend comes only from `urgent` or a grant. The test-build
+ seam (`testLeaveToSpend`, `EQUIPO_TEST_LEAVE_TO_SPEND`) is gone: the Pi
+ tests mark their tasks urgent; the release check no longer looks for a
+ marker nothing can contain.
+5. The instance: `chat_tasks.priority`, `due_by`, `priority_set_by`;
+ `chat_steps.hold`; `chat_releases` (one per step revision); migration
+ 0073. record_task (and start_task, only on a task recorded in that
+ turn with nothing set) take `low`/`normal` and `by`; `urgent` is
+ refused. `PUT /api/v1/tasks/{id}/priority` is the creator's tap
+ (actor from the session, roster in the transaction, revision, audit
+ `task.priority`) and sends a `priority` frame to the runner holding the
+ step. A held step stays queued with its hold; where the creator's input
+ changes the outcome it is Needs you `held` with a `held` card ("I'd
+ wait: Claude resets ..."), Wait or Run it now. `POST
+ /api/v1/tasks/{id}/run-now {step, step_revision}`: the creator's,
+ bound to the hold's revision, one release per revision (a second tap
+ answers the first), audited `task.run_now`, refused on a budget or
+ spend-unknown hold (409 `hold_bar`) and on a runner before 14 (409
+ `runner_too_old`). `PUT /connections/preference` takes `until` (a
+ runner before 14 is refused one). Dispatches carry the priority,
+ deadline and an open release; housekeeping's go as `low` with none.
+6. Pages: the task card and page show the hold line with Run it now
+ anyway (headroom, busy, no_connection) or Raise the budget / Resume
+ (links to Connections), the priority line ("Low priority · By Fri 20
+ Nov · set from your message") with Mark urgent / Not urgent, and the
+ Needs you decision from the held card.
+
+## Tests
+
+- `internal/schedule`: `TestDecideRules` (a row per rule and bar),
+ `TestDecideReviewFamily`, `TestDecideWakeUps`, `TestDecideNeedsYou`,
+ `TestDecideInvariants` ((a) to (f) and wake-ups after now over 20,000
+ random inputs), `TestDecideOrderFree`.
+- `internal/wire`: `TestEncodeBelowProtocol14DropsScheduler`,
+ `TestEncodeBelowProtocol14DropsToolPriority`,
+ `TestSchedulerFramesStrict`, fixture round trips, secret guards.
+- `internal/runner/thin`: the finish line
+ `TestScheduleLowHoldsThenStartsAfterReset` (a low step holds at 0.61,
+ said once with a future wake-up, a normal step runs meanwhile, and the
+ low one starts by itself after the reset),
+ `TestScheduleReleaseOnceAndStaleRefused` (a stale, another person's
+ and a replayed release start nothing; the consumed one is a grant),
+ `TestScheduleFailoverInsideAGrant`, `TestSchedulePriorityChangeGivesLeave`,
+ `TestScheduleReleaseOrder`, `TestScheduleAdmissionRechecksFacts`,
+ `TestScheduleRefreshesStaleReadings`, `TestPreferenceUntilEnds`; the
+ Pi tests now give leave by an urgent task (`TestPiReviewStep` also
+ checks the admission row `metered_urgent`;
+ `TestPiReviewWithoutLeaveToSpend` the headroom hold).
+- `internal/thintest`: `TestContractScheduler`,
+ `TestContractSchedulerOlderRunner`; `internal/equipo/chat`:
+ `TestSchedulerWritesCheckCreatorAndRoster`.
+- Local runs were targeted (`-run`) on the changed packages, plus
+ gofmt, go vet, staticcheck on the changed packages, the darwin runner
+ build, `make budget` (budget lines updated; `internal/wire` gets an
+ exemption at 5032 lines) and the dead-reference scan.
+
+## Mutations, each observed failing
+
+### schedule mutations (all caught)
+- SM1 low threshold 0.70 -> TestDecideRules/low_holds_at_0.61
+- SM2 windows past reset still counted -> TestDecideRules/a_window_past_its_reset_is_not_reported
+- SM3 leave always granted -> TestDecideRules/kept_metered_without_leave_moves; TestDecideInvariants (b) #34 metered without leave
+- SM4 budget bar off -> TestDecideRules/kept_metered_over_budget_holds_there; TestDecideInvariants (d)
+- SM5 busy-slot bar off -> TestDecideRules/kept_metered_busy_holds_there; TestDecideInvariants (c)
+- SM5b spend-unknown bar off -> TestDecideInvariants (d)
+- SM6 kept metered under a spending bar moved instead of held -> TestDecideRules/kept_metered_busy_holds_there (ran on b)
+- SM7 wake-up allowed at now -> TestDecideWakeUps, TestDecideInvariants (#76 a wake-up not after now)
+- SM8 rule 4 removed -> TestDecideRules/metered_only_with_urgent; TestDecideInvariants (e) held though a candidate admits
+- SM9 reported-before-unreported key dropped -> TestDecideRules/reported_before_unreported
+- SM10 preference until ignored -> TestDecideRules/an_expired_preference_is_absent
+- SM11 deadline check fires again after deadline_notified -> TestDecideNeedsYou
+- SM12 Review family tiers removed -> TestDecideReviewFamily
+- SM13 kept subscription not sticky -> TestDecideRules/kept_stays_whatever_the_threshold
+- SM14 limited always usable -> TestDecideRules/limited_is_not_usable
+- SM15 no 72 h bound on reset -> TestDecideNeedsYou (a reset 73 h away)
+- SM16 threshold compare > instead of >= -> TestDecideInvariants (a) admitted at 0.60
+### wire mutations (TestEncodeBelowProtocol14DropsScheduler)
+- WM1 release frame not refused below 14 -> caught (release encoded at 13)
+- WM2 held step report not refused below 14 -> caught
+- WM3 dispatch priority kept below 14 -> caught (dispatch at 13)
+- WM4 preference with until not refused below 14 -> caught
+### runner mutations
+- RM1 release not consumed / no grant at admission -> TestScheduleReleaseOnceAndStaleRefused (release "pending", grants 0)
+- RM2 release accepted for a stale step revision -> TestScheduleReleaseOnceAndStaleRefused (a stale release was kept)
+- RM3 release not bound to the person -> TestScheduleReleaseOnceAndStaleRefused (another person's release was kept)
+- RM4 release kept for a revision that already holds a grant -> first MISSED (the replay arrived after the step ended, so the step check alone refused it); a case with the step still held and its revision granted was added, then caught
+- RM5 admission without the facts recheck -> TestScheduleAdmissionRechecksFacts (admitted on moved facts)
+- RM6 fact changes not waking held steps -> TestScheduleReleaseOnceAndStaleRefused, TestScheduleFailoverInsideAGrant (timed out)
+- RM7 hold said at every look -> first MISSED (nothing re-decided before the reset); the test now wakes the step three times, then caught (said 4 times)
+- RM8 stale readings never probed -> TestScheduleRefreshesStaleReadings (0 probes)
+- RM9 grant not read for later attempts -> TestScheduleFailoverInsideAGrant (the failover attempt held)
+- RM10 priority frame ignores its revision -> TestSchedulePriorityChangeGivesLeave (an older priority applied)
+- RM11 release order back to oldest first -> TestScheduleReleaseOrder
+- RM12 preference until ignored -> TestPreferenceUntilEnds
+- RM13 dispatch's scheduler facts not recorded -> TestScheduleLowHoldsThenStartsAfterReset (ran at 0.61 as normal)
+- RM14 runPi not writing the scheduler's admission in the guard's transaction -> TestPiReviewStep (no admission row)
+### instance mutations
+- IM1 coordinator allowed urgent -> TestContractScheduler (the coordinator set urgent)
+- IM2 coordinator priority changeable after creation (start_task) -> TestContractScheduler (dispatch / start_task changed it)
+- IM3 priority revision not checked -> TestContractScheduler (a stale revision accepted)
+- IM4 priority/Run now creator check removed -> first MISSED in thintest (the rig cannot make a second owner, and isOwner refused the teammate first); TestSchedulerWritesCheckCreatorAndRoster (chat store, two owners) added, then caught for both
+- IM5 roster check left out of SetPriority -> TestSchedulerWritesCheckCreatorAndRoster (a removed creator's priority)
+- IM6 priority audit left out -> TestSchedulerWritesCheckCreatorAndRoster (audits [])
+- IM7 priority frame not sent -> TestContractScheduler (no priority frame; timed out)
+- IM8 release not bound to the held step revision -> TestContractScheduler (a stale step revision accepted)
+- IM9 second tap writes a second release -> TestContractScheduler (a second tap)
+- IM10 Run now passes a spending bar -> TestContractScheduler (Run now past spend unknown)
+- IM11 Run now to a protocol 13 runner -> TestContractSchedulerOlderRunner
+- IM12 preference with an end to a protocol 13 runner -> TestContractSchedulerOlderRunner
+- IM13 dispatch without priority -> TestContractScheduler (dispatch)
+- IM14 a held step marked running -> TestContractScheduler (held: state running)
+- IM15 Needs you held dropped -> TestContractScheduler (needs "")
+- IM16 held card left open after Run now -> TestContractScheduler
+- IM17 page offers Run it now on a spending bar -> TestContractScheduler (spend unknown offers Run now)
+
+## Decisions where the spec was open
+
+- The step revision is the attempt the instance dispatched (runner
+ column `steps.revision`); the runner's failover attempts keep it, a
+ Retry is a new revision. The hold carries it, Run now names it.
+- The held report is state `running` with `hold` (the instance keeps the
+ step queued until a report without it), not a new `deferred` state an
+ older instance would refuse; below 14 it is not sent.
+- `busy` is a hold reason too: a kept metered session whose slot is
+ taken (§7 rule 1) and an admission race.
+- The admission rechecks by reading the facts again inside its
+ transaction and comparing, not by per-row revision columns; the metered
+ slot, spend and budget are rechecked by S1's guard in that same
+ transaction.
+- A `priority` frame (not in §10) carries a priority change to a step
+ the runner already holds, so marking a held task urgent takes effect at
+ once.
+- Research steps go through Decide too (coordinator's family first, as
+ before; never metered). Coordinator turns do not (person turns are
+ never held). Housekeeping turns are not dispatched today
+ (`TurnHousekeeping` is never created); housekeeping's step dispatches
+ go as `low` with no release.
+- The preference stays one provider for every role (as built); `until`
+ is kept beside it, and an expired preference reads as Automatic on
+ both ends rather than being cleared by a write.
+- A deadline given as a date is the end of that day, UTC; at most a year
+ ahead. start_task's priority applies only to a task recorded in the
+ same turn with nothing set.
+- Run now is refused on a budget or spend-unknown hold (it never passes
+ a bar); those holds link to the Connections page for Raise the budget
+ and Resume, and their card offers Wait only.
+- The budget day and month boundaries are wake-ups only for a step with
+ leave and a capable metered connection. Spend unknown has no reset, so
+ it is Needs you.
+
+## Open, or not as the spec says
+
+- No reading probe exists that is not a model turn: Claude reports
+ headroom only on a turn, and Codex's `account/rateLimits/read` runs
+ only at sign-in. The refresh is built and tested with a fake
+ (`Conns.Reading`), but is nil in production, so a reading older than
+ 15 minutes is used as last reported (a window past its reset counts as
+ not reported). A Codex probe over the app-server is the follow-up.
+- No browser test of the new forms (the pages are checked server-side).
+- The staging witness waits for a release (below).
+
+## New copy keys (pending, `COPY REVIEW REQUIRED`, in the Plan 3 inventory)
+
+- `work.hold.headroom`: Waiting for headroom on %s
+- `work.hold.headroom_reset`: Waiting for headroom on %s, resets %s
+- `work.hold.budget`: Waiting: %s has reached today’s budget
+- `work.hold.spend_unknown`: Waiting: %s spend unknown, check it, then Resume
+- `work.hold.busy`: Waiting: %s is running another step
+- `work.hold.no_connection`: Waiting: nothing you connected can run it without spending
+- `work.hold.run_now`: Run it now anyway
+- `work.hold.raise_budget`: Raise the budget
+- `work.hold.resume`: Resume
+- `work.priority.urgent`: Urgent
+- `work.priority.normal`: Normal priority
+- `work.priority.low`: Low priority
+- `work.priority.by`: By %s
+- `work.priority.from_message`: set from your message
+- `work.priority.mark_urgent`: Mark urgent
+- `work.priority.make_normal`: Not urgent
+- `chat.held.wait.before`: I’d wait: %s resets %s, before %s.
+- `chat.held.wait.reset`: I’d wait: %s resets %s.
+- `chat.held.run.after_by`: I’d run it now: %s resets %s, after %s.
+- `chat.held.run.no_reset`: I’d run it now: %s has no reset in the next three days.
+- `chat.held.run.no_connection`: I’d run it now: only a metered connection can run it.
+- `chat.held.spend_unknown`: %s spend is unknown. Check it, then Resume.
+- `chat.held.budget`: %s has reached its budget. Raise it, or wait for tomorrow.
+- `chat.card.wait_reset`: Wait
+- `chat.card.run_now`: Run it now
+
+## How Paul tries it
+
+On staging, once this is released (Pi is already installed on the
+owner runner):
+
+1. Settings, Connections, Add a connection, TensorX: tick "This key has
+ a spending limit at TensorX" (a small prepaid balance, no automatic
+ top-up), keep the $1 a day and $10 a month budget, paste the key and
+ pick `z-ai/glm-5.3`. The one-token probe makes it Ready and shows on
+ its spend line.
+2. Ask the coordinator for a small change on a test repository. On the
+ task page tap Mark urgent (or, when a step shows "Waiting for headroom
+ on Claude", tap Run it now anyway). With Claude doing Engineering,
+ Review goes to another family first, so it runs on TensorX.
+3. What to see: the Review step on TensorX, family glm, label
+ other_family; the Connections spend line moved by that step's cost;
+ once today's spend reaches $1 the next step waits with "TensorX has
+ reached today's budget", Raise the budget, and the row says "Paused
+ until tomorrow". Ask the Review a question: it answers on TensorX,
+ charged. Mark the task Not urgent and a normal step never spends.