Repository navigation
fix(skills-ratchet): price the release stamp's prerelease segment at stable width - #23187
Merged
objectstack-fleet[bot] merged 2 commits intoOct 13, 2026
Merged
Conversation
…stable width The skills token ratchet counted the `metadata.version` stamp that the version script writes into every published SKILL.md as authored text. Under Changesets pre mode the stamp grows from "17.7.0" to "18.0.0-next.0" (+7 bytes), so objectstack-automation (1 token of headroom) and objectstack-data (0) went red on the Version Packages PR with no author edit to pay for. The gate now prices that one stamp at its stable width: the semver prerelease segment of `metadata.version` is not counted, for the files the version script stamps. The stamp is read with check-skill-compatibility-version's own extractMetadataVersion and the stamped set is its stampedSkillPaths(). Nothing else moves: no ceiling changes, a stable tree's reading is byte-identical, and authored growth under either stamp is still red. Eleven self-test rows pin it; the header's reproducibility note gives the hand audit for a prerelease tree. Claude-Session: https://claude.ai/code/session_012zwsLMxQBwHUYJgPyrpEvx Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zwsLMxQBwHUYJgPyrpEvx Co-authored-by: Claude <noreply@anthropic.com>
objectstack-fleet
Bot
deleted the
claude/issue-23176-ratchet-prerelease-stamp
branch
October 13, 2026 06:31
This was referenced Oct 13, 2026
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.
Fixes #23176
Clause-②: no (an internal repo gate; no published accept set or public surface)
The maintainer ruling this lands on
This PR moves the skills token ratchet in the direction its own refusal marks ⛔ MAINTAINER-ONLY: "The other direction lands only in a PR whose body quotes a maintainer ruling authorizing it." The maintainer chose route A on decision record 6138951701 (comment
6138951701on #23176). The choice, verbatim:Route A as that decision record defines it, verbatim:
What changed
One file:
scripts/check-skills-token-ratchet.mjs(+122 / -6).pricedTokens(text, { stamped })is now the count the gate judges. It iscountTokensminus the semver prerelease segment of the frontmattermetadata.versionstamp, and the minus applies only to files the version script stamps.countTokensandTOKEN_CONVENTIONare unchanged.stampPrerelease(text)reads the stamp withextractMetadataVersionfromscripts/check-skill-compatibility-version.mjs, the script whose--fixwrites the stamp. The stamped set is that script'sstampedSkillPaths(). There is no second parser. A version carrying build metadata matches nothing, so nothing is excluded for it.-next.0prerelease segment of its metadata.version stamp (7 bytes) is not priced." On a stable tree that note is empty, somain's output does not change.ceil((bytes - N) / 4), wherebytesis the file'swc -cand N is the byte length of the segment after the stamp's patch number (-next.0is 7,-next.12is 8, a stable stamp is 0). The rest of the counting convention is unchanged.CEILINGSrow (not one number changed); noskills/**,.github/workflows/**or other governed path; nothing onchangeset-release/main/ chore: version packages (next) #21988.Why the fix belongs in this gate and not in the producer. The root
versionscript runscheck-skill-compatibility-version.mjs --fixafterchangeset version, and that writes the stamp from@objectstack/spec's version. The same script's check reds on any other value. So18.0.0-next.0is the correct stamp, and the defect was this gate counting it as authored text. An author cannot use the exclusion to buy room, for two reasons: only that one segment is excluded, and its length is fixed by a stamp another gate holds equal to the spec version.Measurements (head
f06e7f636)objectstack-automation/SKILL.mdobjectstack-data/SKILL.mdmaine540e7ffbmain+ this PRdiffempty)63eb607ad1(the card's tree)63eb607ad1--self-test, then the gate) both exit 0, 76 cases pass8826e954d(the PR's current head)8826e954dmain's48e6aadbb) on both trees. The two modules it imports are byte-identical tomain's on8826e954d.objectstack-data/SKILL.md, the smallest growth that crosses its ceiling onmain, since that file carries 3 bytes of sub-token slack. That gives 6129 / 6128 and exit 1, both on a scratch copy ofmain(stamp17.7.0) and on8826e954d(stamp18.0.0-next.0). The file was restored afterwards and the hash compared.18.0.0-next.12on8826e954dgives 6128 / 6128, green, with an 8-byte segment excluded.Self-test: 11 rows added (65 to 76 cases; roster floor 64 to 75)
The fixtures are padded so the stable spelling has zero byte slack. The "one authored byte over" pair is what proves the padding is right.
Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 31 commands atf06e7f636. All 31 exit 0, and--ranreconciles 31 derived, 31 run, 0 NOT-MEASURED. That includespnpm check:pm-dispatch-gates(the fast tier, 410.9 s),pnpm check:nul-bytes,pnpm check:entry-guardand both ratchet commands.pnpm check:ratchet-remedy-authority: OK. 275 scripts swept: 14 mark the expanding remedy, 5 turn it down, 256 hand out none. That is the same classification as on basee540e7ffb. The control corpus, which pins this gate asmarked, passes set-equality both ways. The change adds no loosening remedy.eslint --no-inline-config --format json scripts/check-skills-token-ratchet.mjslinted 1 file with 0 errors and 0 warnings.--print-configfor the file showsparserOptions{ecmaVersion, sourceType}and noproject/projectService. Type-aware linting is off, so this diff cannot change any untouched file's verdict. CI runs the fullpnpm lint.Changeset
None;
skip-changeset. The root package isprivate: true, andscripts/is in no package'sfiles[].Acceptance notes
TOKEN_CONVENTION(the price-tag header string) is deliberately unchanged. It names the convention the ceilings are pinned in. The exclusion is named on the line of each file it touches, and only on a tree where it applies.63eb607ad1tree, one generator-owned file (objectstack-automation/references/_index.md) reads 816 againstmain's 886. That is a difference between the two bases. The file is not ratcheted and is out of scope here; on the current head8826e954dthe list matchesmain.Generated by Claude Code