Skip to content
Toolkit

CLOSE — 004-entitlements

Closed: 2026-08-28 · Status: DONE

The charter's objective, verified rather than asserted: an operator expresses from the Admin Portal what any plan includes, the server enforces it on the write path, nothing user-visible claims an entitlement the server does not check, and plan_level is gone.

The charter's own bar, phase by phase

PhaseDone when (charter)State
00 — VocabularyThe package ships and the gate reads it; every minted key has a recorded default and a reasonMet. packages/capabilities mirrored in models.Capabilities, every key defaulting to deny with a reason (ADR-0072); labels through the glossary; rules C1–C4 each watched failing (#260, #261)
01 — ResolutionA Go test asserts the omitted-key default and says so; resolution is one call site, not a patternMet. services.CapabilityService.Require(ctx, userID, key) beside PlanLimitService. Default deny on every path — omitted key, non-boolean, unregistered key, failed settings read — the deliberate inversion of the quotas' fail-open (#262)
02 — EnforcementRule 4 (no surviving plan_level) passes unconditionally, and the grandfathering audit ran before the switch was flippedMet. plan_level 12 → 0, held by rule C7 rather than memory; the ladder is now BlockTypeInfo.Capability on 63 of 85 types (ADR-0074). Audit first, on a stock database, and the finding that an absent capability denies where an absent quota unlimits made the first slice a behaviour-preserving grant — migration 000031 (ADR-0073, #263)
03 — ControlsAn operator grants a capability and it takes effect without a deploy — the 02-D3 proof, liveMet, on a running stack. api_is_enabled revoked → POST /account/tokens 422, granted → 201, revoked → 422, one API process never restarted and no code changed (evidence .station/jobs/004-entitlements/evidence/phase-03-running-stack-2026-08-28.md, #272)
04 — Show itEvery badge on screen derives from a resolved capabilityMet. Each catalogue card lists the six capabilities from CAPABILITIES in its order, resolved by the server's own === true (#275), and each other card marks what switching adds and takes away — the current plan read by identity, never by price (ADR-0077)

Six capabilities, not the eight minted. biolinks_themes and biolinks_templates were minted against a write path this port does not have and are retired rather than left ungated (ADR-0075). Rule C5 is what makes 02-D2 unrepeatable: a registered key with no requireCapability() call site, or a gate on a key no registry defines, fails the build. All six are enforced from 19 call sites.

Two findings the track surfaced and fixed as it went, because each was a capability surface reading the wrong source: GET /api/v1/plans served models.Plan unprojected — an operator's affiliate_commission_percentage and anything else in plans.settings reaching every signed-in account — and now serves only what the two registries vouch for (ADR-0078); and AdminUsersPage's override panel spelled 21 quota keys against a 14-entry registry, disagreeing in both directions, now drawn from the served registry and held by rule Q5.

What this track deliberately does not carry forward as work

Four open items stay listed in SESSION.md and are claimable as ROADMAP standing repairs — one PR each, named there rather than duplicated here, per the one-canonical-place rule. Two of them are product calls this track had no authority to make: there is no path down from a paid plan to a free one (CreateCheckout refuses price <= 0, so a zero-price card carries no action — honest, and it leaves a paying user nowhere to go; the old "Current plan" label concealed it), and deleting a stale capability key from users.plan_settings is deleting operator-entered data, which needs an owner's answer before code. The other two are ordinary repairs: accounts on no plan (plan_id 0, three rows on a stock seed) are outside migration 000031's grant and need an operator to assign a plan, and a password cannot be cleared through the file forms, which is now the one way a plan that loses password_protection cannot undo what it has.

Definition of done

Against docs/guides/workstream.md: the outcome is demonstrably true (1), proven on a running stack rather than in a test; verification evidence exists, including every new gate rule — C1–C4, C5, C7, Q5 — observed failing on a deliberately broken input (2); live E2E covers the surfaces this track shipped (3); ROADMAP reflects it (4); consequential decisions are ADRs 0072–0078, not comments (5); this file and a current SESSION.md (6); and nothing user-visible merged wired to nothing (7) — the capability switches on the plan form take effect without a deploy, and the catalogue cannot promise what the gate would refuse, which is that non-negotiable stated in this track's own terms.

Handoff: 005-i18n, chartered the same day. It depends on nothing this track built; it is next because ROADMAP orders it next.

Source: .station/jobs/004-entitlements/reports/CLOSE.md

Library