fix: re-pin vendored core to dspack-gen v0.5.0 and re-sync the coupled copies - #27
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR re-pins the vendored @aestheticfunction/dspack-gen/core (and related byte-copied artifacts) to align ds-mcp with dspack-gen v0.3.2 and the updated dspack v0.4 contract/schema expectations, restoring CI and making previously untracked drift detectable.
Changes:
- Re-pin
@aestheticfunction/dspack-genfrom v0.1.2 to v0.3.2 (commitcbc9e1c) and update lockfile accordingly. - Re-sync/update the dspack v0.4 schema and extend
scripts/check-sync.mjsto drift-track all four dspack schemas plus the compiler-input contract fixture. - Adjust tests to use the correct contract fixture for golden generation-context comparisons and update validator fixtures to reflect contract evolution.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/generation-tools.test.ts | Updates test fixtures/comments and a surface fixture to remain valid under newer contract rules. |
| src/tests/generation-context-golden.test.ts | Switches the golden test to load dspack-gen’s own contract fixture copy to keep golden/input pairing stable. |
| src/tests/fixtures/shadcn.v0_4.contract.json | Adds a byte-synced copy of dspack-gen’s shadcn v0.4 contract fixture for golden pairing. |
| src/schema/dspack.v0.4.schema.json | Re-syncs schema and incorporates the requiredCategories amendment support. |
| scripts/check-sync.mjs | Expands drift checking to include all dspack schemas and the dspack-gen contract fixture. |
| README.md | Updates documentation to describe the new pin, behavior changes, and drift checks. |
| package.json | Updates the git commit pin for @aestheticfunction/dspack-gen. |
| package-lock.json | Updates resolved version/metadata for the new dspack-gen pin and dependency ranges. |
| CHANGELOG.md | Documents the behavior change and coupled sync/test updates in Unreleased notes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+195
to
+196
| commit, `npm install`, `npm run build`, `node scripts/check-sync.mjs | ||
| --write`, verifying the golden tests, and republishing ds-mcp. |
| }, | ||
| "rules": { | ||
| "type": "array", | ||
| "description": "Machine-checkable governance rules, evaluated deterministically over dspack surface documents. Each rule is a typed, structured predicate plus a human-readable rationale. Evaluation semantics per type are normative in the v0.3 specification (the three original types) and the v0.4 specification (required-props, forbiddenCategories).", |
ryandmonk
added a commit
that referenced
this pull request
Aug 12, 2026
Ecosystem documentation audit. Each claim re-verified by running the code. - Quick start downloaded shadcn-ui-v04.dspack.json and wrote it to the unversioned shadcn-ui.dspack.json — the exact collision the changelog says the rename existed to prevent. Keeps the version in the filename now, and documents the npx path (verified working), so the local-install route is no longer a dead end. - docs/demo-shadcn.md told readers to download via the Quick start and then run a v0.2 file the Quick start never produces. It now fetches v0.2 explicitly (URL verified 200) and says plainly that the walkthrough's counts are exact for v0.2 while the Quick start ships v0.4. - CONTRIBUTING claimed a "pre-alpha repository" with a "planned tool surface" and pointed twice at examples/README.md, which does not exist. Eleven tools ship; links now point at docs/README.md and examples/. - SECURITY said "the dspack 0.3 generation tools"; the code gates on 0.3 and 0.4. - README now documents the MCP return shape (JSON inside a single text block, errors in the same channel rather than as protocol errors) — the one thing the stated "MCP client authors" audience needs and no doc gave. The vendored-core paragraph this PR originally rewrote is left untouched: the pin has since moved to v0.3.2 in #27, which rewrites that paragraph to the post-re-pin truth. Keeping the two PRs off the same lines lets them merge in either order. (#27 also corrects two claims this branch made: `containment` is a gate-S2 vocabulary check rather than an S3 rule family, and `forbiddenCategories` was already evaluated at v0.1.2 — only `requiredCategories` was genuinely unevaluatable.) Verified: build, unit tests, and scripts/smoke.sh all pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The core-pin-drift and copy-drift jobs have both been red since dspack-gen
0.3.2 and dspack 0.4.3 shipped. They are not separately fixable: the newer
contract needs the newer core, and — not previously known — both need a
newer JSON Schema.
Re-pin the devDependency from the v0.1.2 tag (c5bfd6d) to the v0.5.0 tag
(5203569, the current latest) and re-sync every copied artifact. This
CHANGES what validate-ui rejects, which is the point of the move, not a
side effect:
- S2 now enforces sub-component containment (spec v0.4 §5.1): a declared
sub-component is valid only inside its declaring compound's subtree.
(dspack-gen 0.3.0)
- S3 now evaluates requiredCategories on required-composition rules
(§4.3). (dspack-gen 0.2.2)
- get-generation-context serves each component's composition.notes in the
system prompt — prompt material, no S-gate change. (dspack-gen 0.5.0)
forbiddenCategories was already evaluated at v0.1.2, so it is unchanged.
Exactly four shipped src/core files differ across the move: vocabulary.ts,
contract.ts, lint/rules.ts, compiler.ts. dspack-gen 0.4.0/0.5.0's other
work lives in run/, which ds-mcp does not vendor.
A third stale copy blocked the first two. src/schema/dspack.v0.4.schema.json
predates the §4.3 amendment, so the loader rejected the spec's own example
contract ("/rules/48: must have required property 'requiredSubComponents'").
Nothing tracked that file: the schemas were byte copies of the spec repo
with no drift check. All four are now in the check-sync manifest — v0.1–v0.3
were already byte-exact, v0.4 was not.
The golden-context test relied on an identity that has since broken. It read
dspack-gen's compiler golden against examples/shadcn-ui-v04.dspack.json,
which was byte-identical to dspack-gen's own contract fixture. The spec repo
has since advanced to contract 3.2.0 while dspack-gen's fixture stayed at
2.3.0, so that comparison started failing for reasons unrelated to the
compiler. The test now reads dspack-gen's contract fixture — the golden's
other half, newly drift-tracked — so it compares compiler output against
the compiler's own input. Tracking the pair also made the 0.5.0 prompt
change land as one coherent re-sync.
Contract 3.2.0 also adds rule.button-carries-text, under which a button
whose only text sits in a descendant is itself a violation, so the
textScope: subtree fixture moves its label onto the button. The trigger
still carries no text of its own, which is what that test pins.
Verified: npm ci clean, 94/94 tests (the pre-drift baseline), smoke.sh
green, both check scripts exit 0, pin exactly at the latest release tag.
Publishing a new ds-mcp version is a separate owner decision.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ryandmonk
force-pushed
the
fix/repin-core-v0.3.2
branch
from
August 12, 2026 16:12
17d99a3 to
fc4a642
Compare
ryandmonk
added a commit
that referenced
this pull request
Aug 12, 2026
Ecosystem documentation audit. Each claim re-verified by running the code. - Quick start downloaded shadcn-ui-v04.dspack.json and wrote it to the unversioned shadcn-ui.dspack.json — the exact collision the changelog says the rename existed to prevent. Keeps the version in the filename now, and documents the npx path (verified working), so the local-install route is no longer a dead end. - docs/demo-shadcn.md told readers to download via the Quick start and then run a v0.2 file the Quick start never produces. It now fetches v0.2 explicitly (URL verified 200) and says plainly that the walkthrough's counts are exact for v0.2 while the Quick start ships v0.4. - CONTRIBUTING claimed a "pre-alpha repository" with a "planned tool surface" and pointed twice at examples/README.md, which does not exist. Eleven tools ship; links now point at docs/README.md and examples/. - SECURITY said "the dspack 0.3 generation tools"; the code gates on 0.3 and 0.4. - README now documents the MCP return shape (JSON inside a single text block, errors in the same channel rather than as protocol errors) — the one thing the stated "MCP client authors" audience needs and no doc gave. The vendored-core paragraph this PR originally rewrote is left untouched: the pin has since moved to v0.3.2 in #27, which rewrites that paragraph to the post-re-pin truth. Keeping the two PRs off the same lines lets them merge in either order. (#27 also corrects two claims this branch made: `containment` is a gate-S2 vocabulary check rather than an S3 rule family, and `forbiddenCategories` was already evaluated at v0.1.2 — only `requiredCategories` was genuinely unevaluatable.) Verified: build, unit tests, and scripts/smoke.sh all pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Both CI jobs have been red since dspack-gen 0.3.2 and dspack 0.4.3 shipped (main last ran green 2026-07-22). They are not separately fixable — and it turned out to be a three-way coupling, not two.
What was actually wrong
dspack-genpin at v0.1.2 (c5bfd6d)core-pin-driftred; S3 could not evaluaterequiredCategoriesexamples/shadcn-ui-v04.dspack.jsonat contract 2.3.0testjob red at "Copy drift check"src/schema/dspack.v0.4.schema.json— untracked by any drift check(3) is why re-pin + re-sync alone still failed. The bundled schema predates the §4.3 amendment, so loading the freshly synced contract threw:
Nothing guarded that file — the schemas were byte copies of the spec repo with no manifest entry. All four are now tracked in
scripts/check-sync.mjs; v0.1–v0.3 were already byte-exact, v0.4 was not.Pin target: v0.5.0, not v0.3.2
dspack-gen released 0.4.0 and 0.5.0 while this was in flight, so v0.3.2 no longer satisfies the repo's own
pin == latest releaseinvariant. Pinned to v0.5.0 (5203569).Exactly four shipped
src/corefiles differ across the whole v0.1.2 → v0.5.0 move, each accounted for:lint/vocabulary.tscontract.ts+lint/rules.tsrequiredCategories(§4.3)compiler.tscomposition.notesin the generation system prompt0.4.0/0.5.0's other work (repair loop, casualty-free generation view, join-id view) lives in
run/, which ds-mcp does not vendor.Behavior change (deliberate), confirmed by probe
dialog-titlewith nodialogancestorform-controlwith no interactive descendantrule.form-control-carries-controlfiresget-generation-contexttable linecomposition.notes(712 chars)One correction to the prior framing:
forbiddenCategorieswas already evaluated at v0.1.2 and is unchanged. OnlyrequiredCategorieswas genuinely unevaluatable, andcontainmentis an S2 vocabulary concern, not an S3 rule family. The README reflects this rather than the earlier "two unevaluated S3 rule families" reading.Surfaces that passed under the old core can fail under this one. That is the point of the move.
Golden-context test: a broken identity, repaired
The test read dspack-gen's compiler golden against
examples/shadcn-ui-v04.dspack.json, relying on that file being byte-identical to dspack-gen's own contract fixture. The spec repo has since advanced to contract 3.2.0 (34 components, 49 rules) while dspack-gen's fixture stayed at 2.3.0 (8 components, 8 rules), so the byte compare began failing for reasons unrelated to the compiler.It now reads dspack-gen's contract fixture — the golden's other half, newly drift-tracked — comparing compiler output against the compiler's own input. Verified: the re-pinned core reproduces the golden byte-for-byte against that contract. Tracking the pair is also what let 0.5.0's prompt change land as one coherent re-sync.
Still a real upstream inconsistency worth its own issue: dspack-gen's
fixtures/shadcn.v0_4.dspack.jsontrails the spec repo's published example.Verification
npm ciclean, 94/94 tests — exactly the pre-drift baselinebash scripts/smoke.sh— all passednode scripts/check-sync.mjs— exit 0, 9/9 in syncnode scripts/check-core-pin.mjs— exit 0, "the pin is exactly the latest release tag"Contract 3.2.0 also adds
rule.button-carries-text; thetextScope: subtreefixture moves its label onto the button accordingly (the trigger still carries no text of its own, which is what that test pins).Not included: the npm release. Publishing a new ds-mcp version is the owner's call.
🤖 Generated with Claude Code