carlos / platform Public

plans 6a: ledger after the Astra fix pass

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

CI passed — run details

diff --git a/docs/superpowers/notes/plans-6a-ledger.md b/docs/superpowers/notes/plans-6a-ledger.md
index a17d10080..2f06fe306 100644
--- a/docs/superpowers/notes/plans-6a-ledger.md
+++ b/docs/superpowers/notes/plans-6a-ledger.md
@@ -41,3 +41,12 @@ Task 9: Ruling: SetAccountPlan's upsert is shared as a statement constant (accou
Task 9: census: 4 body units approved via census-propose (serve, Store.SetAccountPlan, NewServer, Store.migrate); 17 new units hand-written as decision census-ruling-plans-6a-units; record-write layer plans6aWriteCensusInventory (main, registerCLIRoutes, NewServer body-only).
Task 9: merged origin/main c743efea (9160c4cc); full go test ./internal/console/ -run Claim -timeout 40m → ok (1154 s); census (TestPlan14RootReadCensus, TestPlan9B8RecordWriteCensus) → ok; darwin and windows go build ./... ok.
Task 9: complete (commits a63b67e..9160c4c, tests: bash -c 'go test ./internal/provision/ -run "TestPlan14RootReadCensus|TestPlan9B8|Census" && go test ./internal/docsite/ ./internal/plans/ ./internal/billing/... ./internal/billingstripe/ ./cmd/console/ ./cmd/pricebook-export/ && go test . -run BillingCLI' → ok github.com/carlosframework/platform 0.020s)
+Final: fixed CI TestEveryCLIDoorNamesItsRoles — the two operator billing doors join the empty-role allowlist (Plan 1 precedent) and TestEveryClosedDoorRefusesAServiceCredential's count 59→61; TestEveryCLIDoorNamesItsRoles RED→GREEN.
+Final: fixed Astra finding 1 (a replacement subscription refused on stale stored state) — syncSubscription re-reads the recorded live subscription under the lock before declaring a second one; a transient read returns an error so the event is retried — TestReplacementSubscriptionBeforeOldCancellation, TestReplacementWaitsForTheOldRead RED→GREEN.
+Final: fixed Astra finding 2 (billing state committed before the plan write) — Store.SaveBillingSync commits the billing row and the guarded plan change in one transaction — TestSyncFailureBetweenWritesIsRetried (SQLite trigger fails the plan write) RED→GREEN.
+Final: fixed Astra finding 3 (missed first purchase never found) — Provider.CustomerSubscriptions (one list request, at most 10) and billingDiscoveryPass for customers bound in the last 7 days with no subscription recorded (billing_accounts.bound_at) — TestSyncPassDiscoversAMissedFirstPurchase, TestCustomerSubscriptionsLists RED→GREEN.
+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.