plan: offline run's right course after branch review round 3
Section 8: why the invariants kept leaking, the single-shot shape that replaces the guards, what changed in behaviour, and that Paul's decisions in section 7 stand.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 file changed,
+26
−0
docs/superpowers/plans/2026-11-15-offline-move-run.md+26 −0
CI failed — run details
Intent
diff --git a/docs/superpowers/plans/2026-11-15-offline-move-run.md b/docs/superpowers/plans/2026-11-15-offline-move-run.md| index 6a9f3a775..335f4680d 100644 |
| --- a/docs/superpowers/plans/2026-11-15-offline-move-run.md |
| +++ b/docs/superpowers/plans/2026-11-15-offline-move-run.md |
| @@ -203,3 +203,29 @@ Targeted `-run` tests only; CI runs the suite. One amadan task each. |
| 8. Task 0 (the hand rehearsal on dev with `move.sh` on a fresh `moverehearsal` instance) has Paul's go. |
| Slice 2 (customer self-serve) gets its own plan and a security review of the token gate. |
| + |
| +## 8. Right course after branch review round 3 (2026-11-15) |
| + |
| +Round history: R1 2 P1 and 7 P2; R2 1 P1 (Ctrl-C then open, again); Paul chose "one place, guard tests, simulation" under stopping rule 2; R3 1 P1 (the 429 retry loop inside the CLI's doors posted again outside the gate) and 2 P2. No fourth fix round was allowed, so this is a change of shape, not another patch. |
| + |
| +**Why it kept leaking.** Section 3 says "read status, decide, do at most one thing, sleep 2 s". The code had four more places that could wait, post or speak on their own: the doors' 429 retry loop, the doors' first-read loop, the doors' own classification of a status body, and a watcher that put a sentence off to a later view. Each review round guarded the loop in section 3 and found the next of those four. A guard on a call site cannot see a loop inside the callee. |
| + |
| +**The shape now.** One loop, and everything else is a single shot. |
| + |
| +| Piece | Rule | Held by | |
| +|---|---|---| |
| +| `offlinerun.HTTPDoors` (new, `doors.go`) | One request a call. No loop, no wait, no retry, no output. | `TestDoorsAreSingleShot` | |
| +| `runWire` (the CLI's transport) | One `roundTrip` a call. | `TestRunDoorsWireIsSingleShot` | |
| +| `Runner.Run` | The only loop that waits: the poll, the 10 s back-off after a 429, the first reads' five tries. | `TestLoopOwnsEveryWait` | |
| +| `Runner.dispatch` | The only caller of a door. | `TestGateIsTheOnlyWayToPost` | |
| +| `offlinerun.ClassifyStatus` | The only judge of a status answer, decoding included. | `TestOneStatusClassifier` | |
| +| `Runner.judge` | The only place a Ctrl-C is promised an abort. It takes the view by value. | `TestAbortIsPromisedOnlyWithAView` | |
| + |
| +**What changed in behaviour.** |
| +- A POST or status read the rate limit answers (429) is not sent again by the doors. The loop waits 10 s, reads status, decides again and goes back through the gate. The gate forgets the limited action, so it counts towards no cap. This costs one status read per retry. |
| +- A limited POST's line ends with the console's own answer (OR13, `refused: <console sentence>`), then MV-N355 once. Before, the 429 was hidden inside the retry. |
| +- The first Ctrl-C before open is given its meaning only with a view in hand. If no view is in hand (a read cut short, or between reads during an outage) nothing is said until the next view. If that view shows the move open, OR40 is said and the run stops watching. If it shows another move or none, the run ends on that in its own words. OR28 is never put off to a later view. |
| + |
| +**Section 7 stands.** None of Paul's decisions changes. Decision 3 (first Ctrl-C aborts and follows through) holds wherever the move can still be aborted. |
| + |
| +**The simulation** (`internal/host`, `TestOfflineMoveRunSimulation`) now drives `Runner.Run` over `HTTPDoors` over the console's real handlers, so the gate, the doors, the classifier and the loop it checks are the production ones. Its faults gained 429s on POSTs and reads, status failures that pass, and status failures that do not. |