Repository navigation
fix(scripts): the skills token ratchet reds a row whose ceiling sits above its measurement - #37747
Conversation
A row a later shrink left standing above its file used to pass and print its headroom, so the freed tokens sat in the row as budget a later raise could spend with no deletion shown. The per-row check now reds it, naming the row, the measurement, the ceiling and the gap, and tells the author to lower the row to the measurement. The over-ceiling refusal is unchanged. The 37 rows that sat above their measurement on main are lowered to it, 4813 tokens in all; no skills text moves. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
… text Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT at head 席位核对Shape and gates. Fixes is right. The card asks that a ceiling sitting above its measurement fail the ratchet, naming the row, the measurement and the ceiling. Re-measured against today's main. I merged the head onto Failure mode, judged. This makes an existing gate stricter. Its cost is that a PR which shrinks a skill must also lower that skill's ceiling in the same PR, which serialises edits to the ceilings table. That is the purpose of a ratchet, and it is the not-escalate class (a gate tightened, nothing refused that an author could write before). The overlap with #36158 was ruled by the seat (7207185962) and this PR follows that ruling. Changeset. None, and none is owed: both files belong to the private root package, nothing published moves. The Contract review. None owed. No Out of scope. Nothing filed. Landing: not governed, ≤3000 lines, no narrowing. The area lands it. |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Landing · area o1-C · head
State: ready + auto-merge; #37630 closes on merge via |
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
…rement after the main merge The automation skill's state-machines reference shrank 9 tokens on main with its row left standing, which the new above-measurement red caught in the merge queue. The row follows the measurement down to 5927. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): REWORK (mechanical, one row) at head The delta itself holds. But main has moved again, and the queue will red the same way. #37739 landed at Owed. Merge For the area. Every skills PR that lands first can force this step again, as you noted. Once the next head is green, enqueue it promptly, so the window for another shrink to slip in stays short. |
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
…e main merge Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): REWORK (mechanical, one row) at head The delta itself holds. Main moved once more, the other way. #37765 landed at Owed. Merge To stop the chase. This PR pins 37 rows, so any skills PR that lands first can move one of them. Once the next head is green against the current main, it should go to the front of the merge queue. I am asking the seat to do that (the seat does the queue jump). My delta read of the next head covers only its merge trees and the row values against the ratchet. |
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
…ts measurement after #37765 Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP
|
repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3 L1 verdict (L1-a): ACCEPT (delta) at head What moved. The gate against today's main. Main is The full read in 7207645559 stands. The rest of the net diff is unchanged in kind: Landing: not governed, ≤3000 lines, no narrowing. The area lands it now. If a skills PR lands before it is enqueued, merge main once more and re-run the ratchet on the merged tree first. |
|
repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Re-landing · area o1-C · head
State: auto-merge re-armed; #37630 closes on merge via |
Requested by Elon · project thread
Fixes #37630
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
scripts/check-skills-token-ratchet.mjsused to fail a row only when the measured tokens were over its ceiling. A row whose file later shrank passed and printed its headroom. On PR #37442 that left a row 1 token above the merged measurement, and only the reviewer's arithmetic caught it.verdict()) now fails a row whose ceiling is above its measurement. The message names the row, the measurement, the ceiling and the gap, and tells the author to lower the row to the measurement in the same PR. Lowering is the author's own act, so this message carries no⛔ MAINTAINER-ONLYtoken. The over-ceiling refusal is byte-for-byte unchanged.origin/maince4d8c7, 37 of the 61 authored rows sat above their measurement, 4813 tokens in all. The largest gaps wereobjectstack-api/SKILL.md(981),objectstack-query/SKILL.md(940) andobjectstack-data/rules/indexing.md(746). Each row's number changes and gains a-N to the measurement (was C)note, and one block comment sits on the prose side of the CEILINGS doc comment (the placement note says to keep new prose there). Noskills/**text changes and no ceiling is raised.Failure or warning
I chose failure. Reasons:
pending10402(headroom held for an approved PR), and its own record says it is spent ("objectstack-datameasured 13817 against a 13817 ceiling … exactly zero"). So nothing needs an exemption. A future reservation of that kind would need this gate changed, and the header now says so.How unchanged rows on main are treated: they are lowered in this PR, not given a warning tier. Lowering is always legitimate under the header.
Header lines that bound this change, quoted for the skills-lane reviewer:
version:line that the release bot rewrites is excluded from the count … ceilings stay shrink-only and the current headroom (0 and 1 tokens) stays as it is." I read this as bounding the A2′ re-pin, which lowered every stamped row by exactly 5 so that no file's headroom moved. I do not read it as protecting headroom against a later lowering.strippedInternalIdsnote inCEILING_BASIS: "That is the ratchet working as designed: shrink-only means a ceiling may be lowered to the measurement whenever one is taken, not merely by the size of the day's deletion." This is the authority for lowering all 37 rows in one PR.Side effect for the reviewer: in failure mode every count change to a skills file must edit its row. So two skills PRs that change one file's count now always conflict on that row; before, only raises did. This is the intended serialisation, because the merged measurement differs from both branches. It is still new load on skills PRs.
Overlap: open draft PR #36158 rewrites five of the lowered rows:
objectstack-dataSKILL.md,rules/field-types.md(together with the adjacentrules/indexing.md),rules/relationships.md,rules/validation.mdandreferences/examples-objects.md. That PR already conflicts with main on its own skills files and re-measures those rows when it rebases. overlap-check: origin/main, #37676 and #37422 merge cleanly.Tests
Self-test, gate, ablation and reverse reading (head d1295a6)
node scripts/check-skills-token-ratchet.mjs --self-test: exit 0,✓ check-skills-token-ratchet self-test: 111 cases pass.The roster grew 104 to 111, and the floor was raised to match.under the ceiling -> greenbecameunder the ceiling -> red (a ceiling above its measurement), and the shrink-direction row now pins red-until-lowered. Seven new batteries: the red names the row, the measured count, the ceiling and the gap; it tells the author to lower the row; it is not the over-ceiling red (noover by, no authority token); one token above the measurement is red. Each new case reads the verdict and its text together.node scripts/check-skills-token-ratchet.mjs: exit 0,61 authored bundle file(s) within their ceilings, andratcheted (authored) 199660 / 199660 (+0). On main it read199660 / 204473 (-4813).scripts/ablation-replace.mjs, the new branch'sifdisabled, anchor x1 to x0): self-test exit 1,9 failure(s), which is exactly the nine above-measurement batteries. After restore the blob matched HEAD andgit diff HEADwas empty.Acceptance notes
skip-changeset: the only file changed is a rootscripts/gate in the private monorepo root package, so nothing ships.Verification
Local gates (head d1295a6)
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackexited 0. Each exit code was captured before any pipe. They includecheck-skills-token-ratchetwith its--self-test,check:ratchet-remedy-authority,check:doc-authoringandcheck:nul-bytes.--ranreconciliation:34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.check:pm-dispatch-gatesexited 0 on the previous head, ebc8fae. The last commit touches only ratchet self-test lines.check-published-list-mirrorsexited 0.Read first:
verdict(), the new below-ceiling branch (the one behaviour change). Then the header's "ratchet discipline" bullet. Then a sample of the lowered rows against the gate's printed counts.Two-minute check: run
node scripts/check-skills-token-ratchet.mjs. Expect exit 0 and the lineratcheted (authored) 199660 / 199660 (+0). Then raise any row by 1 locally and re-run. Expect a red that names that row, its measurement and the ceiling, ending inLower the row to N.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP