carlos / platform Public

Billing pages (Plan 2): controller rulings and follow-ups open

On branch billing-dash-2-pages

Every ruling the Plan 2 controller made, in order, with what it costs if wrong. Branch tip e00bceaf, CI passed. Final review by Astra and Fable is clean after one fix wave.

  • P1. Billing routes are registered on every console and 404 from the handler (plan), not registered only when on (spec §4.1) — the visible behaviour is identical (http.NotFound body and status, POST too) and it keeps the claim census seeing the routes — if wrong: three registerRoute calls move behind an if.
  • P2. Copy record (T1) is drafted by an Opus subagent and served by the controller through copy-review to Paul (brief: Paul edits), not delegated to Luna — the controller brief says Paul edits in the review page — if wrong: Paul spends time on a review he would have delegated.
  • P3. BDC-20 and BDC-36 (Plan 1 parked wording, rulings 28 and 30 on discussion 775) ride in this copy review as extra rows; an edit to either is applied to Plan 1's record and code in Task 2's commit — if wrong: two strings move in a later commit instead.
  • P4. Copy review served with serve.sh from scratch, not copy-review submit — the worktree is outside the app's roots and copy-review/ in the repo holds another review's tracked files — if wrong: none, same review page.
  • T2-1. Built inventory = every id whose constant exists in code (all BDP-1..150 now), overriding my dispatch decision 1 — the record's rule says so and it gates the whole file — if wrong: none, stricter gate.
  • T3-1. platformCost.OK stays true when the usd rate is missing (Cents 0); the figure's inRates(usd) declaration refuses it — plan's struct comment ("its dollars converted") and Task 3 text conflict; Task 3's text keeps one refusal path (the gate) — if wrong: a figure that skips declaring inRates would show €0 platform cost; reviews check declarations.
  • T3-2. New moneyWhyHistory code; accountFigures takes the history month as the calendar month before in.Now — matches Tasks 4/5's last complete month — if wrong: a caller wanting another month needs a parameter.
  • T3-3. Usage day object over the 8 MiB read cap counts as a read failure (Economics incomplete, costs refused) — the brief says any non-ErrNotExist failure counts; showing a partial cost is the anti-goal — if wrong: one oversized object hides costs until the cap is raised.
  • T4-1. Payment status rule: Refunded for refund-kind rows with negative amount, Paid otherwise; What column carries Refund reversed / Payment returned; Task 6 reuses opBillingPaymentRowOf — one rule on both pages — if wrong: one helper changes.
  • T4-2. BDP-5 (full rate sentence) also under the overview header — global constraint says every converted figure carries the rate date; the record's file note is placement guidance, the text is unchanged — if wrong: one line removed.
  • T4-3. NearestCaps keeps the five labelled usageCaps (the caps the customer's usage page shows) and additionally skips stale periods (capPeriod(cap, now)), taking now as a parameter; contract written in its comment — plan says "highest ratio among caplimit>0" AND "the cap's label as billingusage.go maps them"; the other caps (awakehours, lapse-only sidecars/customdomains) have no approved label — if wrong: a free account near awakehours isn't listed; adding needs one copy row.
  • T4-4. Native breakdown applies to converted totals (tiles, earned lines, month rows, Shared and idle), not per-account cells — spec §4.4 says "next to every converted total"; per-account cells stay euro with the estimate label — if wrong: per-account rows gain a second line.
  • M-1. The parity row's note ("The operator Billing pages: the overview, paying accounts and payments.") ships without copy review — parity.tsv/docs/parity.md is an engineering inventory, not product or user docs; its sibling rows were not copy-reviewed — if wrong: one line re-worded later.
  • T5-1. Accounts tabs keep listing rows when facts/payments are stale; only tab counts are refused (plan text) — rows are identities and every money cell is gated; overview's paying list is a money summary — if wrong: a stale read can show an account under the wrong tab until the next sync.
  • T5-2. Tab label + space + count ("Paying 2") and the pager's aria label reusing BDP-15 need no new copy row — the count is a number beside an approved label, as in the mockup — if wrong: one row added later.
  • T5-3. Upheld T4-4: per-account cells stay euro with the estimate label and the page's BDP-5 rate sentence, no native line — spec §4.4 names converted TOTALS; per-account cost is a single-currency usd model output already labelled estimate; adding native under every cell doubles row height on a 50-row list — if wrong: accountFigures gains Native and both lists render it (one round).
  • T5-4. BDP-14 shows when stored history starts after the month's 1st (overview's condition, now shared opBillingHistoryNote), not for any uncovered month — BDP-14's words are about history start; a mid-month gap shows BDP-13 per cell — if wrong: one helper condition.
  • T6-1. buildOpBillingPayments takes facts after rows (brief signature lacked it) — reusing opBillingPaymentRowOf needs names and deleted checks — if wrong: signature only.
  • T6-2. Month filter offers the current month and 11 before it, plus any requested older month — no extra store read per render — if wrong: months older than a year are reachable only by URL.
  • T6-3. At 390 px payment rows show Account and Net in euros — matches the other lists' narrow hiding — if wrong: CSS only.
  • T6-4. Accepted for the payments list: a row whose settlement currency is not eur shows its native settled net and fee (Stripe's recorded amounts) under the euro figures; eur-settled rows unchanged — these are conversions of recorded money, unlike T4-4/T5-3's modelled per-account cells, which stay as ruled — if wrong: one muted line on rare non-eur rows.
  • T7-1. Dashboard tile's converted ARR note carries the rate date (BDP-4) but no native breakdown; it links to Billing where the breakdown is — if wrong: one muted line on the tile.
  • T7-2. Reverses T7-1's no-breakdown half: the tile's ARR is a converted total, which the spec's §4.4 rule covers; the tile shows the same native breakdown as the overview's ARR tile — if wrong: one muted line removed.
  • F-1. One fix wave for: the four P2s + two cheap P3s (Native on opBillingMoney's inventory copy; operator POST with billing on test). Deferred P3s: deleted accounts' costs fall in no reason row; ARR delta mixes rate days; six uncached bill reads per overview render; funnel sessions EXISTS cost on large consoles; edge/parse read-failure test coverage; crowded Dashboard tile — none changes a shown number's honesty enough to block; on the follow-up list.

Deferred follow-ups (P3 and minor):

  • Task 2: minor (deferred): brief's 'Perf.*Walk' filter matches no test; screen walk is TestConsoleScreensMeetTheBudget (passes).
  • Task 3: minor (deferred): sweep read-failure test covers metrics Get only; edge Get failure and both parse-failure counters untested (economicspass.go:455,516).
  • Task 3: minor (deferred): test runs used TMPDIR=/tmp/g (controller brief allows it for socket tests); keep scratch cleaned.
  • Task 4: minor (deferred): opbilling_overview.go:374 sets Native on the returned copy after opMoney appended it; v.Figures lacks Native (inventory only).
  • Task 4: minor (deferred): store functions were written before their tests (no RED run for BillingFunnel/NearestCaps).
  • Task 4: minor (deferred): ARR delta has no breakdown of its own (ARR note carries it).
  • Task 6: minor (deferred): no money assertions for a taxed refund and its reversal (ideally non-eur settled).
  • Task 7: minor (deferred): with billing on the five Dashboard tiles narrow to fit six at 1280; test-mode pill wraps; the converted note runs four lines in the sixth tile.