Skip to content
Toolkit

ADR-0072 — A capability is a subsystem this port actually has

  • Status: Accepted
  • Date: 2026-08-28
  • Deciders: Repository owner, track 004 phase 00
  • Follows: ADR-0030 (identity vocabularies are generated packages, runtime data is served), ADR-0013 (plan quotas resolve from the plan's settings), ADR-0011 (entitlement is evaluated server-side, per plan)

Context

A plan in this system can count things and cannot include anything. All fifteen plan keys are numeric quotas (audit finding 02-D2); the block picker renders PRO/ULT badges from a plan_level the create path has never consulted. The missing half is a boolean — a capability — and phase 00's job is to decide which ones exist before any of them is enforced.

The obvious source is the PHP reference's available_plan_features.php, which assembles roughly forty feature names. Taking it wholesale would be wrong in both directions. It mixes counts with booleans, and the counts are already models.PlanQuotas. It also names subsystems this port does not have: there is no cloaking, no deep links, no app linking, no leap link, no per-link SEO or dofollow, no per-user font selection, no white labelling, no email reports, no user-facing newsletters, and no slug generator (so "custom URL" is not a distinguishable feature — every URL here is user-chosen). A key minted for a subsystem that does not exist can never acquire an enforcement call site, so it would sit in the registry forever as exactly the thing the track exists to abolish: a declared entitlement that gates nothing.

Decision

Eight capabilities are minted, in packages/capabilities/capabilities.json with the Go mirror in apps/api/internal/models/capability.go: premium_blocks, biolinks_themes, biolinks_templates, ai_tools, api_is_enabled, custom_pwa_is_enabled, targeting_is_enabled, password_protection.

A key is minted when all three hold:

  1. The subsystem exists in this port, with a user-facing write path — not in the PHP reference, and not on a roadmap.
  2. The thing is boolean, not a count already in PlanQuotas. A boolean beside a count is two gating mechanisms for one resource, which the charter rules out; a quota of 0 already blocks creation.
  3. Withholding it is a coherent offer — a plan that does not include it is a smaller plan, not a broken one.

Rule 3 is why sensitive_content is not minted although the PHP system sells it and this port has the field: it is a safety affordance, and withholding it makes the public page worse rather than the plan smaller. It is why statistics is not minted either — gating it would be a read-path gate, and enforcement here is the write path — and why account data export is not: that is a data-rights obligation, not a product tier.

Keys keep the PHP spelling wherever the PHP system had the key, so a plans.settings blob carried over keeps its meaning. This is not theoretical: the seeded Free plan already carries {"api_is_enabled": true}, a capability key living in this port's own data with nothing reading it. One key deviates — PHP's password is spelled password_protection here, because a settings-blob key spelled password reads as a credential wherever the blob is logged, diffed or pasted into an issue. Keys with no PHP counterpart (premium_blocks, ai_tools) take no _is_enabled suffix; the suffix carries no information.

premium_blocks replaces the free/pro/ultimate ladder rather than porting it. PHP's enabled_biolink_blocks is a per-plan set an operator maintains against 85 types; this port's registry already marks which types are premium, so a plan includes them or it does not. The three-level ladder cannot survive in any case: plans here are admin-created rows with arbitrary names (charter finding 3), so nothing maps pro or ultimate to a plan. Inspecting the tiers confirms they encode nothing a plan could include — applemusic is Pro and audio is Ultimate, image_grid is Pro and image_slider is Ultimate. A distinction with no rule behind it does not become one by being carried over.

Every capability defaults to deny, recorded rather than implied, and gate rules C1–C3 hold it: the JSON source is present and non-empty, every entry carries a key, label, description, reason and a default of exactly false (the Go side writing Default: false out in full), and the two runtimes hold identical keys in identical order.

Consequences

Eight keys is eight enforcement call sites owed by phase 02, and gate rule C5 — a registered capability with no enforcement is a build failure — will collect that debt rather than leave it discoverable only by audit. Until C5 turns on, the eight are declared and unenforced, which is the state 02-D2 describes; the difference is that it is now written down, gated, and one phase from being closed.

An operator sees eight new rows on the plan form (phase 03) and nothing changes for any existing user until phase 02 flips a gate, after the grandfathering audit has run.

Minting a ninth capability means answering the three tests above in the PR that adds it. Retiring one means removing its key from both runtimes in the same commit, because C3 refuses the intermediate state.

Source: docs/decisions/0072-a-capability-is-a-subsystem-this-port-has.md

Library