spec: needs-you triage, thin v1 (rev 2)
Cut to instance-side triage: one automatic retry of a passing stop, one more rebase per conflicting candidate, a hosted re-check of checks that predate hosted CI, re-triage at start-up. Judgement stays in Needs you with a recommendation and Try another round. The hand-off turn and split move to v2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+225
−257
docs/superpowers/specs/2026-11-11-equipo-needs-you-triage.md+225 −257
diff --git a/docs/superpowers/specs/2026-11-11-equipo-needs-you-triage.md b/docs/superpowers/specs/2026-11-11-equipo-needs-you-triage.md| index 2ef60272..5ea3d444 100644 |
| --- a/docs/superpowers/specs/2026-11-11-equipo-needs-you-triage.md |
| +++ b/docs/superpowers/specs/2026-11-11-equipo-needs-you-triage.md |
| @@ -1,270 +1,238 @@ |
| -# Equipo: Needs you holds only real decisions |
| +# Equipo: needs-you triage, thin v1 |
| -Status: 2026-11-11, revision 1, **NOT READY** after Astra round 1 (§11). |
| -Not built. Drafted by Claude (Opus 5.5) on `needs-you-triage` from main |
| -4e51bcd. Builds on thin v1 (task lifecycle), |
| -housekeeping (§§3-4: classes, the ledger, the day budget, the principal), |
| -merge authority (the gate, unchanged) and release slice 1 (hosted checks). |
| +Status: 2026-11-11, revision 2 ("thin v1"). Revision 1 (3ab0e85) drew |
| +NOT READY from Astra round 1 (§9); the coordinator cut the scope so it |
| +converges: no new turn kind, no wire change, no split. Drafted by Claude |
| +(Opus 5.5) on `needs-you-triage` from main 8d7f217. Builds on thin v1, |
| +housekeeping (§§3-4: the ledger, the day budget, the principal), merge |
| +authority (the gate, unchanged) and release slice 1 (hosted checks). |
| ## 0. Why |
| Paul, on staging's six Needs you items: "I feel like a bunch of this stuff |
| -doesn't actually need me." His rulings (2026-11-11): |
| - |
| -- Needs you holds only decisions only Paul can make. |
| -- A failed step is never one of them by itself: Equipo retries a stopped |
| - step once, within the retry budget. |
| -- If it fails again, the coordinator reads what happened and fixes the |
| - cause, re-plans, or asks Paul one plain question. Only that question |
| - reaches Needs you. Meanwhile the task says "The coordinator is looking |
| - into it". |
| -- The coordinator stays high-level; specialists hold the details. |
| -- Spend is first-class: a coordinator turn costs about 17k input tokens. |
| +doesn't actually need me." Ruled 2026-11-11: Needs you holds only |
| +decisions only Paul can make; a step that stopped for a passing reason is |
| +retried once on its own, within the retry budget; spend is first-class. |
| Staging, read from its replica at 20:37 UTC: |
| -| Task | Needs you today | What the rows say | |
| -|---|---|---| |
| -| Swipe from the edge (`tks6kwzzdngr`) | `fix_rounds` | round 2 approved, then a Mac re-run's checks failed outside the sandbox | |
| -| Centre the star (`tk3pi43fqzjj`) | `merge_conflict` | the one rebase round passed hosted checks and review; the merge conflicted again | |
| -| Rename control (`tkataquuxfrw`) | `fix_rounds` | round 2's hosted checks failed (units named) | |
| -| Thinking indicators (`tkplvk6zce6q`), Done to recheck (`tknitqeua7yy`) | `retry` | round 1 Engineering `runner_restarted`, never pushed, termination proven | |
| -| Private repository storage (`tkynbqvn3ypm`) | `merge` | approved; checks `needs_network` from 12:45, before hosted checks; the card has no merge audit row, so it predates merge authority. No project has a merge policy row: `main_ships` is unknown everywhere and never asked | |
| - |
| -So item 6 asked because its checks predate hosted checks, not because of |
| -the ships question. (The ships card exists and is already its own |
| -project card; merge authority raises it when a decision fails on it.) |
| - |
| -## 1. Triage: one pure function |
| - |
| -`internal/equipo/triage.Classify(Facts) Verdict`, no store or clock. Facts |
| -are the task's `NeedsYou` (as `progress.needsYou` computes it today), the |
| -newest step (specialist, reason, pushed, terminated), the newest checks |
| -(outcome, reason, hosted), and the task's spent counts (§4). Verdict is a |
| -class and an action: |
| - |
| -| `NeedsYou` and facts | Class | Action | |
| -|---|---|---| |
| -| `retry`: a step (not merge) failed with a transient reason (`runner_restarted`, `interrupted`, `provider_failed`, `clone_failed`, `candidate_unavailable`, `checks_timeout`, `no_runner`, `step_timeout`), termination proven, not yet retried automatically | transient | `retry` | |
| -| `review_blocked`: as above for a review | transient | `retry` | |
| -| `merge_conflict` | mechanical | `rebase`: one more Engineering rebase round on the default branch's tip | |
| -| `merge`, the judged checks `cannot_run` with `needs_network`, `checks_unavailable` or `checks_timeout`, not re-checked on this SHA | mechanical | `recheck`: checks again on the exact SHA on the primary, which takes hosted CI when the repository has it | |
| -| `retry` or `review_blocked` otherwise (a second failure, or a reason that is not transient), `fix_rounds` | judgement | `handoff` | |
| -| `merge` otherwise, `branch_moved`, `machine_removed`, `runner_offline`, a coordinator question (§3) | genuine | none | |
| - |
| -Only `handoff`'s outcome uses a model. Everything else is deterministic. |
| -A verdict whose budget (§4) is spent becomes genuine, with a |
| -recommendation (§5). |
| - |
| -**Never touched:** a task that is cancelled, ended, cancel-requested, |
| -folded, merging, or held (`merge_hold` set), a task whose creator's |
| -housekeeping is paused, and a task whose creator is not a current member. |
| -Triage acts only while the creator's primary is online at protocol 7 |
| -(§7); otherwise nothing changes and Needs you shows what it shows today. |
| - |
| -## 2. Automatic actions |
| - |
| -Each action is a row in housekeeping's ledger (`chat_housekeeping`), |
| -detector `triage_<action>`, subject the task, keyed so it acts once: |
| - |
| -| Action | Key | What it does | |
| -|---|---|---| |
| -| `retry` | `retry:<step>` | the ordinary Retry of that step (a new attempt; merge steps are never retried here) | |
| -| `rebase` | `rebase:<failed merge step>` | an Engineering rebase step, exactly as `mergeFailed` makes the first | |
| -| `recheck` | `recheck:<task>:<candidate>` | a checks step on the candidate, `recheck_by = hosted`, stage back to In review | |
| -| `handoff` | `handoff:<task>:<newest step>:<attempt>` | queues a hand-off turn (§3) | |
| - |
| -The action is claimed and taken in the transaction that noticed it, under |
| -the housekeeping principal with one new permission, `dispatch`, valid only |
| -for its own row's person. The principal still refuses every merge, merge |
| -card, `merge_asked`, `merge_eligible`, `ready_sha`, ending and setting |
| -(`hkForbid`, `hkTaskWrite`), so a recheck never clears `merge_asked`: an |
| -asked SHA stays asked and the re-run only refreshes the card's words, as a |
| -Mac re-run does today. Merge authority, Review and the sandbox rules are |
| -untouched; every merge still goes through `authorizeMerge`. |
| - |
| -When triage runs: at the end of `advance` (every step report, sync and |
| -merge refusal), when a hand-off turn ends, at start-up (§6) and on the |
| -housekeeping tick for held rows. Inside the principal it never runs. |
| - |
| -**Receipts.** Each action is an action row on the Housekeeping view |
| -(newest first, with its task) and a `housekeeping` event: quiet, no |
| -conversation card. Undo: not offered for `retry`, `rebase` and `recheck` |
| -(a dispatched step may already be running; the reversal is the task's |
| -own Cancel). A queued hand-off is undone by cancelling its turn, which |
| -returns the task to Needs you and vetoes the key. |
| - |
| -## 3. The hand-off turn |
| - |
| -A coordinator turn of new kind `handoff`, for the task's creator, queued |
| -after the person's own turns and yielding to them as a move-in does. |
| -`chat_turns.task_id` names its task. The instance writes its whole prompt |
| -(`MessageCommand.Text`), at most 6 KiB, high-level only: |
| - |
| -- the task's title, link, project and brief (clipped to 1,500 bytes); |
| -- what stopped it, in one line (the `NeedsYou` reason, the stopped step and |
| - its reason, rounds and rebases used); |
| -- the newest checks in one line, with hosted CI's failing unit names; |
| -- the newest review: verdict, summary (500 bytes) and up to five finding |
| - headlines; |
| -- after a question (below), the question and the person's answer; |
| -- the choices still open, from the budgets. |
| - |
| -**Tools** (both ends allowlist them for this kind): `read_task` (for |
| -detail if it must), `read_notes`, and `resolve_task{task, action, ...}`, |
| -which accepts only the turn's own task, once per turn: |
| - |
| -- `retry`: the ordinary Retry, if the step is retryable. |
| -- `round{approach}`: another Engineering round on the candidate with the |
| - coordinator's approach (<= 1,000 bytes) beside the feedback, stored on |
| - the step (`chat_steps.approach`). Checks, Review and the gate follow as |
| - for any round. |
| -- `split{parts[2..3]{title, brief}}`: records each part as a task of the |
| - creator in the same project (task cards in the conversation are the |
| - receipt), starts each, and cancels the original through the ordinary |
| - cancel path (it is at rest by construction). |
| -- `ask{question, options[2..3], recommend}`: a `task_question` card in the |
| - creator's conversation, bound to the task, with Equipo's pick. The task |
| - shows `NeedsYou: question`. The answer (the creator only, current card |
| - revision) queues one follow-up hand-off with the answer in its prompt; |
| - the person's tap pays for it, so it is never refused for budget, but it |
| - is recorded. |
| - |
| -The turn's reply is never posted (the receipt, the cards and the task |
| -status say what happened). At most 8 tool calls. A turn that ends without |
| -`resolve_task`, fails, or is cancelled marks the row `failed`; the task |
| -goes back to Needs you as it was, with "The coordinator couldn't settle |
| -this" and a recommendation, and the key never hands off again. |
| - |
| -This is not a housekeeping judgement turn: the coordinator acts for the |
| -creator on the creator's own task, with the narrow tool set above, as it |
| -already may in a person turn. Housekeeping's "model judgement is never an |
| -action" stays true for housekeeping detectors. |
| - |
| -## 4. Budgets |
| - |
| -Per person per day, in the one ledger housekeeping already sums |
| -(`hkUsed`), so automatic work of both loops shares one day: |
| - |
| -| Unit | Day limit | Reserved by | |
| -|---|---|---| |
| -| retries | 3 (housekeeping's) | `retry`, and `resolve_task` retry | |
| -| automatic rounds | 3 (new, `Limits.Rounds`) | `rebase`, `round`, each `split` part | |
| -| coordinator turns | 4 (housekeeping's) | `handoff` | |
| -| tokens | 150,000 (housekeeping's) | `handoff`, 37,500 reserved, charged with the turn's usage | |
| - |
| -Per task: one automatic retry per step; two automatic rounds (rebases |
| -after the first, rounds and split parts together); two hand-offs. A |
| -recheck is free and once per SHA. Steps an action starts are bounded by |
| -count, not tokens: their usage is on their own usage rows as for any step, |
| -and the row's `attempt` names them. A hand-off is settled when its turn |
| -ends: charged its usage rows' input plus output tokens, or the whole |
| -reservation when no figure came (unknown is never zero). Headroom |
| -stand-down does not apply (this is the person's own work, which their own |
| -tap would dispatch); the connection choice still refuses limited ones. |
| - |
| -Day budget spent: the row is `held` (reason `budget`) and the task stays |
| -in Needs you with the recommendation; the next day's tick claims it again |
| -if the task is still there. Task cap spent: `refused` (reason `cap`), |
| -genuine for good. |
| - |
| -## 5. What the person sees |
| - |
| -`wire.Task` gains `triage {kind, reason, since, question, card_id, |
| -recommend}` (omitempty). While an action is in flight, `NeedsYou` is |
| -empty and the task sits in the normal list with an honest line: |
| - |
| -| `kind` | Task line | |
| -|---|---| |
| -| `retrying` | "Retrying after the runner restarted" (the step's reason) | |
| -| `rebasing` | "Engineering is resolving a conflict with main" | |
| -| `rechecking` | "Running the checks again on hosted CI" | |
| -| `looking` | "The coordinator is looking into it" (existing copy; `coordinator` activity `looking` too) | |
| -| `question` | `NeedsYou` `question`: "Needs you: <the question>" with the card | |
| -| `waiting` | `NeedsYou` unchanged, plus why it waits (budget, tries used, runner needs an update, the coordinator couldn't settle it) and Equipo's recommendation | |
| - |
| -## 6. Existing tasks |
| - |
| -At start-up, after housekeeping's claim recovery, `Retriage` passes once |
| -over every open task with a non-empty `NeedsYou`, in its own transaction |
| -per task. The ledger keys make it idempotent: a second start or a sync |
| -afterwards finds the keys and does nothing. |
| - |
| -## 7. Wire: protocol 7 |
| - |
| -`wire.ProtocolHandoff` (7) becomes `ProtocolCurrent`. It adds |
| -`TurnHandoff`, `ToolResolveTask` and `HandoffTools`. `Encode` refuses a |
| -`message` frame of kind `handoff` below 7 (`ErrProtocol`, never sent), its |
| -own downgrade step, first in the chain. The instance queues a hand-off |
| -only for a primary online at 7, and a hand-off dispatched before the |
| -runner reconnected lower is ended `failed` at that connection (§3's |
| -fallback). |
| - |
| -| Combination | Behaviour | |
| -|---|---| |
| -| new instance, runner below 7 | no triage; Needs you as today | |
| -| old instance, new runner | spoken 6: no hand-off frames exist; nothing changes | |
| -| runner reconnects below 7 holding a hand-off | the turn fails, the task returns to Needs you once | |
| - |
| -Runner: the hand-off prompt is the frame's text (no "Newest message" |
| -header, no desk settling), the call bound is 8, `resolve_task` is in the |
| -MCP list, the launcher allowlist and `provider` actions. |
| +| Task | Needs you today | What the rows say | Thin v1 | |
| +|---|---|---|---| |
| +| Swipe from the edge | `fix_rounds` | round 2 approved, then a Mac re-run's checks failed outside the sandbox | stays, with Review's and the checks' last word and a recommendation (§4) | |
| +| Centre the star | `merge_conflict` | the first rebase round passed hosted checks and Review; the merge conflicted again | Engineering rebases again (§2.2), then the gate asks (hosted) | |
| +| Rename control | `fix_rounds` | round 2's hosted checks failed in named units | stays, with the failing units and a recommendation (§4) | |
| +| Thinking indicators, Done to recheck | `retry` | round 1 Engineering stopped `runner_restarted`, never pushed | retried once on its own (§2.1) | |
| +| Private repository storage | `merge` | approved; checks `needs_network` at 12:45, before hosted checks; its card has no merge audit row | hosted re-check on the same SHA (§2.3), then the gate asks (hosted) | |
| + |
| +Item 6 asked because its checks predate hosted checks, not because of |
| +the ships question (no project has a policy row yet; the ships card is |
| +already its own project card). Items 2 and 6 still end at a merge card: |
| +a hosted pass is asked about until amadan#136 lets hosted runs be |
| +verified. The card says so (§4). |
| + |
| +## 1. Shape |
| + |
| +All on the instance; no wire field, frame or protocol change. One pure |
| +function, `triage.Classify(Facts) Verdict` (`internal/equipo/triage`, no |
| +store, clock or I/O), sorts the task's `NeedsYou` (as `progress.needsYou` |
| +computes it today) into **act** (one of three actions) or **ask** (stays |
| +in Needs you with a recommendation). The store runs it at the end of |
| +`advance` (every step report, sync and merge refusal), at start-up (§3) |
| +and on the housekeeping tick for held rows, never under the principal. |
| + |
| +**Never touched:** a task ended, cancelled or cancel-requested, folded, |
| +merging, or held (`merge_hold`); a creator who is not a current member or |
| +whose housekeeping is paused. Classify checks the first four itself; the |
| +store checks the rest in the transaction. |
| + |
| +## 2. The three actions |
| + |
| +Each is a row in housekeeping's ledger (`chat_housekeeping`), detector |
| +`triage_<action>`, subject the task, claimed and carried out in the |
| +transaction that noticed it, under the housekeeping principal with one |
| +new permission, `dispatch` (step dispatch for the principal's own person |
| +only; `hkSpend` today refuses all dispatch). The principal still refuses |
| +merges, merge cards, `merge_asked`, `merge_eligible`, `ready_sha`, |
| +endings and settings. **Triage rows are consumed for good:** only a |
| +`held` row is claimed again; `done`, `failed` and `refused` never act |
| +again and keep their charges, so a failure cannot buy another try. |
| + |
| +Every action revalidates its **source** inside the transaction: the |
| +newest step is still the one named in the key, at that attempt, in the |
| +state that raised it, and the task still meets §1. A person's Retry |
| +(new attempt), Cancel or hold, or any new step, makes the key stale and |
| +it does nothing. |
| + |
| +### 2.1 Retry a passing stop |
| + |
| +- **When:** `NeedsYou` is `retry` or `review_blocked`; the newest step is |
| + Engineering, Review or Checks (a merge step never, checked in |
| + `Classify` itself); it failed with termination proven; its reason is |
| + `runner_restarted`, `interrupted` (the runner no longer held it at |
| + sync), `superseded` (lease lost), `step_timeout` or `checks_timeout`; |
| + and no automatic retry of this step was made before (any attempt). |
| +- **Key** `retry:<step>:<attempt>`. **Costs** one retry (day limit 3, |
| + housekeeping's). |
| +- **Does** the ordinary Retry of that step (`retryStep`, factored out of |
| + `RetryTask`), which refuses merge steps under the principal. |
| + |
| +### 2.2 Rebase a conflicting candidate |
| + |
| +- **When:** `NeedsYou` is `merge_conflict` (the newest step is a merge |
| + that failed `merge_conflict` with termination after the task's one |
| + rebase round), and no automatic rebase was made for this candidate. |
| +- **Key** `rebase:<candidate>`. **Costs** one automatic round (day limit |
| + 3, new `Limits.Rounds`); at most two per task. |
| +- **Does** an Engineering rebase step exactly as `mergeFailed` makes the |
| + first. Checks, Review and the gate follow as for any candidate. |
| + |
| +### 2.3 Re-check stale checks on a hosted-CI project |
| + |
| +- **When:** `NeedsYou` is `merge`; the judged checks of the candidate are |
| + a Checks step that ended `cannot_run` with `needs_network` or |
| + `needs_macos`, with no hosted binding, **before** the project's first |
| + hosted verdict (the earliest `finished_at` of a step in the project |
| + with `checks_sandbox = hosted`); no merge step for the candidate. No |
| + hosted verdict in the project means not a hosted-CI project: nothing. |
| +- **Key** `recheck:<candidate>`. **Costs** nothing (once per SHA). |
| +- **Does** a Checks step on the exact candidate with `recheck_by = |
| + hosted`, stage back to In review, placed as any checks step; on the |
| + primary the dispatch carries slice 1's hosted offer. `merge_asked` is |
| + never cleared (the principal refuses it), so an asked SHA stays asked: |
| + the result refreshes the card's words as a Mac re-run does |
| + (`refreshAfterRecheck`), and a pass is still asked about (hosted is |
| + outside the sandbox). A failure takes the fix round as any failure. |
| + |
| +### 2.4 Budget and spend |
| + |
| +Per person per day in the ledger housekeeping sums (`hkUsed`): retries |
| +3, automatic rounds 3 (new column pair `reserved_rounds`, |
| +`charged_rounds`); a recheck is free. A row reserves its unit when |
| +claimed and is charged it at once (the dispatch is the action). When the |
| +step attempt it started ends, the row is also charged that attempt's |
| +tokens from its usage rows, counted as `rowSpend` counts them (Claude's |
| +cache reads and writes included; an attempt with no complete figure is |
| +recorded as incomplete, never zero). Steps are bounded by count, not by |
| +tokens: the token figures are the record, not a gate (housekeeping's |
| +token limit binds its own judgement turns, which do not exist yet). |
| + |
| +Day limit reached: the row is `held` (reason `budget`); the task stays in |
| +Needs you with the recommendation (§4); the next tick or sync claims it |
| +again if its source is still current. |
| + |
| +## 3. Re-triage on deploy |
| + |
| +At start-up, after housekeeping's claim recovery, `Retriage` runs once |
| +over every open task with a non-empty `NeedsYou`, one transaction per |
| +task. The keys make it idempotent: a second start, a sync or the tick |
| +finds them and does nothing. |
| + |
| +## 4. What the person sees |
| + |
| +`wire.Task` (person API only) gains `triage {kind, reason, since, said, |
| +failed[], recommend, why}`, omitempty. |
| + |
| +- **Acting:** while a triage step runs (`retrying`, `rebasing`, |
| + `rechecking`), `NeedsYou` is already empty (the step is queued or |
| + running) and the task line says so: "Retrying after the runner |
| + restarted", "Engineering is resolving a conflict with main", "Running |
| + the checks again on hosted CI". Each action is a quiet action row on |
| + the Housekeeping view; no conversation card, no Undo (a dispatched step |
| + may already run; the task's Cancel is the reversal). |
| +- **Asking:** every other `NeedsYou` stays, as a plain question with a |
| + deterministic recommendation from what is recorded: Review's newest |
| + finding (or summary) in one line, hosted CI's failing step names, and |
| + why Equipo did not act (a passing stop already retried, today's budget |
| + used, two rebases used). Recommendations: `round` for `fix_rounds`, |
| + `retry` for a stopped step, `rebase` for a conflict. Actions: |
| + - **Ask the coordinator:** the existing link to the conversation with |
| + the task named in the composer (`?about=`); Paul sends it, an |
| + ordinary turn. |
| + - **Try another round:** new `POST /api/v1/tasks/{id}/round` (and the |
| + page form). The creator, an owner, `NeedsYou` `fix_rounds` or |
| + `merge_conflict`: one Engineering round on the candidate with the |
| + last feedback (a rebase round for a conflict). Person-initiated, so |
| + never budgeted. |
| + - **Cancel**, as today. |
| +- **Hosted merge card:** when the gate asks only because hosted checks |
| + are outside the sandbox, its reason reads "Hosted checks passed. Equipo |
| + can merge these on its own once hosted runs can be verified". |
| + |
| +## 5. Data |
| Migration 0064 (additive): `chat_housekeeping.reserved_rounds`, |
| -`charged_rounds`; `chat_turns.task_id`; `chat_steps.approach`; |
| -`chat_cards.recommend`. |
| - |
| -## 8. Tests, failing first |
| - |
| -Contracts in `internal/thintest`, a protocol 7 rig, each seen failing |
| -before the code: |
| - |
| -- `TestTriageRetriesTransient` (items 4 and 5): `runner_restarted` before |
| - any push is retried once with a receipt and "Retrying after ..."; a |
| - second `runner_restarted` hands off. |
| -- `TestTriageRebasesConflict` (item 2): a second conflict starts an |
| - Engineering rebase round; its candidate goes to checks, Review and the |
| - gate, which still asks for a hosted pass. |
| -- `TestTriageHandsOffFixRounds` (items 1 and 3): rounds used up queue one |
| - hand-off with the failing unit names and the review's headlines; the |
| - task says the coordinator is looking; `resolve_task round` starts round |
| - 3 with the approach; `ask` gives a `question` card and Needs you shows |
| - only that; the answer queues the follow-up. |
| -- `TestTriageRechecksStaleChecks` (item 6): `needs_network` at Ready to |
| - merge re-runs checks on the exact SHA with the hosted offer; the asked |
| - SHA stays asked; a hosted pass refreshes the card's words; nothing merges. |
| -- `TestTriageBudgetExhausted`: the fourth retry of the day is held with the |
| - recommendation; the per-task cap refuses; the next day claims the held |
| - row. |
| -- `TestTriageIdempotentRetriage`: `Retriage` twice and a sync act once. |
| -- `TestTriageNeverTouches`: cancelled, cancel-requested, held, paused, |
| - merging tasks and a removed member: nothing changes. |
| -- `TestTriageOldRunner`: protocol 6 primary, nothing changes; a hand-off |
| - held by a runner that reconnects at 6 fails back to Needs you. |
| -- `resolve_task` refusals: another task, a person turn, a second call. |
| - |
| -Unit: `triage.Classify` table; `Encode` refuses the hand-off below 7. |
| -Headless scenario 4 and Mac M4 now expect the automatic retry. Each guard |
| -(the transient list, termination, once per step, never-touched, protocol, |
| -budget, cap, principal `dispatch` scope, resolve's own-task check) is |
| -broken once and its test watched failing. |
| - |
| -## 9. Copy |
| - |
| -New strings in `copy.go`, each through a delegated Astra copy pass: the |
| -four task lines of §5, the question stage line, the waiting reasons and |
| -recommendations, the question card's pick line, and the Housekeeping |
| -view's action names for the six `triage_*` detectors. |
| - |
| -## 10. Out of scope |
| - |
| -Hosted passes still ask (merge authority; amadan#136 lifts it). The Mac |
| -checks gate. A same-SHA checks re-run for anything but a stale network |
| -reason. Undo for dispatched steps. |
| - |
| -## 11. Astra round 1: NOT READY |
| - |
| -`gpt-6-astra`, effort high, read-only, against this revision and main |
| +`charged_rounds`. Nothing else: `recheck_by` exists, keys and sources |
| +live on the ledger row (`subject_id`, `finding_key`, `attempt` = |
| +`step:<id>:<attempt>` of the step the action started). |
| + |
| +## 6. Tests, failing first |
| + |
| +Contracts in `internal/thintest`, each seen failing before the code: |
| + |
| +- `TestTriageRetriesPassingStop` (items 4, 5): `runner_restarted` before a |
| + push is retried once, with the action row and "Retrying after ..."; the |
| + same step stopping again stays in Needs you with `retry` recommended. |
| +- `TestTriageNeverRetriesMerge`: a merge step failed `interrupted`: no |
| + retry, by `Classify` and by `retryStep` under the principal. |
| +- `TestTriageRebasesConflict` (item 2): a conflict after the first rebase |
| + starts one more rebase round for that candidate; the gate then asks. |
| +- `TestTriageRechecksStaleChecks` (item 6): `needs_network` before the |
| + project's first hosted verdict, at Ready to merge with a card: checks |
| + run again on the same SHA with the hosted offer; the SHA stays asked; a |
| + hosted pass refreshes the card with the hosted reason; nothing merges. |
| + Not before any hosted verdict: nothing. |
| +- `TestTriageAsksWithRecommendation` (items 1, 3): `fix_rounds` stays in |
| + Needs you with the failing units, Review's last word and `round`; Try |
| + another round starts round 3 with the feedback. |
| +- `TestTriageStale`: a person's Retry, Cancel or hold before a held row |
| + is claimed again: it does nothing. |
| +- `TestTriageBudget`: the fourth retry of a day is held with the |
| + recommendation; the next day claims it; a failed row never acts again. |
| +- `TestTriageRetriageIdempotent`: `Retriage` twice and a sync act once. |
| +- `TestTriageCancelledUntouched`: cancelled, cancel-requested, held, |
| + paused: nothing changes. |
| + |
| +Unit: the `Classify` table. Headless scenario 4 and Mac M4 now expect |
| +the automatic retry. Every guard (the reason list, the specialist list |
| +and the merge exclusion, termination, once per step, staleness, the |
| +hosted-project rule, budget, consumed rows, the principal's `dispatch` |
| +scope, never-touched) is broken once and its test watched failing. |
| + |
| +## 7. Copy |
| + |
| +New strings in `copy.go`, through a delegated Astra copy pass: the three |
| +acting lines, the recommendation and evidence lines, "Ask the |
| +coordinator", "Try another round", the hosted merge reason, and the |
| +Housekeeping view names of the three `triage_*` detectors. |
| + |
| +## 8. Moved to v2 |
| + |
| +The coordinator hand-off turn kind (most of round 1's findings: turn |
| +keys, requeue, budgets, older protocols, follow-ups), splitting a task, |
| +retrying stops that are not passing, Undo for dispatched steps, hosted |
| +passes merging on their own (amadan#136). |
| + |
| +## 9. Round 1 and where it went |
| + |
| +1. Merge authority through a hand-off retry: no hand-off; `retryStep` |
| + refuses merge steps under the principal and `Classify` never picks |
| + them (§2.1). |
| +2. Bound to the source: every key names its step and attempt or |
| + candidate, revalidated in the transaction (§2). |
| +3. Yield and requeue: no turns (§8). |
| +4. Follow-up keys: no follow-ups (§8). |
| +5. Consumed rows: only `held` is reclaimable, charges kept (§2). |
| +6. Token remainder: no model turns; steps are bounded by count (§2.4). |
| +7. Token totals: `rowSpend`, cache included, incomplete never zero (§2.4). |
| +8. Split: cut (§8). |
| +9. Protocol: no wire change (§1). |
| +10. Retry eligibility and Needs you: passing stops only, and a spent |
| + budget stays in Needs you with the recommendation (coordinator's |
| + rulings, §§2.1, 2.4, 4). |
| + |
| +## 10. Astra round 1 (revision 1): NOT READY |
| + |
| +`gpt-6-astra`, effort high, read-only, against revision 1 and main |
| 4e51bcd. Findings as given, shortened; revision 2 must answer each. |
| 1. **Critical, §3.** `resolve_task` retry can reach `RetryTask`'s merge |