011-plan-ladder — the plans are a ladder somebody can climb, and every rung of it is enforced
Chartered: 2026-08-30 · Status: ACTIVE ·
Source: product gap assessment .archives/removal-safe/docs/assessments/PRODUCT-GAP-ASSESSMENT-082926.md
§Plans · Predecessor: 010, closed 2026-08-30
(close-out)
Problem
004 delivered a sound mechanism and never claimed to deliver a ladder: fifteen enforced quota axes, six default-deny capabilities with a parity gate, an admin plan form that takes effect without a deploy, and a catalogue that cannot promise what the gate would refuse. What it left is a mechanism with one plan in it.
Re-verified against the tree at e9a320c rather than inherited from the
assessment, which is a day old and is now stale in one place because 010 shipped
in between:
- The seed has exactly one plan.
migrations/000001insertsFreewithprices'{}', and nothing since adds a second.CheckoutHandler.Createrefuses a price of zero or less (checkout.go:89-91), so there is no purchasable tier in the product — not a mispriced one, none. - Three of the overview's five axes are missing, not four. The registry has
fifteen keys;
storage_bytes_limitlanded with 010 phase 04 as its first magnitude axis. Absent: a custom-slug axis, a subdomain axis, and a seat axis.teams_limitis not seats — its own description says it counts "legacy teams plus shared workspaces the user owns", so it bounds how many workspaces you may have, never how many people may be in one, andWorkspaceHandler.AddMemberchecks no quota at all. - The downgrade path is not missing. It is present and it cannot run. The
hourly
expire_subscriptionscron (services/cron_tasks.go:15-33) is the only code in the tree that moves an account off a paid plan, and it assigns and compares the string'free'againstusers.plan_id, which isINT NOT NULL DEFAULT 0(migrations/000001:68). PostgreSQL 16 refuses the statement at parse time, with zero matching rows, so the task has errored on every run it has ever made and no subscription has ever expired (evidence.station/jobs/011-plan-ladder/evidence/expire-subscriptions-postgres-2026-08-30.md). - A quota is resolved against the acting member's plan, in a workspace that
is not theirs.
CheckStorageBytes(ctx, userID, workspaceID, adds)reads the usage from the workspace and the allowance from whoever is uploading. Every older axis ischeck(ctx, userID, …)with no workspace at all. Since000026,workspace_idis the access boundary — so whose plan applies is an unanswered question the ladder makes expensive rather than academic. - New accounts are on a plan that does not exist.
users.plan_iddefaults to0; the seededFreeplan isplan_id1. This is 004's residue, restated because the ladder is where it stops being harmless.
Objective
The plans are a ladder somebody can climb, and every rung of it is enforced. Named tiers exist with their axes set and their prices the owner's to fill; the three missing axes are in the registry with the paths that read them; and moving between rungs — up by purchase, down by expiry — is a path that runs.
The bar is the one 007 set and 008, 006, 009 and 010 kept: the serving path obeys. A quota axis no write path reads is not an axis, a tier nobody can buy is not a rung, and a downgrade that errors is not a downgrade. 007's rule applies unchanged here — and this track is where it gets tested against a number rather than a boolean.
Phases
Each is independently shippable and revertible. Phase 00 mints the ledger and its gate before any axis or tier lands, for the reason six tracks have recorded: a scoreboard minted after the work measures nothing.
| Phase | Outcome | Done when |
|---|---|---|
| 00 — The ladder ledger and its gate | One row per rung of the ladder — each new quota axis, the expiry path, the tier seed — naming what stores it, the path that must read or run it, and its test | npm run check:ladder prints N of M closed, starts with everything open, is watched failing on a deliberately broken input, and a row flips only in the commit that adds its reader. A row for an axis names the write path that refuses on it; a row may not claim closed on a stored number alone |
| 01 — The bottom rung runs | An expired subscription actually lands on the free plan | The expiry task is proved failing against PostgreSQL first, then fixed, then proved moving a row — and the free plan is resolved by identity, never by a literal spelling (ADR-0077's rule one table over). users.plan_id's default of 0 is settled in the same slice: an account on no plan gets a stated answer rather than an absent one. Idempotent and re-runnable, 009's transition rule |
| 02 — The seat axis | How many people may be in a workspace is a number the product knows and refuses on | A seats_limit axis in the registry, unseeded, read by WorkspaceHandler.AddMember — which today checks nothing — and by nothing else. The count is of the workspace's roster, not of the actor's workspaces, so it is not teams_limit under a second name |
| 03 — The custom-slug axis | A plan can bound how many names a workspace holds | A custom_slugs_limit axis read by the claim check ADR-0115 made the single answer for all fourteen write paths — one reader, because 009 already proved there is exactly one place a name is taken. What counts as custom is decided in the ADR, not in a handler |
| 04 — Whose plan applies | One answer, in one place, for every axis | The per-user/per-workspace split is resolved and every quota call site moves onto it in the same commit, with a gate rule holding it there. Nothing new is enforced in this phase; it is the phase that stops the ladder meaning two different things in two different rooms |
| 05 — The tiers exist and the catalogue tells the truth | Named tiers are seeded with their axes set, and the surface says what each rung costs and includes | The seed lands the shape — tier rows with every quota axis and capability set, prices left for the owner, status such that nothing half-priced is purchasable — and 004's admin form fills the prices without a deploy. The catalogue reads the seeded rows, and CheckoutHandler's refusal of a non-positive price stays exactly where it is |
Subdomains are deliberately not a phase. See Blocker 3: the axis would have no serving path to read it, because 009 phase 06 was never built.
Out of scope
Subdomain addressing itself (009 phase 06, gated on 009's Blocker 2); what a hosted artifact may execute (010 Blocker 3); the storage axis's own mechanism, which 010 phase 04 landed and this track only seeds; payment-gateway work beyond what a seeded price already exercises; ACME/SSL; tax and discount mechanics, which exist; and any new analytics surface.
Blockers — owner decisions
Each is named here with options and a recommendation and is answered by nobody in the meantime. None blocks the buildable remainder: 00–04 proceed around them, and 05 needs the first only for its numbers, never for its shape.
- What are the tiers, and what does each cost? Names, the axis values per tier, monthly/annual/lifetime prices, currency, trial days. The repository cannot infer any of it, and the assessment says so. Recommendation: phase 05 seeds the shape and the axes — the part that is product mechanics — with prices left empty and the rows in a status that is not purchasable, so nothing half-priced can ever be bought; the owner then fills prices through the admin form 004 built, which takes effect without a deploy. A seeded price this session invented would be a number nobody agreed to, in a table customers are charged from.
- What happens to a workspace already over the new quota when it moves down a
rung? Options: (a) refuse the downgrade while the workspace is over; (b)
allow it and let the existing quota semantics apply —
current >= maxrefuses the next write and touches nothing already stored; (c) disable or archive the excess by some stated rule. Recommendation: (b) — it is what the mechanism already does, it never destroys an author's work, and 009 settled the neighbouring question the same way (nothing is deleted by a clock). (a) traps an account on a plan it is trying to leave, which is the worse failure of the two. - Does a subdomain quota mean anything before subdomains exist? 009 phase 06 was not built, gated on 009's Blocker 2, so there is no path that could read such an axis. Options: (a) add it now, unenforced — which is precisely what 007's ledger exists to forbid and what "nothing user-visible merges wired to nothing" refuses; (b) hold it until subdomains ship, and say so on the ROADMAP row. Recommendation: (b), and this charter is built that way: the axis is named in the ledger as an open row with no phase, so it is visible rather than forgotten, and it cannot be ticked.
- Whose plan applies in a shared workspace — the owner's or the acting
member's? Today it is neither consistently: fifteen axes read the actor's
plan, and the newest one reads the actor's plan against the workspace's
usage. Options: (a) the workspace owner's plan governs everything in that
workspace; (b) the acting member's, as today; (c) the more permissive of the
two. Recommendation: (a) —
workspace_idhas been the access boundary since000026, a member should not import their own allowance into somebody else's workspace, and (b) makes a workspace's limits depend on which colleague happens to click. Phase 04 is scoped to apply the answer in one place; it does not need the answer to build the one place.
A fifth question this charter answers rather than asks: a rung is closed only when something reads it. A stored number, a seeded row and an admin control are all necessary and none of them is sufficient; the ledger's rows flip on the reader, exactly as 007's, 009's and 010's did.
Verification
The bar is the one the last six tracks kept, and it is not restated per phase:
npm run verifyexit 0 andgo vet ./... && go test ./...green before every merge; the merge gate is local (ROADMAP "Standing policy").- Every new or widened gate watched failing once on a deliberately broken input,
recorded in
evidence/. - A phase whose subject is a statement is proved against PostgreSQL 16, not against a mock — 009 phase 05's rule, and phase 01 here is exactly that shape: its defect is invisible from Go and was found by running the statement.
- A live E2E spec per new user-facing surface. The live suite does not currently run in this environment (010's close-out records why); where it cannot, the phase says what it proved instead, and against what.
- Migrations at the next free number with a
.down.sql, applied manually, never renumbered.
Source: .station/jobs/011-plan-ladder/README.md