Skip to content
Toolkit

ADR-0050 — The gate reads the tokens a value spends

Status: Accepted · Date: 2026-08-22 · Project: 002-renaissance, phase 04 (second slice) · Extends: ADR-0048

Context

ADR-0048 widened the parity question from "does the target have this component" to "does it have the same variants" — and recorded its own limit: value parity was still unchecked. Item 22's second half is the live case: web re-valued neutral to --surface-3/--text-2 when the sixth tone landed, while StudioTone.neutral still returns .studioSurface2/ .studioText3. Both targets state neutral, so set comparison is blind to it.

Decision

The same gate grows V3/V4, one level below V1/V2:

  • An axis opts in with values, naming the properties to compare and where each target states them — web as a CSS declaration in the value's own rule (color/background on .lk-status--neutral), Swift as the enum's computed property (ink/fill).
  • The bridge is mechanical, not maintained. .studioText3 is --text-3, by name transformation alone (strip studio, kebab-case, hyphen before digits). Nothing is hand-copied into the ledger — the hand-copied token file is the failure mode ADR-0048 already refused.
  • V3 — every value drift carries a disposition (planned | not-planned, with a reason) under values.drifts. Undispositioned token disagreement on any compared property fails the build.
  • V4 — nothing may go stale, and extraction must succeed. A drift row over agreement, a drift row for a value the targets do not both state, a web rule not declaring the property as exactly one var(--token), a missing Swift property or case arm, and a token outside the studio* namespace each fail loudly rather than comparing nothing.
  • The generated ledger gains a Value drifts (dispositioned) table under the Variant axes section, per S3's regeneration contract.

Status.tone declares ink/fill; neutral lands as the one drift row, planned — the phase-04 drift slice re-values the Swift case together with raising the enum, and V4 forces the row's deletion at that commit.

Consequences

  • The recorded drift is now load-bearing: fixing StudioTone.neutral without deleting the row fails, and re-introducing drift on any of the ten compared pairs fails at the commit that causes it.
  • A web value that stops being a single token (a literal, a second declaration) breaks V4 by design — value parity is defined over tokens, and a non-token value is a finding, not a comparison.
  • All six rule firings proven by deliberate lies before landing (V3 undispositioned ×2 properties; V4 stale row, non-shared row, missing web declaration, unmappable token, missing case arm).
  • Card's param-backed axis and Button's mixed namespace remain the next slices, per ADR-0048's order; EmptyState compares nothing until Swift declares its axis (swift: null opts the whole component out).

Source: docs/decisions/0050-the-gate-reads-the-tokens-a-value-spends.md

Library