Skip to content

fix(scripts): the skills token ratchet reds a row whose ceiling sits above its measurement - #37747

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/area-o1C-37630
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/area-o1C-37630

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

Fixes #37630
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感:这是仓库内部的技能长度检查,发布给客户的技能文字一个字都没改。
  • 为什么做:属于技能长度管控。以前文件变短后上限还停在原处,多出来的额度没人发现,后来的改动可以悄悄用掉;现在会直接报错,并给出该降到的数字。
  • 出错会怎样:最坏是技能相关的 PR 被误拦,作者照提示把上限降到实测值即可;整个改动可直接撤回。
  • 要你做的:无。

What changes

scripts/check-skills-token-ratchet.mjs used 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.

  • The per-row check (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-ONLY token. The over-ceiling refusal is byte-for-byte unchanged.
  • The header's shrink-only bullet now says the PR that shrinks a file lowers its row to the new measurement in that PR. A row left above its measurement is red.
  • 37 CEILINGS rows are lowered to their measurement. On origin/main ce4d8c7, 37 of the 61 authored rows sat above their measurement, 4813 tokens in all. The largest gaps were objectstack-api/SKILL.md (981), objectstack-query/SKILL.md (940) and objectstack-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). No skills/** text changes and no ceiling is raised.

Failure or warning

I chose failure. Reasons:

  1. With the 37 stale rows lowered, every row on main sits at its measurement, so a failure reds nothing that exists today.
  2. A warning would be one more line in a log of 100-plus lines. A log line is how the 1-token gap on PR feat(core): requires knowledge mounts the knowledge service and one vector store #37442 got through. The card's failure mode is a reading nobody looks at, and a warning is still a reading nobody looks at.
  3. The header already has the gate's rule: every path that moves a row pins it AT the measurement. Headroom left by a shrink is not budget. Failing on it makes that rule hold mechanically, just as failing over the ceiling does.
  4. No header-documented reservation exists today. The header's one reservation is pending10402 (headroom held for an approved PR), and its own record says it is spent ("objectstack-data measured 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:

  • Record 6139629628 item 2 (the A2′ stamp exclusion), as the header quotes it: "counts authored content only: the frontmatter 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.
  • The strippedInternalIds note in CEILING_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.
  • The raise paths, all pinned at the measurement: ruling record 6513306068 ("may move the row by the measured remainder, pinned AT the measurement"), and ruling A on record 6819475461, made standing by record 6840575378 ("may raise that file's row by the row's own measured delta and by no more").

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-data SKILL.md, rules/field-types.md (together with the adjacent rules/indexing.md), rules/relationships.md, rules/validation.md and references/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 -> green became under 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 (no over 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, and ratcheted (authored) 199660 / 199660 (+0). On main it read 199660 / 204473 (-4813).
  • Ablation (scripts/ablation-replace.mjs, the new branch's if disabled, 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 and git diff HEAD was empty.
  • Reverse reading: main's CEILINGS judged by the new verdict, 37 of 61 rows red, gap 4813.

Acceptance notes

  • The card's acceptance asks the gate to report a row whose ceiling exceeds its measured tokens, naming the row, the measurement and the ceiling. It does that, as a failure; the choice is argued above for the reviewer. A test pins the new reading. The existing over-ceiling refusals are unchanged.
  • skip-changeset: the only file changed is a root scripts/ gate in the private monorepo root package, so nothing ships.

Verification

Local gates (head d1295a6)
  • All 34 commands from node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack exited 0. Each exit code was captured before any pipe. They include check-skills-token-ratchet with its --self-test, check:ratchet-remedy-authority, check:doc-authoring and check:nul-bytes.
  • --ran reconciliation: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.
  • check:pm-dispatch-gates exited 0 on the previous head, ebc8fae. The last commit touches only ratchet self-test lines.
  • check-published-list-mirrors exited 0.
  • The control-byte self-scan found 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 line ratcheted (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 in Lower the row to N.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP

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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3

L1 verdict (L1-a): ACCEPT at head d1295a6cd5b3e5030421c0e0015d756f14994a12 (Fixes #37630). Full read · 2026-11-27T01:51Z

席位核对

Shape and gates. l1-face --pr 37747: clean. Check-runs at d1295a6: 26 success, 23 expected skip, 0 failed, 0 pending; mergeable_state clean. Draft, base main, first line after the attribution lines Fixes #37630. 2 files, +103/-50. Not governed (scripts/check-skills-token-ratchet.mjs and its test, no workflow, skill, ADR or .claude path). Clause-②: no · Metadata-protocol: none.

Fixes is right. The card asks that a ceiling sitting above its measurement fail the ratchet, naming the row, the measurement and the ceiling. verdict() now fails such a row and its message names all three. The 37 of 61 CEILINGS rows that sat above their measurement are lowered to it (4,813 tokens of slack removed), so the gate is green on its own data. The new behaviour is pinned in the test file, and the ablation (the slack check disabled) turns 9 cases red.

Re-measured against today's main. I merged the head onto origin/main in a scratch worktree and ran the ratchet there: green, ratcheted (authored) 199660 / 199660 (+0). So no skill that landed since the branch point is over or under its new ceiling.

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 skip-changeset label is on, with both premises (root-only, no shipped file) true.

Contract review. None owed. No packages/spec/src/**, no governed path, no Clause-②: yes, no narrowing.

Out of scope. Nothing filed.

Landing: not governed, ≤3000 lines, no narrowing. The area lands it. Fixes closes the card.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP

Landing · area o1-C · head d1295a6cd5 · 2026-11-27T01:52Z · ACCEPT → PR #37747 comment 7207645559 (L1-a)

Probe Reading
check-runs at d1295a6cd5 26 success · 23 expected skip · 0 failed · 0 pending · mergeable_state clean
check-governed-merges.mjs --pr 37747 NOT governed · +103 / −50
landing-k.mjs --pr 37747 K = 9 < 15 · no shared book moved under this PR's

State: ready + auto-merge; #37630 closes on merge via Fixes.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 01:53
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 27, 2026
…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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3

L1 verdict (L1-a): REWORK (mechanical, one row) at head 00112a68423857659496972ff5dab8603d070f23 (Fixes #37630). Delta read from ACCEPT 7207645559 at d1295a6cd5 · 2026-11-27T02:34Z

The delta itself holds. adaa6a8825 is a pure merge: its tree equals git merge-tree of d1295a6cd5 and 077831538 (no hand edit). 00112a6842 lowers one row, state-machines-and-approvals.md 5936 → 5927, with its note. That is the measurement after #37726. Checks on this head: 25 success, 19 expected skip, 0 failed; Type Check · source gates success.

But main has moved again, and the queue will red the same way. #37739 landed at 6f5c1cfa and changed skills/objectstack-ai/references/context-packs.md. I merged this head onto current origin/main in a scratch worktree and ran node scripts/check-skills-token-ratchet.mjs: red, "skills/objectstack-ai/references/context-packs.md is 1453 tokens; its ratchet ceiling is 1454, above the measurement by 1". This is the gate this PR adds, working as designed.

Owed. Merge origin/main (at or after 6f5c1cfa) and lower that one row, 1454 → 1453, in the same form as 00112a6842. Then re-run the ratchet on the merged head, and send the head for a delta read. That read covers the merge's tree and the row change only.

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.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3

L1 verdict (L1-a): REWORK (mechanical, one row) at head e53ab63eec0fd4b83d46543a108269066658a5cd (Fixes #37630). Delta read from REWORK 7208250389 at 00112a6842 · 2026-11-27T02:56Z

The delta itself holds. d2e31ded9a and e53ab63eec are both pure merges: each tree equals git merge-tree of its two parents. a998be3d0e lowers context-packs.md 1454 → 1453 with its note, which is what 7208250389 asked. The other row changes in the script since 00112a6842 (objectstack-data/rules/security.md 4340, objectstack-ui/rules/actions.md 3890, with their notes) are main's own bytes from #37762, brought in by the merge. Checks on this head: 25 success, 19 expected skip, 0 failed.

Main moved once more, the other way. #37765 landed at 9862d636 and grew skills/objectstack-ai/SKILL.md by 2 tokens, to 6801. On main that is within main's ceiling of 6801. This PR lowered that row to 6799 earlier, and the merge keeps the PR's 6799. I merged this head onto 9862d636 in a scratch worktree (it merges clean) and ran the ratchet: red, "skills/objectstack-ai/SKILL.md is 6801 tokens; the ratchet ceiling is 6799 (over by 2)", total 199710 / 199708 (+2).

Owed. Merge origin/main (at or after 9862d636) and set that row to the merged tree's measurement, 6799 → 6801, with a note naming #37765. Then run the ratchet on that head merged with the newest main just before you send it.

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.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4czzx9dtSEm3jWWL9c3

L1 verdict (L1-a): ACCEPT (delta) at head e9f74d656961e3a6d09a54f44a62fb35398d6f4a (Fixes #37630). Delta read from REWORK 7208574157 at e53ab63eec · 2026-11-27T03:21Z

What moved. 57e51b48 is a pure merge of 9862d636 (its tree equals git merge-tree of its parents). e9f74d65 sets the skills/objectstack-ai/SKILL.md row to 6801, which is byte-identical to main's row, so this PR no longer changes that line. The #37765 note sits in the re-lock comment.

The gate against today's main. Main is 00cb37b0e7, with no commit touching skills/ or the ratchet script since 9862d636. I merged this head onto it in a scratch worktree and ran node scripts/check-skills-token-ratchet.mjs: green, ratcheted (authored) 199710 / 199710 (+0). Checks on this head: 25 success, 19 expected skip, 0 failed; mergeable_state clean.

The full read in 7207645559 stands. The rest of the net diff is unchanged in kind: verdict() and its pins, and rows pinned at their measurements.

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. Fixes closes the card.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP

Re-landing · area o1-C · head e9f74d6569 · 2026-11-27T03:22Z · ACCEPT → PR #37747 comment 7208927706 (L1-a delta; full read 7207645559). Dequeued earlier by the gate's own red after main moved (#37726, #37739, #37765); each fixed by a main merge and the affected row.

Probe Reading
check-runs at e9f74d6569 25 success · 19 expected skip · 0 failed · 0 pending
main since 9862d6369a no commit touching skills/ or the ratchet script
check-governed-merges.mjs --pr 37747 NOT governed · +111 / −51
landing-k.mjs --pr 37747 K = 5 < 15

State: auto-merge re-armed; #37630 closes on merge via Fixes.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit cac93cc Nov 27, 2026
44 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-o1C-37630 branch November 27, 2026 04:04
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…iles become routers (objectstack-ai#38347)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuUejT99q3PMj1DD6eNBk5Kd)_

Part of objectstack-ai#34770

Clause-②: no
Metadata-protocol: none

Supersedes draft PR objectstack-ai#36158: the same change, resumed from
`claude/issue-34770-skill-router-budget@937e2f1`
on a new branch after seat 4's lane went vacant, with `main` merged in
and the three eval cases of ruling 7176941587 Q1 B added. objectstack-ai#36158 can be
closed with a pointer here; nothing on its branch is missing from this
one.

`Part of`, not `Fixes`: rulings 7128031203 and 7168461386 keep the first
line at `Part of objectstack-ai#34770` until the catalog-size line of the card's
Done-when is met, and this PR does not meet it (the catalog descriptions
are not touched here).

## 维护者速读

- 用户能看到什么变化:用户无感。发给 AI 的两份技能说明(数据建模、自动化)的入口文件从约 27 KB、28 KB 缩到 9 KB、10.7
KB:入口只留开工前四项检查、会悄悄出错的坑、和「写什么去读哪个文件」的路由表,其余原文搬进同包的参考文件,教的内容不变。
- 为什么做:入口文件每次都整份装进 AI 的上下文,越长越贵、越容易漏读;缩成路由后,AI 只在需要时才读细节。
- 出错会怎样:只动教 AI 的文字和三道评测题的判分词,没有产品行为变化。风险是 AI 少读一段后答错;为此前后各跑了一轮评测,逐题对照(见
Tests)。可整笔撤回。
- 要你做的:座位复核后请审批人批准(`skills/**` 属 Tier H)。本 PR 合并后,云端仓库要按 #36934
把十一处托管章节的指向跟着改。

## Rulings this executes

- **7128031203** (①A ②A ④A): land as is, the hosted repoint is cloud's
(#36934); a before and an after eval round, parity = the after round's
failing set is the before round's or a subset, a flipped case is re-run
once and the second reading counts; a ceiling row raised because text
MOVED is accepted at the measured bytes with zero headroom when the sum
of ceilings does not rise.
- **7168461386** (A): six flow-shape facts go back into the automation
entry, and that one row rises by exactly the bytes restored.
- **7176941587** (Q1 B, Q2 A, Q3 A): three eval cases are relaxed first,
then both rounds are run; the 187 bytes of entry wording stay;
`triggers#6` is the eval seat's and is not touched here.

## What changes

**Two entry files become routers.** `skills/objectstack-data/SKILL.md`
26,860 → 8,983 bytes (472 → 167 lines),
`skills/objectstack-automation/SKILL.md` 28,206 → 10,703 bytes (480 →
215 lines). Each keeps four first checks, the traps that parse and then
fail at run time, and a table that says which file to open for what is
being written. No rule's teaching changes; the text moved, and the
changeset lists section by section where it went and which anchors no
longer exist in the entry files.

**Eight files receive the moved text**:
`objectstack-data/references/examples-objects.md`,
`rules/field-types.md`, `rules/relationships.md`, `rules/security.md`,
`rules/validation.md`;
`objectstack-automation/references/examples-flows.md`,
`references/integration-recipes.md`, and a re-pointed link in
`references/state-machines-and-approvals.md`.

**One correction** (unchanged from objectstack-ai#36158): the multi-value lookup note
showed a `{record.tags.0}` token "in flow values", which a flow value
slot refuses; it now shows the CEL spelling `record.tags[0]`.

**New in this round, over `937e2f14`:**

1. **`main` merged** (through `600197a6ae`; a merge commit, not a
rebase). Two things `main` changed in the entry files while objectstack-ai#36158 was
open were mapped onto the relocated text instead of being lost with the
old sections:
- objectstack-ai#37551's option-label wording. The automation entry's item 4 of §
Valid-but-silently-wrong keeps the rule and both outcomes (refused at
publish where the options are inline, else no row matches or the run
fails); `references/examples-flows.md` carries `main`'s sentence
verbatim.
- objectstack-ai#37551's `actionLayout` sentence of § Object Extension Model, now in
`references/examples-objects.md`, verbatim.
- A scan of every line `main` removed from the two entry files found no
stale copy left in a receiving file.
2. **Three eval cases accept the spellings the bundles teach** (ruling
7176941587 Q1 B):
- `objectstack-automation/evals/flows-triggers-approvals.json` case 1:
`must_not_contain` `values:` → `values: {` (the key form a node carries;
a prose heading also spells the bare word).
- `objectstack-data/evals/hooks-security-seeds-datasources.json` case 7:
`hooks: {` leaves `must_contain` for one any-of group `hooks: {` /
`"hooks": {` / `.refusals.CREDIT_LIMIT` (the nested literal, its JSON
spelling, or the dotted key `references/data-hooks.md` teaches).
- `objectstack-data/evals/objects-fields-relationships.json` case 10:
`type: 'boolean'` leaves `must_contain` for one any-of group `type:
'boolean'` / `Field.boolean(`.
3. **Ratchet rows re-measured on the merged tree**, since objectstack-ai#37747 made a
row equal its measurement exactly (see Verification).
4. **The changeset** follows the merged tree's sizes and names the three
eval cases.
5. **Three nits of contract review 7240993637** (head `edcd7df4ad`, one
commit over the reviewed `3b62b5e9b0`):
- `skills/objectstack-project/SKILL.md` line 187 pointed at
objectstack-data, "Schema evolution", a heading the router moved. It now
names `rules/field-types.md` § Changing a field that has data. That file
sat at its ceiling, so the longer pointer is paid in the same file by
five function-word cuts that lose no fact; its row stays 2990.
- `scripts/check-skills-token-ratchet.mjs` loses one formula comment
line the merge left in the `rules/security.md` history block.
- The changeset says what the `Skill Boundaries` table listed (the
neighbouring skills) and names the re-pointed objectstack-project line.

## Acceptance notes

Decided by the thread (small, no shipped behaviour):

- `"hooks": {` is a third member of case 7's any-of group. The ruling
names the dotted key; the JSON spelling of the same nested literal is
the form a `.json` translation file carries, and refusing it would fail
a correct answer on quote marks.
- `references/state-machines-and-approvals.md` measured 2 tokens over
`main`'s row after the merge (the re-pointed link is 9 bytes longer). It
is paid inside the file ("In a packaged flow, see below" → "A packaged
flow: below") instead of raising a row no ruling covers.
- The before round ran on `main` `600197a6ae` plus only the three
eval-case edits (skill text byte-identical to `main`), so both rounds
grade with the same token lists. Without that the three relaxed cases
would differ between the rounds for a reason that is not the router.

Not done, and why:

- **objectstack-ai#36718's flow-shape harness is NOT re-run** (a merge condition of
ruling 7128031203). It was scratch in the vacated container and is not
in the repository. It was run to 0 on `937e2f14` (report 7170977110);
this round adds no flow example over that head, only the two sentences
above, both `main`'s own words. NOT MEASURED on this head.
- The catalog-size line of Done-when: outside this PR, hence `Part of`.
- `triggers#6` (ruling Q3 A): the eval seat's.

## Tests

Skill evals, the command line of objectstack-ai#37235 unchanged for both rounds, run
in the thread's cloud container (subscription login, no API key):

```
pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-data,objectstack-automation --repeats 1 --model <as objectstack-ai#37235> --effort medium --concurrency 4
```

| round | tree | turns | with-skill | objectstack-automation |
objectstack-data | no-skill | trigger cases |
|:--|:--|--:|--:|--:|--:|--:|--:|
| before | `main` `600197a6ae` + the three eval-case edits
(`304a4c5375`, local only) | 206/206 | 75/96 | 24/29 | 51/67 | 2/96 |
14/14 |
| after, first reading | head `3b62b5e9b0` | 206/206 | 77/96 | 23/29 |
54/67 | 2/96 | 13/14 |
| after, with the second readings | head `3b62b5e9b0` | +7 | **80/96** |
24/29 | 56/67 | | 14/14 |

**Parity under ruling 7128031203 ②A holds: the after round's failing set
is a strict subset of the before round's.**

- **Failed in both rounds (16):** automation `flows-triggers-approvals`
objectstack-ai#5, objectstack-ai#11, objectstack-ai#14, objectstack-ai#16, `integrations-declared` objectstack-ai#1; data
`hooks-security-seeds-datasources` objectstack-ai#3, objectstack-ai#6, objectstack-ai#8, objectstack-ai#16, objectstack-ai#19, objectstack-ai#34, objectstack-ai#38; data
`objects-fields-relationships` objectstack-ai#2, objectstack-ai#8, objectstack-ai#22, objectstack-ai#24.
- **Failed before, pass after (5):** data
`hooks-security-seeds-datasources` objectstack-ai#5, objectstack-ai#14, objectstack-ai#15, objectstack-ai#24;
`objects-fields-relationships` objectstack-ai#10.
- **Passed before, failed on the after round's first reading (4), each
re-run once as the rule says, and each passed its second reading:**
automation `flows-triggers-approvals` objectstack-ai#7 (the first answer carried the
forbidden `current_user.positions`), data
`hooks-security-seeds-datasources` objectstack-ai#25 (missed `default datasource`),
`objects-fields-relationships` objectstack-ai#11 (missed `type: 'select'`), and
trigger case `objectstack-data/triggers#6` (the bundle was read when it
should have been left alone; the case of ruling Q3 A, which this PR does
not change). Re-run with the same flags plus `--case` for those four
keys: 7 of 7 turns, all four pass.
- The three relaxed cases: `flows-triggers-approvals` objectstack-ai#1 and
`hooks-security-seeds-datasources` objectstack-ai#7 pass in both rounds;
`objects-fields-relationships` objectstack-ai#10 failed before on `label: '是否完成'`, not
on the relaxed token, and passes after.

One repetition per case is the round the card and objectstack-ai#37235 fix; at that
depth a single case moves between readings for no reason of the text
(four did here, in the unfavourable direction, and reverted). The five
that moved the favourable way were not re-read: the rule re-reads a flip
that would break parity, and a gain is not claimed from one reading.
Read the result as "not lower", not as "five cases better".

Both rounds were read on `3b62b5e9b0`. The commit after it
(`edcd7df4ad`) changes no file of the two evaluated bundles (one line of
objectstack-project, a script comment, the changeset), so the rounds
were not run again.

Records (round.json, every turn's record, both summaries):
`skill-evals-before-304a4c53.tgz`, `skill-evals-after-3b62b5e9.tgz`,
`skill-evals-after-reread-3b62b5e9.tgz` in the project's shared files,
folder `34770/`.

No unit test changes: the diff is skill text, three eval fixtures,
ratchet rows and a changeset. The one test that names the ratchet
script, `packages/spec/scripts/platform-catalog.test.ts`, ran apart from
the gate list (see Verification).

## Verification

Eleven skill files, measured on the head `edcd7df4ad` against `main`
(`ceil((utf8 bytes − the SKILL.md version stamp line) / 4)`, the
ratchet's own arithmetic):

| file | lines | bytes | ratchet row |
|:--|--:|--:|--:|
| `objectstack-data/SKILL.md` | 472 → 167 | 26,860 → 8,983 | 6709 → 2239
|
| `objectstack-data/references/examples-objects.md` | 192 → 305 | 6,892
→ 14,441 | 1723 → 3611 |
| `objectstack-data/rules/field-types.md` | 273 → 318 | 14,160 → 16,799
| 3540 → 4200 |
| `objectstack-data/rules/relationships.md` | 384 → 393 | 16,714 →
17,274 | 4179 → 4319 |
| `objectstack-data/rules/security.md` | 349 → 388 | 17,335 → 19,290 |
4334 → 4823 |
| `objectstack-data/rules/validation.md` | 329 → 392 | 11,031 → 13,861 |
2758 → 3466 |
| `objectstack-automation/SKILL.md` | 480 → 215 | 28,206 → 10,703 | 7045
→ 2669 |
| `objectstack-automation/references/examples-flows.md` | 145 → 432 |
6,170 → 25,729 | 1543 → 6433 |
| `objectstack-automation/references/integration-recipes.md` | 186 → 212
| 10,379 → 12,222 | 2595 → 3056 |
| `objectstack-automation/references/state-machines-and-approvals.md` |
388 → 388 | 23,706 → 23,708 | 5927 → 5927 |
| **ten files of the move** | 3,198 → 3,210 | 161,453 → 163,010 | 40,353
→ 40,743 |
| `objectstack-project/SKILL.md` (the re-pointed line) | 214 → 214 |
11,985 → 11,987 | 2990 → 2990 |

- **What an AI loads first**: the two entry files together 55,066 →
19,686 bytes (13,754 → 4,908 tokens), 64% smaller.
- **Whole pack**: authored (ratcheted) 200,068 → 200,458 tokens (+390);
bundle total 304,380 → 304,770. The pack does not shrink: the text moved
inside it.
- **Ruling ④A accounting**: every raised row equals its measured bytes,
zero headroom (the gate is exact since objectstack-ai#37747, so a row above or below
its file is red). Of the +390, +430 is the automation entry's own row
(the pure router measured 2239; ruling 7168461386 A restores six
flow-shape facts and ruling 7176941587 Q2 A keeps 187 bytes, 2239 →
2670, then 2669 after the merge). Set that authorised row aside and the
moves sum to −40: the sum of ceilings does not rise.

<details><summary>Gates run locally on the head</summary>

Derived with `node scripts/pm/dispatch-gates.mjs --commands` on
`3b62b5e9b0`, each command run and its exit code recorded, then
reconciled with `--ran`: **69 derived, 68 run (each exit 0), 1
NOT-MEASURED, 0 unrun.**

On head `edcd7df4ad` (the three nits) the 16 gates that read the changed
files were run again, each exit 0: the fourteen skill gates
(`check-skills-token-ratchet` and its self-test, `check:skill-docs`,
`check:skill-refs`, `check:skill-served-sections`, `check:skill-links`,
`check:skill-identifier-liveness`, `check:skill-compatibility`,
`check:skill-frame-sync`, `check:doc-authoring`, `check:nul-bytes`,
`check:pm-skill-id-lint`, `check:skill-examples`,
`check:doc-formula-expressions`) and the two changeset gates. The other
gates were not re-run on it. A trial merge with `origin/main`
`c6a1328dfe` (which moved the ratchet script and
`skills/objectstack-ai/SKILL.md` meanwhile) has no conflict and the
ratchet is green on the merged tree (200,510 / 200,510); the trial was
discarded and `main` is not merged again.

- NOT MEASURED: `pnpm check:dual-build-cjs-loads` exited 3 (prerequisite
not met: it needs every package's `dist`, a whole `pnpm build`). Long
builds go to GitHub under this project's standing rule, so CI is the
reading for it; the diff touches no package source.
- `pnpm check:skill-examples` needed `pnpm --filter
'@objectstack/client-react...' --filter '@objectstack/lint...' build`
first; then exit 0, 351 prose examples type-check across 3 surfaces.
- Outside the derived list, run apart: `pnpm --filter @objectstack/spec
exec vitest run scripts/platform-catalog.test.ts` (the one test that
names the ratchet script), 21 of 21.
- `node scripts/pm/overlap-check.mjs` before the first push: clean
against `origin/main` and the two open PRs that share a file (objectstack-ai#38224,
objectstack-ai#38192).

Exit 0, all 68: `node scripts/check-adr-0087-registration.mjs --base
origin/main` · `node scripts/check-adr-0087-registration.mjs
--self-test` · `node scripts/check-changeset-no-major.mjs --base
origin/main` · `node scripts/check-closing-keyword-parity.mjs` · `node
scripts/check-closing-keyword-parity.mjs --self-test` · `node
scripts/check-comment-mask-corpus.mjs` · `node
scripts/check-declaration-mirrors.mjs` · `node
scripts/check-declaration-mirrors.mjs --self-test` · `node
scripts/check-doc-route-spelling.mjs --advisory` · `node
scripts/check-doc-route-spelling.mjs --self-test` · `node
scripts/check-dts-emitted.mjs --self-test` · `node
scripts/check-empty-changeset.mjs --base origin/main` · `node
scripts/check-empty-changeset.mjs --self-test` · `node
scripts/check-self-test-wired.mjs` · `node
scripts/check-self-test-wired.mjs --self-test` · `node
scripts/check-self-test-workflow-commands.mjs` · `node
scripts/check-self-test-workflow-commands.mjs --self-test` · `node
scripts/check-skills-token-ratchet.mjs` · `node
scripts/check-skills-token-ratchet.mjs --self-test` · `node
scripts/check-whole-set-label-write.mjs` · `node
scripts/check-whole-set-label-write.mjs --self-test` · `node
scripts/ci/assert-turbo-remote-cache.mjs --self-test` · `node
scripts/ci/plan-test-core-shards.mjs --self-test` · `node
scripts/ci/prune-turbo-cache.mjs --self-test` · `node
scripts/ci/snapshot-next.mjs --self-test` · `node
scripts/pm/bare-root-worklist.mjs --self-test` · `node
scripts/pm/check-governed-queue-guard.mjs --self-test` · `node
scripts/pm/release-rehearsal-clone.mjs --self-test` · `node
scripts/release-pending-publish.mjs --self-test` · `--filter
@objectstack/lint run check:doc-formula-expressions` · `--filter
@objectstack/spec run check:skill-docs` · `--filter @objectstack/spec
run check:skill-refs` · `--filter @objectstack/spec run
check:skill-served-sections` · `check:adr-anchors` ·
`check:agent-test-spelling` · `check:bash32-floor` ·
`check:changeset-gate-self-tests` · `check:ci-filter-parity` ·
`check:cli-command-ids` · `check:closed-ceremony-text` ·
`check:corpus-claim-drift` · `check:cross-package-test-inputs` ·
`check:doc-authoring` · `check:driver-memory-census` ·
`check:dts-closure` · `check:entry-guard` · `check:gitlink-declared` ·
`check:lean-entry-closure` · `check:merge-driver` · `check:nul-bytes` ·
`check:parse-guard` · `check:pm-dispatch-gates` ·
`check:pm-expected-skips` · `check:pm-governed-merges` ·
`check:pm-skill-id-lint` · `check:pnpm-filter-targets` ·
`check:pnpm-flag-spellings` · `check:published-files` ·
`check:ratchet-remedy-authority` · `check:refd-timer-probe` ·
`check:role-word` · `check:scripts-symbol-anchors` ·
`check:skill-compatibility` · `check:skill-frame-sync` ·
`check:skill-identifier-liveness` · `check:skill-links` ·
`check:sourcemap-no-sources-content` · `check:watch-hint-literal`

</details>

**Writer**: all `skills/**` text was written by the card thread itself,
a session at `CONTRACT_REVIEW_TIER` per the claim (7240213191). Every
assistant turn of the session's transcript was served at the tier (210
of 210 when counted against the constant in
`scripts/pm/dispatch-gates.mjs`); `verify-review-tier.mjs` itself
refuses the transcript because the session once ran a read-only
sub-agent to read the rulebook, so that count is the thread's reading,
not the script's PASS.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgUTzGxLiCQYi8Wvn3K)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L6bhgUTzGxLiCQYi8Wvn3K

<!-- signed: repo:objectstack#2 · os-sales ·
session_01L6bhgUTzGxLiCQYi8Wvn3K -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check-skills-token-ratchet: say when a ceiling sits above the measured tokens (a raise outlived by a later shrink)

2 participants