Skip to content
Toolkit

ADR-0018: One component set, checked across three targets

  • Status: Accepted · Amended by: ADR-0179 (the Swift target and check:studio-parity retired)
  • Date: 2026-08-18
  • Deciders: Decisions 004 and 004a (operator-answered, 2026-08-14); Renaissance workstream 002, phase 00

Context

ADR-0003 made Studio canonical at the token level, after the app was found running on a hand-copied fork of the token file. Decision 004 extended the claim to components — Studio is the component library, across static CSS, React and Swift — and decision 004a asked how completing that promise is contained. The answer was workstream 002-renaissance, sized by the component inventory .station/jobs/001-renaissance/evidence/studio-component-inventory.md.

The inventory found the premise already broken in a way no gate saw:

  • Swift shipped components React never got — led by StudioConfirmDialog, while 55 app files used an app-side confirm that Studio React could not replace.
  • React shipped shells, primitives and the resource family Swift never got, with no record of whether that is intent or drift.
  • The app carried 31 components of its own in apps/web/src/components/ui/ — the set 002-renaissance exists to empty into Studio — and nothing counted it down.

Three targets, one name, no cross-check: the exact defect ADR-0003 fixed for tokens, one layer up. This repository has now paid for that defect enough times (the token fork, the two trackers, the four hand-maintained lists the catalogue/navigation/plugin/reference-data gates each ended) that the remedy is settled practice: derive the truth from source, require the exceptions to be written down, and fail the build on silent divergence.

Decision

The component sets are derived from source and gated in CI (scripts/check-studio-parity.mjs, the Studio cross-target parity step of the design-system job):

  • React is the export surface of @studio/react (src/index.js).
  • Swift is the public struct Studio* set under studio/packages/swift/Sources/, mapped through an alias table where the targets name one thing differently (TextField ↔ Input).
  • App is what apps/web/src/components/ui/index.ts still exports — kept in the ledger so "the app's components move into Studio" is a countdown, not a memory.

Skew may exist; silent skew may not. Every component present on one target and absent on another must carry a disposition in studio/parity/ledger.json: planned (with where that is tracked) or not-planned (with the reason). A gap with no disposition fails the build; so does a disposition whose gap has closed or whose component no source knows. The human-readable ledger, studio/docs/parity-ledger.md (deleted with the gate, ADR-0179), is generated by the script (--write) and CI fails if the committed copy is stale — the same contract as Studio's dist.

Cross-target parity is not symmetry. The ledger records intent, and "not planned, because…" is a valid permanent state: SwiftUI navigation idioms get no React twin, web shells get no Swift twin unless phase 04 finds a shipped surface that needs one. What the gate forbids is the state the inventory found — divergence nobody decided.

Consequences

  • Authoring a component on any target now has a bookkeeping step: the gap rows it closes must be deleted from the ledger (S2 enforces this — a stale disposition is a build failure, so the ledger cannot describe the tree as it was).
  • The gate's success line counts the app-side components not yet in Studio React — the number 002-renaissance drives to zero, visible in every CI run.
  • Renaming or removing a public component on any target becomes a visible event on every PR, which is the point.
  • The alias table is hand-maintained and validated both ways (the Swift struct must exist, the React export must exist); an alias can hide a genuine rename, but not a deletion.

Source: docs/decisions/0018-one-component-set-checked-across-three-targets.md

Library