Skip to content

Commit 4f7aa88

Browse files
docs(agents): a volatile count nobody acts on is deleted, not synced (#38127)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDypKu7B9nwbu5WuV7AEio8)_ Fixes #37887 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户无感:开发规范新增一条规矩,会随日常开发变化、又没人据此做事的数字(规则条数、文件数、注册表大小)不写进用户可见输出、文档、技能文字或测试基线;遇到就删掉它,以及唯一作用是让它与注册表相等的检查,其他检查不动;限额、配额、价格这类有人据此做事的数字照留。 - 为什么做:按你的指示把规矩写进开发座位必读的开发规范而非发给客户的技能文档,并先删掉开发规范自己的无用计数,避免再为同步无意义数字误报、被合并队列踢出。 - 出错会怎样:只改规则文字和一处字节上限,不改任何产品代码或运行行为,可直接撤回。 - 要你做什么:批准合并(开发规范是受保护文件)。 ## What changes 1. **One rule in `AGENTS.md`**, under Documentation Guardrails right after the docs-path table (the closest existing rule set; there is no separate section on user-facing text): > **Volatile counts are deleted, not synced.** ⛔ Never write into user-facing output, docs, skills text or a test baseline a count that ordinary development moves (rules, files, registry entries) unless a reader acts on it (a limit, quota, price). Meet one: delete it, and any check whose only job is keeping it equal to a registry (its PR cites this rule, not the duplicate pin a test deletion needs); never update either. Only the meaningless count and a check whose sole job is keeping it equal to a registry are deleted. The parenthesis names the precedence over the Build & Test rule that a test is deleted only when its PR names a duplicate pinning the assertion (ruling record 6120820653): a count-sync check is the exception, and its PR cites this rule instead. 2. **The rule applied to `AGENTS.md` itself** — volatile counts deleted, sentences reworded only as needed, no rule or gate removed: - Translations row: `(nine packages — platform-objects, five plugins, three services)` dropped; "Regenerate all nine" → "Regenerate them all"; "gates all nine in CI" → "gates them all in CI". - Spec artifacts: "`packages/spec` has **six** checked-in generated artifacts, each with its own CI gate" → "Each checked-in generated artifact of `packages/spec` has its own CI gate". - Route and surface ownership: "Five rules. They matter more…" → "These rules matter more…"; its closed-query-set item: "Three things to get right:" → "Get these right:". - Build & Test: "Three principles the ratchet's invariants encode:" → "Principles the ratchet's invariants encode:". - Prime Directive 11: "Two PreToolUse hooks **enforce** this" → "PreToolUse hooks **enforce** this"; "the third hook" → "another hook". - Commit-message attribution: "Two exemptions:" → "Exemptions:". - Merge queue §7: "**Three classes of PR never enter this path…**" → "**These classes of PR never enter this path…**". - Spec generators: "Three generators have **no** gate at all … reports all three each run" → "Some generators have **no** gate at all … reports each of them every run". - Post-Task Checklist step 3: "one of fourteen retirement surfaces" → "one of the retirement surfaces". Kept, because a reader acts on them: the eleven required merge-queue contexts (treated as contract), "ALL FIVE hold" for force-push, the ten frozen `plugin-` packages, "those four lift", the three-part finding and three cures (fixed definitions), the two line-initial changeset declarations, and the six-hourly Version Packages cadence. 3. **Ruled raise of the `AGENTS.md` byte ceiling** — only the `AGENTS.md` row of `CEILINGS` in `scripts/pm/check-skill-line-ratchet.mjs`: **78401 → 78712 (+311 B)**, exactly the measured size at this head (`wc -c AGENTS.md`: 78401 at base 8e3980a, 78712 at 9407435). Nothing else in that script changes. ## Ruling of record - #37887 comment 7233980615, the maintainer verbatim: 「没用的统计数字直接删,不同步」 - #37887 comment 7234354812, the transcription of the maintainer's decision-card choice at 2026-11-28T04:25:40Z: option **A** 「A 上调上限并删无用计数」, answering 「要上调 AGENTS.md 的字节上限,让 #38127 那条规则落地吗?」 - The 2026-11-27 「同意」 to the AGENTS.md placement, quoted in the card's filing gate, after 「是不是应该立skills卡,让开发遇到类似的没有意义统计数据直接删除」. - Raise path: the ratchet header's ruled raise (ruling record 6184799323, letter B). Whether this citation suffices is the contract reviewer's call. ## Tests Rule text and one ceiling number; no behaviour changed, no tests owed. No changeset: nothing here ships in any package's `files[]` (`skip-changeset`). ## Acceptance notes - No internal skill under `.claude/skills/**` teaches syncing a volatile count, so no pointing line was added (grep under Verification). ## Verification Two-minute check: `pnpm check:pm-skill-ratchet` exits 0 and prints `AGENTS.md is 78712 bytes (ceiling 78712; headroom 0)`. <details><summary>Count greps</summary> `.claude/skills`: `grep -rIn -i count .claude/skills` gives 27 hits (control: it finds `totalCount` / `open_issues_count` reading rules); filtered for update/bump/sync/increment/adjust/drift/equal/match it gives 0. `grep -rIn -i -E 'rule count|rules? total|[0-9]+ rules|registry size|file count' .claude/ AGENTS.md` gives 0. In AGENTS.md, spelled-out one to twenty and digit-plus-noun counts (rules, files, packages, artifacts, gates, checks, entries, hooks, skills, routes, contexts, families, items, surfaces) were read by hand; the deletions and the kept counts are listed above. `git grep` finds no gate pinning any deleted phrase. </details> <details><summary>Local gates at 9407435 (dispatch-gates --commands, 37 derived; --ran: 37 run, 0 NOT-MEASURED, 0 UNRUN)</summary> Every command exited 0, captured before any pipe; `check:pm-skill-ratchet` (self-test + gate) prints `AGENTS.md is 78712 bytes (ceiling 78712; headroom 0)`. Commands: - `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-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-whole-set-label-write.mjs` - `node scripts/check-whole-set-label-write.mjs --self-test` - `node scripts/ci/plan-test-core-shards.mjs --self-test` - `node scripts/pm/bare-root-worklist.mjs --self-test` - `pnpm check:adr-anchors` - `pnpm check:agent-test-spelling` - `pnpm check:bash32-floor` - `pnpm check:ci-filter-parity` - `pnpm check:cli-command-ids` - `pnpm check:cross-package-test-inputs` - `pnpm check:docs-audit-scope` - `pnpm check:driver-memory-census` - `pnpm check:entry-guard` - `pnpm check:gitlink-declared` - `pnpm check:nul-bytes` - `pnpm check:parse-guard` - `pnpm check:pm-dispatch-gates` - `pnpm check:pm-governed-merges` - `pnpm check:pm-governed-prose` - `pnpm check:pm-skill-id-lint` - `pnpm check:pm-skill-ratchet` - `pnpm check:pnpm-filter-targets` - `pnpm check:pnpm-flag-spellings` - `pnpm check:ratchet-remedy-authority` - `pnpm check:refd-timer-probe` - `pnpm check:required-contexts` - `pnpm check:scripts-symbol-anchors` - `pnpm check:watch-hint-literal` Whole-tree and CI-only families are left to the PR check-runs. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cxRDKprCtjpEdtiPFW)_ <!-- signed: repo:objectstack#1 · os-elon-musk · session_016WV4cxRDKprCtjpEdtiPFW --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7b90456 commit 4f7aa88

2 files changed

Lines changed: 19 additions & 14 deletions

File tree

‎AGENTS.md‎

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ entry; new packages arrive covered; a package that graduates deletes its entry i
8484
same PR; when a re-measure forces a count up, rewrite the entry's `note` too — a note
8585
naming only the old errors reads as "nearly graduated" to the next author.
8686

87-
Three principles the ratchet's invariants encode:
87+
Principles the ratchet's invariants encode:
8888

8989
- **A package's `tsconfig.json` reaches every `*.test.ts` / `*.spec.ts` in it**
9090
([why](docs/agents/build-and-test.md#why-a-test-the-tsconfigjson-misses-is-hidden)). A sibling
@@ -239,15 +239,15 @@ See `ui/AGENTS.md` for the app-id / localStorage / auth gotchas.
239239
the shared tree has its HEAD switched and reset *under you*, silently clobbering uncommitted work — a feature
240240
branch on the *shared* checkout is **not** enough. Before your **first file edit**, be in a dedicated worktree on
241241
a feature branch: `git fetch origin main && git worktree add --no-track ../objectstack-<task> -b <branch>
242-
origin/main && cd ../objectstack-<task> && pnpm install`. Two PreToolUse hooks **enforce** this —
242+
origin/main && cd ../objectstack-<task> && pnpm install`. PreToolUse hooks **enforce** this —
243243
`.claude/hooks/guard-main-checkout.sh` blocks `Edit`/`Write`/`NotebookEdit`, and
244244
`.claude/hooks/guard-main-checkout-bash.sh` blocks the identical write arriving through **Bash** (`>`/`>>`
245245
redirection, `sed -i`, `perl -i`, `tee`, `cp`, `mv`, `rm`, `touch`) — and both check the **target file's own
246246
repo**, so sibling repos (`cloud`, `hotcrm`) you touch are covered too (deliberate non-task override:
247247
`OS_ALLOW_MAIN_EDITS=1`, one switch for both). The Bash guard is precision-first: it never blocks reads, and any
248248
shape it cannot resolve with confidence (`bash -c …`, `xargs`, `node -e`, a `$VAR`/glob target) is allowed through
249-
— the rule still outranks the hook. **A worktree isolates neither the stash nor the build cache** — the
250-
third hook (`guard-shared-stash.sh`, `OS_ALLOW_STASH=1`) and the replacements live in Multi-agent discipline below.
249+
— the rule still outranks the hook. **A worktree isolates neither the stash nor the build cache** — another
250+
hook (`guard-shared-stash.sh`, `OS_ALLOW_STASH=1`) and the replacements live in Multi-agent discipline below.
251251
12. **Contract-first — fix the metadata, not the runtime.** `packages/spec` is the one contract between metadata
252252
*producers* and the runtime/renderers that *consume* it. When a piece of metadata "doesn't work," ask **first**:
253253
*is it spec-compliant? is this the long-term-correct direction?* If the metadata is wrong, fix it at the
@@ -450,7 +450,7 @@ platform's, not your form downgraded. Which layer does this is unknown; don't go
450450
it. **Commit message:** an agent commit ends with the model-free trailer pair
451451
`Claude-Session: https://claude.ai/code/session_<id>` and `Co-authored-by: Claude <noreply@anthropic.com>`, and the
452452
pre-push hook refuses a model identifier in that pair; no model identifier lands in a PR title or body, a comment, a
453-
changeset, a doc or a code comment. Two exemptions: a harness-written `Co-Authored-By` trailer (REPORTING: not declared
453+
changeset, a doc or a code comment. Exemptions: a harness-written `Co-Authored-By` trailer (REPORTING: not declared
454454
a deviation; landed history is not rewritten) and a verbatim maintainer ruling preserved as a quotation block.
455455

456456
**GitHub mutates body BYTES — spell poison-shaped tokens out in words, never literally.**
@@ -497,7 +497,7 @@ Even inside your own worktree, operate defensively:
497497
accepted and non-draft, then let the queue merge it**
498498
([why](docs/agents/multi-agent-discipline.md#what-the-merge-queue-does-with-your-pr)).
499499

500-
⛔ **Three classes of PR never enter this path on green alone:** (a) a diff touching any **governed surface**
500+
⛔ **These classes of PR never enter this path on green alone:** (a) a diff touching any **governed surface**
501501
(**Prime Directive #14**, which names them and holds the current list — **this file and `CLAUDE.md` are on it**,
502502
so re-read it rather than recalling it); (b) the **Version Packages** PR, or any PR whose merge performs a
503503
release (**Prime Directive #15**); (c) a PR whose **changed lines exceed 3,000** (`additions + deletions`,
@@ -648,12 +648,17 @@ Root also exports: `defineStack`, `composeStacks`, `defineView`, `defineApp`, `d
648648
| `content/docs/references/` | **AUTO-GEN** | ❌ Never hand-edit. Regenerated by `packages/spec/scripts/build-docs.ts`. |
649649
| `content/docs/releases/` | **RELEASE-OWNED** | ❌ Never edit in a code PR. Release notes are written **centrally at release time**, compiled from changesets + the ADR-0087 registries — never accreted a row per PR. Your PR's input is its **changeset**; for spec removals also the D2/D3 registry entries. Factual error on a releases page → dedicated docs-only PR or an issue, never a rider on code changes. |
650650
| `packages/*/CHANGELOG.md` | **RELEASE-OWNED** | ❌ Never edit in a code PR — `changeset version` compiles it from `.changeset/*.md` and it ships inside the npm tarball as the text an upgrading agent greps (§ *Post-Task Checklist* step 3). Your PR's input is its **changeset**, on a hard, unwatched deadline: the release that consumes it deletes that input and publishes the sentence. Factual error in a released entry → **amend that entry in a dedicated docs-only PR**, ⛔ never an erratum in a later entry and never a rider on code changes — the reader greps the tombstoned symbol and lands on the old entry, so a correction anywhere else is one it never reaches; what shipped stays recorded in the published tarballs and in git history. |
651-
| `**/translations/*.generated.ts` (nine packages — `platform-objects`, five plugins, three services) | **AUTO-GEN** | ❌ Never hand-edit the file *structure*. Regenerate all nine with `node scripts/check-i18n-bundles.mjs --write` (merge mode keeps every existing **translated-locale** value; the default locale `en` is rewritten from the source on every run, so hand-edits to `en.*.generated.ts` do not survive and belong in the source metadata); `pnpm i18n:extract` still covers `platform-objects` alone. Translated-locale *values* (`zh-CN` / `ja-JP` / `es-ES`) are hand-written: editing one of those strings is fine, adding or dropping keys is drift. `pnpm check:i18n` gates all nine in CI, and `pnpm check:i18n-coverage` ratchets untranslated declared labels. |
651+
| `**/translations/*.generated.ts` | **AUTO-GEN** | ❌ Never hand-edit the file *structure*. Regenerate them all with `node scripts/check-i18n-bundles.mjs --write` (merge mode keeps every existing **translated-locale** value; the default locale `en` is rewritten from the source on every run, so hand-edits to `en.*.generated.ts` do not survive and belong in the source metadata); `pnpm i18n:extract` still covers `platform-objects` alone. Translated-locale *values* (`zh-CN` / `ja-JP` / `es-ES`) are hand-written: editing one of those strings is fine, adding or dropping keys is drift. `pnpm check:i18n` gates them all in CI, and `pnpm check:i18n-coverage` ratchets untranslated declared labels. |
652652
| `content/docs/<tree>/` — every tree except `references/` and `releases/` above | hand-written | ✅ Update that tree's own `meta.json` when adding a page: each is an explicit ordered `pages` array with no rest-spread, so a page you add but never list is absent from the nav. |
653653

654+
**Volatile counts are deleted, not synced.** ⛔ Never write into user-facing output, docs, skills text or a test
655+
baseline a count that ordinary development moves (rules, files, registry entries) unless a reader acts on it (a
656+
limit, quota, price). Meet one: delete it, and any check whose only job is keeping it equal to a registry (its PR
657+
cites this rule, not the duplicate pin a test deletion needs); never update either.
658+
654659
### Touched `packages/spec`? Regenerate its artifacts BEFORE pushing
655660

656-
`packages/spec` has **six** checked-in generated artifacts, each with its own CI
661+
Each checked-in generated artifact of `packages/spec` has its own CI
657662
gate. All of them live in one job — `TypeScript Type Check` in `lint.yml`, which is
658663
required and has no paths filter, so no gate can go dormant on the PR that breaks it.
659664
Its lanes run every gate even after an earlier one is red, so one run reports every stale
@@ -708,9 +713,9 @@ Principles the wrapper encodes (its own output is the authority on detail):
708713
a name, with accepted cases in the shrink-only, hand-edited
709714
`dual-source-exports.baseline.json`.
710715

711-
Three generators have **no** gate at all. Nothing verifies `gen:openapi` and `gen:sbom`
716+
Some generators have **no** gate at all. Nothing verifies `gen:openapi` and `gen:sbom`
712717
are current, and `gen:migration-registry` writes gitignored output that install, build and
713-
test regenerate; the wrapper reports all three each run rather than staying silent.
718+
test regenerate; the wrapper reports each of them every run rather than staying silent.
714719

715720
---
716721
## Context Routing — apply the right role per path
@@ -779,7 +784,7 @@ export class MyPlugin implements Plugin {
779784

780785
## Route & surface ownership
781786

782-
Five rules. They matter more than usual here because this repo is largely written by
787+
These rules matter more than usual here because this repo is largely written by
783788
agents, and every one of them is a trap that reads as reasonable code.
784789

785790
**1. One route, one owner.** Never add a second implementation of a path that another
@@ -816,7 +821,7 @@ zero rows, and no status, header or field distinguishes either from a real answe
816821
AI caller cannot see it at all. This is review-enforceable: a PR adding a `GET` route
817822
that reads `req.query` without declaring a closed set is incomplete.
818823

819-
Three things to get right:
824+
Get these right:
820825

821826
- ⛔ **Measure the set from the handler's ACTUAL read points, never from the docs or
822827
the card.** It is not "the filters" — it is paging, ordering, format, alias spellings
@@ -1032,7 +1037,7 @@ Both non-handshake shapes, and how to classify and probe your own:
10321037
migration**: removing or renaming anything an author can write (a spec key, an export, a config field) puts the FROM
10331038
→ TO mapping and the one-line fix in the body, which ships as `CHANGELOG.md` in the npm package. Removing an
10341039
authorable spec key also needs a tombstone (`retiredKey()`, `packages/spec/src/shared/retired-key.ts`) so the
1035-
rejection carries the prescription — one of fourteen retirement surfaces; follow the `spec-property-retirement`
1040+
rejection carries the prescription — one of the retirement surfaces; follow the `spec-property-retirement`
10361041
skill (`.claude/skills/`), never reconstruct the kit. **A breaking changeset must also state its ADR-0087
10371042
disposition, in writing** — exactly one marker in the changeset body, which also carries both declaration lines
10381043
(`pnpm check:adr-0087-registration` reads the arm and the kind there). ⛔ The categories are NOT copied here —

‎scripts/pm/check-skill-line-ratchet.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const CEILINGS = new Map([
143143
['.claude/skills/checklist-author/SKILL.md', 3574],
144144
['.claude/skills/dogfood-verification/SKILL.md', 9526],
145145
['.claude/skills/spec-property-retirement/SKILL.md', 26922],
146-
['AGENTS.md', 78401], // raised 78106 → 78401 (+295 B, the merge-queue speed-budget sentence; 1050 → 1053 lines) by ruling record 7044162186 「抬到 1053,整句写进去」 under ruling record 6184799323, letter B
146+
['AGENTS.md', 78712], // raised 78401 → 78712 (+311 B, the volatile-counts rule less the counts it deleted) by ruling records 7233980615 「没用的统计数字直接删,不同步」 and 7234354812 (option A 「上调上限并删无用计数」) under ruling record 6184799323, letter B; raised 78106 → 78401 (+295 B, the merge-queue speed-budget sentence; 1050 → 1053 lines) by ruling record 7044162186 「抬到 1053,整句写进去」 under ruling record 6184799323, letter B
147147
['CLAUDE.md', 273],
148148
]);
149149

0 commit comments

Comments
 (0)