carlos / platform Public

Astra brief for the flat-plans branch review, round 1

Briefs the reviewer on the billing paths, the removed seat machinery, storage statements, limits equivalence, the census envelope, the export and the Stripe runbook, with Paul's #1033 decisions fixed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev e0afe9bd5e0e32592742e76ea05bc4fb63b4e8da parent 9bedd59
1 file changed, +107 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-FLAT-PLANS.md +107 −0

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-FLAT-PLANS.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-FLAT-PLANS.md
new file mode 100644
index 000000000..f62557fac
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-FLAT-PLANS.md
@@ -0,0 +1,107 @@
+# Review brief: branch flat-plans (#1033, flat paid plans), round 1 of 3
+
+Repo carlos/platform, branch `flat-plans`, commit 9bedd59db1b248f3cd16df3e5f2d138bb1dfd565.
+Under review: the diff `b9eaea97c496c31a25a2e53312193270175695f0..9bedd59db1b248f3cd16df3e5f2d138bb1dfd565` (base is `main` on the amadan
+remote when the branch was cut).
+Authorities, merged on main: `docs/superpowers/specs/2026-10-20-plans-caps-packs-design.md`,
+`docs/superpowers/specs/2026-10-25-public-price-export-schema-3.md`,
+`docs/superpowers/plans/2026-10-27-plans-6c-stripe-setup.md`,
+`docs/site/plans.md`. The branch's own runbook is
+`docs/superpowers/plans/2026-11-14-flat-plans-rollout.md`.
+
+You are an independent reviewer. Read the diff, then the code it touches,
+and check every claim against that code.
+
+## Fixed: do not re-argue
+
+Paul's decisions of 2026-11-14 (amadan discussion #1033): paid plans are
+flat, priced on resources, with unlimited people; Free keeps a cap of 3
+people; Community is shown as "Teams" with the key `community` kept; Teams
+€50/y and Business €500/y flat with exactly what the 10-member minimum got;
+GBP and USD are the old per-member price times 10; packs unchanged;
+existing subscriptions move to the flat price at renewal; the book stays
+draft until Paul approves it. Report only mechanisms that fail to honour
+these.
+
+## What to check
+
+1. **Billing correctness (production money path).** Checkout, upgrade and
+ recognition in `internal/console/billingcheckout.go`,
+ `internal/console/billingchange.go`, `internal/billing/recognise.go`. A
+ new subscription must carry one plan item at quantity 1. A subscription
+ under an earlier book (per-member prices) must still be recognised and
+ must never be upgraded in place at quantity 1 (it would undercharge).
+ Can any path still send a quantity other than 1 for a plan item, or
+ charge for a person joining?
+2. **Removed seat machinery.** `billingseats.go` is deleted. Check that
+ nothing still depends on it: outstanding operations recorded before the
+ change (kind `seat`, `AuthorisedBy`, `InviteToken`) still settle
+ (`internal/console/billingops.go`); the invite revoke and accept paths in
+ `internal/console/server.go`; removal in `ownership.go`; the hourly pass
+ in `billingpass.go`; a `seats_unpaid` problem opened before the change
+ can still be closed (`apibilling.go`, `billingstore.go`
+ `problemClosableWhileLive`).
+3. **Storage.** Seat columns stay in the schema (additive rule) but leave
+ the statements in `billingstore.go` and `accountplans.go`. Check every
+ INSERT, SELECT and Scan for column and placeholder counts, and that a
+ row written before the change still reads.
+4. **Limits.** `internal/plans/catalog.go`: per-plan `ceilings` replace the
+ catalog's for that plan; `Effective` no longer takes a member count.
+ Check the new catalog `internal/plans/testdata/example-catalog.json`
+ gives Teams and Business exactly the 10-member values of the old
+ catalog (`git show b9eaea97c496c31a25a2e53312193270175695f0:internal/plans/testdata/example-catalog.json`,
+ and the deleted `internal/plans/team.go`), ceilings included, and that
+ no plan's reachable limits with packs changed. The mail pause now reads
+ the plan's ceilings (`planmail.go`, `plangracepass.go`, `planlimits.go`
+ `planCeilings`).
+5. **Member cap.** Only `max_members` (Free's 3) limits people
+ (`internal/console/planmembers.go` `checkMemberCap`, `admitMember`, and
+ `createInviteLocked` in `server.go`). Check the cap still holds under the
+ member lock for invites and joins, and that a sponsored or exempt
+ account still passes.
+6. **Catalog loading and deploy order.** `refuseTeamPlans` refuses the old
+ catalog by name. Check the runbook's claim that binary and config must
+ swap together, and whether anything else parses the catalog or the plan
+ record (`internal/plans/record.go`, boxes) and would break.
+7. **Census.** `docs/superpowers/notes/census-proposal-flat-plans.md`
+ re-pins the `internal/plans` envelope only. Give a census verdict for
+ that envelope per the card's rule: does the change let root open, run,
+ query or follow anything new, or weaken a check root relies on?
+8. **Public export.** `internal/plans/export.go`, golden
+ `internal/plans/testdata/example-public-pricebook.json`: no team block,
+ a `name` on every plan, schema number kept at 3. Is keeping 3 safe for a
+ schema 3 reader?
+9. **Stripe script and runbook.** `cmd/console/stripesetup_script_test.go`
+ `TestStripeSetupFlatBook`, `TestRepoPriceBooksLoad`, and the runbook's
+ live steps: is anything wrong or missing that would make the operator's
+ run unsafe (live changes, price map, the subscription move)?
+
+## 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 verdict for the `internal/plans` envelope
+(approve or reject, citing the lines read). 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.