Skip to content

docs(pm-dispatch): require a positive control and short anchors in Re-check greps - #13106

Queued
os-litant wants to merge 2 commits into
mainfrom
claude/issue-12671-recheck-anchor-discipline
Queued

docs(pm-dispatch): require a positive control and short anchors in Re-check greps#13106
os-litant wants to merge 2 commits into
mainfrom
claude/issue-12671-recheck-anchor-discipline

Conversation

@os-litant

Copy link
Copy Markdown
Collaborator

Fixes #12671

A card's Re-check grep quotes the author's full remembered sentence. That same sentence
is line-wrapped in the source file, git grep matches line by line, and the command
returns zero on a tree where the text is entirely present. The next reader takes the zero
as authoritative absence — "already gone, nothing to fix". That is worse than shipping no
command at all: it is a real re-check step carrying a broken instrument, and the zero it
prints looks like a reading.

The three measured instances

# What was measured Reading
1 A card's own Re-check grep, quoting a full comment sentence in packages/rest/src/rest-server.ts Zero hits on a tree where the comment is fully present at :9656-9657, split across a wrap. Positive control sendError in the same file = 7, so the tool was not broken.
2 A dispatch-time census grep for a phrase over *.ts Missed a citation wrapped across a comment line boundary at packages/rest/src/package-door-declared-code.test.ts:91-92, and simultaneously OVER-counted, because the site had entered the list through an earlier bare-token search. Wrong in both directions at once.
3 An earlier card whose title already names the wrap-tolerance problem Recognition did not change the habit. The method was written down, correctly, in one business card's body — where the next author writing a Re-check section never reads it. The defect is the FILING TEMPLATE, not the authors' memories.

A fourth defect, measured on the same demo command, is why clause 1 below is the remedy
and clause 2 is only its companion: that verbatim grep also mismatched on CASE. Broken
down over *.ts by matching files — contiguous 1, case-insensitive 7, wrap-tolerant
13 — the two defects contribute roughly half each. A positive control catches both,
because it does not ask the author to predict which mistake they made. An anchor rule
alone catches only the wrap.

What landed

One bullet in .claude/skills/pm-dispatch/references/dispatch-runbook.md, section
落卡与裁决记录细则:

  1. Every Re-check grep carries a POSITIVE CONTROL from the same file — a word certain to
    exist, and never a substring of the term under test. A zero whose control did not pass
    is recorded as 没读到, never as 不存在.
  2. Anchors take the SHORTEST non-wrapping fragment, never the full remembered sentence.

The wrap-tolerant multiline form was deliberately NOT prescribed. The card rates it the
costliest and most error-prone of its three candidates, and it treats only the wrap.

Why this file

SKILL.md states the parent clause — 卡上每条前提行自带一条 re-check 命令 — under
落卡/升级流程 ①. Its siblings already have references homes (② points at
decision-analysis.md, ③ at this runbook's 落卡与裁决记录细则); ① had none, and this
section is the one a seat has open at the moment it files a card. decision-analysis.md
was the other candidate and was rejected on scope: its 适用面 bounds it to
needs-user-decision cards, while all three measured instances are finding and business
cards.

Two files were named as serially occupied by in-flight PRs and neither was touched:
SKILL.md and references/landing-operations.md.

Ratchet

Net-0, no ceiling raised, no re-wrap harvesting.

File Ceiling Before After Net
.claude/skills/pm-dispatch/references/dispatch-runbook.md 274 274 274 0

The 120-byte line rule caught one intermediate mistake worth recording: the replacement
line for the third cut landed at 160 bytes. Its predecessor had been exempt only because
a 「…」 quotation spanned the lines; closing the quotation on a single line dropped the
exemption. Tightened to 115 bytes, and the gate is green on the final tree.

Cut ledger

Every cut verified to survive at a named source before removal.

Cut Lines Content survives at
裁决记录四件补遗 items ② and ④ 2 SKILL.md 落卡/升级流程四件同笔 carries all four: 状态转换同笔(…换结果态,永不留挂) and 条件已判即判(输入已知的就地判掉). The result-state label enumeration is the SKILL.md state table plus the 发现分诊轮 line. Item ① is genuinely an addendum and was kept.
The pnpm install --workspace-concurrency toolchain sentence, stapled to the end of the two-readings bullet 1 .claude/agents/os-dev.md Toolchain traps, which carries it in full — the refusal, the error text, and the point that install is a new worktree's first command. The dev runs that command, not the PM.
The rejection-envelope clause body under 条件性标准条款 2 .claude/agents/os-dev.md standard clause 拒收类用例断言信封,不断言 throw 本身code + status, the ADR-0112 envelope, the bare toThrow() refusal, and the message-first-sentence rule. The one part with no other home, the no-backfill boundary, is retained verbatim in the one-line replacement.
Total 5 Added bullet is 5 lines.

Gates

Union derived on the final commit f6eeae1d6 with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack — 7 families, no
paths passed by hand, derived after the merge of origin/main so the stale-tree warning
from the first derivation is cleared. Exits captured by redirect before any pipe.

Gate Exit Verdict line the gate itself printed
check:pm-skill-ratchet 0 ✓ check-skill-line-ratchet: …/dispatch-runbook.md is 274 lines (ceiling 274; headroom 0).
check:pm-skill-id-lint 0 ✓ check-skill-id-lint: 23 file(s) clean (pattern /#[0-9]{3,}/g).
check:skill-frame-sync 0 ✓ check-skill-frame-sync: 4 copies of the decision frame are structurally isomorphic across 3 files
check:doc-authoring 0 ✓ doc authoring guard: 48 published skill files clean — no internal issue-id references.
check:agent-test-spelling 0 green sweep, non-vacuity carried by its --self-test
check:pm-governed-merges 0 ✓ check-governed-merges --self-test: 206 assertions
check:doc-formula-expressions 0 ✓ check:doc-formula-expressions: 22 record-scoped formula example(s) across 425 files / 1453 TS blocks judged clean
check:nul-bytes 0 check-nul-bytes: OK (scanned 7285 text file(s) … no raw ASCII control bytes).

check:doc-formula-expressions first exited 1 with PREREQUISITE NOT MET on two unbuilt
workspace packages. That is not a red gate and nothing was measured by it; both packages
were built under the shared verify lock and the gate then ran and passed. check:nul-bytes
is not in the derived union — it is owed by any edit — and the edited file was also swept
directly for raw control bytes, no hits.

No changeset: the diff is .claude/** only and publishes nothing. skip-changeset applied
at PR-open by read-union-write plus a comparison read-back.

One question left for the maintainer

The card itself raises it and it is recorded here rather than acted on: it asks whether it
should be merged into the earlier card that already named the wrap-tolerance problem, on
the grounds that its own value is the three measured instances rather than its separate
existence. That other card is #12454; it remains open, its own three citation sites are
still outstanding, and nothing here touches it. The distinction that argues against
merging is that the other card repairs three citations while this one repairs the tool
habit that turns those citations into false zeros.

Generated by Claude Code


Generated by Claude Code

claude added 2 commits August 29, 2026 05:10
…-check greps

A card's `Re-check` grep quotes the author's full remembered sentence, but the
same sentence is line-wrapped in the source file, so `git grep` matches nothing
and the next reader reads that zero as "already gone, nothing to fix". Measured
three times in one lane, plus a fourth defect stacked on the same command: a
verbatim quotation whose case did not match the tree.

The rule lands on the filing side, in the 落卡与裁决记录细则 section that holds
the references detail for the main file's "每条前提行自带一条 re-check 命令":
every grep carries a positive control from the same file, and a zero without a
passing control is recorded as 没读到 rather than 不存在. The control is the one
remedy that covers BOTH defects, because it does not ask the author to predict
which mistake they made. Anchors take the shortest non-wrapping fragment.

Net-0 against the file's ratchet, paid by three cuts whose content survives at
a named source; no re-wrap harvesting.

Claude-Session: https://claude.ai/code/session_01MnijPVVDakqK2J335JoJtq

Co-authored-by: Claude <noreply@anthropic.com>
@os-zhuang
os-zhuang marked this pull request as ready for review August 29, 2026 08:18
@os-zhuang
os-zhuang added this pull request to the merge queue Aug 29, 2026
Any commits made after this event will not be merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

[finding] 归档卡里的 Re-check grep 用的是脑中完整的那句话,文件里它折了行 —— 三次实测返回没有阳性对照的假零

3 participants