Skip to content

fix: re-pin vendored core to dspack-gen v0.5.0 and re-sync the coupled copies - #27

Merged
ryandmonk merged 1 commit into
mainfrom
fix/repin-core-v0.3.2
Aug 12, 2026
Merged

fix: re-pin vendored core to dspack-gen v0.5.0 and re-sync the coupled copies#27
ryandmonk merged 1 commit into
mainfrom
fix/repin-core-v0.3.2

Conversation

@ryandmonk

@ryandmonk ryandmonk commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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

# Stale artifact Consequence
1 dspack-gen pin at v0.1.2 (c5bfd6d) core-pin-drift red; S3 could not evaluate requiredCategories
2 examples/shadcn-ui-v04.dspack.json at contract 2.3.0 test job red at "Copy drift check"
3 src/schema/dspack.v0.4.schema.json — untracked by any drift check the blocker: loader rejected the spec's own example contract

(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:

dspack schema validation failed:
  /rules/48: must have required property 'requiredSubComponents'

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 release invariant. Pinned to v0.5.0 (5203569).

Exactly four shipped src/core files differ across the whole v0.1.2 → v0.5.0 move, each accounted for:

File Effect From
lint/vocabulary.ts S2 sub-component containment (spec v0.4 §5.1) gen 0.3.0
contract.ts + lint/rules.ts S3 requiredCategories (§4.3) gen 0.2.2
compiler.ts composition.notes in the generation system prompt gen 0.5.0

0.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

Gate Probe Result
S2 dialog-title with no dialog ancestor now a vocabulary error
S3 form-control with no interactive descendant rule.form-control-carries-control fires
prompt get-generation-context table line now carries composition.notes (712 chars)

One correction to the prior framing: forbiddenCategories was already evaluated at v0.1.2 and is unchanged. Only requiredCategories was genuinely unevaluatable, and containment is 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.json trails the spec repo's published example.

Verification

  • npm ci clean, 94/94 tests — exactly the pre-drift baseline
  • bash scripts/smoke.sh — all passed
  • node scripts/check-sync.mjs — exit 0, 9/9 in sync
  • node 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; the textScope: subtree fixture 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

Copilot AI lite review requested due to automatic review settings August 10, 2026 19:52

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 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-gen from v0.1.2 to v0.3.2 (commit cbc9e1c) and update lockfile accordingly.
  • Re-sync/update the dspack v0.4 schema and extend scripts/check-sync.mjs to 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 thread README.md
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 ryandmonk changed the title fix: re-pin vendored core to dspack-gen v0.3.2 and re-sync the coupled copies fix: re-pin vendored core to dspack-gen v0.5.0 and re-sync the coupled copies Aug 12, 2026
@ryandmonk
ryandmonk force-pushed the fix/repin-core-v0.3.2 branch from 17d99a3 to fc4a642 Compare August 12, 2026 16:12
@ryandmonk
ryandmonk merged commit b1016a5 into main Aug 12, 2026
2 checks passed
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>
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