Repository navigation
fix(create-objectstack): template baseline pins @objectstack/* exactly; specVersion stays a range - #25665
Conversation
…y; specVersion stays a range scripts/sync-template-versions.mjs now stamps the scaffolder's exact version (prereleases verbatim) into every bundled template's @objectstack/* dependencies, and keeps the manifest's specVersion at the major's range. The two values were one before, so the ratchet compared them for equality; it now holds the deps at the exact version and specVersion at the range the pinned spec dependency's major implies. The self-test gains two batteries: a prerelease corpus judged clean at its exact version with specVersion still a range, and a scaffolder version that is not a whole semver refused with nothing written. The version read is anchored at both ends, since it is now written verbatim. The blank template is restamped by the script itself, and the stale caret comments in index.ts and runtime-image.ts are corrected. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GcPmaQ9wUnUUM3ATKkiCes
📓 Docs Drift Check1 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 13 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 7441c441ffbddf4fb7dc3910d3fd1304a50749bb && git checkout 7441c441ffbddf4fb7dc3910d3fd1304a50749bb
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2c523d0100e9368ba8af3b08c652f23e943de46a 3f96816841bf43e75cd89540464ac2a275dd1fe9 && git checkout -B drift-repro 2c523d0100e9368ba8af3b08c652f23e943de46a && git merge --no-ff 3f96816841bf43e75cd89540464ac2a275dd1fe9
node scripts/docs-audit/affected-docs.mjs --json 2c523d0100e9368ba8af3b08c652f23e943de46a |
|
ACCEPT ·
Generated by Claude Code |
Requested by Elon · project thread
Fixes #25510
Clause-②: no
Metadata-protocol: none
The remaining slice after PR #25539 (which made the scaffolders write exact pins). The committed template baseline now says what the scaffold writes, and the release-time version pass keeps it that way.
What changed
scripts/sync-template-versions.mjsstamps two values where it used to stamp one:@objectstack/*dependency gets the scaffolder's exact version (18.1.0; a prerelease such as19.0.0-rc.0verbatim);specVersionstays the major's range (^18.0.0), because it names the spec line the template is authored against.loadScaffolderVersion()keeps its{ version, major, range }shape;rangeis documented as thespecVersionvalue only. The version read is now anchored at both ends (EXACT_VERSION), since it is written verbatim into dependencies:18.1.0garbageused to pass a prefix match.specVersionis not.--self-test: fixtures are built in lockstep at the exact version. Two new batteries (roster floor 8 → 10):42.0.0-rc.1) is judged clean at its exact version withspecVersionstill^42.0.0, byte-identical and unwritten;template-consistency.test.ts: the ratchet now requires each@objectstack/*dep to equalcreate-objectstack's exact version (was^MAJOR.x). ThespecVersionagreement test comparesspecVersionwith^<major of the pinned spec dep>.0.0instead of string equality.template-version-stamps.test.ts: the stale-to-rewritten run expects exact deps; a new case runs the CLI at43.0.0-rc.2and asserts the deps take it verbatim whilespecVersionandengines.protocoltake the major.copyWithLocalImportsgained a target-directory parameter so the second fixture copies the import closure instead of a hand list.templates/blank/package.json: restamped by running the script itself (9 entries,^18.0.0→18.1.0).create-objectstack/src/index.ts(3 places) andsrc/runtime-image.ts.create-objectstackpatch.Post-version trees
Simulated by setting
create-objectstack's version, running the script, then the two ratchet files:18.1.1(minor/patch train)19.0.0-rc.0(major rc cut)cut-rc.ymlandrelease.ymlread the stamped surface fromstampedPaths(), which is unchanged (same three files per template), andcut-rc.yml's allowlist already admits each template'spackage.json. One behaviour change on the release path: on a minor or patch train the templatepackage.jsonnow changes on every version pass (it used to log "already pins"). That file is already in the allowlist, so the cut still pushes.Verification (head 3f96816)
pnpm --filter create-objectstack test: Test Files 18 passed (18), Tests 269 passed (269).pnpm --filter create-objectstack typecheck: exit 0, afterpnpm --filter 'create-objectstack^...' buildexit 0.node scripts/sync-template-versions.mjs --self-test: exit 0. Ablations, each restored after: deps stamped with the range again → 10 failures (Control A and I); the version regex back to a prefix match → Control J red;specVersionstamped from the exact version → Control A red on both manifests.^18.0.0baseline → 2 failures intemplate-consistency.test.ts; deps stamped with the range → 2 failures intemplate-version-stamps.test.ts.node scripts/sync-scaffold-emission-policy.mjs --self-test(imports this script's declarations) exit 0, and--checkexit 0.dispatch-gates --commands): 100 families, 95 exit 0, 5 NOT MEASURED (exit 3):check:dts-closure,check:dual-build-cjs-loads,check:lean-entry-closure,check:sourcemap-no-sources-contentneed a full build;check-plugin-teardown-shape --self-testneeds an unshallow clone.--ranreconcile: "100 derived famil(ies) accounted for — 95 run, 5 NOT-MEASURED". CI runs all five.Acceptance notes
content/docs/protocol/kernel/plugin-spec.mdx,content/docs/upgrading.mdx) rides the devx seat's own docs PR, which carriesPart of #25510.skills/objectstack-platform/references/bootstrap.md:147-153still shows^17.0.0for five@objectstack/*packages in a published skill'spackage.jsonexample. Governed surface, not edited here; for the devx seat to route..github/workflows/cut-rc.yml:505-507("On a minor train it logs already pins and writes nothing"),scripts/regen-artifacts.mjs:781andscripts/cross-package-test-inputs.mjs:1522(call the stamped values "ranges").Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01GcPmaQ9wUnUUM3ATKkiCes