plans: Plan 4 refresh round 3, refuse up front (#511)
R9-R14 after Astra's round 2 (stopping rule 2): the durable attempt ID always wins; a monotonic armed root replica floor; one console barrier for every door needing the floor; relaxed budget only for fleet tiers; copies above 1 need a durable LastGood; parity for /deploy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/plans/2026-11-01-stateless-replicas-4-deploy-and-drill.md+22 −0
CI passed — run details
Intent
<task-notification> <task-id>b5lod83is</task-id> <tool-use-id>toolu_01G8wzaqtcCQuzD6QpeZu91g</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/72128d15-58b8-452f-9f7e-8e864e8854d2/tasks/b5lod83is.output</output-file> <status>completed</status> <summary>Background command "Run Astra plan review round 2" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 25.6 g CO₂e (2,977,507 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on stateless-replicas-4, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/docs/superpowers/plans/2026-11-01-stateless-replicas-4-deploy-and-drill.md b/docs/superpowers/plans/2026-11-01-stateless-replicas-4-deploy-and-drill.md| index 3c22450e8..66e0808fc 100644 |
| --- a/docs/superpowers/plans/2026-11-01-stateless-replicas-4-deploy-and-drill.md |
| +++ b/docs/superpowers/plans/2026-11-01-stateless-replicas-4-deploy-and-drill.md |
| @@ -118,6 +118,28 @@ Plan 4 was written against main of 2026-11-01. It is refreshed here against main |
| - The retirement stop still goes through `swap.go:834`. The ACK follows the stop proof. |
| - Test: one request is paused between admission and selection while successor requests keep arriving; retirement stays bounded, and the ACK comes only after the stop proof. |
| +### Refresh round 3: Astra plan review, round 2 (R9-R13; refuse up front and enforce in one place) |
| + |
| +Round 2 found the same fault families again. Under stopping rule 2, these rulings refuse up front or centralise the enforcement; they do not add more per-path cases. |
| + |
| +- **R9 (R1), the durable attempt always wins.** The coordinator adopts the record's attempt ID in every phase: pending, releasing, released, failed, unknown or done. It mints a new ID only for a changed target or incarnation, or for an unconsumed durable `RetryOf`. The writer at `replicadeploy.go:51` enforces the same rule. Tests: takeover by a box with a populated book, after failed, after unknown and after done, with zero extra release commands. |
| +- **R10 (R5), the root floor is armed and only ever moves forward.** The box does not judge live registry evidence at activation. |
| + - A durable root marker, "replica floor armed", is written once, before this box first projects anything that needs the floor: an assignment with copies above 1, a retiring assignment, or a fleet tier. It is written by the same root path that owns the existing moves floor (`rootMoves`, `readEffectiveMovesFloor`), and it is never cleared automatically. |
| + - `activationRule`, `activationGuard` and forward recovery refuse a candidate below StatelessReplicasFloor whenever the marker is armed. That marker is the only evidence the guards read, so a projection writer racing the guards cannot invalidate the check. |
| + - Tests: arm, then race a projection write after the final predicate, then attempt a downgrade, which is refused; journal recovery with the marker armed. |
| +- **R11 (R4, R6), one console barrier for all replica policy.** |
| + - A single `replicaPolicyBarrier(ctx, need)` runs under the floor mutex. It checks the published system pointers (the `fleetfloor.go:139,179` pattern; an unreadable pointer refuses), the console build and the destination boxes. |
| + - Every door whose result needs StatelessReplicasFloor calls it: copies, size override, default size, create with a size, and placement when the size is a fleet tier. The publication judge takes the same mutex. |
| + - Tests: both orders, for copies 2 and for a 12g default, with the heartbeats unchanged. |
| +- **R12 (R6), the relaxed budget is only for fleet tiers.** Existing named sizes (small to xlarge) keep the quarter rule everywhere, so an old binary still applies an existing name exactly as before. Only the new fleet tiers (6g and up) use `FleetMemoryBudget`, and only they need the floor. The first user is unaffected: xlarge, 2 GiB, already fits a t4g.xlarge under the quarter rule. Test: xlarge on a 7990 MiB fleet box is still refused by the quarter rule; 6g on a 16 GiB fleet box is allowed. |
| +- **R13 (R3), copies above 1 need a durable baseline.** |
| + - The first begin after the upgrade turns a legacy same-incarnation `released` record into `LastGood`. |
| + - Raising copies above 1 is refused until the record holds `LastGood`, so a legacy record whose history is only failed or unknown must deploy successfully once first. That refusal uses a new SR-4 copy row: "deploy once, then set copies". |
| + - Tests: legacy released, then upgrade, then failure, then failure, then a returning box joins A; a legacy failed record refuses copies 2. |
| +- **R14 (D2), parity.** `/deploy` is added to the coordinator row at `parity/parity.tsv:249`, and the parity docs and `internal/console/parity_test.go` stay green. |
| + |
| +**Round limit.** This is the third and final plan round. If Astra's round 3 still finds a P1, the next step is to cut scope or ask Paul, not a fourth round. |
| + |
| - **Test patterns.** Each task's red run names only its new tests, because `TestReplica(Release.*|Deploy.*|OnlyOne.*)$` already matches about 20 passing Plan 1 tests. |
| - **Execution.** Opus implements; Astra reviews every task, and Fable is added for root, termination and the whole branch (Paul, 2026-11-08). Review rounds are capped at three. |