Skip to content

spec(v0.4): S2 sub-component containment invariant (0.4.4) - #41

Merged
ryandmonk merged 1 commit into
mainfrom
feat/s2-containment
Aug 7, 2026
Merged

spec(v0.4): S2 sub-component containment invariant (0.4.4)#41
ryandmonk merged 1 commit into
mainfrom
feat/s2-containment

Conversation

@ryandmonk

Copy link
Copy Markdown
Contributor

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

…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>
Copilot AI lite review requested due to automatic review settings August 7, 2026 21:02

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

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-spec version 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 thread spec/dspack-v0.4.md
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
Comment thread spec/dspack-v0.4.md
### 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
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