carlos / platform Public

plans 6a: ledger after the Astra fix pass and the Plan 4d integration

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev c93bf4d0eaa34050036ce7b44b3cafbe203ec461 parent f713e24
1 file changed, +3 −1
  • docs/superpowers/notes/plans-6a-ledger.md +3 −1

CI passed — run details

diff --git a/docs/superpowers/notes/plans-6a-ledger.md b/docs/superpowers/notes/plans-6a-ledger.md
index 2f06fe306..a72a21046 100644
--- a/docs/superpowers/notes/plans-6a-ledger.md
+++ b/docs/superpowers/notes/plans-6a-ledger.md
@@ -48,5 +48,7 @@ Final: fixed Astra finding 3 (missed first purchase never found) — Provider.Cu
Final: fixed Astra finding 4 (ErrNotFound kept paid limits silently) — a not-found current live subscription opens one deduplicated subscription_missing problem, limits kept; closing it while the provider still answers not found ends the subscription and drops to the default plan — TestMissingSubscriptionOpensAProblemThenCloses RED→GREEN.
Final: fixed Astra finding 6 (unpaid problem closable) — billing.Subscription.Live (settlement) separate from State (entitlement); the adapter's liveOf counts unpaid as live; close refuses while Live — TestCloseRefusedWhileUnpaid, TestLiveOf RED→GREEN.
Final: fixed Astra finding 7 (Minor, request budget) — the plan's budget restated as built (2 subscription reads per sync, a third for a recorded live one, discovery lists, readiness 1 + prices + products); no test.
-Final: Ruling: Astra finding 5 (billing bypasses Plan 4d-1's applyAccountPlan) deferred to after 4d-1 merges: billing activation is blocked until then — the parent will brief the integration — cost if wrong: billing cancellations would lower limits without starting the lapse lifecycle if billing were switched on first.
Final: merged origin/main 953b9fda (496621b9); census regenerated: plans-6a-units hand overlay now 19 units (setBillingPlanTx, putBillingState, type sqlExecer, DiscoverableBillingAccounts new; SetBillingPlan and PutBillingState no longer read), seal c3c0dfd0, census-propose seal 30908dfa, record-write layer on plan14SelfServeMoves1; TestPlan14RootReadCensus + TestPlan9B8 → ok; full go test ./internal/console/ -run Claim -timeout 40m → ok (472 s); darwin and windows builds ok.
+Final: fixed Astra finding 5 (billing bypassed Plan 4d's lapse lifecycle), after merging origin/main 9b81d97b (4d-1): applyAccountPlan and the new applyBillingPlan share transitionAccountPlan (lapse lock, old row, grace re-converge and publish after a write); Store.SaveBillingSync commits the billing row, setBillingPlanTx's guarded write (default/billing rows only, unchanged writes suppressed) and, for a fall (lapseStarted), Plan 4d's own markLapseSQL and deleteCapStateSQL in one transaction; lock order billing account lock -> lapse lock -> store transaction; Store.SetBillingPlan removed; publishPlanNow removed — TestBillingCancellationStartsALapse, TestBillingPackReductionAtRenewalStartsALapse, TestBillingRepaymentTurnsThingsBackOn RED→GREEN (mutation check: with the lapse mark off both lapse tests fail), TestBillingSyncGracePassAndOperatorDoNotDeadlock, existing TestSetBillingPlanLeavesSponsoredAndOperatorRows, TestPaidSubscriptionOnSponsoredAccountOpensProblem, TestSyncUnchangedKeepsThrottle and 4d's TestOnlyApplyAccountPlanSetsAccountPlans green.
+Final: Ruling: a deleted account in SaveBillingSync is (false, false, nil), not ErrAccountGone, so a sync for it finishes rather than retrying; TestSetBillingPlanRefusesADeletedAccount now asserts that and no row — cost if wrong: none.
+Final: merged origin/main 9b81d97b (f713e241); census: 20 hand units seal 544fad24, census-propose seal a6fe3a52, record-write layer on plans4d; census tests ok; full go test ./internal/console/ -run Claim -timeout 40m → ok (478 s); darwin and windows builds ok.