Skip to content
Toolkit

ADR-0051 — The axis a parameter states

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

Context

ADR-0048 declared only enum-backed variant axes and named its leftovers: StudioCard states its variants as init parameters (flush: Bool, radius: CGFloat), not an enum, and hand-copying those values into the ledger would be the hand-copied token file again. So Card — whose four Swift drifts ADR-0034 recorded precisely so phase 04 would not have to rediscover them — was the one converted component whose variant drift the gate still could not see.

Decision

variantAxes grows a third Swift extraction mode: swiftInit names a struct, and the axis's Swift value set is the Bool parameters across that struct's public inits — each name: Bool states exactly the one value its external label spells, and a value-typed parameter states none.

  • A Bool parameter is a two-state variant and nothing else is. flush: Bool is web's .lk-card--flush said in Swift's grammar. radius: CGFloat can reach the xl step (StudioRadius.xl) but does not state a variant — a free value is an API, not an enumeration, and extracting "what callers might pass" would be transcription again.
  • V1/V2 apply unchanged. Undispositioned drift fails in either direction; a swiftInit naming a struct that is gone (or that declares no public init) fails; stale and unknown gap rows fail.
  • The parity document renders the extracted set exactly as it does an enum's; *no axis* now means only a literal "swift": null.

Card lands declared: web flush, hover, selected, xl vs Swift flush. hover and selected are planned gaps — ADR-0034's recorded drifts, the phase-04 drift slice raises StudioCard and must delete both rows. xl is not-planned: the radius: parameter is the API, and the docstring's phantom size: .xl stays on ADR-0034's record for the drift slice.

Consequences

  • Adding a fifth lk-card--* modifier without touching Swift now fails verify at the commit that causes it, and renaming flush: in either target fails as a stale or undispositioned row.
  • Button's lk-btn--* namespace is the remaining leftover — it mixes variants with a size (sm), a structural modifier (icon) and both danger and destructive, so it still needs enumeration before any extractor can be honest about it. Next slice.
  • ADR-0034's other two Card drifts — s5 (20px) vs --space-6 (24px) padding, unconditional clipShape vs flush-only clipping — are base-value drifts, not variant values; they stay invisible to this axis machinery and belong to the drift slice with the raises.
  • Five rule firings proven by lies before landing: V1 ×3 (hover, selected, xl undispositioned), V2 dead struct name, V2 stale flush row, V2 unknown value — and the extractor's negative space checked (radius:, @ViewBuilder content extracted nothing).

Source: docs/decisions/0051-the-axis-a-parameter-states.md

Library