Repository navigation
fix(pm): the record writer refuses a Head-sha key followed by a hex span anywhere on a line; a backtick fence's info string holds no backtick - #28166
Merged
Conversation
…pan anywhere on a line; a backtick fence's info string holds no backtick Three should-fixes from the #28103 contract review (record 6523547564), filed as #28111. 1. `post-stamped.mjs`: a second presence limb, `HEAD_SHA_KEY_SPAN` — the key directly followed by a 7-to-40 hex code span anywhere on a line — restores the write-time refusal of the 16 reader-null shapes the key-line limb alone let through (a word before the key, a second key on the line, a table row, underscore emphasis, a task-list item, a heading-styled key, a unicode bullet or an emoji, a bullet then a blockquote marker, strikethrough, parentheses, a no-break-space indent, an HTML comment). The prose mentions #28103 freed stay free; the one prose shape the limb refuses (the key immediately followed by a hex span inside a sentence) is the bound the card accepted, and it matches 0 of 11764 live comments updated since 2026-10-23. Six pins. 2. `RECORD_KEY_SPELLINGS['Head-sha']`, the refusal's `why` and the function docblock grant the heading the three spaces of indent the reader admits, instead of saying "unindented". Pinned. 3. `check-half-states.mjs`: `FENCE_LINE` opens a backtick fence only when its info string carries no backtick (CommonMark §4.5); a tilde fence's info string may hold one. Pinned in the H51 block. Self-tests: half-states 5131, post-stamped 753, exit 0. Corpus: 0 records read differently, 0 refused differently, on 11764 comments / 750 records. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cwv77cYicgaKyj39Y2
Contributor
Author
|
domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS 维护者速读
席位意见:ACCEPT。本席逐行读了 diff,并在这个 head 上本地跑了两个自检(5131 和 753 例,都是 exit 0):
席位核对
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Elon · project thread
domain:skills#2 · os-elon-musk · session_016WV4cwv77cYicgaKyj39Y2
Fixes #28111
Clause-②: no
Metadata-protocol: none
维护者速读
post-stamped.mjs发帖前的Head-sha拒收加第二条「有键」判据:行内任何位置「键名紧跟 7–40 位十六进制码段」也算作者写了键。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 把判据收窄到「以键开头的行」后,16 种读取器读不出 head 的写法(键前有单词、一行两个键、表格行、下划线强调、任务列表项、题头样式、unicode 项目符号或 emoji、项目符号后接引用、删除线、括号、NBSP 缩进、HTML 注释)悄悄通过了;现在又都拒收。(2)RECORD_KEY_SPELLINGS['Head-sha']、拒收文案和函数注释改说题头「缩进最多三个空格」,不再说「不缩进」,与读取器一致。(3)check-half-states.mjs的FENCE_LINE:反引号围栏的信息串含反引号时不开栏(CommonMark §4.5),波浪线围栏不受此限。共 2 个文件,+45/−13。27e0bd584vs 本 head):750 条记录读法逐条相同(0 变),11764 条评论拒收逐条相同(0 变);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 放开的散文提及(只提键名、或码段在句子后面)仍不拒;新判据唯一会拒的散文形态是「键名紧跟码段」出现在读不出 head 的记录体里,这是卡片接受的边界,线上 0 例,已钉住。围栏规则只会让读取器读到更多本来就该读到的行(0 条线上记录含该形态)。回滚即 revert。post-stamped.mjs的HEAD_SHA_KEY_SPAN与headShaKeyPresent(两行),再看check-half-states.mjs的FENCE_LINE(一行)。--test读为两条路径均不在登记册上,普通队列落地)。What changes
scripts/pm/post-stamped.mjs— item 1, choice (a). A second presence limb,HEAD_SHA_KEY_SPAN(/head-sha[_~][ \t]:[ \t_~|]*[0-9a-f]{7,40}/i): the key directly followed by a 7-to-40 hex code span, anywhere on a line, through the decoration a key or a value may wear.headShaKeyPresentis the OR of the two limbs and replaces the bareHEAD_SHA_KEY_LINE.testinrecordKeyedLineRefusalsand in theheadShaKeyLinelocator. The refusal'swhy` names both limbs. The docblock records the 16 shapes the limb restores, the prose shapes that stay free, the one prose shape it refuses (the key immediately followed by a hex span inside a sentence) and the corpus measurement behind accepting it.scripts/pm/post-stamped.mjs— item 2.RECORD_KEY_SPELLINGS['Head-sha']says the heading isitself indented at most three spaces; the refusalwhyand therecordKeyedLineRefusalsdocblock say the same;unindentedis gone from all three.scripts/pm/check-half-states.mjs— item 3.FENCE_LINEis/^[ ]{0,3}({3,}(?!.*)|~{3,})/: a backtick run opens a fence only when the rest of the line carries no backtick; a tilde run's info string may hold one.FENCE_CLOSE_LINE, the walker and every other reader are untouched; the docblock cites CommonMark §4.5 and the 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 review's F16.whynames both limbs, the spelling and thewhygrant the heading three spaces and never sayunindented; the existing wording pin is loosened toBELOW an unquoted. check-half-states (H51 block): a backtick run with a backtick in its info string opens nothing (the line below reads; after a later bare run the FIRST plain line still wins), a backtick-free info string opens, a tilde run with a backtick in its info string opens, and such a line inside an open four-backtick fence stays fenced.Why
The contract review of PR #28103 (record 6523547564) left should-fixes 1 to 3, filed as #28111 and triaged p3 (6524831843: loudness only, no wrong head admitted). Measured on
origin/main27e0bd584before the change (skills-lane-seat2/28111/probe-shapes.mjsin the project files, both trees):recordKeyedLineRefusalsuntouched and readnullincontractReviewHeadSha: a record that silently reads as no record.unindentedof the heading while the reader opens the scope on/^[ ]{0,3}#/.``` a`bopened a fence, so the record's ownHead-sha:line below it was skipped (fail-closed; CommonMark renders the line as a paragraph).Item 1, (a) versus (b), measured before choosing. The card prefers restoring loudness where it costs no live false positive. The span limb's false-positive population is a line that matches
HEAD_SHA_KEY_SPANbut is not a key line. On the 11764 issue comments updated since 2026-10-23 (REST, 118 pages, fetched 2026-10-30T14:40Z; 750 carry the heading marker): 0 such lines in any comment, 0 in any record, so 0 records newly refused; 0 records carry the key anywhere without a key line. Choice (a) therefore costs no live refusal, and the one synthetic prose false positive the review named (P3, the key immediately followed by a hex span inside a sentence) is pinned as the accepted bound so the next reader of the function knows it was chosen. Choice (b) was not taken.No new gate, no new refusal class: the writer's refusal fires on a superset of what it fired on after #28103 and a subset of what it fired on before (every shape it now refuses, base-before-#28103 refused too), and the reader's accept set only grows by lines CommonMark already rendered as paragraphs.
Verification
30a0fbad, exit captured before any pipe:check-half-states --self-test0 (5131 cases; main 5130),record-recognisers --self-test0 (337),post-stamped --self-test0 (753 across 26 batteries; main 747),check-owed-reviews --self-test0 (65 in 9 batteries),check-governed-queue-guard --self-test0 (403).skills-lane-seat2/28111/ablation.log), each leg onesed, restored withgit checkout, porcelain empty: (A)headShaKeyPresentback to the line limb alone: post-stamped 4 of 753 red, all four the new span-limb pins; (B)FENCE_LINEback to the base shape: half-states 1 of 5131 red (the new info-string pin), post-stamped 0; (C) the spelling back tounindented: post-stamped 1 of 753 red (the new wording pin). No other pin moves in any leg.skills-lane-seat2/28111/probe-corpus.mjs,probe-corpus.out): 11764 issue comments updated since 2026-10-23, 750 carrying the heading marker, driven throughcontractReviewHeadShaandrecordKeyedLineRefusalsin a worktree atorigin/main27e0bd584and one at this head: 0 records read differently (the 2 nulls are the two no-key legacy records on both trees), 0 comments refused differently (the 1 refusal on each side is the pre-existingLocal-runsrow on record 6517315440); 0 lines match the span limb without being a key line; 0 comments carry a backtick fence opener with a backtick in its info string.probe-shapes.out): on this head each of the 17 shapes is refused and reads null; P1 (no span) and P2 (span later in the sentence) stay free; P3 (key then span in a sentence) is refused as the accepted bound; P4 (a plain line above a prose mention) reads and passes.--no-inline-config) on the two files: exit 0.dispatch-gates --commandsat the committed head30a0fbadderives 48 families (26 pnpm, 22 direct node); all 48 run in a second worktree at this head afterpnpm install --frozen-lockfile --ignore-scripts, every exit 0 (skills-lane-seat2/28111/gates-ran.clean.txt);--ranreconciles 48 derived / 48 run / 0 NOT-MEASURED / 0 UNRUN. No changeset derived: no published package is touched,skip-changesetrides the create.check-governed-merges.mjs --teston the two paths answers 0 of 2 on the register (not governed, ordinary queue landing); the register's reading at PR time is the seat's. No contract review is owed: none of the four contract faces is touched.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_016WV4cwv77cYicgaKyj39Y2