carlos / platform Public

plans 6b: round-3 findings and the round-4 brief

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 98fc42c8420216d0f34070ad2b179c05388fde5d parent 3da59f3
2 files changed, +140 −0
  • docs/superpowers/specs/CODEX-FINDINGS-PLANS-6B-PLAN-R3.md +114 −0
  • docs/superpowers/specs/CODEX-REVIEW-BRIEF-PLANS-6B-PLAN-R4.md +26 −0

CI passed — run details

diff --git a/docs/superpowers/specs/CODEX-FINDINGS-PLANS-6B-PLAN-R3.md b/docs/superpowers/specs/CODEX-FINDINGS-PLANS-6B-PLAN-R3.md
new file mode 100644
index 000000000..aca0758d9
--- /dev/null
+++ b/docs/superpowers/specs/CODEX-FINDINGS-PLANS-6B-PLAN-R3.md
@@ -0,0 +1,114 @@
+**Verdict: changes required** at `c2e313e3aa9191b70c04a5d0b577f6ce8148f6d2`.
+
+No Critical findings. Six new Important findings and two Minor findings follow. Calls 1–16 are treated as settled. Wording was not reviewed.
+
+The dispositions assess the plan, not an implementation.
+
+| Round-2 finding or gap | Disposition | Evidence |
+|---|---|---|
+| 1. Replay changes request parameters | **Fixed** | Exact requests are persisted and saved operations are never resent: [591–605](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:591). |
+| 2. Restore replayed in another period | **Partly fixed** | Recovery no longer executes saved restores. However, a first send can still cross renewal; recording the period does not prevent that. New finding 2. |
+| 3. Applied invite charge bypasses admission checks | **Partly fixed** | Every admission recomputes capacity: [877–887](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:877). The single-use consent transition has a separate gap: new finding 3. |
+| 4. One-page live-subscription enumeration | **Fixed for Checkout and retirement** | Exhaustive pagination, bounded refusal and page-two tests are explicit: [448–482](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:448). See the inherited-discovery qualification below. |
+| 5. Refresh prevents returning customers buying | **Fixed** | Plain refresh is separated from the paid-allowance check: [562–567](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:562). Checkout uses plain refresh and has a cancellation regression test. |
+| 6. Background pass expires active Checkout | **Fixed** | Intent observation never expires sessions: [729–742](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:729). The broader “background passes only observe” invariant still fails elsewhere. |
+| 7. Completed intent blocks retirement | **Fixed** | Terminal intents are ignored; retirement evaluates subscriptions: [945–951](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:945). |
+| 8. Expired, never-executed Checkout request replayed | **Fixed as reported** | Checkout creation is never replayed: [757–763](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:757). Its replacement uncertainty policy needs further justification: new finding 1. |
+| 9. Budget omits algorithm costs | **Partly fixed** | Cardinalities and call-count assertions are added, but the new table still undercounts particular paths. New finding 8. |
+| Payment-fake cases | **Fixed for the previously named gaps** | Failure before delivery and renewal are modeled and tested: [416–437](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:416). Findings 1–2 require additional timing cases. |
+| Request-budget gap | **Partly fixed** | The revised accounting is substantially better, but its list cardinality and refresh costs remain inaccurate. |
+
+Across the six invariants:
+
+| Invariant | Assessment across the tasks |
+|---|---|
+| 1. Single send, period-bound operations, observation-only recovery | Tasks 7, 9 and 10 remove saved-step replay. Period enforcement and negative-outcome inference remain unsafe; customer creation and Checkout expiry also lack a complete single-send lifecycle. Findings 1, 2 and 7. |
+| 2. Capacity decided at admission | Task 11 removes the stored-`applied` shortcut and freshens capacity correctly. Consent consumption is not consistently connected to terminal operation transitions. Finding 3. |
+| 3. Exhaustive enumeration or refusal | The new Checkout and retirement lists satisfy this. However, inherited discovery still calls capped `CustomerSubscriptions` at current HEAD; Task 5 names new exhaustive methods without explicitly migrating that caller. The existing adapter returns a single page without checking completeness: [adapter.go:185](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/internal/billingstripe/adapter.go:185). The implementation needs an explicit migration or a distinction between bounded discovery and exhaustive enumeration. |
+| 4. Refresh separated from allowances | The new contracts and Checkout path satisfy this. Tasks 10–11 require the allowance check before quantity changes. |
+| 5. Background passes only observe | Operation and intent observers comply. Task 11’s seat-drift pass still changes provider quantities. Finding 4. |
+| 6. Terminal intents are history | Checkout, page decisions and retirement consistently ignore reconciled terminal intents. |
+
+Tasks 0–3 and 14–15 introduce no additional provider recovery paths. Task 12 remains an explicit owner-triggered portal action. The inherited one-line assertions were checked against revision 2; the material inconsistencies are described below.
+
+Only new findings follow.
+
+1. **Important — ten minutes plus a negative read does not establish that an uncertain request cannot still complete.**
+ Task 7 abandons an uncertain operation when its target is absent after `opQuiet`; Task 9 similarly abandons a creating intent when an exhaustive session list finds nothing. Neither contract establishes provider-side completion or cancellation of the original request. See [606–615](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:606) and [729–735](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:729).
+
+ A stop-renewal request times out while still processing. Ten minutes later, a read shows renewal enabled, so the operation is abandoned. A subsequent owner request enables renewal successfully. The original request then completes and disables it. This execution is not excluded by the provider interface.
+
+ Require evidence that the original request can no longer execute before releasing its exclusion. A documented provider guarantee could supply that evidence; elapsed time alone cannot. Extend the fake to support completion after an uncertain return and after a subsequent read.
+
+2. **Important — a first restore can execute in the next period.**
+ `PeriodEnd` is stored locally, but `ChangeRequest` carries no period precondition. Task 7 checks a moved period only after the restore response, before sending the charge: [376–382](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:376), [602–607](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:602).
+
+ In P1, three packs were paid for but the subscription currently contains one. `allowanceLocked` reads P1, renewal bills one pack, then the first restore request sets the quantity to three with `ProrateNone` in P2. Abandoning the operation afterward does not undo the free restoration. The seat path has the same problem.
+
+ `TestChargeNotSentWhenFirstStepPeriodMoved` already admits this ordering but checks only the second request. Require protection against applying the first restore outside its authorized period, and assert that P2 receives no unpaid capacity.
+
+3. **Important — successful sends can bypass single-use consent consumption.**
+ `sendOpLocked` directly records a definite successful response as `applied`. `settleOpsLocked` processes only unresolved operations, while `ConsumeInviteSeatAuthorisation` is assigned to that settlement path. See [591–614](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:591) and [865–867](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:865).
+
+ Invite A successfully purchases seat eleven, and its operation becomes `applied`; its membership write fails. Invite B takes the free seat. A retries, now needing seat twelve. The applied operation is excluded from settlement, so the stated consumption path has not consumed A’s authorization, permitting another charge.
+
+ Make every transition to `applied`, including the definite-response path, atomically consume the associated authorization. Test a crash between operation settlement and consent consumption as well as the existing failed-membership scenario.
+
+4. **Important — the seat-drift pass still mutates provider state.**
+ Task 11 explicitly makes the background pass call `reconcileSeatsLocked`, which sends reductions and free restores: [889–896](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:889). The hourly budget also includes these writes.
+
+ An account has twelve subscription seats and eleven members after a CLI removal or a failed membership write. The next pass sends a quantity reduction, changing the next renewal’s bill without an active owner request. This directly contradicts Invariant 5 and `TestObservationPassSendsNothing`.
+
+ Separate observation from mutation. Specify how deferred seat reductions are completed under the chosen invariant; simply removing this call would leave those reductions unfinished.
+
+5. **Important — the one-hour backstop escalates healthy pending payments.**
+ The outstanding states include `pending`. Task 7 opens `operation_unresolved` for any operation still unresolved after an hour, while the fake deliberately supports pending payment for 23 hours: [418](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:418), [598–615](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:598).
+
+ A pack purchase awaits payment. Every provider read succeeds and reports `PendingUpdate`. At the first pass after an hour, the account receives an operator-only problem. Payment later succeeds, but the problem still requires operator closure.
+
+ Distinguish a known pending payment from an unknown outcome or failed observation. Use the pending-payment lifecycle for the former, and test a healthy pending operation lasting beyond an hour.
+
+6. **Important — the billing page prevents owners from resuming recovered Checkout sessions.**
+ Task 8 offers nothing whenever a non-live account has an `open` or `creating` intent: [653–669](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:653). Task 9 requires another Checkout request to reuse a recovered session: [750–753](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:750).
+
+ Checkout creation succeeds but its response is lost. Observation subsequently finds the open session and stores its URL. The owner returns to the billing page, which offers neither purchase nor continuation. They cannot reach the recovered payment page through the specified UI and may have to wait for expiry.
+
+ Provide an owner action to continue an observed open session. Test the full page-to-recovery flow, not only a manually repeated POST.
+
+7. **Minor — the blanket no-resend rule is not implemented for customer binding or session expiry.**
+ Customer creation retains `customer:<sqid>` and expiry retains `expire:<intent id>`, but neither has a persisted send/outcome lifecycle comparable to operations. See [165–172](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:165), [737–758](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:737).
+
+ An expiry call fails before delivery and returns uncertain. The intent remains open. A later explicit replacement reads it as open and sends expiry again under the same key. An uncertain customer creation similarly leaves no binding, so the next Checkout attempt calls customer creation again.
+
+ Specify explicit exceptions or extend single-send observation to these paths. As written, “nothing is ever resent” is false even though operation replay is removed.
+
+8. **Minor — the revised budget still understates list and refresh costs.**
+ The table uses `L(live subs)`, but the adapter pages through subscriptions in every status before filtering. It also omits Checkout’s recorded-subscription refresh: [178–202](/home/paulca/.cache/tmp/claude-1001/plans-6b-checkout-flow/docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md:178).
+
+ A customer with 200 ended subscriptions and one live subscription requires three list requests, not `L(1)`. Separately, reusing an open Checkout with an ended recorded subscription requires refresh + list + session read, while the reuse row allows only list + session read. An empty list also costs one request, although `ceil(0/100)` is zero.
+
+ Count all objects examined, give empty enumeration a one-request minimum, and include the mandatory refresh in the relevant branches.
+
+**Call 17 is not safe to approve as written.** Refusing changes while an outcome remains unknown is conservative. Automatically declaring non-execution after ten minutes needs the missing finality guarantee in finding 1. The one-hour operator backstop is reasonable for persistent observation failures, but must exclude healthy pending payments. Alternative (b) is conservative only if operator closure also requires adequate evidence; another negative snapshot alone does not resolve the same uncertainty.
+
+This was a static, offline review. No tests, network calls or repository writes were made. HEAD, index and working tree remain unchanged.
+
+---
+
+**FIRST PROMPT:**
+“Follow the brief docs/superpowers/specs/CODEX-REVIEW-BRIEF-PLANS-6B-PLAN-R3.md exactly, at the branch's current HEAD.”
+
+**WHAT:**
+Review revision 3 of the Plans 6b implementation plan.
+
+**STATUS:**
+Complete: changes required; six new Important findings and two Minor findings.
+
+**NEEDED:**
+Call 17 remains Paul’s decision; recommendation (a) needs the fixes above before approval.
+
+**RECOMMENDED:**
+Resolve uncertain-request finality, period enforcement and atomic consent consumption first.
+
+**SESSION:**
+Safe to close. Repository unchanged; nothing started or left running.
\ No newline at end of file
diff --git a/docs/superpowers/specs/CODEX-REVIEW-BRIEF-PLANS-6B-PLAN-R4.md b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-PLANS-6B-PLAN-R4.md
new file mode 100644
index 000000000..8228f7030
--- /dev/null
+++ b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-PLANS-6B-PLAN-R4.md
@@ -0,0 +1,26 @@
+# Plan review brief, round 4: Plans 6b
+
+Round 3 reviewed c2e313e3; its findings are
+docs/superpowers/specs/CODEX-FINDINGS-PLANS-6B-PLAN-R3.md. Revision 4 is
+`git diff c2e313e3..HEAD`. Paul ruled Call 17 (auto first, then an
+operator); the mechanism is now built on Stripe's documented
+idempotency guarantees, cited in the plan. Subscription schedules were
+considered and rejected, with citations. Context, rulings and read-only
+rules as in rounds 1-3. Text the plan marks as binding in revision 2
+(c86d0692) or revision 3 (b505823d) is part of the plan; read it there.
+
+Report:
+1. A disposition table for round 3's eight findings and the inherited
+ discovery-cap note.
+2. Check the cited Stripe guarantees are used correctly: same key and
+ byte-identical parameters only; resend window inside the key
+ lifetime; cached 500s treated as unknown; 409 handling; nothing
+ released on a negative read; the 25-hour restore margin actually
+ prevents a first restore landing in the next period (including
+ resends and clock skew); MarkOpApplied as the only path to applied;
+ background passes write nothing to the provider.
+3. Only NEW findings, graded Critical / Important / Minor with a
+ concrete failure scenario.
+4. A verdict: accept, accept with fixes, or changes required.
+
+Do not review the wording.