Skip to content

spec: v0.4 draft amendment — textScope, ∃-within, trigger rule re-anchor (ADR-M3-1 amendment)#13

Merged
ryandmonk merged 2 commits into
mainfrom
spec/v0.4-amendment-textscope
Jul 4, 2026
Merged

spec: v0.4 draft amendment — textScope, ∃-within, trigger rule re-anchor (ADR-M3-1 amendment)#13
ryandmonk merged 2 commits into
mainfrom
spec/v0.4-amendment-textscope

Conversation

@ryandmonk

Copy link
Copy Markdown
Contributor

What

The ADR-M3-1 amendment, maintainer-directed after PR-15's decomposition (dspack-gen#24): the first live run of required-props showed the rule as authored was stricter than the projection it protects — 67 of 204 violating runs had surfaces the A2UI target emits successfully (labeled bearer + textless sibling button), and 20 more carried liftable misplaced text; only 117 were irreducibly unprojectable (no label text anywhere).

Changes (v0.4 is a draft; semantics freeze at release)

  1. textScope: self | subtree on requiredText (default self, schema-enforced dependentRequired): subtree expresses "carries a label somewhere under it" — for compound wrappers whose documented projections lift text from within.
  2. within is now ∃-quantified: at least one matching descendant per scope satisfies the constraints (was: every one must). The ∀ form is what flagged the textless siblings.
  3. rule.trigger-carries-label re-anchored: alert-dialog-trigger + requiredText + textScope: subtree — stating exactly the precondition of the extended, audited lift landing in dspack-emit (companion PR). Contract → 2.2.0.
  4. §4.1 amendment note records the principle: a rule SHOULD state exactly the precondition of the projection it protects — stricter requirements (e.g. "no unlabeled buttons") are separate rules with their own rationales (deliberately NOT added to shadcn: icon-only buttons are legitimate).

Acceptance

npm run validate green; 17/17 negative fixtures rejected (new: bad textScope value).

Companions (sequenced, not stacked)

dspack-gen evaluator update + fixtures + findings correction note (the merged 131/73 split used a bucket definition that counted trigger-own-text as projectable-today; the emitter does not consume it — corrected numbers 67/20/117); dspack-emit audited lift; ds-mcp sync; amendment-effect rerun.

🤖 Generated with Claude Code

…-M3-1 amendment)

On PR-15 evidence (dspack-gen#24: 216 runs; corrected decomposition 67
projectable-today / 20 liftable / 117 no-text-anywhere):

- required-props requiredText gains textScope: self|subtree (default self;
  dependentRequired on requiredText); 'within' scoping is now ∃-quantified.
  Amendment note in §4.1 states the principle the evidence taught: a rule
  SHOULD state exactly the precondition of the projection it protects.
- rule.trigger-carries-label re-anchored on alert-dialog-trigger with
  textScope subtree — 'an accessible label exists somewhere under the
  trigger' — matching the audited lift landing in dspack-emit. Contract
  2.1.0 -> 2.2.0.
- migration doc amendment note; negative fixture for bad textScope.

validate + 17 negative fixtures green. Maintainer-directed amendment
(2026-07-04); v0.4 is a draft — semantics freeze at release, not before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

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 v0.4 draft spec, migration guide, schema, and example pack to amend required-props semantics so rules more precisely match the projection preconditions they are intended to protect (notably for trigger labeling).

Changes:

  • Introduces textScope: self | subtree for requiredText and documents the draft amendment rationale in the v0.4 spec and migration guide.
  • Changes within evaluation semantics to be ∃-quantified (at least one matching descendant per scope satisfies constraints) and re-anchors rule.trigger-carries-label to alert-dialog-trigger.
  • Updates schema validation (incl. dependentRequired) and adds a negative fixture; bumps the shadcn example contract version and updates the rule instance.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spec/migration-v0.3-to-v0.4.md Updates the migration example rule and records the draft amendment note for the re-anchored trigger-label rule.
spec/dspack-v0.4.md Amends required-props documentation: adds textScope, switches within to ∃ semantics, and records the evidence-based draft amendment.
schema/dspack.v0.4.schema.json Adds textScope (enum + default) and schema-level dependency to require requiredText when textScope is present.
fixtures/negative/rule-required-props-bad-textscope.dspack.json Adds a negative fixture to ensure invalid textScope values are rejected by schema validation.
examples/shadcn-ui.dspack.json Updates example contract version and re-anchors rule.trigger-carries-label to alert-dialog-trigger with textScope: subtree.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread schema/dspack.v0.4.schema.json Outdated
Comment thread spec/dspack-v0.4.md Outdated
…aluation-unit wording

- requiredText schema description no longer claims descendant text never
  satisfies (contradicted textScope: subtree); points at textScope.
- spec §4.1 semantics reworded: constraints are ALWAYS evaluated against
  candidate nodes matching component, never the within node; within changes
  candidacy, quantification, and finding location. The two modes and the
  constraint definition now name their evaluation unit explicitly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ryandmonk ryandmonk merged commit 41c0aad into main Jul 4, 2026
1 check passed
@ryandmonk ryandmonk deleted the spec/v0.4-amendment-textscope branch July 4, 2026 14:37
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