sponsor-existing-accounts: review brief, round 3 of 3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+12
−12
docs/superpowers/reviews/CODEX-REVIEW-BRIEF-sponsor-existing-accounts.md+12 −12
CI cancelled — superseded by a newer push — run details
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-sponsor-existing-accounts.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-sponsor-existing-accounts.md| index 07fcbca64..5a0207cae 100644 |
| --- a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-sponsor-existing-accounts.md |
| +++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-sponsor-existing-accounts.md |
| @@ -1,4 +1,4 @@ |
| -# Review brief: branch sponsor-existing-accounts, round 2 of 3 |
| +# Review brief: branch sponsor-existing-accounts, round 3 of 3 |
| Repo carlos/platform, branch `sponsor-existing-accounts`, the commit that adds this brief (named in your prompt). |
| Under review: the diff `origin/main...HEAD`. Paul's ruling (2026-10-31): every account that exists when plan limits switch on is sponsored with no limits, so no existing user hits a cap or has to pay; new accounts get normal plans. A new optional catalog field `sponsor_accounts_before` (RFC 3339) names the cutoff. Round 1 (findings in `~/.cache/sponsor-existing-accounts/review-r1.md`, all four addressed) led to a redesign. Settlement is now synchronous at console startup (`sponsorAtStart` / `SettleLaunchSponsorship` / `Store.SponsorExistingAccounts`), before billing, NewServer, workers and the listener. It writes every sponsored row in one transaction. A future cutoff, an unreadable account manifest or a failed write makes that start run with plans and billing off. The derived `sponsorOwed` gate was removed. Paul's rulings, added in this round: sponsored rows are exempt from the plan 3b daemon and always-on refusals; the billing page shows "Unlimited" for sponsored values. |
| @@ -7,19 +7,19 @@ Under review: the diff `origin/main...HEAD`. Paul's ruling (2026-10-31): every a |
| No limit, cap, grace step, mail pause, throttle or limits record acts on an account that is owed a sponsorship, at any point, including before settlement, during a failed settlement, and across console restarts. Settlement never overwrites a row written by an operator or a checkout. |
| +## Round 3 (final) |
| + |
| +Round 2 (`~/.cache/sponsor-existing-accounts/review-r2.md`) found a P1, late materialization escaping sponsorship, and a P2, fractional cutoffs. Paul chose the structural fix for the P1: **sponsor on insert.** The rule lives in a one-row table, `plan_launch_sponsorship`. `SettleLaunchSponsorship` records the rule at startup and sponsors the existing accounts in the same transaction. A start with plans off clears it. Every account insert (`CreateAccount`, `EnsureAccount` used by NewServer materialization, `console member` and late CLI mints, and the ops backfill) applies the rule in its own transaction. The invariant is stated in `internal/console/plansponsor.go`. Fractional cutoffs are refused before parsing. |
| + |
| ## What to check |
| -1. Round 1's four findings are resolved, with no new instance of the same fault families (consistent sponsorship state during enforcement, eligibility at the payment boundary, settlement completeness, cutoff precision). |
| -2. The startup ordering in `cmd/console` really precedes every reader of plan limits, and the source-reading test `TestServeSettlesTheSponsorshipBeforeItServes` would catch a regression. The serve lock gives one console per store. The builder left one gap open on purpose: `console member` takes no lock. Judge whether it matters. |
| -3. Plans-off on refusal: no path half-enables plans or billing. |
| -4. The daemon and always-on exemption covers sponsored rows only, and does not leak to other sources. |
| -5. Every enforcement path that reads plan limits sees a sponsored row for every eligible account. Hunt for paths that bypass `EffectiveLimits` (box limits records, member cap, free-account rule, plan 3b refusals, rate-limit and keep doors, billing page and checkout). |
| -6. The bulk insert writes only when no row exists. Check that it doesn't bypass anything `applyAccountPlan` does that a sponsored row needs (transition, limits record, revision). The census test that makes `applyAccountPlan` the only plan-change path still holds in spirit. |
| -7. The "unlimited" values (`sponsorUnlimited`) cannot overflow anywhere they are used, on the console or the box (grace multiples, mail pause, durations, rate limits, limits-record JSON). |
| -8. The catalog ID: an unset field leaves existing IDs unchanged, and fractional cutoffs are refused. |
| -9. Census card and overlay in `docs/superpowers/notes/census-proposal-sponsor-existing-accounts.md`. You are the census reviewer: approve or reject it with reasons. The envelope was re-pinned after round 1, so it needs approval at this commit. |
| - |
| -Out of scope (Paul's rulings, don't report them): the catalog's email ceiling still applies to the mail pause, and sponsored accounts count toward the free-account rule. Copy wording is under Paul's own review. |
| +1. The invariant holds on every path that makes an account row exist. Hunt for any insert into `accounts` that bypasses the rule, and for any way an account becomes visible to enforcement or checkout before its row commits. |
| +2. Clearing and recording the rule can't leave it stale or wrong: a plans-off start clears it, and a `console member` run concurrent with a console start is safe. |
| +3. The P2 fix is complete. |
| +4. Earlier rounds' fault families don't recur (enforcement consistency, the payment boundary, settlement completeness, cutoff precision). |
| +5. Census: the `internal/plans` envelope was re-pinned at this commit. Approve or reject it. Also check that the new table's classification in the claim SQL gate is right. |
| + |
| +This is the final round. Report only real defects. P3s go on a follow-up list. |
| ## Severity |