Repository navigation
fix(pm): the record reader closes a fence only on a bare run and opens its scope only on an unindented heading; the writer refuses on a key line and names the new causes - #28103
Conversation
…s its scope only on an unindented heading; the writer refuses on a key LINE and names the two new causes
`contractReviewHeadSha` (check-half-states.mjs) closed a fence on any run of
the opening character, so a closing line with trailing text — fence content
to CommonMark — ended the fence and a `Head-sha:` line after it was read.
It also opened its heading scope on a `## Contract review` heading indented
four spaces or a tab, an indented code block to the renderer, while holding
the key line itself to three spaces. Both read the same as base and appear
in 0 of 713 live records; both are now closed, each pinned and ablated once.
`FENCE_CLOSE_LINE` admits whitespace only after the run; the scope opens on
`^[ ]{0,3}#` and the shared marker keeps its tolerance for the locator.
`post-stamped.mjs` tested the `Head-sha` key ANYWHERE in a record-shaped
comment, so one that quoted a record heading and named the key mid-sentence
was refused at write time. `HEAD_SHA_KEY_LINE` now asks for a line opening
on the key, however decorated (indent, blockquotes, a bullet or a list
number, bold, backticks), so every refused shape #28042 pinned stays refused
and the prose mention is not. The refusal's `why` and
`RECORD_KEY_SPELLINGS['Head-sha']` name the code-indented line and the line
under a quoted or code-indented heading. No new refusal class, no new gate.
`contract-review.md:33` now says the `Head-sha:` line sits 题头之下, at 120
bytes and line-neutral; the `--template` note says the same in English.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4czoR81DDKSnGWnBYqA
|
domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS Contract-review-claim: session_016WV4d1QkPVVzNz3FJqb2iS · head f619d31 · 2026-10-30T12:51Z |
|
domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS Contract reviewHead-sha: ① Derived judgmentsBase is
② Semver levelNo published package is touched ( ③ Boundary flags
④ Design judgmentRules face, per
Implemented-by: VERDICT: PASS Must-fix: none. Should-fix (file on a follow-up card):
|
|
domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS 维护者速读
席位意见:ACCEPT。契约复核 PASS,没有 must-fix。复核构造了 78 种新写法,加上之前的 56 种和 31 种拒收写法,再加两个真实评论串,四个读者在新旧两边都做了对比:每一处变化都是从「读到被引用的 head」变成「读不出」或「读到作者自己那一行」,没有一处比基线更宽,四个读者每一行结论一致。 should-fix 1 是:写入侧不再拒收 16 种读者本来就读不出的写法,比如以普通单词开头的键行、表格行、行内第二个键。这些写法不会让任何 head 被误读成已审,线上 0 例,所以只是报错没那么及时,不是安全问题。它和 should-fix 2–3(措辞、CommonMark 信息串规则)一起转到跟进卡 #28111。 席位核对
|
Requested by Elon · project thread
domain:skills#2 · os-elon-musk · session_016WV4czoR81DDKSnGWnBYqA
Fixes #28057
Clause-②: no
Metadata-protocol: none
维护者速读
Head-sha:读取器再收紧两处,写入侧的拒收更准、报错点名新原因。(1) 围栏代码只在「同字符、不短于开栏、整行只有符号」的一行上关闭;三个反引号后面跟了文字的行是围栏内容,不关栏。(2)## Contract review题头缩进 4 个空格或 tab(渲染为代码块)不再打开读取范围,与Head-sha:行本身的 3 空格上限一致。(3)post-stamped.mjs发帖前的Head-sha拒收改为只看「以该键开头的行」(任意缩进、引用、列表、粗体、反引号都算),不再因为正文句中提到Head-sha:就拒收。(4) 拒收文案与RECORD_KEY_SPELLINGS['Head-sha']点名两个新原因:代码缩进的行、引用或代码缩进题头之下的行。(5)contract-review.md:33写明Head-sha:行在「题头之下」,行数不变、120 字节;--template的说明同步。4 个文件。check-half-states.mjs的FENCE_CLOSE_LINE与contractReviewHeadSha的两行改动;再看post-stamped.mjs的HEAD_SHA_KEY_LINE。.claude/**×1,本地--test读为 Tier S)。What changes
scripts/pm/check-half-states.mjs.FENCE_CLOSE_LINE(new, module-private) admits only whitespace after the run;contractReviewHeadShanow opens a fence onFENCE_LINE(info string allowed) and closes it only on aFENCE_CLOSE_LINEof the same character with a run at least the opening length. The heading scope opens only when the marker line also matches^[ ]{0,3}#(no blockquote marker, no four-space or tab indent);CONTRACT_REVIEW_HEADING_MARKERitself is unchanged, so the locator, H43, owed-reviews, the guard andrecordKeyedLineRefusalsstill see an indented or quoted heading as a record. Two pins in the H51 block: the trailing-text close (open stays open; a later bare run closes; trailing whitespace closes) and the indented heading (four spaces and a tab open nothing, three spaces does, the marker still finds it,latestContractReviewOnHeadanswers null).scripts/pm/post-stamped.mjs.HEAD_SHA_KEY_ANYWHEREbecomesHEAD_SHA_KEY_LINE: a line opening on the key after any indent, blockquote markers, a-/*/+bullet or a list number, bold or backticks, case-blind,mflag. Every refused shape the fix(pm): read a record's Head-sha line only below its heading, refuse an unreadable one at write time, and name the line in the rules #28042 battery pins still reads as a key line; a mid-sentence mention does not. The refusalwhyandRECORD_KEY_SPELLINGS['Head-sha']name the code-indented line and the line under a quoted or code-indented heading. Three pins: the prose mention is untouched, decorated key lines (numbered, doubly quoted,+-bulleted, under a code-indented heading) are refused, the printed text names both causes.scripts/pm/record-recognisers.mjs. The--templatenote forHead-shasays the line is plain and BELOW the heading, and lists the shapes that read as prose. One line added to the printed template help; no reader touched..claude/skills/pm-dispatch/references/contract-review.md(:33, line-neutral, 120 bytes): 「题头之下Head-sha:行独占码段」.Why
The delta contract review of PR #28042 (record 6520969324) left should-fixes 4 to 8, filed as #28057 and triaged p3 (6522257381: loudness, no wrong head admitted). Measured on
origin/main549203d04before the change:FENCE_LINEmatched a closing run with trailing text, so after```+``` not a closethe fence was read as closed and aHead-sha:line after it was read. CommonMark keeps the fence open. Same on base.## Contract review(an indented code block to the renderer) while the key line is held to three spaces. Same on base; 0 live instances.HEAD_SHA_KEY_ANYWHEREmatched the key anywhere, so a record-shaped comment that quotes a heading at line start and namesHead-sha:mid-sentence was refused with "aHead-shakey is present". Loudness only.contract-review.md:33named the line but not that it sits below the heading; the--templatenote said "on THIS line" only.No new refusal class and no new gate: the accept set of every reader is the same or narrower than base, and the write-time refusal fires on a strict subset of what it fired on before (a key LINE rather than the key anywhere).
Verification
check-half-states --self-test0 (5113 cases),record-recognisers --self-test0 (337),post-stamped --self-test0 (747 across 26 batteries),check-owed-reviews --self-test0 (65 in 9 batteries),check-governed-queue-guard --self-test0 (403).git checkoutandgit status --porcelainempty: (A)FENCE_CLOSE_LINEback to the bareFENCE_LINEshape: half-states 1 of 5113 red (the trailing-text pin), recognisers 0, post-stamped 0. (B) the scope-open test back to!/^\s*>/: half-states 1 red (the indented-heading pin), post-stamped 1 of 747 (the code-indented-heading limb). (C)HEAD_SHA_KEY_LINEback to/head-sha[ \t]:/i: post-stamped 1 red (the mid-sentence pin). (D) the two new causes removed from thewhy` and the spelling: post-stamped 1 red (the wording pin). No other pin moves in any leg.contractReviewHeadShaandrecordKeyedLineRefusalsin a worktree at this head and one atorigin/main6b125a7a: 0 records read differently, 0 records refused differently, 0 differences in the refusal over all 11482 comments; the 2 nulls are the two no-key legacy records, the 1 refusal on both sides is the pre-existingLocal-runsrow on record 6517315440.check-skill-line-ratchetexit 0 (contract-review.md 60 lines, ceiling 60; line 33 is 120 bytes underMAX_LINE_BYTES120),check-skill-id-lintexit 0 (105 files clean),check-skills-token-ratchetexit 0 (56 files within ceilings).dispatch-gates --commandsat the committed headf619d317derives 56 families; all 56 run in a second worktree (pnpm install --frozen-lockfile --ignore-scriptsfirst), exit codes recorded;--ranreconciles 56 derived / 56 run / 0 NOT-MEASURED / 0 UNRUN. One first-pass exit 3 (check:doc-formula-expressions, no formula/lint dist) exits 0 afterturbo run build --filter=@objectstack/formula --filter=@objectstack/lint. No family red. No changeset derived: no published package is touched,skip-changesetrides the create.check-governed-merges.mjs --teston the four paths answers Tier S (.claude/**×1; the threescripts/pm/**paths are off the register); the register's reading at PR time is the seat's.Human Minimum
Each item is one rule from
CONTRIBUTING.md › Human Minimum,
which links the AGENTS.md text that states it.
packages/specholds no runtime logic. (not touched)main, one pull request.skip-changeset)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4czoR81DDKSnGWnBYqA