Repository navigation
feat(scripts): --fix derives skill body versions; release guard and token ratchet follow - #31745
Conversation
…l body names Pure functions and self-test rows only: extractBodyVersions finds the install-shape pins and the prose versions in every skill markdown body, judgeBodyVersions holds each to its package's workspace version unless its sentence reads as history, and deriveBodyVersions is the --fix derivation that rewrites the non-history ones. Kept apart from deriveFrontmatter, which the token ratchet asks for the one stamp line. Not yet called from the gate's run or its --fix leg. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jU4PLtyyimMz72z285
…ease guard and unpriced by the token ratchet Ruling B on the item 3 decision: the version pass now rewrites the install pins a skill body names, the way it restamps the frontmatter. - check-skill-compatibility-version: the check judges every body version, and --fix writes them. A new export, bodyPinnedPaths(), lists the files whose body the writer owns, asked of the writer with a probe. - release.yml: the post-version guard resolves bodyPinnedPaths() as a sixth whole-line filter. An empty list is a real answer there. - check-skills-token-ratchet: the body pin values the writer rewrites are not priced. This generalises the stamp-line rule. bootstrap.md's row is re-pinned 1351 -> 1343, the same 8 its count fell, so its headroom does not move (BODY_PIN_REPIN). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jU4PLtyyimMz72z285
|
domain:skills#2 · zhuangjianguo · session_01QsR2jT34CXs5fCn3BDirZw Contract-review-claim: session_01QsR2jT34CXs5fCn3BDirZw · head 1415775 · 2026-11-09T01:56Z |
|
domain:skills#2 · zhuangjianguo · session_01QsR2jT34CXs5fCn3BDirZw Contract reviewServed-tier: Inputs read: card #31115 (body; comments 6706623953 triage, 6708443569 ruling A on item 1, 6718198041 claim, 6718224824 decision owed with the dev's four-option analysis, 6718947788 and 6719355267 items 1–2 report and landing, 6730018726 ruling B of record for item 3, 6730391223 os-dev-report for this PR), PR #31745 body and file list (3 files, +626 −46, every patch present), ① Derived judgments
② Semver levelThe diff touches two repo scripts and one workflow; no ③ Boundary flags
④ Design judgment
The simulated release in the PR body (five packages set to Verdict reasoning. The surface is the claim plus exactly the two files the ruling names. The guard's sixth filter admits only what the writer owns, whole-line, and fails red on a throw, on an empty list and on a regressed extractor. The ratchet unprices only the bytes the same writer replaces, pinned on fixtures and on the live file, and the re-pin is the stamp-line precedent applied with the arithmetic right (5398 → 5368, 1350 → 1342, headroom 1 → 1). Width Implemented-by: VERDICT: PASS |
|
domain:skills#2 · zhuangjianguo · session_01QsR2jT34CXs5fCn3BDirZw 维护者速读
席位核对Head-sha:
|
Requested by Steedos · project thread
Fixes #31115 (item 3, the last; items 1 and 2 landed in #31432).
Clause-②: no
Metadata-protocol: none
维护者速读
check:skill-compatibility现在也检查技能正文里写死的版本号(如bootstrap.md起步 package.json 里的 5 个"@objectstack/…": "18.3.0"),发版时由--fix自动改写;新导出bodyPinnedPaths()列出会被改写的文件,release.yml 的发版后守卫据此放行;token 棘轮不再计价这些由脚本写入的版本值。18.9→18.10这类变宽导致 Version Packages PR 被棘轮打红的坑(bootstrap.md余量只有 1)。18.10.0-next.12的发版:--fix改写 12 个文件,守卫零意外路径,棘轮保持绿。回滚即 revert 本 PR。.github/workflows/release.yml(新增BODY_LIST,第六个过滤器,空列表合法);scripts/check-skills-token-ratchet.mjs(bodyPinValues与BODY_PIN_REPIN,bootstrap.md行 1351→1343);scripts/check-skill-compatibility-version.mjs(bodyPinnedPaths、applyFix)。pnpm check:skill-compatibility和node scripts/check-skills-token-ratchet.mjs --self-test,应分别看到「6 body version(s) in 71 skill markdown file(s)」和「104 cases pass」。.github/workflows/release.yml),需要一位受管审批人批准(APPROVED review)。What changes
scripts/check-skill-compatibility-version.mjs.skills/**. A version must equal its workspace package's version, or sit in a sentence that reads as history (since,removed in,until, …). An install pin is always judged.--fixrewrites body versions in the same pass as the frontmatter.applyFixwrites each file once, and a range (^/~) is kept.bodyPinnedPaths(): the files whose body the writer owns. The writer is asked with a probe value, so a file stays listed after the pass made it current. A history-only file is never listed. A moved skills directory throws; a catalog with no pins answers[].deriveBodyVersionscome from the first item 3 commit, now called..github/workflows/release.yml, "Validate the post-version tree".BODY_LISTis resolved frombodyPinnedPaths()and applied as a sixth whole-linegrep -vxF -ffilter.check:skill-compatibility, which now judges the bodies.scripts/check-skills-token-ratchet.mjs: the second exclusion.bodyPinValues()reads them offderiveBodyVersionswith a probe, so there is no second parser.pricedTokenstakesbodyPinned, andrun()readsbodyPinnedPaths().bootstrap.md's row is re-pinned 1351 → 1343, the same 8 its count fell (five18.3.0values are 30 bytes, 5398 → 5368), so its headroom stays 1. This is recorded asBODY_PIN_REPIN.grep | sed | tr | wc) that the self-test reproduces on the live file.Why
The maintainer ruled B on the item 3 decision (「31115 … 同意」, 2026-11-09; triage record 6730018726).
--fixrewrites the install-shape body pins at version time; the written set is declared to the release guard; and the ratchet stops pricing writer-rewritten body pin values, generalising the frontmatter stamp-line rule. Without the third part, a width change at release redsbootstrap.mdon the Version Packages PR.Tests
Self-tests, scans and a simulated release
pnpm check:skill-compatibility: the self-test passes 22 check cases and 22--fixderivation cases (floor 30 → 44). The new cases: the written set equalsstampedSkillPaths()thenbodyPinnedPaths()on an all-stale fixture; a history-only file is neither listed nor written; the guard'sgrep -vxF -fadmits a body write only through the body list, and an empty list admits nothing; the export throws on a moved tree and answers[]with no pins; on the live tree the writer's list equals the reader's. The scan reads "6 body version(s) in 71 skill markdown file(s)", and--fixon main is a no-op.node scripts/check-skills-token-ratchet.mjs --self-test: 104 cases pass (floor 97 → 104). The new cases: exactly the owned value bytes are unpriced, never a range, a name or a history version; any pin width from17.7.0to18.10.0-next.12moves no count; one authored byte over a zero-headroom row is red at every width; on the live file the writer's bytes equal the reader's; the header's hand audit reproduces the live count; and the re-pin record. The scan is green, withbootstrap.mdat 1342 / 1343.18.10.0-next.12and--fixwas run.bootstrap.mdpins (12 files), and the check stayed green.bootstrap.mdwas unexpected.Acceptance notes
--fixwrites are declared to the release guard, and the ratchet does not price them, as ruled..github/workflows/release.ymlandscripts/check-skills-token-ratchet.mjs. docs: teach os mcp connect and the use-runtime deploy target in the remaining pages #31335 was already on main when this branch was cut, so no merge of main was needed.skills/**readings: no file underskills/**changes.bootstrap.mdstays at 190 → 190 lines, and the bundle (all SKILL.md) at 4592 → 4592 lines.bodyPinnedPaths()as writable. The check reds it, so no green tree carries one.Verification
1415775e(merge basef2abd4767).node scripts/pm/dispatch-gates.mjs --ran: 55 derived, 55 run, 0 NOT-MEASURED, 0 UNRUN, and all 55 exit 0 at this head.--tier: no path-derived mandate, so this was built on the default tier.Generated by Claude Code