carlos / platform Public

Plans 4d-1 ledger

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 19b8abaa1f5c9d1918ac1d8d030679aa2e05cfa2 parent 3352b43
1 file changed, +39 −0
  • docs/superpowers/notes/plans-4d1-ledger.md +39 −0

CI passed — run details

diff --git a/docs/superpowers/notes/plans-4d1-ledger.md b/docs/superpowers/notes/plans-4d1-ledger.md
new file mode 100644
index 000000000..7f2442600
--- /dev/null
+++ b/docs/superpowers/notes/plans-4d1-ledger.md
@@ -0,0 +1,39 @@
+# SDD ledger — plan: docs/superpowers/plans/2026-10-25-plans-4d-lapse.md
+Setup: Calls for Paul 1-8 ACCEPTED by Paul 2026-10-25 (recorded in plan). Spec: docs/superpowers/specs/2026-10-20-plans-caps-packs-design.md. amadan tasks 625-636.
+Task 1: complete (commits fae43b2..87ad2d1, tests: go test ./internal/plans/ → ok github.com/carlosframework/platform/internal/plans 0.293s)
+Task 2: Ruling: an old assignment that was sponsored (Sponsored set or source sponsored) counts as never paid, even on a paid plan name — Call 3 says losing sponsorship is not a lapse, and sponsored rows can name "personal" — cost if wrong: a sponsored-to-free move that should lapse would not (operator can still act by hand).
+Task 2: Ruling: added TestApplyAccountPlanWithoutACatalogWritesOnlyThePlan beyond the brief, pinning the "no catalog, no change" constraint for applyAccountPlan itself — cost if wrong: none.
+Task 2: complete (commits 87ad2d1..4beb75e, tests: go test ./internal/console/ -run 'SetAccountDisabled|PublishCarriesDisabled|ApplyAccountPlan|LapseEligible|OnlyApplyAccountPlan|AccountPlan|PlanLimits|Throttle' → ok github.com/carlosframework/platform/internal/console 18.729s)
+Task 3: Ruling: PutLapseItem/DeleteLapseItem take a ctx directly (the plan signature) and have no Context-less twin, unlike DoorKeyInsert/DoorKeyInsertContext — the plan names only the ctx form — cost if wrong: none (an extra wrapper if a caller lacks a ctx).
+Task 3: complete (commits 4beb75e..529a7df, tests: go test ./internal/console/ -run 'LapseItem|LiveAppsCreated|ClaimSQLCensus|StoreGate|ClaimSQLTableCensus|ClaimSQLUnauthorized' → ok github.com/carlosframework/platform/internal/console 14.877s)
+Task 4: Ruling: lapse domains are only claims whose app is a live app of the account; an instance catch-all claim (Instances, host "*.<parent>") is a domain with Ref "*.<parent>", judged custom on its parent — a trashed app's claim serves nothing, and the "*." ref is exactly the form the edge matches — cost if wrong: a claim on a trashed app keeps routing nowhere anyway; an instance catch-all left out would keep serving after a lapse.
+Task 4: Ruling: TestLeftoverLevels pins grace planNow+7d through evaluateCap and also asserts leftoverCap's classification — cost if wrong: none.
+Task 4: complete (commits 529a7df..bf74cf7, tests: go test ./internal/console/ -run 'LeftoverLevels|ChooseOff|SidecarsOff|LapseHosts|LapseInventory|MeasureLeftovers|CapLevels|EvaluateCap' → ok github.com/carlosframework/platform/internal/console (cached))
+Task 5: Ruling: Task 2's TestApplyAccountPlanMarksALapse and ...PackReductionIsALapse now give the account more running things than the lower plan covers, and the raise case expects lapse_since cleared — Task 5's re-converge inside applyAccountPlan clears a lapse with nothing off and nothing over, as the plan's ClearLapse rule says (pre-flight conflict between Task 2's "free -> personal: unchanged" and Task 5) — cost if wrong: none to behaviour; the tests pin the Task 5 rule.
+Task 5: Ruling: TestFurtherFallWaitsForItsOwnGrace uses a test catalog with a paid "mini" plan (cap 2) and a one-thing pack, because the example catalog's packs (5 apps each) need 26+ things to show a pack fall — cost if wrong: none.
+Task 5: Ruling: the negative tests (GraceTurnsNothingOff, WaitsForNotice, NoLapseWithoutAFall, WithoutACatalogUnchanged) pass before the implementation by design; the positive ones were watched failing (broad-t4.log) — cost if wrong: none.
+Task 5: Ruling: audit details for plan.turned_off/turned_on go in planNoticeCopy (audit.* keys) so the Luna pass covers them — cost if wrong: none.
+Task 5: Ruling: a sponsored account's things come back in the same applyAccountPlan call (it re-converges), stronger than "next pass" — cost if wrong: none.
+Task 5: complete (commits bf74cf7..0f9c115, tests: go test ./internal/console/ -run 'Lapse|ApplyAccountPlan|FurtherFall|DeletingAThing|NoLapseWithout|SponsoredAccountsNever|CustomDomainsTurnedOff|GracePass|Throttle|StorageDeny' → ok github.com/carlosframework/platform/internal/console 32.773s)
+Task 6: Ruling: planStage's lapse answer comes from a helper (lapseStages) that reads the plan row and items once per planStage call; notifyPlanOwners reads items again for lastOff and the email list — at most three small SQLite reads per account per pass, no bucket reads — cost if wrong: none.
+Task 6: Ruling: usagePhrase formats usage.custom_domains with the count only (its draft copy has one %d) — cost if wrong: none.
+Task 6: Ruling: email.lapse_off_list is appended only when a due notice is at stage lapse_off and something is off — cost if wrong: none.
+Task 6: complete (commits 0f9c115..27beff1, tests: go test ./internal/console/ -run 'BannerSaysLapse|NonEligibleBanner|CLIWarningSaysLapse|LapseOffReminds|LapseEmail|Banner|CLIWarning|GracePass' → ok github.com/carlosframework/platform/internal/console 16.548s)
+Task 7: Ruling: planDisabledFor does not match "*."+parent when the parent has no dot (a bare TLD), so a stray "*.com" entry can never turn off a whole TLD — cost if wrong: none.
+Task 7: Ruling: the page is rendered into a package var at init (its inputs are constants only), not per edge — cost if wrong: none.
+Task 7: complete (commits 27beff1..b9cb78f, tests: bash -c 'GOFLAGS=-buildvcs=false go test ./internal/host/ -run 'PlansPass|Throttle|PlanDisabled|Disabled' && GOFLAGS=-buildvcs=false go test ./internal/edge/ -run 'ImportGate|Throttle|Gate|Pending|Disabled'' → ok github.com/carlosframework/platform/internal/edge (cached))
+Task 8: Ruling: the sweep stops a turned-off live entry of any kind (instances and workers, always-on ones too), not only instances; the always-on arm and due loop skip it while off and restart it once back on (pinned in TestDisabledForSkipsDueAndAlwaysOn) — the plan says "a turned-off app serves no one" and workers are turned off too — cost if wrong: none expected.
+Task 8: Ruling: TestDisabledForLeavesProbeWakes asserts the probe's full claim-path call list; a mutation dropping the probe exemption was watched failing it — cost if wrong: none.
+Task 8: complete (commits b9cb78f..84b9b33, tests: go test ./internal/activator/ -run 'DisabledFor|ServeScheduledRefusesDisabled|MaxRunFor|IdleFor|Sweep|Due|AlwaysOn|ProbeWake' → ok github.com/carlosframework/platform/internal/activator 2.001s)
+Task 9: Ruling: a keep value naming nothing in the inventory is refused with a new keep.stale string, not keep.too_many — "You ticked N, and the plan covers M" is false for a stale form; still nothing changes — cost if wrong: one extra string (in the Luna pass).
+Task 9: Ruling: PlanKeepURL is set for owners only (members would get the owner-only 404) — cost if wrong: members see no link.
+Task 9: Ruling: the keep page also uses keep.failed, keep.on, keep.off, keep.workers strings (inventory unreadable; row state) — cost if wrong: none; all in the Luna pass.
+Task 9: Ruling: the keep POST is a claim door on bab/kass (it writes plan_lapse_items admitted per app), with check from the world; the GET is a read with a claimPageRead probe on claimWorldLapse; both filtered invariant subtests pass and the door reaches sql/plan_lapse_items — cost if wrong: none.
+Task 9: complete (commits 84b9b33..b2edd8b, tests: go test ./internal/console/ -run 'KeepPage|KeepSave|BannerLinksToKeep|ClaimConsoleRouteCensus|Banner' → ok github.com/carlosframework/platform/internal/console 14.847s)
+Task 10: Ruling: the activator hook is a named host function planDisabledRoute instead of a closure in runAgent, so runAgent gains no read sites (a body change only) and the new read is one new unit — cost if wrong: none.
+Task 10: Ruling: Luna's answer was applied verbatim (28 strings; it lengthened the lapse banner/CLI/email lines to cover domains vs newest-first, renamed tick to choose, and reworded the edge body to "If you own this site, sign in to the console for help."); its two Flags are informational (domains are not choosable on the keep page, which is the build; "workers" kept), so nothing goes to Paul — cost if wrong: copy edits.
+Task 10: Ruling: keep.workers was dropped before the Luna pass (unused) — cost if wrong: none.
+Task 10: Ruling: docs say carlos db pull/query work on a turned-off instance: apidb.go reads the bucket replica and never wakes the instance — cost if wrong: a docs line.
+Task 10: Ruling: census: 10 changed units claimed through census-propose (overlay plans-4d-lapse); 13 new units are a hand decision overlay plans-4d-units (census-ruling-plans-4d-units), chained before it; record-write layer plans4d_census_test.go (NewServer re-digested, plangrace.go capID const block's "sidecars" literal as key-site); no record writer added. Astra approval of the card is the parent's — cost if wrong: census re-run.
+Task 10: Ruling: Astra whole-branch review and CI wait are the parent session's, per the brief; one unreproduced FAIL of the edge -run set seen once after the merge (three -count=1 reruns green) — cost if wrong: a flake for CI to show.
+Task 10: complete (commits b2edd8b..3352b43, tests: bash -c 'GOFLAGS=-buildvcs=false go test ./internal/provision/ -run 'TestPlan14RootReadCensus$|TestPlan9B8RecordWriteCensus' -count=1 && GOFLAGS=-buildvcs=false go test ./internal/plans/ ./internal/host/ ./internal/edge/ ./internal/activator/ -run 'LimitsFell|RoundTrip|Disabled|PlansPass|DisabledFor' -count=1 && go test ./internal/console/ -run 'Lapse|Keep|BannerSaysLapse|CLIWarningSaysLapse|ClaimConsoleRouteCensus' -count=1' → ok github.com/carlosframework/platform/internal/console 69.380s)