Skip to content

governance(shadcn): form-control must contain an interactive control (3.1.0) - #37

Merged
ryandmonk merged 1 commit into
mainfrom
feat/form-control-governance
Aug 7, 2026
Merged

governance(shadcn): form-control must contain an interactive control (3.1.0)#37
ryandmonk merged 1 commit into
mainfrom
feat/form-control-governance

Conversation

@ryandmonk

Copy link
Copy Markdown
Contributor

The narrow governance rule from the T1 evidence chain (emit#31#36gen#52).

  • rule.form-control-carries-control: required-composition + requiredCategories: [{id: "interactive", min: 1}], scoped to form-control, owner rationale verbatim, x-source provenance to the committed Build evidence.
  • Proven both directions with gen 0.2.2: all 14 worked examples stay S3-green; the committed zero-control probe surface now FAILS with 5 findings, each carrying the rationale.
  • Consequential widening (one spec sentence + the reference check): required-composition.component accepts a sub-component id, exactly as required-props already did — the ratified rule itself anchors on form-control.
  • Category audit: interactive also holds dropdown-menu/accordion/tabs — activatable, not data-entry. The rule stands on the category as-is; taxonomy issue filed separately.
  • Contract → 3.1.0. Harness: examples PASS, 20 negatives reject, lib boundary clean.

Downstream pins (emit/gen/studio at v2.3.0, emit eval corpus at 48643ff) are unaffected by design.

🤖 Generated with Claude Code

…(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>
Copilot AI lite review requested due to automatic review settings August 7, 2026 16:30
@ryandmonk
ryandmonk merged commit 862ca95 into main Aug 7, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.component may target sub-component ids (like form-control).
  • Add governance rule rule.form-control-carries-control requiring at least one interactive descendant under form-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 thread lib/validate.mjs
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants