Skip to content

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
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-9suuvw
Oct 30, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-9suuvw

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

domain:skills#2 · os-elon-musk · session_016WV4cwv77cYicgaKyj39Y2

Fixes #28111

Clause-②: no
Metadata-protocol: none

维护者速读

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 is itself indented at most three spaces; the refusal why and the recordKeyedLineRefusals docblock say the same; unindented is gone from all three.
  • scripts/pm/check-half-states.mjs — item 3. FENCE_LINE is /^[ ]{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.
  • Pins. post-stamped: the 16 shapes in two pins (each refused AND reader null), the freed prose cases (no span, span later in the sentence, a sub-floor span, a non-hex span) stay free, the accepted prose bound (refused in a reader-null body, passes beside a plain key line), the locator quotes the span-limb line and the why names both limbs, the spelling and the why grant the heading three spaces and never say unindented; the existing wording pin is loosened to BELOW 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/main 27e0bd584 before the change (skills-lane-seat2/28111/probe-shapes.mjs in the project files, both trees):

  1. All 16 shapes the review listed (plus a second table-row spelling) pass recordKeyedLineRefusals untouched and read null in contractReviewHeadSha: a record that silently reads as no record.
  2. The spelling said unindented of the heading while the reader opens the scope on /^[ ]{0,3}#/.
  3. ``` a`b opened a fence, so the record's own Head-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_SPAN but 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

  • Self-tests on the committed head 30a0fbad, exit captured before any pipe: check-half-states --self-test 0 (5131 cases; main 5130), record-recognisers --self-test 0 (337), post-stamped --self-test 0 (753 across 26 batteries; main 747), check-owed-reviews --self-test 0 (65 in 9 batteries), check-governed-queue-guard --self-test 0 (403).
  • Ablation on the committed head (skills-lane-seat2/28111/ablation.log), each leg one sed, restored with git checkout, porcelain empty: (A) headShaKeyPresent back to the line limb alone: post-stamped 4 of 753 red, all four the new span-limb pins; (B) FENCE_LINE back to the base shape: half-states 1 of 5131 red (the new info-string pin), post-stamped 0; (C) the spelling back to unindented: post-stamped 1 of 753 red (the new wording pin). No other pin moves in any leg.
  • Corpus (skills-lane-seat2/28111/probe-corpus.mjs, probe-corpus.out): 11764 issue comments updated since 2026-10-23, 750 carrying the heading marker, driven through contractReviewHeadSha and recordKeyedLineRefusals in a worktree at origin/main 27e0bd584 and 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-existing Local-runs row 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.
  • Shapes (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.
  • ESLint (--no-inline-config) on the two files: exit 0.
  • Gates: dispatch-gates --commands at the committed head 30a0fbad derives 48 families (26 pnpm, 22 direct node); all 48 run in a second worktree at this head after pnpm install --frozen-lockfile --ignore-scripts, every exit 0 (skills-lane-seat2/28111/gates-ran.clean.txt); --ran reconciles 48 derived / 48 run / 0 NOT-MEASURED / 0 UNRUN. No changeset derived: no published package is touched, skip-changeset rides the create.
  • Landing tier: check-governed-merges.mjs --test on 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.

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; the derived lint families pass.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (no published package: skip-changeset)
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the 维护者速读 block is the one Chinese channel).
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cwv77cYicgaKyj39Y2

…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
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 30, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS

维护者速读

  • 改了什么:写入侧(post-stamped.mjs)判断「作者写了 Head-sha 键」时,新增第二条判据 HEAD_SHA_KEY_SPAN:键后面紧跟一个 7–40 位十六进制的代码段,出现在行内任何位置都算。RECORD_KEY_SPELLINGS['Head-sha'] 和拒绝说明改为「标题最多缩进三格」,不再说「不缩进」。读取侧(check-half-states.mjs)的 FENCE_LINE 按 CommonMark 处理:反引号围栏的信息串里如果还有反引号,就不算开了围栏。共 2 个文件,+45/−13。
  • 为什么改:PR 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 放过了句中提到键的写法,但审查记录 6523547564 量出有 16 种写法读取侧读不出 head、写入侧却不报错,比如 Current Head-sha:、表格行、下划线强调、HTML 注释。这样的记录会被当成「没审任何 head」静默入库。另外两处是该审查的 should-fix 2 和 3。
  • 风险与回滚:只影响报错是否响亮,不会让错误的 head 被接受。用 2026-10-23 以来的 11764 条评论(其中 750 条审查记录)做了前后对比:读取差异 0,拒绝差异 0。唯一接受的误报是「句中键后紧跟十六进制代码段,而且整条记录读不出 head」,已钉住。回滚就是 revert。
  • 先看:HEAD_SHA_KEY_SPAN 和它上面的 docblock,再看 FENCE_LINE 的那一处改动。
  • 两分钟验证:node scripts/pm/post-stamped.mjs --self-test,753 例(基线 747);node scripts/pm/check-half-states.mjs --self-test,5131 例(基线 5130)。都是 exit 0。
  • 需要你做的:无。登记册判定本 PR 不在受管面。四个契约面都没碰,所以不另起 agent 复核,由本席读 diff 并核 CI。本席转 ready 并开自动合并。

席位意见:ACCEPT。本席逐行读了 diff,并在这个 head 上本地跑了两个自检(5131 和 753 例,都是 exit 0):

席位核对

  • 形态: one PR, Fixes #28111, two files: scripts/pm/post-stamped.mjs and scripts/pm/check-half-states.mjs (+45 −13); record-recognisers.mjs untouched. skip-changeset. check-governed-merges.mjs --pr 28166: NOT governed (0 of 2 paths); ordinary queue landing. No contract face is touched, so per contract-review.md the review is the seat's own read plus CI.
  • 前提实测: item 1 took option (a) after a measurement. Over 11764 live comments (750 records, since 2026-10-23, base 27e0bd584): 0 lines match the span limb outside a key line, 0 read diffs, 0 refusal diffs, and 0 fence lines have a backtick in their info string.
  • 门禁 check-runs: head 30a0fbad3e141b4ea725035a4e9af7d27f24c078: 12 success, 18 skipped, 0 failed and 14 still running at this read; auto-merge waits on them. The dev report shows 48 of 48 derived gate families exit 0, reconciled with --ran. The seat re-ran the half-states and post-stamped self-tests on this head: both exit 0.
  • 接受的偏差: one, the accepted bound the card offered. When the key is followed immediately by a hex span inside a sentence, in a record whose reader names no head, the writer refuses it. It is pinned, and 0 live comments write it.
  • 范围外去向: none.
  • 落地条款: the PR is not on the register, so the ordinary queue applies. The seat flips it to ready and arms auto-merge on its own read and green CI, under the maintainer's landing grant for this term (seat thread, 2026-10-29 22:04Z).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 30, 2026 15:00
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 30, 2026 15:00
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 412908c Oct 30, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-9suuvw branch October 30, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s 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.

pm(post-stamped): the key-line Head-sha presence test no longer refuses 16 reader-null record shapes base refused; restore loudness or record the bound

1 participant