governance(shadcn): form-control must contain an interactive control (3.1.0) - #37
Merged
Merged
Conversation
…(3.1.0) The rule the T1 Build evidence demanded, expressed through the §4.3 requiredCategories amendment it justified: A form-control represents the location of the user-editable control in a field. It must contain an approved interactive control; text-only or empty form controls are not meaningful form composition. (rationale verbatim as owner-approved; carried into every finding.) Scoped specifically to form-control via the existing interactive category — no component enumeration. Proven both directions with gen 0.2.2's evaluator: all 14 worked examples stay S3-green, and the committed T1 probe surface (the lint-clean zero-control form the Build matrix generated) now FAILS S3 with five findings, one per empty form-control, each carrying the rationale. Consequential widening, one sentence of spec: required-composition's `component` now accepts a sub-component id, as §4.1's required-props already did — both types anchor on lint-time nodes, where sub-components appear as ordinary nodes, and the governed location of a category requirement is very often a compound's sub-component (form-control being the motivating case). The reference-resolution check in lib/validate mirrors it. Category audit note: `interactive` also contains dropdown-menu, accordion, and tabs — activatable but not form data-entry controls. The rule stands on the category as-is (it catches the measured defect); the taxonomy nuance is filed separately rather than silently reshaping the category. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the shadcn/ui contract and v0.4 spec/validator to support and ship a governance rule that ensures form-control nodes actually contain an interactive control, aligning lint-time composition checks with the T1 evidence chain.
Changes:
- Extend spec §4.3 and validator reference resolution so
required-composition.componentmay target sub-component ids (likeform-control). - Add governance rule
rule.form-control-carries-controlrequiring at least oneinteractivedescendant underform-control. - Bump shadcn/ui contract version to
3.1.0(plus associated text normalization in the contract file).
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| spec/dspack-v0.4.md | Documents the required-composition amendment (requiredCategories + sub-component anchoring). |
| lib/validate.mjs | Updates governance reference checking to allow required-composition.component to resolve to sub-components. |
| examples/shadcn-ui.dspack.json | Releases shadcn/ui 3.1.0 and adds the new form-control interactive-control governance rule. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
148
to
149
| // required-props (v0.4) is the one type whose `component` accepts a | ||
| // sub-component id (spec v0.4 §4.1); `within` accepts either kind. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The narrow governance rule from the T1 evidence chain (emit#31 → #36 → gen#52).
rule.form-control-carries-control:required-composition+requiredCategories: [{id: "interactive", min: 1}], scoped toform-control, owner rationale verbatim,x-sourceprovenance to the committed Build evidence.required-composition.componentaccepts a sub-component id, exactly asrequired-propsalready did — the ratified rule itself anchors onform-control.interactivealso holdsdropdown-menu/accordion/tabs— activatable, not data-entry. The rule stands on the category as-is; taxonomy issue filed separately.Downstream pins (emit/gen/studio at v2.3.0, emit eval corpus at 48643ff) are unaffected by design.
🤖 Generated with Claude Code