Repository navigation
feat(skills): derive the compatibility majors and metadata.version from the workspace version - #22692
Conversation
…om the workspace version check-skill-compatibility-version.mjs gains the derivation the catalog's version binding asks for: every SKILL.md metadata.version must equal the fixed group's version (read off @objectstack/spec's manifest, the package every compatibility line cites and the version @objectstack/skills ships at), and --fix writes both that stamp and each pin's major from the workspace manifests. The root `version` script runs --fix after `changeset version`, so a Version Packages PR carries the restamped frontmatters. The ten SKILL.md files are regenerated by --fix: only their version: line moves (1.x/4.4 -> 17.7.0); every compatibility pin was already at the workspace major. Claude-Session: https://claude.ai/code/session_01RdnZdPZH9ByduzPRWuH9tN Co-authored-by: Claude <noreply@anthropic.com>
…derived SKILL.md lines The --fix leg in the root `version` script makes it a generator in git-merge-regen's population; the NOT_DRIVER_MANAGED row says why the ten SKILL.md files stay a human's to merge: two derived lines inside hand-written prose. Claude-Session: https://claude.ai/code/session_01RdnZdPZH9ByduzPRWuH9tN Co-authored-by: Claude <noreply@anthropic.com>
Contract reviewServed-tier: Skills seat 1 (seat post #7623), ① Derived judgments
② Semver levelNone owed from this PR ( ③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
维护者速读(终稿)— PR #22692(#22658 的 PR 2,Tier H)Skills seat 1 ·
Generated by Claude Code |
Fixes #22658
Clause-②: no
Ruling A on #22649 (record 6096124407, maintainer 「22649 同意 A」): the
compatibility:line and each skill'smetadata.versionderive from the package version instead of being kept by hand. This is PR 2 of the two the card allows — the derivation and the ten regenerated frontmatters (Tier H:skills/**). PR 1 (claude/issue-22658-skills-package) adds the@objectstack/skillspackage; this PR does not depend on it merging (see the version source below). Noskills/**path moves; no skill's teaching changes — the ten diffs are oneversion:line each.What changes
scripts/check-skill-compatibility-version.mjs— the gate that already reconciled every@objectstack/PKG N.xpin against the workspace manifests now also reconcilesmetadata.version: everySKILL.mdmust carry exactly the fixed group's version, read off@objectstack/spec's manifest (CATALOG_VERSION_PACKAGE); an absent stamp is red, a stale one is red naming file / declared / actual / fix, and a workspace without that package is red rather than "nothing to derive". A new--fixleg is the one writer: it rewrites each pin's major to the cited package's current workspace major (an inline scalar or a folded block scalar) andmetadata.versionto that version, writes only the files that moved, then runs the check; it invents no structure (a file with noversion:key comes back unchanged and is named). Every prescription that used to say "edit the line" now names--fix; the header and the report footer say the line ships inside@objectstack/skillsand frommainas thenextchannel. The self-test grows from 18 to 27 pinned batteries: R9 stale stamp, R10 absent stamp, R11 the exempt (unpinned) upgrade skill is stamped too, R12 the anchor package missing, and five--fixderivation cases (both lines rewritten with every other byte kept, no-op on a derived file, a folded-block pin, no invented structure, an unknown package left for the check). R1's prescription regex moved with the text.package.json(root) — theversionscript runsnode scripts/check-skill-compatibility-version.mjs --fixafterchangeset version, besidesync-protocol-version.mjsandsync-template-versions.mjs: the Version Packages PR carries the restamped frontmatters, somainnever sits red here between a bump and a hand edit, and the maintainer's own merge of that PR is the Tier H act forskills/**.scripts/regen-artifacts.mjs— aNOT_DRIVER_MANAGEDrow (skills/*/SKILL.md,gen: version, root owner): the--fixmakes the rootversionscript a generator ingit-merge-regen's population, and the recorded answer to "discard both sides and re-run" is no — two derived lines inside hand-written prose; a text conflict stays a human's, the two lines re-stamp on the next--fix.pnpm check:merge-driver:all 43 generator(s) across 81 manifest(s) have a recorded disposition.skills/*/SKILL.md(10 files) — regenerated by--fix, never by hand:metadata.version"1.0"/"1.2"/"1.3"×4 /"1.4"×3 /"4.4"→"17.7.0"; 10 insertions, 10 deletions, nothing else. Everycompatibility:pin was already at the workspace major (17.x), so those lines are byte-identical.skills/README.md's generated block does not carry the version; it is unchanged (check:skill-docsgreen).The version source, measured
The PM's mechanism assumption named two possible sources and asked which exists on
main:packages/skills/package.jsondoes not exist at this branch's base (243dd3c62);packages/spec/package.jsondoes. The derivation reads@objectstack/spec— the fixed group's anchor, the package every published skill'scompatibility:line cites — and@objectstack/skillscarries the identical version by thefixedgroup (check-changeset-fixedholds the membership). So this PR is green on its own and stays correct whichever of the two PRs lands first; the alternative (readpackages/skills/package.json) would redcheck:skill-compatibilityon this branch until PR 1 is onmain, and redmainif this PR landed first. The constant is one line to change if the maintainer prefers the literal package.The gate had no hand-maintained version constant to replace: it already reconciled pins against the workspace manifests. What was hand-kept was the frontmatter itself; that is what
--fixand theversionscript now own.Reverse verification on the live tree (restored, proven)
On
skills/objectstack-query/SKILL.md(HEAD blob5e7ca000…), with a trap restoring throughgit checkout HEAD -- PATH:version:line deleted →check-skill-compatibility-versionexit 1:cannot read metadata.version: frontmatter metadata: map has no version: key, naming the file and--fix;"4.4"→ exit 1:declared: metadata.version "4.4"/actual: @objectstack/spec 17.7.0 (packages/spec/package.json)/fix: run … --fix;--fix→1 of 10 SKILL.md file(s) rewritten, exit 0;git diff HEADempty,git statusclean; the gate green again (10 metadata.version stamp(s) all equal @objectstack/spec 17.7.0).Gates run (exit codes captured before any pipe)
Derived on the changed set and reconciled with
--ran: 51 derived, 51 run, 0 UNRUN; every family exit 0. Named by the card and all green:check:skill-compatibility(self-test 22 check cases + 5 derivation cases + 6 declaration cases; run: 10 files, 11 pins, 10 stamps),check-skills-token-ratchet(+ self-test),check:skill-docs,check:skill-refs,check:skill-examples(262 prose examples type-check, on the built tree),check:skill-identifier-liveness,check:skill-frame-sync,check:skill-frame-freshness,check:skill-top-level-keys,check:pm-governed-merges(+pm-governed-prose),check:merge-driver,check:doc-authoring,check:nul-bytes,check:corpus-claim-drift,check:role-word,check:self-test-wired,check:ratchet-remedy-authority,check:dts-closure/check:dual-build-cjs-loads/check:sourcemap-no-sources-content/check:lean-entry-closureon a full build under the verify lock (72 tasks,VERDICT command-exit 0, held 463s),check:pm-dispatch-gates(fast tier; its reading is in the report comment). Lint at5567d606c: eslint--format jsonover the two JavaScript files touched — 2 files, 0 errors, 0 warnings; the config enables no type-aware linting, so no untouched file's verdict moves.Token ratchet reading, before → after (
check-skills-token-ratchet, all within ceilings, exit 0):objectstack-data/SKILL.md6127 → 6128 of 6128 (headroom 1 → 0),objectstack-automation5783 → 5783 (headroom 2),objectstack-platform5830 → 5831 (headroom 2),objectstack-ui3847 → 3848 (headroom 8),objectstack-upgrade6184 → 6185 (headroom 8); the other five gain one token with wide headroom. No ceiling was touched. A future bump that lengthens the version string (17.10.0) may cost one more token onobjectstack-data; that would be theversionscript's run, and the ceiling is the maintainer's to move.Acceptance notes
--fixleg, and the self-test rides the existingcheck:skill-compatibilityalias.skip-changeset: nothing publishes from this PR (skills/**reaches npm only through@objectstack/skills's build, whose changeset is PR 1's; the gate and the ledger are repo tooling; the root manifest is private).metadata.version: "17.x.y"inside@objectstack/skills.维护者速读(草稿)
SKILL.md里的metadata.version不再手写,由check-skill-compatibility-version.mjs --fix从工作区版本派生(本次全部变成"17.7.0";compatibility:的17.x已与工作区一致,一字未动);门禁同时校验这一行,发版时pnpm run version自动重打。"1.3"、"4.4",与任何真实版本无关。skills/**);之后由席位落地。Claim
This branch,
claude/issue-22658-compat-line-derived, is named on theBranch:line of the claim extension 6098607178 on #22658 (the round-2 claim6096391379names PR 1's branch); contract review 6098612738 on this PR.Generated by Claude Code