Skip to content
Toolkit

ADR-0048 — The gate widens from names to variants

Status: Accepted · Date: 2026-08-22 · Project: 002-renaissance, phase 04 (first slice)

Context

check-studio-parity.mjs reconciles component existence per target and nothing else. Phase 04's opening question was recorded twice on 2026-08-20, in the same shape: web's Status grew a sixth tone and re-valued neutral while Swift's StudioTone kept five cases and the old pair; web's EmptyState grew the free-standing/compact distinction (ADR-0028) while StudioEmptyState frames unconditionally. Both passed the gate silently — "does Swift have this component" was the wrong question. The right one: does it have the same variants, with the same values.

Decision

The same gate grows a second axis instead of a second script. The ledger's new variantAxes section declares, per component, one variant axis and where each target states it; the S-rules' contract repeats one level down as V-rules:

  • Truth is extracted, not transcribed. Web's value set is read from the CSS modifier prefix (lk-status--* across studio/packages/core/src); Swift's from the named public enum's top-level cases, or the empty set where the axis entry says "swift": null — Swift declaring no axis at all, which is itself the EmptyState drift.
  • V1 — every variant gap carries a disposition (planned | not-planned, with a reason) under the axis's gaps. Undispositioned drift fails the build, in either direction.
  • V2 — nothing may go stale: a gap row for a value the target now states, a value neither target knows, an enum name StudioKit no longer declares, a prefix matching no class — each fails.
  • The generated parity-ledger.md gains a Variant axes table, under S3's existing regeneration contract.

Only enum-backed axes are declared. StudioCard states flush and the xl radius as init parameters (flush: Bool, radius:), not an enum — a parameter extractor is a later slice, and hand-copying its values into the ledger would be the hand-copied token file again. Button's lk-btn--* namespace mixes variants with a size (sm), a structural modifier (icon) and both danger and destructive — it needs enumeration before it can be declared honestly. Neither is in this slice.

Consequences

  • Two axes land declared: Status.tone (gap: accent, swift, planned — the archived item-22 drift) and EmptyState.variant (gap: compact, swift, planned). Raising StudioTone or adding the Swift variant now requires deleting the gap row, and adding a seventh web tone without touching Swift fails verify at the commit that causes it.
  • Value parity is still unchecked. Item 22's second half — neutral resolving to --text-3/--surface-2 in Swift but --text-2/--surface-3 on web — is invisible to set comparison. The next slice compares per-value tokens (the studioText3 ↔ --text-3 mapping is mechanical); the gap row's reason carries the pointer until then.
  • Card's parameter-backed axis and Button's mixed namespace are the other named leftovers; each becomes a slice with its own extraction, not a hand-maintained list.
  • All six rule firings (V1 both directions; V2 stale row, unknown value, missing enum, dead prefix) were proven by deliberate lies before landing.

Source: docs/decisions/0048-the-gate-widens-from-names-to-variants.md

Library