ADR-0073 — Every plan that predates enforcement grants everything
- Status: Accepted
- Date: 2026-08-28
- Deciders: Track 004 phase 02, on the recommendation the grandfathering
audit stated and did not decide
(evidence
.station/jobs/004-entitlements/evidence/grandfathering-audit.md) - Follows:
ADR-0072
(a capability is a subsystem this port has — and defaults to deny),
ADR-0013
(plan quotas resolve from the plan's
settings), ADR-0011 (entitlement is evaluated server-side, per plan)
Context
Phase 02 turns eight capabilities into gates on the write path. They resolve
deny for anything that is not an explicit true in the plan's settings —
deliberately, because failing open on a capability hands out the thing being
sold (ADR-0072, CapabilityService).
No plan grants one. The keys did not exist until 2026-08-28, so every plan an
operator has ever created omits all eight, and the seeded Free plan carries
exactly one — api_is_enabled, in plans.settings since migration 000001,
read by nothing.
The grandfathering audit measured a stock database and found zero rows and zero users that any gate would refuse. Its finding is that this zero does not transfer, and the reason is an asymmetry with the quota half: an absent quota key means unlimited, an absent capability key means denied. 001's quota enforcement was therefore invisible until an operator set a number. Shipping these gates against plans that grant nothing does the opposite — on the day of the release, every user on every plan loses premium blocks, themes, templates, AI, API tokens, PWAs, targeting and password protection at once, with nothing anywhere recording that a decision was made.
Decision
Migration 000031 writes all eight capability keys as true into every
existing plans.settings, before the first gate ships. Everything is allowed
today, so granting everything changes nothing; the migration preserves current
behaviour exactly rather than defining a product's plan tiers.
Two properties of it are decisions, not incidentals:
- The grant is unconditional —
settings || {…: true}, right-biased. A value already sitting in the column does not survive it. Nothing has ever read these booleans, so apremium_blocks: falsecopied in from PHP-era data records no decision this product ever honoured; honouring it now would be a behaviour change wearing the clothes of a preservation, and the user it downgrades would be downgraded silently. Quotas and every other key in the blob are untouched — the merge is key by key. - After this migration, withholding is an operator action, not a default. Plans created afterwards carry whatever the plan form sets (phase 03), and any capability can be withdrawn from any plan there without a deploy — which is the shape the track exists to produce.
Enforcement stays create-only, per the charter: existing rows of a now-gated kind stay readable, editable and deletable.
Alternatives
- Ship the gates as they are. Rejected: a silent downgrade of every paying customer on release day, and the audit exists to prevent exactly that.
- Grant only the keys a plan does not already carry (
{…} || settings). Rejected for the reason in decision 1: it preserves values no code path ever consulted, and each preservedfalseis a user who loses something on release day. - Grant per plan, from what its tier "should" include. Rejected: that is pricing, not a migration. Nothing in the repository knows a customer's tiers, and a migration that guesses them is unreviewable.
- Ship a notice instead of a migration. Rejected: a notice does not stop the write path refusing the write.
Consequences
- On a stock database the migration touches one row and changes one behaviour:
the Free plan now grants all eight instead of carrying one decorative key.
Verified up, twice (idempotent), and down on PostgreSQL 16 with all 31
migrations applied —
evidence
.station/jobs/004-entitlements/evidence/migration-000031-grant.md. - A user whose
plan_idmatches noplansrow is not reached by this.GetEffectivePlanSettingsLEFT JOINs the plan, so for those accounts the result is their ownusers.plan_settingsblob and nothing else — the grant lands on a row they are not attached to, and they are denied all eight when the gates ship. The remedy is an operator one (assign those accounts a plan); writing the keys into each user's override instead was rejected here, because an override is right-biased over the plan forever and would hard-code today's grants into individual accounts past every future plan decision. - A stale capability key in
users.plan_settingsstill outranks the grant. The pre-#261 override panel offered twenty-five hardcoded booleans the server read none of; afalsewritten through it denies a capability this migration grants. Left alone deliberately — deleting operator-entered data is its own product call — and recorded as an open item in 004's session file. - The
.down.sqlremoves the eight keys from every plan, returning the database to "no plan grants anything". It cannot restore the Free plan's seededapi_is_enabled: true; down-then-up does, and that value was never read.
Source: docs/decisions/0073-every-plan-that-predates-enforcement-grants-everything.md