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 2e75b19
Browse filesBrowse the repository at this point in the historyBrowse files
fix(pm): the Head-sha reader opens scope only on an unquoted heading, 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
const m = CONTRACT_REVIEW_HEAD_SHA_LINE.exec(line);
@@ -33504,7 +33516,17 @@ Doubles as the fire's **write self-check** (step 0). \`201\` is not the reading.
33504
33516
t('⛔ record reader: a delta record on head A whose PROSE names head B is NO review of B', latestContractReviewOnHead([cm51(1, DELTA51, T51)], HEAD51), null);
33505
33517
t('⭐ record reader: …and IS the review of A — the `Head-sha:` line alone decides', latestContractReviewOnHead([cm51(1, DELTA51, T51)], OLDHEAD51)?.sha, OLDHEAD51);
t('record reader: `contractReviewHeadSha` reads the line\'s span — the first line BELOW the heading wins; bold or backticks on the key, a trailing span and a blockquoted heading are tolerated', [contractReviewHeadSha(DELTA51), contractReviewHeadSha(UNDER51(`**Head-sha:** \`${HEAD51}\` (moved to \`${OLDHEAD51}\`)`, `Head-sha: \`${OLDHEAD51}\``)), contractReviewHeadSha(UNDER51(`\`Head-sha\`: \`${HEAD51}\``)), contractReviewHeadSha(`> ## Contract review\nHead-sha: \`${HEAD51}\``)].join(), [OLDHEAD51, HEAD51, HEAD51, HEAD51].join());
33519
+
t('record reader: `contractReviewHeadSha` reads the line\'s span — the first line BELOW the heading wins; bold or backticks on the key, a trailing span and up to three spaces of indent are tolerated', [contractReviewHeadSha(DELTA51), contractReviewHeadSha(UNDER51(`**Head-sha:** \`${HEAD51}\` (moved to \`${OLDHEAD51}\`)`, `Head-sha: \`${OLDHEAD51}\``)), contractReviewHeadSha(UNDER51(`\`Head-sha\`: \`${HEAD51}\``)), contractReviewHeadSha(UNDER51(` Head-sha: \`${HEAD51}\``))].join(), [OLDHEAD51, HEAD51, HEAD51, HEAD51].join());
33520
+
// ⛔ A BLOCKQUOTED heading opens no scope: a fully quoted signed record followed by a plain prose line opening
33521
+
// `Head-sha:` would otherwise lend the quoted signature to the plain line's head (the locator still sees a record here,
33522
+
// through the marker's `>` tolerance — it then names no head). Measured live: 0 of 709 records quote their heading.
33523
+
const QUOTED_RECORD51 = `> ## Contract review\n> Head-sha: \`${OLDHEAD51}\`\n> Reviewed-by: \`session_01SEAT\`\n> **VERDICT: PASS**\n\nHead-sha: \`${HEAD51}\` is the head the PR has since moved to.`;
33524
+
t('⛔ record reader: a QUOTED record followed by a plain line opening `Head-sha:` names no head — a blockquoted heading opens no scope, and nor does a quoted heading alone', [contractReviewHeadSha(QUOTED_RECORD51), contractReviewHeadSha(`> ## Contract review\nHead-sha: \`${HEAD51}\``), latestContractReviewOnHead([cm51(1, QUOTED_RECORD51, T51)], HEAD51)].join('|'), '||');
33525
+
// ⛔ An INDENTED CODE BLOCK (four spaces or a tab) is a quotation too: skipped above the record's own line, nothing alone.
33526
+
t('⛔ record reader: a `Head-sha:` line indented as CODE — four spaces or a tab — above the record\'s own is skipped, and alone names no head', [contractReviewHeadSha(UNDER51(` Head-sha: \`${HEAD51}\``, `Head-sha: \`${OLDHEAD51}\``)), contractReviewHeadSha(UNDER51(`\tHead-sha: \`${HEAD51}\``, `Head-sha: \`${OLDHEAD51}\``)), contractReviewHeadSha(UNDER51(` Head-sha: \`${HEAD51}\``)), contractReviewHeadSha(UNDER51(`\tHead-sha: \`${HEAD51}\``))].join('|'), [OLDHEAD51, OLDHEAD51, '', ''].join('|'));
33527
+
// ⛔ A fence closes only on its OWN character and a run at least as long: a nested ``` inside ````, a ~~~ inside ```,
33528
+
// are content, and a `Head-sha:` line between them stays fenced; a longer closing run closes; a never-closed one runs out.
33529
+
t('⛔ record reader: a nested or mismatched fence does not close the open one — the `Head-sha:` line inside stays fenced; a longer run closes; an unmatched run leaves it open to the end', [contractReviewHeadSha(UNDER51('````', '```', `Head-sha: \`${HEAD51}\``, '```', '````', `Head-sha: \`${OLDHEAD51}\``)), contractReviewHeadSha(UNDER51('```', '~~~', `Head-sha: \`${HEAD51}\``, '```', `Head-sha: \`${OLDHEAD51}\``)), contractReviewHeadSha(UNDER51('```', `Head-sha: \`${HEAD51}\``, '`````', `Head-sha: \`${OLDHEAD51}\``)), contractReviewHeadSha(UNDER51('```', '~~~', `Head-sha: \`${HEAD51}\``, '~~~', `Head-sha: \`${OLDHEAD51}\``))].join('|'), [OLDHEAD51, OLDHEAD51, OLDHEAD51, ''].join('|'));
33508
33530
t('⛔ record reader: the key folded INTO the span, a bare hex value, a lowercase key and a sub-floor span name no head', [contractReviewHeadSha(UNDER51(`\`Head-sha: ${HEAD51}\``)), contractReviewHeadSha(UNDER51(`Head-sha: ${HEAD51}`)), contractReviewHeadSha(UNDER51(`head-sha: \`${HEAD51}\``)), contractReviewHeadSha(UNDER51('Head-sha: `ba3d95`'))].join('|'), '|||');
33509
33531
// ⛔ The shapes the review of the line-form reader probed (2026-10-30): a `Head-sha:` line naming ANOTHER head above the
33510
33532
// record's own — placed before the heading, blockquoted, bulleted or fenced. Each is a citation, not the record's line,
'the two positions: a declaration renders as bare digits, and the patrol reads digits': 24,
4088
4088
'the shared rule: this tool and H56 cannot come to disagree': 6,
4089
4089
'the keyed lines: a claim\'s exact-value fields, judged by the readers that own them': 30,
4090
-
'the record line: a `## Contract review` record\'s `Head-sha:` and `Local-runs:` lines, judged when present — an absent line is not re-judged': 17,
4090
+
'the record line: a `## Contract review` record\'s `Head-sha:` and `Local-runs:` lines, judged when present — an absent line is not re-judged': 18,
4091
4091
'the vacant body: a VACANT seat post\'s ledger holds pointers, never obligations': 27,
4092
4092
'the decision facets: a decision analysis carries its marker, and a delta, a record or a quotation is not one': 22,
4093
4093
'the relay transport: the same act as one op, the comment found on the board, the exit register kept apart': 13,
@@ -5318,6 +5318,7 @@ export function selfTest() {
5318
5318
t('⛔ the key folded INTO the span, a bare hex value and a lowercase key are refused — each names no head to every reader',rkeys(SHA_WITH([`\`Head-sha: ${SHA_HEAD}\``]))==='Head-sha'&&rkeys(SHA_WITH([`Head-sha: ${SHA_HEAD}`]))==='Head-sha'&&rkeys(SHA_WITH([`head-sha: \`${SHA_HEAD}\``]))==='Head-sha');
5319
5319
t('⭐ a quoted line ABOVE the record\'s own passes — the reader skips the quotation and reads the line below it',rkeys(SHA_WITH([`> Head-sha: \`${'f'.repeat(40)}\``,`Head-sha: \`${SHA_HEAD}\``]))==='');
5320
5320
t('⛔ ABSENT is NOT re-judged for this key either: a record with no `Head-sha` key at all passes untouched — the retired-dialect records carry none',rkeys(SHA_WITH([]))==='');
5321
+
t('⛔ a fully QUOTED record, and a code-indented (four spaces or tab) line alone, are refused — a quoted heading opens no scope and an indented line is code',rkeys(SHA_WITH([`Head-sha: \`${SHA_HEAD}\``]).split('\n').map((l)=>`> ${l}`).join('\n'))==='Head-sha'&&rkeys(SHA_WITH([` Head-sha: \`${SHA_HEAD}\``]))==='Head-sha'&&rkeys(SHA_WITH([`\tHead-sha: \`${SHA_HEAD}\``]))==='Head-sha');
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');})());
5323
5324
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}\``)==='');
'the locator: the newest `## Contract review` on this head, on EITHER thread (#17302)': 19,
2073
-
'#18141 · #27979: the head sha sits in a span of ITS OWN on the `Head-sha:` line — the key-in-span spelling and a span in the prose name no head': 13,
2073
+
'#18141 · #27979: the head sha sits in a span of ITS OWN on the `Head-sha:` line — the key-in-span spelling and a span in the prose name no head': 14,
2074
2074
'the `Served-tier:` reading — the tier that SERVED the record (#17915 · #18060 · #18174)': 27,
2075
2075
'⭐ the 2026-09-20 ruling: a pure-regeneration head move KEEPS the record, decided on the COMMITTED trees': 22,
2076
2076
'#18042: the copyable record TEMPLATE — the one machine-read artefact with nothing to copy': 29,
@@ -2185,7 +2185,7 @@ export async function selfTest() {
2185
2185
`**Director seat adoption record** — the verdict on \`${HEAD_9AF9}\` below is adopted verbatim.\n\n---\n\n## Contract review\n\n- **Reviewed-by:** \`${RECORD_SESSION}\``,
2186
2186
].map((body,i)=>({id: 3310+i,created_at: '2026-09-01T08:52:00Z', body }));
2187
2187
t('⛔ the RETIRED dialects — the head in the heading (two spellings), on the first body line, in the adoption sentence — read ABSENT: a record names its head on the `Head-sha:` line or not at all',LEGACY.every((row)=>locateReviewOfRecord(pairOf({prComments: [row]})).state==='absent'));
2188
-
t('a blockquoted heading still reads — H51 tolerates the `>` a seat writes without meaning it',locateReviewOfRecord(pairOf({prComments: [{ ...RECORD_ON_9AF9,body: RECORD_ON_9AF9.body.replace(/^##/,'> ## ')}]})).state==='found');
2188
+
t('⛔ #28024: a blockquoted heading is still the record MARKER (H51 tolerates the `>`), but it opens no head scope — the record names no head and reads ABSENT',locateReviewOfRecord(pairOf({prComments: [{ ...RECORD_ON_9AF9,body: RECORD_ON_9AF9.body.replace(/^##/,'> ## ')}]})).state==='absent');
2189
2189
t('⛔ a `###` sub-heading is not the marker',locateReviewOfRecord(pairOf({prComments: [{ ...RECORD_ON_9AF9,body: RECORD_ON_9AF9.body.replace(/^##/,'### ')}]})).state==='absent');
2190
2190
t('⛔ the heading mentioned inside a paragraph is not the marker',locateReviewOfRecord(pairOf({prComments: [{ ...RECORD_ON_9AF9,body: RECORD_ON_9AF9.body.replace(/^##/,'see the ## ')}]})).state==='absent');
@@ -2241,6 +2241,10 @@ export async function selfTest() {
2241
2241
t('⛔ #28024: a blockquoted, bulleted or fenced `Head-sha:` line ABOVE the record\'s own is ABSENT for the head it names — on the PR thread and on the card alike',CITED_LEADS.every((lead)=>locateReviewOfRecord(pairOf({headSha: DELTA_B,prComments: [QUOTED_ABOVE(lead)]})).state==='absent'&&locateReviewOfRecord(pairOf({headSha: DELTA_B,cardComments: [QUOTED_ABOVE(lead)]})).state==='absent'));
2242
2242
t('⭐ #28024: …and each record is FOUND for the head its OWN line names, with that line\'s full sha',CITED_LEADS.every((lead)=>{constr=locateReviewOfRecord(pairOf({headSha: DELTA_A,prComments: [QUOTED_ABOVE(lead)]}));returnr.state==='found'&&r.sha===DELTA_A&&r.id===6516042955;}));
// ⛔ A fully QUOTED signed record followed by a plain prose line opening `Head-sha:`: the quoted heading opens no scope,
2245
+
// so the plain line is not read against the quoted signature — absent for B, and absent for A (the quoted line is quoted).
2246
+
constQUOTED_RECORD={id: 6516042956,created_at: '2026-10-30T05:53:38Z',body: QUOTED_ABOVE([]).body.split('\n').map((l)=>`> ${l}`).join('\n')+`\n\nHead-sha: \`${DELTA_B}\` is the head the PR has since moved to.`};
2247
+
t('⛔ #28024: a QUOTED record followed by a plain `Head-sha:` prose line is ABSENT for both heads — a blockquoted heading opens no scope',locateReviewOfRecord(pairOf({headSha: DELTA_B,prComments: [QUOTED_RECORD]})).state==='absent'&&locateReviewOfRecord(pairOf({headSha: DELTA_A,prComments: [QUOTED_RECORD]})).state==='absent');
2244
2248
t('⛔ #28024: a `Head-sha:` line BEFORE the `## Contract review` heading is not the record\'s — absent for the head it names, found for the one below the heading',locateReviewOfRecord(pairOf({headSha: DELTA_B,prComments: [PRE_HEADING]})).state==='absent'&&locateReviewOfRecord(pairOf({headSha: DELTA_A,prComments: [PRE_HEADING]})).state==='found');
2245
2249
t('⭐ a correct record beside a refused one is FOUND, in either arrival order',locateReviewOfRecord(pairOf({prComments: [KEYED_ROW,NEWER_RECORD]})).state==='found'&&locateReviewOfRecord(pairOf({prComments: [RECORD(HEAD_9AF9,undefined,'2026-09-01T08:45:00Z',3404),KEYED_ROW]})).state==='found');
2246
2250
t('…and the locator chooses the CORRECT one — a refused spelling is never chosen over it, and never chosen at all',locateReviewOfRecord(pairOf({prComments: [KEYED_ROW,NEWER_RECORD]})).id===3403&&locateReviewOfRecord(pairOf({prComments: [RECORD(HEAD_9AF9,undefined,'2026-09-01T08:45:00Z',3404),KEYED_ROW]})).id===3404);
0 commit comments