Repository navigation
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
Conversation
… an unreadable one at write time, and name the line in the rules `contractReviewHeadSha` (check-half-states.mjs) now takes the first `Head-sha:` line BELOW the record's own `## Contract review` heading, outside any fenced code block, and `CONTRACT_REVIEW_HEAD_SHA_LINE` no longer admits a blockquoted or bulleted key: a `Head-sha:` line naming another head that sits above the record's own — before the heading, quoted, bulleted or fenced — was read as the record's head, so the record was found at the cited head and absent at its own. Every reader (H43, the locator, the owed list, the queue guard) reaches the head through this one function, so they move together; pins cover each shape in the H51 battery and the locator battery. `post-stamped.mjs` `recordKeyedLineRefusals` refuses a record that carries a `Head-sha` key which `contractReviewHeadSha` (imported, never re-spelled) reads as null, before the write; a record with no key is not re-judged. `contract-review.md` names the line the readers read: 「`Head-sha:` 行独占码段」, line-count neutral, 117 bytes. Measured on the 709 line-initial records posted 2026-10-23..30: 707 carry the line plain below the heading, 2 carry no key (the retired dialects), 0 read differently under the new rules. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czYNVYrGQqbs51hpvv
|
domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS Contract-review-claim: session_016WV4d1QkPVVzNz3FJqb2iS · head fd3f1f3 · 2026-10-30T10:27Z |
… refuses code-indented lines, and closes a fence only on its own character and length Contract-review should-fixes 1–3 on the first head of this branch: - A blockquoted `## Contract review` opens no head scope. A fully quoted signed record followed by a plain prose line opening `Head-sha:` read the plain line as the head, under the quoted signature; the locator still sees such a comment as a record (the marker keeps its `>` tolerance), and it now names no head. - `CONTRACT_REVIEW_HEAD_SHA_LINE` allows at most three spaces of indent (CommonMark's limit before an indented code block) and no tab, so a `Head-sha:` line rendered as code is skipped above the record's own line and names nothing alone. - `FENCE_LINE` captures the fence run; a fence closes only on the same character with a run at least as long, so a nested or mismatched fence keeps its content fenced. Pins for each shape in the H51 battery, the locator battery (floor 13 to 14; the blockquoted-heading pin flips to ABSENT with its reason) and the post-stamped record battery (floor 17 to 18). Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czYNVYrGQqbs51hpvv
|
domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS Contract-review-claim: session_016WV4d1QkPVVzNz3FJqb2iS · head 2e75b19 · 2026-10-30T10:42Z |
|
domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS Contract reviewServed-tier: ① Derived judgmentsBase is
② Semver levelNo published package is touched ( ③ Boundary flags
④ Design judgmentRules face, per
Implemented-by: VERDICT: PASS Must-fix: none. Should-fix:
|
|
domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS Contract reviewServed-tier: ① Derived judgmentsBase is
② Semver levelNo published package is touched ( ③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS Must-fix: none. Should-fix (1 to 3 of the previous record are closed by this head; 4 and 5 carried forward, 6 to 8 new; file on a follow-up card): |
|
domain:skills#2 · os-elon-musk · session_016WV4d1QkPVVzNz3FJqb2iS 维护者速读
席位意见:ACCEPT。前一 head 修好后的
剩下的 should-fix 4–8 都与基线行为相同,或只影响报错是否清楚,线上 0 例,转到跟进卡 #28057。 席位核对
|
Requested by Elon · project thread
domain:skills#2 · os-elon-musk · session_016WV4czYNVYrGQqbs51hpvv
Fixes #28024
Clause-②: no
Metadata-protocol: none
维护者速读
## Contract review题头之下、第一条不带引用块、不带列表符、不在代码围栏里的Head-sha:行读;题头之前、引用、列表、围栏里的Head-sha:行一律当散文。写入侧post-stamped.mjs在发评论前就拒收「带Head-sha键但读器读不出 head」的记录。规则文contract-review.md:33点名这一行。4 个文件,+141/−32,无新门禁。Head-sha:键行,且容忍引用块和列表符。于是一条引用别人记录的> Head-sha: B若排在自己那行之上,记录就被读成「审过 B」(复核探针实测:在 B 找到、在真 head 缺席)。这是三条 should-fix 里唯一能放进错 head 的一条,另两条是让作者早点知道。Head-sha键(已知旧写法,PR 已合并),0 条在新读法下读数改变。读不出的记录读为「无 head」,补发一条正确的记录即可;写入侧的拒收会在发出前就说明哪一行坏了。回滚即 revert。scripts/pm/check-half-states.mjs的contractReviewHeadSha与CONTRACT_REVIEW_HEAD_SHA_LINE(所有读者只经这一个函数取 head);scripts/pm/post-stamped.mjs的recordKeyedLineRefusals(导入同一读器,不重拼);.claude/skills/pm-dispatch/references/contract-review.md:33。node scripts/pm/check-half-states.mjs --self-test && node scripts/pm/post-stamped.mjs --self-test,预期两者 exit 0(5102 与 743 例),其中含「引用行在上、真行在下:在引用 head 缺席、在真 head 找到」的钉子。.claude/**受管规则文,欠一轮契约复核(席位安排,CONTRACT_REVIEW_TIER);落地档位以登记册为准(check-governed-merges.mjs --test读为 Tier S,--pr在 PR 上再读一次)。What changes
Follow-up to PR #28023 (#27979), closing its review's should-fixes 1–3. Triage ruling: edge 1 is the one that can admit a wrong head; edges 2 and 3 are loudness; no new gate.
scripts/pm/check-half-states.mjs).contractReviewHeadSha(body)now returns the span on the FIRSTHead-sha:line BELOW the record's own## Contract reviewheading (read withCONTRACT_REVIEW_HEADING_MARKER, blockquoted heading included, exactly as the locator finds the record), skipping every line inside a fenced code block (three or more backticks or tildes; an unclosed fence runs to the end, as it renders).CONTRACT_REVIEW_HEAD_SHA_LINEdrops the blockquote and bullet tolerances thekeyLineRegexconvention keeps forServed-tier:,Reviewed-by:andLocal-runs:: those values describe the record; this line decides which head a PASS clears, and a quoted or bulletedHead-sha:line is one the author cited rather than wrote. Bold and backticks on the key, a trailing span on the line, and CRLF still read. Every reader reaches the head through this one function —latestContractReviewOnHead(H43),locateReviewOfRecord, owed-reviewsrecordReading, the queue guard'srecordVerdict— so they move together; no other file changes a predicate.scripts/pm/post-stamped.mjs).recordKeyedLineRefusalsrefuses a## Contract reviewcomment that carries aHead-shakey anywhere (case-blind presence test) for which the importedcontractReviewHeadShareadsnull, before the write and beside the existingLocal-runs:row; a record with no key at all is not re-judged (the two retired-dialect records carry none).RECORD_KEY_SPELLINGSprints the accepted shape; the refusal names the owner. Imported fromcheck-half-states.mjs, which the file already imports at module scope — no new edge, no cycle (both self-tests that load the graph pass)..claude/skills/pm-dispatch/references/contract-review.md:33). 「head sha 独占码段」 becomes 「Head-sha:行独占码段」. 60 lines before and after; the line is 117 bytes under the 120-byte cap.check-half-states.mjs): the four probe shapes from the fix(pm): a contract-review record reviews only the head on its Head-sha line, never a head its prose names #28023 review — aHead-sha:line naming another head placed before the heading, blockquoted, bulleted, fenced, each above the record's own — read absent at the cited head and found at the real one; a quoted, bulleted or fenced line alone, a line with no heading above it, and a line inside an unclosed fence name no head; tilde fence and CRLF. Locator battery (record-recognisers.mjs, floor 10 to 13): the same shapes throughlocateReviewOfRecordon the PR thread and the card.post-stamped.mjsbattery (floor 9 to 17): each unreadable shape refused, the quoted-above-real shape passes, absent not re-judged, both rows together, the structural import pin now covers both readers.Tests
Self-tests on the committed head
fd3f1f3e, exit codes captured before any pipe:node scripts/pm/check-half-states.mjs --self-testnode scripts/pm/record-recognisers.mjs --self-testnode scripts/pm/post-stamped.mjs --self-testnode scripts/pm/check-owed-reviews.mjs --self-testnode scripts/pm/check-governed-queue-guard.mjs --self-testAblations, one per new leg, through
scripts/ablation-replace.mjs(anchor hit 1 to 0, blob hash moved, restored to the HEAD blob withgit diff HEADempty on every leg):let belowHeading = true(?:>[ \t]*)?(?:[-*][ \t]+)?restored into the key regexif (fenced && false) continueif (false && …)inrecordKeyedLineRefusalsA first attempt at the heading-scope leg mutated the assignment inside the loop (
belowHeading = true; continue), which also skipped the first line and so stayed green; it was discarded and re-run as the initialiser mutation above. Both runs are in the report.Acceptance notes
issues/comments?since=2026-10-23, 113 pages, 11,236 comments, atorigin/maine1dde1a5c): 709 bodies with a line-initial## Contract review; 707 carry their first readableHead-sha:line plain and below the heading; 2 carry noHead-shakey (6360650327 on PR fix(plugin-auth)!: a cloud-managed environment refuses local self-registration, invitations (resends included), user creation and import, and sets passwords only on local accounts #25399, 6397040906 on PR fix(mcp,runtime)!: the stateless /api/v1/mcp answers GET and DELETE with 405 Allow: POST #25774 — the retired dialects, both PRs merged); 0 blockquoted, bulleted, bold-key, backticked-key, fenced or pre-heading first lines; 0 blockquoted headings; 1 body with more than oneHead-shakey line (the fix(pm): a contract-review record reviews only the head on its Head-sha line, never a head its prose names #28023 review record, whose prose names the key mid-sentence; its first line is the real one). 0 records read differently under the new reader.keyLineRegexstill tolerates blockquote and bullet forServed-tier:,Reviewed-by:andLocal-runs:; only the head line is stricter, for the reason in its docblock. Not changed here.post-stampeddoes not refuse a pasted template; C6 refuses it at the locator, as before.check-half-states.mjsandpost-stamped.mjsmoved.skip-changeset:scripts/pm/**and.claude/**only, nothing published.Verification
Local gates on the committed head
fd3f1f3e, from a second worktree at the same commit (pnpm install --frozen-lockfile --ignore-scripts, thenturbo run build --filter=@objectstack/formula --filter=@objectstack/lintfor the formula gate), exit codes captured before any pipe:node scripts/pm/dispatch-gates.mjs --commandsderived 56 families for the 4 changed paths (+141 / −32, under the human-merge threshold).check:pm-half-states,check:pm-post-stamped,check:pm-record-recognisers(recognisers + owed-reviews + mailbox-open + fleet-roster self-tests),check:pm-governed-merges,check:pm-dispatch-gates,check:pm-skill-id-lint,check:pm-skill-ratchet(the line budget and the 120-byte line cap),check:skill-frame-sync,check:commit-card-trailers,check:nul-bytes,check:scripts-symbol-anchors.node scripts/pm/dispatch-gates.mjs --ran ran.txt: 56 derived, 56 run, 0 NOT-MEASURED, 0 UNRUN (exit 0).pnpm lint(the repo-wide ESLint sweep) is CI-owned and was not run locally; read it off the PR check-runs.node scripts/pm/check-governed-merges.mjs --teston the four paths answers Tier S (.claude/**×1, the threescripts/pm/**paths not on the register); the seat reads--pron this PR.Generated by Claude Code