spec(v0.4): S2 sub-component containment invariant (0.4.4) - #41
Merged
Conversation
…Build evidence (0.4.4) A sub-declared component id may appear only within the subtree of an instance of a declaring compound, unless the contract also declares the id as a top-level component (the explicit independently-usable escape hatch; unused by shipped contracts today). Measured need: 19% of generated nodes in the post-T3 six-scenario Build probe placed subs outside their compound (root-level form-label, select-trigger beside its select, bare alert-dialog-content duplicated beside a nested one); all passed S2-as-membership, none could be expressed as an S3 rule (all four types anchor on containers; nothing anchors at root), and the emitter refused terminally AFTER the repair loop. Two of six scenarios died unrepaired on this class. Semantics: owners come only from composition.subComponents (never names, prefixes, adjacency, or examples); pass iff at least one owner is an ANCESTOR (any depth — intermediate structure allowed); root orphans and sibling placement are the same refusal; both-declared ids are components everywhere; findings are pathed and name the orphan and its owner(s) so repair can relocate. Ownership, not order — v0.3 §8's exclusions stand. No schema change: the ownership relationship is already contract data. Enforcement lands in dspack-gen S2 (fail-first pins ride that change). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ratifies a v0.4.4 spec amendment that adds an S2 containment invariant for sub-components (derived from composition.subComponents), ensuring sub-declared component ids only appear within the declaring compound’s subtree unless also declared top-level. It also bumps the package version to 0.4.4 to publish the spec update.
Changes:
- Adds a new “S2 — sub-component containment” invariant to the v0.4 spec (§5.1) with normative semantics and rationale.
- Clarifies that containment is structural/derivable from contract ownership and must not be authored as S3 containment rules.
- Bumps
@aestheticfunction/dspack-specversion from 0.4.3 → 0.4.4.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| spec/dspack-v0.4.md | Adds the §5.1 S2 containment amendment and normative semantics to make orphaned sub-components fail in S2 (repair-visible) rather than terminally at emit time. |
| package.json | Publishes the spec change by bumping the package version to 0.4.4. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
258
to
+262
| territory, resolved through the contract at lint time. Generation schemas continue to | ||
| encode vocabulary and shape only (v0.3 §3) — neither categories nor any rule content | ||
| belongs in them. | ||
|
|
||
| ### 5.1 S2 — sub-component containment |
| ### 5.1 S2 — sub-component containment | ||
|
|
||
| > **Amendment (2026-08-07), on measured evidence.** Post-T3 Build evaluation | ||
| > against the production contract (dspack-emit eval/, six scenarios) showed |
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.
Ratified amendment: §5.1 — a sub-declared id may appear only within the subtree of a declaring compound, unless the contract also declares it as a top-level component. Structural vocabulary invariant, mechanically derivable from
composition.subComponents; explicitly NOT an S3 rule (inverse containment is inexpressible in all four rule types) and NOT a grammar constraint (generation schemas stay vocabulary+shape).Evidence: post-T3 Build probe — 19% of generated nodes out of context; 2/6 scenarios terminally dead after the repair loop never saw a finding (dspack-emit eval/t3-build-matrix.json + probe record). Companion records: dspack#40 (field trio inversion, corrected separately), dspack-emit#33 closeout report.
No schema change (ownership is already contract data); validator suite + lib boundary green; version 0.4.4. S2 enforcement + the four fail-first pins land in dspack-gen next.
🤖 Generated with Claude Code