plans 6b: whole-branch review brief (round 1 of 3) and follow-up list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+80
−0
docs/superpowers/notes/plans-6b-followups.md+24 −0docs/superpowers/reviews/CODEX-REVIEW-BRIEF-plans-6b-branch.md+56 −0
CI failed — run details
diff --git a/docs/superpowers/notes/plans-6b-followups.md b/docs/superpowers/notes/plans-6b-followups.md| new file mode 100644 |
| index 000000000..29f1c9811 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/plans-6b-followups.md |
| @@ -0,0 +1,24 @@ |
| +# Plan 6b follow-ups (P3 and deferred minors) |
| + |
| +Per AGENTS.md stopping rule 1, these never start a review round. From the per-task reviews (SDD ledger) and the copy pass. |
| + |
| +- Task 1: minor (deferred): team_test idle-ceiling assertion proves nothing (plan idle == ceiling 900) |
| +- Task 1: minor (deferred): no test of team factor <= 1 (ceilings unscaled boundary) |
| +- Task 1: minor (deferred): TestCatalogRefusesBadTeams checks only err != nil, not which rule fired |
| +- Task 1: minor (deferred): near-MaxInt64 pooled ceilings make team Effective fail rather than saturate |
| +- Task 2: minor (deferred): FormatMinor fixed %02d vs MinorPerMajor; empty currency leading space; no thousands separator |
| +- Task 2: minor (deferred): TestPublicExportSchema3Team Pooled compared with PooledLimits itself |
| +- Task 3: minor (deferred): acceptInviteLocked maps any transition error to 410 gone (pre-existing) |
| +- Task 3: minor (deferred): membership rise keeps 4c throttle on the CLI path until the hourly pass |
| +- Task 3: minor (deferred): CLI reads old row outside the transaction (cross-process race, pre-existing) |
| +- Task 4: minor (deferred): price swap onto an already-present price not refused; no test of invoice lines past one page; fake.go ~1300 lines |
| +- Task 5: minor (deferred): PrepareChange accepts duplicate ItemID; ProrationDate to the second; redundant ids=nil |
| +- Task 5: fix round 1/5 (7 addressed, 0 open; af3b406a). minor (deferred): no test pins Content-Type on POSTs |
| +- Task 6: minor (deferred): intent state list twice (NonTerminalCheckoutIntents vs intentTerminal) without a tie test; race subtest asserts only != 200 |
| +- Task 7: review 1 (38bcc5e9): Important raiseExplained loose+untested; minors taken: stall on unmoved/missing, restore pass paging, forged hold, missing-path evidence, stall opened_at clock, dead code, crash test budget, gate test comment; + restore first-send margin in sendOpLocked. minor (deferred): billingops.go 723 lines mixed |
| +- Task 8: review 1 (Astra, 219045d5): P1 prices don't follow currency radios; P2 upgrade not-owner lacks /accounts/new link; P2 strings outside billingCopy; P2 action order. P3 (follow-up): flaky store/scan/object probe returned pending once. |
| +- Task 9: review 1 (Astra, de7e00bb): P1 (Invariant 8) indeterminate create/expiry classification lost when the following observation fails, then resendable; P1 (return contract) a completed intent skips observe+sync on /done. P3 follow-ups: broad-pattern lifetimes timeout; page offers Buy while checkout.uncertain says "Use Confirm now" for an unanswered customer create (copy pass). |
| +- Task 11: review 1 (Astra, e5c17749): P1 unknown historical price recorded as 0 covers a charge; P1 DB read errors return admitJoined; P2 CSRF literal copy; P2 outstanding mapping (ruled: keep admitUncertain); P2 TDD order (recorded); P3 fresh-read test opens problem before the request (taken). |
| +- Task 8: follow-up (P3): TestClaimConsoleMutationInvariant's GET /api/cli/apps/{account}/{app}/store/scan/object probe answered pending instead of clean once locally; the rerun passed. |
| +- Task 9: follow-up (P3, copy pass): with an unanswered customer create the page offers Buy (Task 8's !Live row) while checkout.uncertain says "Use Confirm now". |
| +- Task 7 Minor 9: billingops.go mixes store, decisions and the HTTP door; split the store into its own file. |
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-plans-6b-branch.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-plans-6b-branch.md| new file mode 100644 |
| index 000000000..44752cb6c |
| --- /dev/null |
| +++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-plans-6b-branch.md |
| @@ -0,0 +1,56 @@ |
| +# Review brief: branch plans-6b-checkout-flow (Plan 6b: checkout, team plans and the billing page), round 1 of 3 |
| + |
| +Repo carlos/platform, branch `plans-6b-checkout-flow`, the commit that adds this brief (named in your prompt). |
| +Under review: the diff `origin/main...HEAD` (merge base 0a32ce38, main merged in as c0e7d1dc). |
| +Authorities: the spec `docs/superpowers/specs/2026-10-20-plans-caps-packs-design.md` (merged on main), Plan 6a as merged (7f79385e), and the plan this branch builds, `docs/superpowers/plans/2026-10-25-plans-6b-checkout-flow.md`, which rides on this branch (Astra accepted it after nine rounds; Paul ruled Calls 1 to 18). Review the code against that plan. |
| + |
| +You are an independent reviewer. Read the plan's Invariants, Risks, Calls, Global Constraints and Review Focus, then the code, and check every claim against that code. This is the code's first whole-branch round; every task already had its own review (records in `docs/superpowers/notes/plans-6b-ledger.md`). |
| + |
| +## Fixed: do not re-argue |
| + |
| +- Paul's Calls 1 to 18 and accepted risks R1 and R2 (the plan, "Calls for Paul" and "Risks"). Report only mechanisms that fail to honour them. |
| +- The plan's design: Stripe idempotency keys as the finality primitive; provider time (a response Date at most 60 s old plus monotonic elapsed, one clock probe where a path has no read) for every billing safety decision. |
| +- Every line marked `Ruling:` in `docs/superpowers/notes/plans-6b-ledger.md`. Raise one only with new evidence that it breaks an invariant. |
| +- `docs/superpowers/notes/plans-6b-followups.md` lists P3s and deferred minors already known; don't re-report them. |
| +- Billing is dormant: nothing runs unless the console's billing variables are set (6c, Paul's live Stripe setup). Don't report the dormancy itself. |
| + |
| +## What to check |
| + |
| +1. **Never charge twice, never charge without consent** (Invariants 1, 2, 7, 8, 9): every provider write is a persisted `billing.Prepared` sent verbatim; resends only through `recoveryEligible`; an indeterminate request (cached 5xx) is never resent; a seat charge needs a stored, single-use, verifiable authorisation; revocation and resends share `opOutstanding`. Trace `sendOpLocked`, `finishOpLocked`, the Checkout create/expiry and customer create paths (`billingcheckout.go`) and seat admission (`billingseats.go`). |
| +2. **Provider time only** in first-send stamps, resend windows, the restore margin, `expires_at`, proration dates and the restore stall. Look for any console wall-clock value reaching one of these. |
| +3. **Late restore after renewal** (Risk R1, `billinglate.go`): obligations survive read failures and restarts, an unknown start quantity never explains a raise, the stall opens one problem. |
| +4. **Locks**: billing hold vs the member lock (member lock first, never under a billing hold), `*Locked` helpers never lock, no forged `billingHold{}`; the retirement gate's order (finish ops, resolve intents, then judge subscriptions, no provider write after step 3) and the step-up replay (`billingretire.go`, `stepup.go`, `emailsignin.go`): a failed step-up setup clears retirement; a replay needs its retirement mark. |
| +5. **Passes only read** (`billingpass.go`): no `Send`, no `PortalURL`, local writes only under the hold. |
| +6. **Request budgets**: the call-count tests assert what the plan's budget rows say, reads included. |
| +7. **The step-up change is a security gate**: `requireFreshAuth` now wraps `stepUpGate`; check every other caller keeps its behaviour. |
| +8. **Merge with main** (c0e7d1dc): conflicts were resolved in `internal/console/server.go` (struct fields) and `svcroutes_test.go` (closed-door count 68). Check nothing from main was lost there. |
| +9. **The census** (you judge it; Paul no longer rules on census classes, #280): the root-read card `docs/superpowers/notes/census-proposal-plans-6b-checkout-flow.md` reports no changed units and two re-pinned envelopes, `.` (the root `carlos` package) and `internal/plans`. Read every changed function in those two packages and what it reaches, and answer the card's question: does any root read now open, run, query or follow a path or input a tenant, an app or a box agent can create, write or name, or is a check weakened? Also the record-write layer `internal/provision/plans6b_census_test.go`: it re-pins `Server.registerCLIRoutes` and `NewServer` with unchanged kinds; confirm the bodies add no record write. Give an approve or escalate verdict per envelope and for the record-write layer. |
| + |
| +## Severity |
| + |
| +- **P1**: unsafe, would not compile, a test fails, or it would not work. |
| + Blocks merge. |
| +- **P2**: wrong or missing. Fixed without reopening this review. (The |
| + census, and review of any newly changed security, root, termination |
| + or production-storage behaviour, still check the fix; see AGENTS.md, |
| + "Stopping rules".) |
| +- **P3**: clarity or polish. Goes on a follow-up list; never a reason for |
| + another round. |
| + |
| +A P1 states its failure scenario and the evidence (file:line). Do not |
| +raise a P2 to P1 to keep the review open. |
| + |
| +## Output |
| + |
| +Findings ranked P1, P2, P3. Each gives the section or task, the problem, |
| +the evidence (file:line, verified), the failure scenario, a concrete |
| +fix and the invariant or trust boundary it breaks (that is its fault |
| +family). Then the census verdicts (item 9). End with exactly one verdict: |
| + |
| +- **READY**: no P1 and no P2. |
| +- **READY AFTER FIXES**: no P1. The listed P2s are fixed without another |
| + round. |
| +- **NOT READY**: one or more P1s, listed. |
| + |
| +Do not edit files. Do not spawn Anthropic-model reviewers or subagents of |
| +your own. Do not run the full test suites (a targeted `go test -run` is fine if a doubt needs it; the Go build cache may be read-only in your sandbox). |