Repository navigation
docs(spec): align adaptation component validation with root themes - #6139
Conversation
… domains AST-012's FR4/IR3 said a rule may style an existing component visual-prop value but MUST NOT introduce a new one, and read as an unconditional fail-closed rule. Build tooling cannot honor that unconditionally: it enumerates a prop's domain from the component docs, and some public prop types are opaque aliases rather than literal unions, so their finite domain is not resolvable. Stated as written, the contract promised enforcement that no validator can deliver, and the honest alternative — rejecting every value on an unenumerable axis — would fail correct themes. The contract now says what is actually enforceable, in both directions: - When tooling CAN resolve a prop's finite built-in domain, it MUST reject a rule-only value that is neither built in nor present on the effective root component surface. Resolvable domains stay fail-closed. - When the domain is an opaque alias the validator cannot enumerate, the rule MAY retain the same pass-through behavior root-theme validation already has. That is a named validation limitation, NOT an extension point: accepting such a value does not make the axis extensible, and the conditional-API invariant still governs it. `component-theming-surface` mirrors the same boundary, because it owns INV15 (conditional styling does not create conditional API) and the verification row that evidences it, and records the alias-backed gap under its known conformance and verification gaps. Spec-only: no runtime, tooling, or release changes. The implementation that satisfies this contract follows in its own change. @imdreamrunner
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
left a comment
There was a problem hiding this comment.
This changes an accepted release contract rather than documenting implementation detail. AST-012 currently says adaptation rules are not an enrollment surface for component values; allowing opaque alias-backed values to pass through lets a closed axis emit unreachable CSS with no diagnostic or type augmentation. That is the exact failure the current #5543 review blocks.
Please do not weaken the accepted contract to fit the current validator. Either resolve alias-backed finite domains in shared root/adaptation validation (the intended role of #6061), or defer the adaptations API until that can be done safely. If the owner wants the pass-through limitation instead, that needs an explicit new owner decision before this spec can become current.
cixzhang
left a comment
There was a problem hiding this comment.
Approved. This now makes adaptation component writes reuse root component validation and keeps enrollment and future tightening owned by the root contract; adaptations add no parallel policy.
Summary
componentsResponsibility boundary
Adaptations own conditions, ordering, cascade, and the additional no-conditional-enrollment rule. They do not own a separate visual-prop resolver, allowlist, or inference path.
The effective root is not a registry of every valid component value. A root entry is required only when it is the enrollment evidence that makes a custom value valid. Independently valid built-ins and open primitive values need no dummy root CSS.
Why this is separate
This isolates the validation contract from the implementation in #5543. Shared root/adaptation value-domain improvements may land independently; adaptation behavior remains monotonic because it always consumes the shared root result.
Relevant discussion:
Test plan
pnpm check:knowledgedocs/specs/AST-012/spec.mdanddocs/architecture/component-theming-surface.mdStack
Predecessor to #5543. No implementation changes are included here.