You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 30a0fba
Browse filesBrowse the repository at this point in the historyBrowse files
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
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
@@ -33618,6 +33626,7 @@ Doubles as the fire's **write self-check** (step 0). \`201\` is not the reading.
33618
33626
t('⛔ record reader: a `Head-sha:` line before the heading, blockquoted, bulleted or fenced — naming another head ABOVE the record\'s own — is NO review of that head', Object.values(CITED51).map((body) => latestContractReviewOnHead([cm51(1, body, T51)], HEAD51)).join('|'), '|||');
33619
33627
t('⭐ record reader: …and each IS the review of the head its own line names — the cited line is prose to the reader', Object.values(CITED51).map((body) => latestContractReviewOnHead([cm51(1, body, T51)], OLDHEAD51)?.sha).join(), [OLDHEAD51, OLDHEAD51, OLDHEAD51, OLDHEAD51].join());
33620
33628
t('⛔ record reader: a quoted, bulleted or fenced line ALONE names no head, nor does a line with NO heading above it, nor one inside an unclosed fence', [contractReviewHeadSha(UNDER51(`> Head-sha: \`${HEAD51}\``)), contractReviewHeadSha(UNDER51(`- **Head-sha:** \`${HEAD51}\``)), contractReviewHeadSha(UNDER51('```md', `Head-sha: \`${HEAD51}\``, '```')), contractReviewHeadSha(`Head-sha: \`${HEAD51}\``), contractReviewHeadSha(UNDER51('```', `Head-sha: \`${HEAD51}\``))].join('|'), '||||');
33629
+
t('⛔ #28111 · record reader: a backtick run whose info string carries a BACKTICK opens no fence (CommonMark) — the line below it reads; a backtick-free info string opens one, and so does a tilde run with a backtick in its info string', [contractReviewHeadSha(UNDER51('``` a`b', `Head-sha: \`${HEAD51}\``)), contractReviewHeadSha(UNDER51('```md `x`', `Head-sha: \`${HEAD51}\``, '```', `Head-sha: \`${OLDHEAD51}\``)), contractReviewHeadSha(UNDER51('```md', `Head-sha: \`${HEAD51}\``)), contractReviewHeadSha(UNDER51('~~~ a`b', `Head-sha: \`${HEAD51}\``)), contractReviewHeadSha(UNDER51('````', '``` a`b', `Head-sha: \`${HEAD51}\``, '````', `Head-sha: \`${OLDHEAD51}\``))].join('|'), [HEAD51, HEAD51, '', '', OLDHEAD51].join('|'));
33621
33630
t('record reader: a tilde fence is a fence too, and CRLF line endings read', [contractReviewHeadSha(UNDER51('~~~', `Head-sha: \`${HEAD51}\``, '~~~', `Head-sha: \`${OLDHEAD51}\``)), contractReviewHeadSha(`## Contract review\r\nHead-sha: \`${HEAD51}\`\r\n`)].join(), [OLDHEAD51, HEAD51].join());
33622
33631
t('⛔ record reader: the RETIRED dialects — head in the heading (two spellings), on the first body line, in an adoption sentence — name no head', [DIALECT_A, DIALECT_B, DIALECT_C, DIALECT_D].map((d) => latestContractReviewOnHead([cm51(1, d(HEAD51), T51)], HEAD51)).join('|'), '|||');
Copy file name to clipboardExpand all lines: scripts/pm/post-stamped.mjs
+35-12Lines changed: 35 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -2060,20 +2060,35 @@ export function keyedLineRefusalText(rows) {
2060
2060
2061
2061
/** What the record's owner accepts, printed BY the refusal so the fix is one line away. */
2062
2062
exportconstRECORD_KEY_SPELLINGS=Object.freeze({
2063
-
'Head-sha': '`Head-sha: ` then the reviewed head as 7 to 40 hex in a code span of its OWN, at the START of a line (up to three spaces of indent) BELOW an unquoted, unindented `## Contract review` heading — not blockquoted, not bulleted, not inside a fence, not indented as code (four spaces or a tab), not before the heading, not under a quoted or code-indented heading; the first such line is the head the record names, and a record written before the line existed may omit it',
2063
+
'Head-sha': '`Head-sha: ` then the reviewed head as 7 to 40 hex in a code span of its OWN, at the START of a line (up to three spaces of indent) BELOW an unquoted`## Contract review` heading itself indented at most three spaces — not blockquoted, not bulleted, not inside a fence, not indented as code (four spaces or a tab), not before the heading, not under a quoted or code-indented heading; the first such line is the head the record names, and a record written before the line existed may omit it',
2064
2064
'Local-runs': '`Local-runs: none` at the START of a line, or `Local-runs: probe — REASON` naming the ONE local run the read-only rule was broken for and why; a record written before the line existed may omit it',
2065
2065
});
2066
2066
2067
-
/** PRESENCE only, case-blind: a `Head-sha` key opening a LINE, however decorated or placed — any indent, blockquote
2068
-
* markers, a bullet or a list number, bold or backticks around the key — so a decorated, fenced, code-indented or
2069
-
* pre-heading key line still counts as written. Consulted solely to tell "the author wrote the key and the reader
2070
-
* cannot read it" (refused) from "no key at all" (not re-judged). ⛔ Not mid-sentence: a comment that quotes a record's
2071
-
* heading and then names the key in prose wrote no key line, and was refused for it until 2026-10-30 (loudness only). */
2067
+
/** PRESENCE only, case-blind, TWO limbs — either says "the author wrote the key":
2068
+
* 1. `HEAD_SHA_KEY_LINE` — a `Head-sha` key opening a LINE, however decorated or placed: any indent, blockquote
2069
+
* markers, a bullet or a list number, bold or backticks around the key — so a decorated, fenced, code-indented or
2070
+
* pre-heading key line still counts as written. The convention `keyLineRegex` imposes on every other key.
2071
+
* 2. `HEAD_SHA_KEY_SPAN` — the key DIRECTLY followed by a 7-to-40 hex code span, anywhere on a line, through the
2072
+
* decoration a key or a value may wear (bold, backticks, underscores, strikethrough, a table cell bar). Restores the
2073
+
* refusal of 16 reader-null shapes the line limb alone let through (the #28103 review, ①.4): a word before the
2074
+
* key (`Current Head-sha:`), a second key on the line, a table row, underscore emphasis, a task-list item, a
2075
+
* heading-styled key, a unicode bullet or an emoji, a bullet then a blockquote marker, strikethrough, parentheses,
2076
+
* a no-break-space indent, an HTML comment. Each reads null to every reader, so each is a record that would be
2077
+
* filed as a review of NO head; this limb says so before the write.
2078
+
* Consulted solely to tell "the author wrote the key and the reader cannot read it" (refused) from "no key at all"
2079
+
* (not re-judged). ⛔ Not a mid-sentence mention: a comment that quotes a record's heading and then names the key in
2080
+
* prose — `Head-sha:` with no span, or a span further along the sentence — wrote no key, and was refused for it until
2081
+
* 2026-10-30 (loudness only). The one prose shape the span limb DOES refuse is the key immediately followed by a hex
2082
+
* span inside a sentence, which the #28103 review measured as its only false positive and this card accepted:
2083
+
* measured on the 11764 issue comments updated since 2026-10-23 (750 carrying the record's heading, 2026-10-30),
2084
+
* 0 comments write that shape on a line that is not also a key line, so the limb refuses no live body. */
rows.push({key: 'Head-sha',line: headShaKeyLine(text),why: '`contractReviewHeadSha` reads NO head here — a `Head-sha` key opens a line, but no line below an unquoted, unindented `## Contract review` heading carries it plainly with a hex span of its own (a blockquoted, bulleted, fenced or pre-heading line, a code-indented line — four spaces or a tab — a line under a quoted or code-indented heading, the key folded into the span, a bare hex value, a lowercase key and a sub-floor span all read as nothing). Every reader would file this record as a review of NO head.'});
rows.push({key: 'Head-sha',line: headShaKeyLine(text),why: '`contractReviewHeadSha` reads NO head here — a `Head-sha` key opens a line or is followed by a hex span, but no line below an unquoted`## Contract review` heading indented at most three spaces carries it plainly with a hex span of its own (a blockquoted, bulleted, fenced or pre-heading line, a code-indented line — four spaces or a tab — a line under a quoted or code-indented heading, the key folded into the span, a bare hex value, a lowercase key and a sub-floor span all read as nothing). Every reader would file this record as a review of NO head.'});
2102
2117
construns=readLocalRuns(text);
2103
2118
if(!localRunsStand(runs))
2104
2119
rows.push({key: 'Local-runs',line: runs.line,why: '`readLocalRuns` reads the line and cannot grade its value — `none` and `probe — REASON` are the closed set, and a probe with no reason names no deviation.'});
@@ -5328,7 +5343,15 @@ export function selfTest() {
5328
5343
// or `+`-bulleted line, is a written line the reader refuses, and is refused here.
5329
5344
t('⭐ NOT a key line: a record-shaped comment that names `Head-sha:` mid-sentence, with no line opening on the key, is untouched — presence is a key LINE',rkeys('## Contract review\n\nThe seat\'s own record carries its Head-sha: line plainly, below the heading; see `Head-sha:` in the template.')===''&&rkeys(`> ## Contract review\n\nquoted above; the record\'s Head-sha: line is \`${SHA_HEAD}\` there`)==='');
5330
5345
t('⛔ …while a decorated key LINE still counts as written and is refused when the reader names no head: numbered, doubly quoted, `+`-bulleted, and one under a CODE-INDENTED heading',rkeys(SHA_WITH([`1. Head-sha: \`${SHA_HEAD}\``]))==='Head-sha'&&rkeys(SHA_WITH([`> > **Head-sha:** \`${SHA_HEAD}\``]))==='Head-sha'&&rkeys(SHA_WITH([`+ Head-sha: \`${SHA_HEAD}\``]))==='Head-sha'&&rkeys(` ## Contract review\nHead-sha: \`${SHA_HEAD}\``)==='Head-sha');
5331
-
t('the `Head-sha` refusal and the printed spelling NAME the two causes the reader added — a code-indented line and a line under a quoted or code-indented heading',(()=>{consttext=recordLineRefusalText(recordKeyedLineRefusals(SHA_WITH([`\tHead-sha: \`${SHA_HEAD}\``])));construle=RECORD_KEY_SPELLINGS['Head-sha'];returntext.includes('a code-indented line — four spaces or a tab')&&text.includes('a line under a quoted or code-indented heading')&&rule.includes('not indented as code (four spaces or a tab)')&&rule.includes('not under a quoted or code-indented heading')&&rule.includes('BELOW an unquoted, unindented');})());
5346
+
// ⛔ #28111: the SECOND presence limb — the key directly followed by a hex span, anywhere on a line — restores the
5347
+
// refusal of the 16 reader-null shapes the line limb let through (the #28103 review, ①.4); each reads null and is refused.
5348
+
t('⛔ #28111 · the key behind a WORD, a second key on the line, a table row and a task-list item are written keys the reader cannot read — refused',[`Current Head-sha: \`${SHA_HEAD}\``,`Reviewed Head-sha: \`${SHA_HEAD}\``,`head: Head-sha: \`${SHA_HEAD}\``,`Served-tier: \`${CONTRACT_REVIEW_TIER_NAME}\` · Head-sha: \`${SHA_HEAD}\``,`| Head-sha: | \`${SHA_HEAD}\` |`,`| Head-sha: \`${SHA_HEAD}\` |`,`- [ ] Head-sha: \`${SHA_HEAD}\``].every((line)=>rkeys(SHA_WITH([line]))==='Head-sha'&&contractReviewHeadSha(SHA_WITH([line]))===null));
5349
+
t('⛔ #28111 · underscore emphasis, a heading-styled key, a unicode bullet or an emoji, a bullet then a blockquote marker, strikethrough, parentheses, a no-break-space indent and an HTML comment — each refused',[`_Head-sha:_ \`${SHA_HEAD}\``,`__Head-sha__: \`${SHA_HEAD}\``,`### Head-sha: \`${SHA_HEAD}\``,`• Head-sha: \`${SHA_HEAD}\``,`✅ Head-sha: \`${SHA_HEAD}\``,`- > Head-sha: \`${SHA_HEAD}\``,`~~Head-sha:~~ \`${SHA_HEAD}\``,`(Head-sha: \`${SHA_HEAD}\`)`,`\u00a0Head-sha: \`${SHA_HEAD}\``,`<!-- Head-sha: \`${SHA_HEAD}\` -->`].every((line)=>rkeys(SHA_WITH([line]))==='Head-sha'&&contractReviewHeadSha(SHA_WITH([line]))===null));
5350
+
t('⭐ #28111 · the prose cases #28103 freed STAY free under the span limb: the key with no span, the key with its span further along the sentence, a sub-floor span, and the key with a span that is no sha',rkeys('## Contract review\n\nThe seat\'s own record carries its Head-sha: line plainly, below the heading; see `Head-sha:` in the template.')===''&&rkeys(`> ## Contract review\n\nquoted above; the record\'s Head-sha: line is \`${SHA_HEAD}\` there`)===''&&rkeys('## Contract review\n\nits Head-sha: `ba3d95` prefix is the one I cite')===''&&rkeys('## Contract review\n\nits Head-sha: `origin/main` is what I cite')==='');
5351
+
t('⛔ #28111 · the one prose shape the span limb refuses, by the card\'s accepted bound: the key IMMEDIATELY followed by a hex span inside a sentence, in a body whose reader names no head; a record carrying its own plain line above it passes',rkeys(`## Contract review\n\nI re-read the record above (its Head-sha: \`${SHA_HEAD}\` is the one I judged) and agree.`)==='Head-sha'&&rkeys(SHA_WITH([`Head-sha: \`${SHA_HEAD}\``],`(the earlier record\'s Head-sha: \`${'a'.repeat(40)}\` is superseded)`))==='');
5352
+
t('#28111 · the locator quotes the span-limb line the refusal is about, and the `why` names BOTH limbs',(()=>{constrows=recordKeyedLineRefusals(SHA_WITH([`Current Head-sha: \`${SHA_HEAD}\``]));returnrows.length===1&&rows[0].line.startsWith('Current Head-sha')&&rows[0].why.includes('opens a line or is followed by a hex span');})());
5353
+
t('#28111 · `RECORD_KEY_SPELLINGS[\'Head-sha\']` grants the heading the three spaces the reader admits — "indented at most three spaces", never "unindented"',RECORD_KEY_SPELLINGS['Head-sha'].includes('heading itself indented at most three spaces')&&!/unindented/.test(RECORD_KEY_SPELLINGS['Head-sha'])&&!/unindented/.test(recordKeyedLineRefusals(SHA_WITH([`> Head-sha: \`${SHA_HEAD}\``]))[0].why));
5354
+
t('the `Head-sha` refusal and the printed spelling NAME the two causes the reader added — a code-indented line and a line under a quoted or code-indented heading',(()=>{consttext=recordLineRefusalText(recordKeyedLineRefusals(SHA_WITH([`\tHead-sha: \`${SHA_HEAD}\``])));construle=RECORD_KEY_SPELLINGS['Head-sha'];returntext.includes('a code-indented line — four spaces or a tab')&&text.includes('a line under a quoted or code-indented heading')&&rule.includes('not indented as code (four spaces or a tab)')&&rule.includes('not under a quoted or code-indented heading')&&rule.includes('BELOW an unquoted');})());
t('the `Head-sha` refusal prints the spelling that reads, names the owner, and quotes the offending line',(()=>{constrows=recordKeyedLineRefusals(SHA_WITH([`> Head-sha: \`${SHA_HEAD}\``]));consttext=recordLineRefusalText(rows);returntext.includes(RECORD_KEY_SPELLINGS['Head-sha'])&&text.includes('contractReviewHeadSha')&&rows[0].line.includes('> Head-sha');})());
5334
5357
t('⛔ NOT a record: a claim or a report carrying a quoted `Head-sha:` line is untouched — the reader runs on the record\'s heading only',rkeys(`Claim: x\n> Head-sha: \`${SHA_HEAD}\``)===''&&rkeys(`os-dev-report\n\n> Head-sha: \`${SHA_HEAD}\``)==='');
0 commit comments