Skip to content
Toolkit

ADR-0030: Identity vocabularies are generated packages; runtime data is served; modules are compiled, not loaded

  • Status: Accepted
  • Date: 2026-08-20
  • Deciders: Repository owner, ahead of track 003; generalises ADR-0016 and ADR-0017, informs ADR-0014

Context

The PHP predecessor iterated fast because its "plugins" were never code — a module's existence, activation and per-plan availability were rows and config re-read per request by a shared interpreted runtime (available_plan_features.php, enabled_biolink_blocks). The Go port cannot copy that mechanism, and the question kept resurfacing in three disguises: should Go load plugins dynamically; which shared concepts deserve a packages/* package the way link-model does; and why did hand-copied vocabularies (targeting lists, the retired plugins array, the app's token file) keep drifting into live bugs.

Decision

Three rules, one per disguise:

  1. Shared identity vocabularies become packages, generated from one data file. A vocabulary two runtimes must agree on — where drift is a live bug — lives in one language-neutral source with types generated per consumer, the way studio.tokens.json already generates the token layers. Planned instances: packages/product-model (track 003 phase 00 — the widened registry), packages/block-model (track 003 phase 02 — block descriptors + render spec as JSON, generating TS types and Go structs), packages/capabilities (track 004 — the capability key vocabulary), and promoting shared/contracts to a package whose generated client types make API drift a compile error (standing repair).
  2. Shared runtime vocabularies are served, never packaged. Data whose truth lives in server behaviour (targeting lists, plugin status, plan quotas) is exposed by an endpoint derived from the code that consumes it — ADR-0017's rule, restated as the general boundary. A package snapshot of runtime data is the copy-drift defect with a version number.
  3. Go modules are compiled and composed, not dynamically loaded. The expendability the PHP system bought with an interpreter, the Go port buys with data: a "module" is a statically compiled service behind a narrow interface, constructed (or not) by the composition root (apps/api/cmd/server/plugins.go) from config, probed live per ADR-0014, activated per plan by flags/capabilities. Go's stdlib plugin package is rejected (platform-locked, exact-toolchain-locked, breaks the portable single binary); subprocess RPC plugins are rejected as unwarranted for a single-binary SaaS. Fast iteration comes from moving the axis of change into data plus a seconds-long redeploy — not from hot-swapping code.

Consequences

  • Track 003's deliverables are packages by name, not directories to be invented mid-track; its charter cites this ADR.
  • The test for "should this be a package" is now written down: identity → generated package; runtime → endpoint. link-model and Studio's token pipeline are the precedents on the first side, ADR-0017 on the second.
  • Anyone proposing a plugin loader, a .so module, or a hand-copied vocabulary answers this ADR first.

Source: docs/decisions/0030-identity-vocabularies-are-generated-packages-runtime-data-is-served.md

Library