From 710f50867dd70beb2daa5d08b384c3a898d5511f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 07:31:58 +0000 Subject: [PATCH 1/3] fix(pm): queue guard refuses a same-head PASS record that names an open must-fix or should-fix A Tier S entry now clears only on a clean PASS: one VERDICT line reading PASS, no FAIL spelled anywhere else on the comment (heading, lower-case or bulleted key, bare line), VERDICT lines above the heading counted, and no must-fix or should-fix the record names. One reader, contractReviewRecordReading beside contractReviewVerdictLines; a grade it cannot attribute fails closed. Co-Authored-By: Claude --- scripts/pm/check-governed-queue-guard.mjs | 82 +++++++++++++++++++---- scripts/pm/check-half-states.mjs | 81 +++++++++++++++++++++- scripts/pm/record-recognisers.mjs | 27 ++++++-- 3 files changed, 171 insertions(+), 19 deletions(-) diff --git a/scripts/pm/check-governed-queue-guard.mjs b/scripts/pm/check-governed-queue-guard.mjs index cdc54b255f5..dcb5a1891fa 100644 --- a/scripts/pm/check-governed-queue-guard.mjs +++ b/scripts/pm/check-governed-queue-guard.mjs @@ -363,6 +363,11 @@ * clears only when it carries exactly ONE `VERDICT:` line and that line reads * PASS (`recordPassVerdict`, the fleet reader's counting form * `contractReviewVerdictLines`); FAIL, none or two refuse, naming the comment. + * Since card #33604 that PASS must also be clean, read by the same record + * reader (`contractReviewRecordReading`): a FAIL spelled anywhere else on the + * comment, a must-fix or should-fix it names (owed a delta review, so the + * later same-head record that closes them clears), or a grade it cannot + * attribute refuses — the guard decides, not the seat's pre-landing check. * And only a comment posted by the relay's identity or an account in * `GOVERNED_APPROVERS` is read at all (`recordAuthorTrusted`): any other * author's comment is dropped before the locator sees the thread — ignored, @@ -981,13 +986,14 @@ export async function loadRecordRecognisers(load = (specifier) => import(specifi reviewFace: tier?.reviewFace, threads: tier?.REVIEW_OF_RECORD_THREADS, location: tier?.REVIEW_OF_RECORD_LOCATION, - // Every `VERDICT:` line of a record (#33541): a Tier S entry lands on exactly one, reading PASS. - verdictLines: tier?.contractReviewVerdictLines, + // The record's whole reading (#33541, #33604): its `VERDICT:` lines, its FAIL spellings and its + // must-fix / should-fix grades — a Tier S entry lands on one PASS line, no FAIL, no open grade. + reading: tier?.contractReviewRecordReading, // Who may post a record (#33541): the relay's identity and the authorized approvers, nobody else. trustedAuthors: typeof bot === 'string' && bot !== '' ? Object.freeze([bot, ...GOVERNED_APPROVERS]) : null, }; const missing = [ - ...['locate', 'deliveredCard', 'servedTierStands', 'isModelIdentifierToken', 'reviewFace', 'verdictLines'].filter((key) => typeof found[key] !== 'function'), + ...['locate', 'deliveredCard', 'servedTierStands', 'isModelIdentifierToken', 'reviewFace', 'reading'].filter((key) => typeof found[key] !== 'function'), ...(found.trustedAuthors === null ? [`trustedAuthors (FLEET_BOT_LOGIN from ${RECOGNISER_SOURCES.author})`] : []), ...(Array.isArray(found.threads) && found.threads.length > 0 ? [] : ['threads']), ...(typeof found.location === 'string' && found.location.length > 0 ? [] : ['location']), @@ -2068,8 +2074,8 @@ export function landsOnLowRiskArm(entry) { * The record leg's VERDICT, on every Tier S entry (card #33541; AGENTS.md * Prime Directive 14 lands Tier S on "a PASS verdict"): a record that STANDS * must also READ PASS. Read off the SAME comment the locator chose, with the - * fleet's verdict reader in its counting form (`contractReviewVerdictLines`, - * `check-half-states.mjs`, re-exported by the recognisers — one regex with + * fleet's one record reader (`contractReviewRecordReading`, + * `check-half-states.mjs`, re-exported by the recognisers — the regexes of * `contractReviewVerdictOf`, ⛔ never a second parser): the record carries * exactly ONE `VERDICT:` line and it reads PASS. FAIL, no `VERDICT:` line (a * heading-inline or bare word alone included), two such lines (a quoted @@ -2077,21 +2083,44 @@ export function landsOnLowRiskArm(entry) { * rows, or no reader loaded — each is `not-pass`, a refusal naming the * comment id. Several same-head records: the locator's newest one is the one * read, so a later FAIL withdraws an earlier PASS and a later PASS supersedes - * an earlier FAIL. Pure. + * an earlier FAIL. + * + * ⚖️ And a PASS that is not clean does not clear either (card #33604; the + * guard decides, not the seat's pre-landing check): a record that ALSO reads + * FAIL anywhere else — its heading, a lower-case or bulleted `verdict:` key, a + * bare FAIL line (N2 of record 6890532571) — contradicts itself; a record that + * names an open must-fix or should-fix owes a delta review of its fix + * (`contract-review.md`), so the LATER same-head record that closes them is + * the one that clears; and a grade the reader cannot attribute is unreadable, + * which fails closed. Pure. */ export function recordPassVerdict(record, pair, recognisers) { if (record?.state !== 'stands') return record; const refuse = (verdict, why) => ({ ...record, state: 'not-pass', verdict, verdictReason: why }); - if (typeof recognisers?.verdictLines !== 'function') return refuse(null, 'the contract-review verdict reader was not loaded'); + if (typeof recognisers?.reading !== 'function') return refuse(null, 'the contract-review verdict reader was not loaded'); const rows = (recognisers.threads ?? []).flatMap((thread) => (Array.isArray(pair?.[thread.rows]) ? pair[thread.rows] : [])); const comment = record.id === null || record.id === undefined ? null : rows.find((r) => r?.id === record.id) ?? null; if (comment === null) return refuse(null, 'the record comment was not among the rows read, so its verdict is unknown'); // The author the binding admitted, carried for the words (the rows reached here are trusted ones only). const author = typeof comment.user?.login === 'string' ? comment.user.login : null; - const words = recognisers.verdictLines(comment.body); - if (words.length === 0) return { ...refuse(null, 'it states no verdict (no `VERDICT:` line under its heading)'), author }; + const reading = recognisers.reading(comment.body); + const words = reading?.verdicts ?? []; + if (words.length === 0) return { ...refuse(null, 'it states no verdict (no `VERDICT:` line anywhere in it)'), author }; if (words.length > 1) return { ...refuse(null, `it states ${words.length} \`VERDICT:\` lines (${words.join(', ')}), and a record states exactly one`), author }; - return words[0] === 'PASS' ? { ...record, verdict: 'PASS', author } : { ...refuse(words[0], `it reads ${words[0]}`), author }; + if (words[0] !== 'PASS') return { ...refuse(words[0], `it reads ${words[0]}`), author }; + // A quoted record line is comment text: flattened (no backtick, pipe or angle bracket survives) and cut. + const quote = (line) => `\`${String(line).replace(/[`|<>\r\n]+/g, ' ').slice(0, 80)}\``; + const fails = Array.isArray(reading?.failSpellings) ? reading.failSpellings : null; + const open = Array.isArray(reading?.findings?.open) ? reading.findings.open : null; + const unreadable = Array.isArray(reading?.findings?.unreadable) ? reading.findings.unreadable : null; + if (fails === null || open === null || unreadable === null) return { ...refuse(null, 'its FAIL spellings and finding grades could not be read, so it clears nothing'), author }; + if (fails.length > 0) return { ...refuse(null, `its one \`VERDICT:\` line reads PASS, yet it also reads FAIL (${fails.slice(0, 2).map(quote).join(', ')}), and a record that contradicts itself clears nothing (#33604)`), author }; + if (open.length > 0) { + const named = open.slice(0, 4).map((f) => (f.id ? `${f.id} (${f.grade})` : f.grade)).join(', '); + return { ...refuse(null, `it reads PASS but names ${open.length} open must-fix/should-fix finding(s) (${named}${open.length > 4 ? ', …' : ''}): each earns a delta review of its fix, and the later same-head record that closes them is the one that clears (#33604)`), author }; + } + if (unreadable.length > 0) return { ...refuse(null, `it reads PASS but a must-fix/should-fix grade on it cannot be attributed (${unreadable.slice(0, 2).map(quote).join(', ')}): name each finding \`S1 (should-fix)\`, or state \`no should-fix\` (#33604)`), author }; + return { ...record, verdict: 'PASS', author }; } /** @@ -5520,6 +5549,35 @@ export async function selfTest() { assert('⛔ #33541-a-FAIL-AFTER-a-PASS-on-the-same-head-is-REFUSED-the-latest-record-decides', failAfterPass.exitCode === EXIT_REFUSED_UNAPPROVED && failAfterPass.entries[0].record.id === 922 && failAfterPass.entries[0].record.state === 'not-pass', JSON.stringify(failAfterPass.entries[0].record)); const passAfterFail = await tierRun({ comments: [recordComment({ id: 923, at: '2026-09-13T12:00:00Z', verdictWord: '**VERDICT: FAIL**' })], cardComments: [recordComment({ id: 924, at: '2026-09-13T14:00:00Z' })] }); assert('#33541-a-PASS-AFTER-a-FAIL-on-the-same-head-CLEARS-across-the-two-threads-the-latest-record-decides', passAfterFail.exitCode === EXIT_CLEAR && passAfterFail.entries[0].record.id === 924 && passAfterFail.entries[0].record.verdict === 'PASS', JSON.stringify(passAfterFail.entries[0].record)); + { + // ⭐ #33604: a PASS that is not clean clears nothing — the guard decides, not the seat's pre-landing check. + // Grades in the shapes measured on the records of PRs #33686, #33687, #33688 and #33711 (2026-11-15). + const graded = (prose, extra = {}) => tierRun({ comments: [recordComment({ prose, ...extra })] }); + const openShould = await graded(['', '### ④ Design judgment', '', 'No must-fix. Two should-fix, both owing a delta review.', '', '**S1 (should-fix) — a landing the maintainer cleared is reported as a BREACH.**', '- **S2 (should-fix) — two knocks have no row.**', '- **N1 (nit) — wording.**']); + assert('⛔ #33604-a-same-head-PASS-record-naming-an-OPEN-should-fix-is-REFUSED-naming-the-findings', openShould.exitCode === EXIT_REFUSED_UNAPPROVED && openShould.entries[0].record.state === 'not-pass' && openShould.entries[0].record.verdict === null && /comment 900, .*reads PASS but names 2 open must-fix\/should-fix finding\(s\) \(S1 \(should-fix\), S2 \(should-fix\)\)/.test(renderGuardVerdict(openShould)), renderGuardVerdict(openShould)); + const openMust = await graded(['- must-fix: the arm reads no label.']); + assert('⛔ #33604-…and-a-PASS-naming-a-must-fix-unnumbered-under-a-bullet-is-refused-too', openMust.exitCode === EXIT_REFUSED_UNAPPROVED && /names 1 open must-fix\/should-fix finding\(s\) \(must-fix\)/.test(renderGuardVerdict(openMust)), renderGuardVerdict(openMust)); + const deltaCloses = await tierRun({ comments: [recordComment({ id: 941, at: '2026-09-13T12:00:00Z', prose: ['**S1 (should-fix) — the knock has no key.**'] }), recordComment({ id: 942, at: '2026-09-13T14:00:00Z', prose: ['Delta review.', '- **S1: closed.** Every knock names a key.', 'No must-fix. S1 of record 941 is closed on this head.'] })] }); + assert('#33604-the-LATER-same-head-delta-record-that-CLOSES-them-CLEARS', deltaCloses.exitCode === EXIT_CLEAR && deltaCloses.entries[0].record.id === 942 && deltaCloses.entries[0].record.verdict === 'PASS', JSON.stringify(deltaCloses.entries[0].record)); + const deltaRaises = await tierRun({ comments: [recordComment({ id: 943, at: '2026-09-13T12:00:00Z' }), recordComment({ id: 944, at: '2026-09-13T14:00:00Z', prose: ['- **S1: closed.**', '- **S3 (should-fix, the seat\'s, no head change) — the PR body describes round 1.**'] })] }); + assert('⛔ #33604-a-delta-record-that-raises-a-NEW-should-fix-is-refused-though-an-older-clean-PASS-stands', deltaRaises.exitCode === EXIT_REFUSED_UNAPPROVED && deltaRaises.entries[0].record.id === 944 && /S3 \(should-fix\)/.test(renderGuardVerdict(deltaRaises)), renderGuardVerdict(deltaRaises)); + const clean = await graded(['Findings: no must-fix, no should-fix.', '- N1 (nit, prose face): the body overstates.', '- nit: the compare is sent first.', 'Nits only; the head is not moved.']); + assert('#33604-CONTROL-a-PASS-whose-grades-read-no-must-fix-no-should-fix-and-nits-CLEARS', clean.exitCode === EXIT_CLEAR && clean.entries[0].record.verdict === 'PASS', renderGuardVerdict(clean)); + const unattributed = await graded(['Two should-fix remain, see the thread.']); + assert('⛔ #33604-a-grade-the-reader-cannot-attribute-FAILS-CLOSED', unattributed.exitCode === EXIT_REFUSED_UNAPPROVED && /cannot be attributed \(`Two should-fix remain, see the thread\.`\)/.test(renderGuardVerdict(unattributed)), renderGuardVerdict(unattributed)); + const unread = await tierRun({ comments: [recordComment()], recognisers: { ...live, reading: () => ({ verdicts: ['PASS'] }) } }); + assert('⛔ #33604-a-reading-with-no-grades-in-it-FAILS-CLOSED', unread.exitCode === EXIT_REFUSED_UNAPPROVED && /could not be read, so it clears nothing/.test(renderGuardVerdict(unread)), renderGuardVerdict(unread)); + // ⛔ N2 of record 6890532571: a self-contradicting record never clears beside its one PASS line. + const headingFail = await tierRun({ comments: [{ ...recordComment(), body: recordComment().body.replace('## Contract review', '## Contract review (delta) — **FAIL**') }] }); + assert('⛔ #33604-N2-a-heading-reading-FAIL-above-the-template-PASS-line-is-REFUSED', headingFail.exitCode === EXIT_REFUSED_UNAPPROVED && /yet it also reads FAIL \(`## Contract review \(delta\) — \*\*FAIL\*\*`\)/.test(renderGuardVerdict(headingFail)), renderGuardVerdict(headingFail)); + const n2Spellings = await Promise.all(['verdict: fail', '- **VERDICT: FAIL**', '**Verdict:** FAIL', '> * Verdict: Fail', 'FAIL', '**FAIL** — the arm reads no label'].map((line) => graded([line]))); + assert('⛔ #33604-N2-a-FAIL-spelled-outside-the-explicit-regex-lower-case-key-list-bullet-emphasis-bare-is-REFUSED', n2Spellings.every((r) => r.exitCode === EXIT_REFUSED_UNAPPROVED && /yet it also reads FAIL/.test(renderGuardVerdict(r))), n2Spellings.map((r) => r.entries[0].record.verdictReason).join(' | ')); + const n2Prose = await graded(['- Newest FAIL over an older PASS: refused.', 'FAIL, none or two refuse, naming the comment.', 'The fail-closed verdict: holds.']); + assert('#33604-N2-CONTROL-prose-that-merely-MENTIONS-FAIL-is-not-a-verdict-line-the-record-CLEARS', n2Prose.exitCode === EXIT_CLEAR, renderGuardVerdict(n2Prose)); + // ⛔ N3 of record 6890532571: `VERDICT:` lines above the heading count. + const above = await tierRun({ comments: [{ ...recordComment(), body: `**VERDICT: FAIL**\n\n${recordComment().body}` }] }); + assert('⛔ #33604-N3-a-VERDICT-line-ABOVE-the-heading-counts-two-lines-REFUSED', above.exitCode === EXIT_REFUSED_UNAPPROVED && /states 2 `VERDICT:` lines \(FAIL, PASS\)/.test(renderGuardVerdict(above)), renderGuardVerdict(above)); + } // ⭐ #33541, the author: the relay and GOVERNED_APPROVERS post records; any other author is IGNORED, never refused loudly. const PM_DIRECT = 'os-project-manager'; assert('#33541-the-account-a-seat-would-post-from-directly-is-outside-the-trusted-set-the-relay-carries-its-records', !live.trustedAuthors.includes(PM_DIRECT)); @@ -5944,9 +6002,9 @@ export async function selfTest() { assert('the-template-VERDICT-PASS-line-clears-the-arm', explicitPass.exitCode === EXIT_CLEAR && explicitPass.entries[0].record.verdict === 'PASS'); const newestFail = await tierRun({ ...arm, comments: [recordComment({ id: 901, at: '2026-09-13T12:00:00Z' }), recordComment({ id: 902, at: '2026-09-13T14:00:00Z', verdictWord: '**VERDICT: FAIL**' })] }); assert('⛔ the-NEWEST-same-head-record-is-the-one-whose-verdict-is-read-an-older-PASS-does-not-clear-a-newer-FAIL', newestFail.exitCode === EXIT_REFUSED_UNAPPROVED && newestFail.entries[0].record.id === 902 && newestFail.entries[0].record.state === 'not-pass'); - const noReader = await tierRun({ ...arm, recognisers: { ...live, verdictLines: undefined } }); + const noReader = await tierRun({ ...arm, recognisers: { ...live, reading: undefined } }); assert('⛔ a-recogniser-set-without-the-verdict-reader-REFUSES-the-arm-fail-closed', noReader.exitCode === EXIT_REFUSED_UNAPPROVED && noReader.entries[0].record.state === 'not-pass' && /verdict reader was not loaded/.test(renderGuardVerdict(noReader))); - assert('the-live-loader-reaches-the-fleet-verdict-reader-in-its-counting-form', typeof live.verdictLines === 'function' && live.verdictLines('## Contract review\n\n**VERDICT: FAIL**').join() === 'FAIL'); + assert('the-live-loader-reaches-the-fleet-record-reader-and-its-counting-form', typeof live.reading === 'function' && live.reading('## Contract review\n\n**VERDICT: FAIL**').verdicts.join() === 'FAIL' && live.verdict === undefined && live.verdictLines === undefined); assert('lowRiskRecordVerdict-passes-a-non-standing-record-through-and-reads-the-chosen-comment', (() => { const absent = { state: 'absent' }; const pair = { prComments: [{ id: 5, body: '## Contract review\n\n**VERDICT: PASS**' }], cardComments: [] }; diff --git a/scripts/pm/check-half-states.mjs b/scripts/pm/check-half-states.mjs index 500e62339ac..05e28f3a762 100644 --- a/scripts/pm/check-half-states.mjs +++ b/scripts/pm/check-half-states.mjs @@ -12851,13 +12851,79 @@ export function contractReviewVerdictOf(body) { * that states two (a quoted earlier verdict, a FAIL appended under a PASS) or * none (only a heading-inline or bare word) is refused rather than resolved by * line order. The patrol reader above keeps its first-match answer. + * + * Since card #33604 (N3 of record 6890532571) the WHOLE comment is read, lines + * above the heading included: a `VERDICT:` line a seat puts above the heading + * is still a verdict the comment states. A comment with no heading is still no + * record and states nothing. */ export function contractReviewVerdictLines(body) { + return contractReviewRecordReading(body)?.verdicts ?? []; +} + +/** + * The record leg's whole reading of one contract-review comment, or `null` + * when it carries no `## Contract review` heading (card #33604). ONE reader for + * the queue guard, built on this file's regexes, ⛔ never a second parser: + * + * verdicts every explicit `VERDICT:` line's word, whole comment (N3); + * failSpellings the trimmed lines that read FAIL OUTSIDE the explicit form (N2): + * the heading's own tail (the patrol's inline dialect), a line + * keyed `verdict:` in any case, under a list bullet or emphasis, + * and a line that opens with a bare `FAIL` and nothing but a + * separator after it. A record carrying one never clears beside + * its one PASS line: it contradicts itself; + * findings the must-fix and should-fix grades (`contract-review.md`: a + * must-fix is a FAIL, a should-fix earns a delta review of its + * fix, nits alone end the round). Read per mention of the + * hyphenated word, case-insensitive: + * open a finding NAMED with its grade, the line's lead + * (after quote, bullet, emphasis): `S1 (should-fix) —`, + * `**M2 (must-fix, rules face)**`, `- should-fix: …`; + * negated `no must-fix`, `no should-fix`, `no must-fix or + * should-fix` — the shape a clean round states; + * unreadable any other mention (`Two should-fix, both …`): the + * grade is there and this reader cannot say whose, + * so the record fails CLOSED. + * A delta record names the findings it closes by id alone + * (`S1: closed.`, the measured shape), which mentions no grade. + * + * Grammar measured on the records of PRs #33686, #33687, #33688 (both rounds) + * and #33711 (2026-11-15): `**S1 (should-fix) — …**`, `- **S2 (should-fix) — …**`, + * `- nit: …`, `- N1 (nit, prose face): …`, `No must-fix, no should-fix.`, + * `Findings: no must-fix, no should-fix.`, `No must-fix. S1 and S2 each earn …`, + * `- **S1: closed.** …`; nits are never read. Pure. + */ +const CONTRACT_REVIEW_LINE_LEAD = String.raw`^[ \t]*(?:>[ \t]*)*(?:(?:[-*+]|\d+[.)])[ \t]+)?[*_]{0,3}[ \t]*`; +const CONTRACT_REVIEW_FAIL_KEYED = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`verdict[ \t]*[*_]{0,3}[ \t]*[::][ \t]*[*_` + '`' + String.raw`]{0,3}[ \t]*fail\b`, 'i'); +const CONTRACT_REVIEW_FAIL_BARE = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`FAIL[*_]{0,3}[ \t]*(?:$|[—–·::|]|-[ \t])`); +const CONTRACT_REVIEW_GRADE = /\b(must|should)-fix(?:es)?\b/gi; +const CONTRACT_REVIEW_GRADE_NAMED = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`(?:([A-Z]{1,3}\d+)[*_]{0,3}[ \t]*(?:[(\[][ \t]*|[—–:][ \t]*)?)?[*_]{0,3}(must|should)-fix\b`, 'i'); +const CONTRACT_REVIEW_GRADE_NEGATED = /\b(?:no|nor|zero)[ \t]+(?:(?:must|should)-fix(?:es)?[ \t]*(?:,|\/|or|and)[ \t]*(?:no[ \t]+)?)?$/i; +export function contractReviewRecordReading(body) { const text = String(body ?? ''); const m = CONTRACT_REVIEW_HEADING_MARKER.exec(text); - if (!m) return []; - const [, ...below] = text.slice(m.index + m[0].length).split(/\r?\n/); - return below.map((line) => CONTRACT_REVIEW_VERDICT_EXPLICIT.exec(line)?.[1] ?? null).filter((word) => word !== null); + if (!m) return null; + const headingTail = text.slice(m.index + m[0].length).split(/\r?\n/)[0]; + const lines = text.split(/\r?\n/); + const verdicts = []; + const failSpellings = []; + const open = []; + const unreadable = []; + if (CONTRACT_REVIEW_VERDICT_INLINE.exec(headingTail)?.[1] === 'FAIL') failSpellings.push(`## Contract review${headingTail}`.trim()); + for (const line of lines) { + const explicit = CONTRACT_REVIEW_VERDICT_EXPLICIT.exec(line); + if (explicit) verdicts.push(explicit[1]); + else if (CONTRACT_REVIEW_FAIL_KEYED.test(line) || CONTRACT_REVIEW_FAIL_BARE.test(line)) failSpellings.push(line.trim()); + const named = CONTRACT_REVIEW_GRADE_NAMED.exec(line); + // The NAMED mention is the one the lead regex ended on; every other mention on the line is read on its own. + const namedAt = named ? named[0].length - `${named[2]}-fix`.length : -1; + for (const mention of line.matchAll(CONTRACT_REVIEW_GRADE)) { + if (mention.index === namedAt) open.push({ id: named[1] ?? null, grade: `${named[2].toLowerCase()}-fix`, line: line.trim() }); + else if (!CONTRACT_REVIEW_GRADE_NEGATED.test(line.slice(0, mention.index))) unreadable.push(line.trim()); + } + } + return { verdicts, failSpellings, findings: { open, unreadable: [...new Set(unreadable)] } }; } // --------------------------------------------------------------------------- @@ -32850,6 +32916,15 @@ async function selfTest() { t43('H43 verdict: a record with no verdict word, a body with no heading, and a mention in prose all read null', [contractReviewVerdictOf('## Contract review\n\nServed-tier: `CONTRACT_REVIEW_TIER`'), contractReviewVerdictOf('**VERDICT: PASS**'), contractReviewVerdictOf('## Contract review\n\nthe seat will post PASS later')].join(), ',,'); t43('H43 verdict: the roster of words is PASS and FAIL, nothing else', CONTRACT_REVIEW_VERDICTS.join(), 'PASS,FAIL'); t43('H43 verdict lines: every explicit `VERDICT:` line under the heading, in order — one, two (a quoted one counts), none for the inline and bare dialects, none without a heading', [contractReviewVerdictLines(PASS43).join('+'), contractReviewVerdictLines('## Contract review\n\n**VERDICT: PASS**\n\n> **VERDICT: FAIL**').join('+'), contractReviewVerdictLines('## Contract review (clause ②) — **PASS**\n\nPASS').length, contractReviewVerdictLines('**VERDICT: PASS**').length].join(), 'PASS,PASS+FAIL,0,0'); + t43('H43 verdict lines (#33604 N3): a `VERDICT:` line ABOVE the heading counts too; still none without a heading', [contractReviewVerdictLines('**VERDICT: FAIL**\n\n## Contract review\n\n**VERDICT: PASS**').join('+'), contractReviewVerdictLines('**VERDICT: FAIL**').length].join(), 'FAIL+PASS,0'); + // #33604: the record reading — grades in the shapes measured on PRs #33686, #33687, #33688 and #33711 (2026-11-15). + const read43 = (prose) => contractReviewRecordReading(`${PASS43}\n\n${prose}`); + const grades43 = (prose) => { const r = read43(prose); return `${r.findings.open.map((f) => `${f.id ?? '-'}:${f.grade}`).join('+')}|${r.findings.unreadable.length}`; }; + t43('#33604 grades: named findings are OPEN — `**S1 (should-fix) — …**`, a bulleted `- **S2 (should-fix) — …**`, `M1 (must-fix, rules face)`, an unnumbered `- should-fix: …`', ['**S1 (should-fix) — a cleared landing reads as a BREACH.**', '- **S2 (should-fix) — two knocks have no row.**', '> M1 (must-fix, rules face): the arm reads no label.', '- should-fix: the body is stale.'].map(grades43).join(), 'S1:should-fix|0,S2:should-fix|0,M1:must-fix|0,-:should-fix|0'); + t43('#33604 grades: a clean round reads none — `No must-fix, no should-fix.`, `Findings: no must-fix, no should-fix.`, `no must-fix or should-fix`, `No must-fix. S1 and S2 each earn …`, the closing `- **S1: closed.**`, and nits', ['No must-fix, no should-fix.', 'Findings: no must-fix, no should-fix.', 'There is no must-fix or should-fix.', 'No must-fix. S1 and S2 each earn a delta review of their fix.', '- **S1: closed.** Every knock names a key.', '- N1 (nit, prose face): the body overstates.\n- nit: the compare is sent first.'].map(grades43).join(), '|0,|0,|0,|0,|0,|0'); + t43('#33604 grades: a mention the reader cannot attribute is UNREADABLE (fail closed) — the count line `Two should-fix, both …` beside two named ones', grades43('No must-fix. Two should-fix, both in `readArmLanding`.\n\n**S1 (should-fix) — x.**\n**S2 (should-fix) — y.**'), 'S1:should-fix+S2:should-fix|1'); + t43('#33604 N2: FAIL read outside the explicit line — heading tail, lower-case key, bullet, emphasis, a bare line; prose that only mentions the word is not one', [contractReviewRecordReading(PASS43.replace('## Contract review', '## Contract review — **FAIL**')).failSpellings.length, ...['verdict: fail', '- **VERDICT: FAIL**', '**Verdict:** FAIL', 'FAIL', '**FAIL** — x'].map((l) => read43(l).failSpellings.length), ...['- Newest FAIL over an older PASS.', 'FAIL, none or two refuse.', 'The fail-closed verdict: holds.'].map((l) => read43(l).failSpellings.length)].join(), '1,1,1,1,1,1,0,0,0'); + t43('#33604 reading: no heading is no record (null); the template record reads one PASS, no FAIL, no grade', [contractReviewRecordReading('**VERDICT: PASS**'), JSON.stringify(contractReviewRecordReading(PASS43))].join(), ',{"verdicts":["PASS"],"failSpellings":[],"findings":{"open":[],"unreadable":[]}}'); t43('H43 verdict: latestContractReviewOnHead now carries the verdict beside id and sha', [latestContractReviewOnHead(rows43(ACCEPT43, PASS43), HEAD43)?.verdict, latestContractReviewOnHead(rows43(FAIL43), HEAD43)?.verdict, latestContractReviewOnHead(rows43(PASS43), '0123456789abcdef')].join(), 'PASS,FAIL,'); // The row and the probe, gated on the reading. t43('H43 row: ⛔ BEFORE the hand-off, nobody asked is NOT a half state — quiet', h43GovernedReviewRequestGap(h43pr(16), GOV43, APP43, [], BEFORE43), null); diff --git a/scripts/pm/record-recognisers.mjs b/scripts/pm/record-recognisers.mjs index 40dea6707c4..9c30664158b 100644 --- a/scripts/pm/record-recognisers.mjs +++ b/scripts/pm/record-recognisers.mjs @@ -87,6 +87,7 @@ import { branchNameTarget, closingKeywordTargets, contractReviewHeadMatch, + contractReviewRecordReading, contractReviewVerdictLines, deliveryEvidence, deliveryEvidenceNote, @@ -98,8 +99,9 @@ import { } from './check-half-states.mjs'; // The fleet's one verdict reader, in its counting form, re-exported so the queue guard's lazy loader // reaches it: every Tier S entry lands on a record with exactly one `VERDICT:` line reading PASS -// (#33501 for the low-risk skills arm, #33541 for every other leg). ⛔ Never a second parser. -export { contractReviewVerdictLines }; +// (#33501 for the low-risk skills arm, #33541 for every other leg), and, through the whole +// reading, no FAIL spelled elsewhere and no open must-fix or should-fix (#33604). ⛔ Never a second parser. +export { contractReviewRecordReading, contractReviewVerdictLines }; // The tier `isModelIdentifierToken` refuses by VALUE. IMPORTED, never restated: // `dispatch-gates.mjs` is the one line in `scripts/pm/**` where the model id is // spelled as a value, and a second value site here is the drift that let a @@ -2070,6 +2072,9 @@ function templateFace({ face: faceId, paths }) { const BRIEF_GRADE_LINES = Object.freeze([ ' Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.', ' A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.', + ' Spell a must-fix or should-fix with its id and grade, `S1 (should-fix) — …`, and a clean round as', + ' `No must-fix, no should-fix.`: the queue guard reads a graded finding as OPEN on this head and', + ' refuses the record; the delta record names those it closes by id alone, `S1: closed`.', ' A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix', ' anywhere else moves the head, and this record no longer covers it.', " ⛔ Judge the tree, never the PR body's account of it.", @@ -2288,8 +2293,8 @@ export function contractReviewBriefLines(values = {}) { * * ⛔ Not read: the verdict WORD (the file's boundary, and the corpus already * spells it two ways) and the ①②③ items (prose the seat reads). The queue guard - * reads the word on the comment this function chose, with - * `contractReviewVerdictLines` (re-exported above), and drops comments by + * reads the word and the grades on the comment this function chose, with + * `contractReviewRecordReading` (re-exported above), and drops comments by * untrusted authors from the threads before calling this (card #33541): both * are the guard's facts, so this locator's other callers keep their reading. * @@ -3312,6 +3317,20 @@ export async function selfTest() { t('…and each run located the record on the thread it was posted to, not on the other one', pinRuns.every(([where, r]) => r.record?.where === where), JSON.stringify(pinRuns.map(([w, r]) => [w, r.record?.where]))); t('…and the guard fetched exactly ONE thread per entry in the set, no more and no fewer', pinRuns.every(([, r]) => r.threadsRead.join() === `${PIN_PR},${PIN_CARD}`), JSON.stringify(pinRuns.map(([, r]) => r.threadsRead))); t('⭐ #33541: the record the template prints carries exactly ONE `VERDICT:` line, and it reads PASS, so the guard that cleared it read its verdict', contractReviewVerdictLines(PIN_RECORD.body).join() === 'PASS' && pinRuns.every(([, r]) => r.record?.verdict === 'PASS'), JSON.stringify(pinRuns.map(([, r]) => r.record?.verdict))); + t('⭐ #33604: the grade shapes the BRIEF prescribes are the ones the GUARD reads — `S1 (should-fix)` refuses the template record, `No must-fix, no should-fix.` clears it', await (async () => { + const saved = PIN_RECORD.body; + const withProse = (prose) => saved.replace('### ④ Design judgment\n', `### ④ Design judgment\n\n${prose}\n`); + try { + PIN_RECORD.body = withProse('**S1 (should-fix) — the knock has no key.**'); + const open = await pinRun('PR'); + PIN_RECORD.body = withProse('No must-fix, no should-fix.'); + const clean = await pinRun('PR'); + const briefSays = ['`S1 (should-fix) — …`', '`No must-fix, no should-fix.`', '`S1: closed`'].every((frag) => BRIEF_BODY.includes(frag)); + return briefSays && saved.includes('### ④ Design judgment\n') && open.verdict.exitCode !== GUARD.EXIT_CLEAR && open.record?.state === 'not-pass' && /S1 \(should-fix\)/.test(open.record?.verdictReason ?? '') && clean.verdict.exitCode === GUARD.EXIT_CLEAR && clean.record?.verdict === 'PASS'; + } finally { + PIN_RECORD.body = saved; + } + })()); t('⛔ #33541: the same template record posted by an author outside the relay and GOVERNED_APPROVERS is not read -- refused as no record', await (async () => { const saved = PIN_RECORD.user; PIN_RECORD.user = { login: 'drive-by-commenter' }; try { const r = await pinRun('PR'); return r.verdict.exitCode !== GUARD.EXIT_CLEAR && r.record?.state === 'absent'; } finally { PIN_RECORD.user = saved; } })()); t('⛔ CONTROL: with the record on NEITHER thread the same run is refused -- the pin can fail', await (async () => { const none = await pinRun('nowhere'); return none.verdict.exitCode !== GUARD.EXIT_CLEAR && none.record?.state === 'absent'; })()); t('the guard prints the location in the WORDS this file owns, so a seat is told one thing', GUARD.REVIEW_OF_RECORD_LOCATION === REVIEW_OF_RECORD_LOCATION && TEMPLATE_TEXT.includes(`ONE comment on ${REVIEW_OF_RECORD_LOCATION}`)); From 7c2fb525133fc94d6d46477f7ec94e879d37021e Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 08:54:17 +0000 Subject: [PATCH 2/3] fix(pm): the record reader clears a delta record that cites or closes graded findings, and reads every verdict-bearing FAIL Review 6891926185 on PR #33736: S1, a delta record's citation of the prior record, a named finding whose line says closed, and 'No new should-fix' read clean; S2, a heading-led key, a table cell, words before the key, a dash, a bare FAIL with a full stop and a second heading read FAIL, and a comma no longer carries a denial. Co-Authored-By: Claude --- scripts/pm/check-governed-queue-guard.mjs | 19 ++++- scripts/pm/check-half-states.mjs | 97 +++++++++++++++-------- 2 files changed, 79 insertions(+), 37 deletions(-) diff --git a/scripts/pm/check-governed-queue-guard.mjs b/scripts/pm/check-governed-queue-guard.mjs index dcb5a1891fa..fbecc180a77 100644 --- a/scripts/pm/check-governed-queue-guard.mjs +++ b/scripts/pm/check-governed-queue-guard.mjs @@ -2119,7 +2119,8 @@ export function recordPassVerdict(record, pair, recognisers) { const named = open.slice(0, 4).map((f) => (f.id ? `${f.id} (${f.grade})` : f.grade)).join(', '); return { ...refuse(null, `it reads PASS but names ${open.length} open must-fix/should-fix finding(s) (${named}${open.length > 4 ? ', …' : ''}): each earns a delta review of its fix, and the later same-head record that closes them is the one that clears (#33604)`), author }; } - if (unreadable.length > 0) return { ...refuse(null, `it reads PASS but a must-fix/should-fix grade on it cannot be attributed (${unreadable.slice(0, 2).map(quote).join(', ')}): name each finding \`S1 (should-fix)\`, or state \`no should-fix\` (#33604)`), author }; + // ⛔ The remedy names the shapes the reader takes, and never asks for a sentence the record may already carry. + if (unreadable.length > 0) return { ...refuse(null, `it reads PASS but a must-fix/should-fix mention on it cannot be attributed (${unreadable.slice(0, 2).map(quote).join(', ')}): the reader takes a finding named at a line's lead (\`S1 (should-fix) — …\`, closed as \`S1 (should-fix): closed\`), a citation \`(record ID: …)\` and a denial (\`No must-fix, no should-fix.\`); any other mention of the grade word refuses (#33604)`), author }; return { ...record, verdict: 'PASS', author }; } @@ -5564,7 +5565,21 @@ export async function selfTest() { const clean = await graded(['Findings: no must-fix, no should-fix.', '- N1 (nit, prose face): the body overstates.', '- nit: the compare is sent first.', 'Nits only; the head is not moved.']); assert('#33604-CONTROL-a-PASS-whose-grades-read-no-must-fix-no-should-fix-and-nits-CLEARS', clean.exitCode === EXIT_CLEAR && clean.entries[0].record.verdict === 'PASS', renderGuardVerdict(clean)); const unattributed = await graded(['Two should-fix remain, see the thread.']); - assert('⛔ #33604-a-grade-the-reader-cannot-attribute-FAILS-CLOSED', unattributed.exitCode === EXIT_REFUSED_UNAPPROVED && /cannot be attributed \(`Two should-fix remain, see the thread\.`\)/.test(renderGuardVerdict(unattributed)), renderGuardVerdict(unattributed)); + assert('⛔ #33604-a-grade-the-reader-cannot-attribute-FAILS-CLOSED-and-the-remedy-names-the-shapes-not-a-sentence-to-add', unattributed.exitCode === EXIT_REFUSED_UNAPPROVED && /cannot be attributed \(`Two should-fix remain, see the thread\.`\)/.test(renderGuardVerdict(unattributed)) && /a citation `\(record ID: …\)`/.test(renderGuardVerdict(unattributed)) && !/or state `no should-fix`/.test(renderGuardVerdict(unattributed)), renderGuardVerdict(unattributed)); + // ⭐ S1 of review 6891926185: a delta record that cites or closes graded findings CLEARS — measured on #33711's final record 6891542450. + const cleanDelta = await graded(['DELTA review from `42323f341b198c6c0625ac74f6ffd3eea8265c6b` (record 6891274033: PASS, should-fix S3, nits N7 and N8) to this head.', '', '- **S3: closed.** The record leg applies the author binding.', '', 'No must-fix. No should-fix. Three new nits.', '', '- **N9** wording.']); + assert('#33604-S1-the-MEASURED-clean-delta-record-citing-the-prior-record-with-its-grade-CLEARS', cleanDelta.exitCode === EXIT_CLEAR && cleanDelta.entries[0].record.verdict === 'PASS', renderGuardVerdict(cleanDelta)); + const closedNamed = await Promise.all(['- **S1 (should-fix): closed.**', 'S1 (should-fix) — closed on this head', 'No new should-fix.', 'No open should-fix.'].map((line) => graded([line]))); + assert('#33604-S1-a-named-finding-whose-line-says-closed-and-no-new-or-open-should-fix-CLEAR', closedNamed.every((r) => r.exitCode === EXIT_CLEAR), closedNamed.map((r) => r.entries[0].record.verdictReason).join(' | ')); + const citedThenOpen = await graded(['DELTA review from `9d13278d` (record 6890932729: PASS, should-fix S1 and S2, nits N1 to N6) to this head.', '**S3 (should-fix) — new at this head.**']); + assert('⛔ #33604-S1-CONTROL-a-citation-excuses-only-itself-a-new-named-should-fix-beside-it-still-refuses', citedThenOpen.exitCode === EXIT_REFUSED_UNAPPROVED && /S3 \(should-fix\)/.test(renderGuardVerdict(citedThenOpen)), renderGuardVerdict(citedThenOpen)); + // ⛔ S2 of review 6891926185: every verdict-bearing FAIL form refuses, and an ambiguous negation fails closed. + const s2Fails = await Promise.all(['### VERDICT: FAIL', '## Verdict: FAIL', '| Verdict | FAIL |', 'Overall verdict: FAIL', 'Verdict — FAIL', 'FAIL.', '**FAIL.**', '## Contract review — FAIL'].map((line) => graded([line]))); + assert('⛔ #33604-S2-heading-led-key-table-cell-words-before-the-key-a-dash-a-bare-FAIL-full-stop-and-a-second-heading-each-REFUSE', s2Fails.every((r) => r.exitCode === EXIT_REFUSED_UNAPPROVED && /yet it also reads FAIL/.test(renderGuardVerdict(r))), s2Fails.map((r) => r.entries[0].record.verdictReason).join(' | ')); + const halfDenied = await graded(['No must-fix, should-fix S1 and S2 below.', '- **S1** the knock has no key.']); + assert('⛔ #33604-S2-a-comma-does-not-carry-the-denial-No-must-fix-comma-should-fix-S1-is-UNREADABLE-not-clean', halfDenied.exitCode === EXIT_REFUSED_UNAPPROVED && /cannot be attributed/.test(renderGuardVerdict(halfDenied)), renderGuardVerdict(halfDenied)); + const cleanDenials = await Promise.all(['No must-fix. No should-fix.', 'No must-fix and no should-fix.', 'Neither must-fix nor should-fix.', '0 must-fix, 0 should-fix', '- should-fix: none', '| Verdict | PASS |'].map((line) => graded([line]))); + assert('#33604-S2-CONTROL-denials-with-their-own-no-neither-nor-zero-and-a-grade-valued-none-CLEAR', cleanDenials.every((r) => r.exitCode === EXIT_CLEAR), cleanDenials.map((r) => r.entries[0].record.verdictReason).join(' | ')); const unread = await tierRun({ comments: [recordComment()], recognisers: { ...live, reading: () => ({ verdicts: ['PASS'] }) } }); assert('⛔ #33604-a-reading-with-no-grades-in-it-FAILS-CLOSED', unread.exitCode === EXIT_REFUSED_UNAPPROVED && /could not be read, so it clears nothing/.test(renderGuardVerdict(unread)), renderGuardVerdict(unread)); // ⛔ N2 of record 6890532571: a self-contradicting record never clears beside its one PASS line. diff --git a/scripts/pm/check-half-states.mjs b/scripts/pm/check-half-states.mjs index 51f35d7ed9a..41d947a413a 100644 --- a/scripts/pm/check-half-states.mjs +++ b/scripts/pm/check-half-states.mjs @@ -12867,60 +12867,84 @@ export function contractReviewVerdictLines(body) { * the queue guard, built on this file's regexes, ⛔ never a second parser: * * verdicts every explicit `VERDICT:` line's word, whole comment (N3); - * failSpellings the trimmed lines that read FAIL OUTSIDE the explicit form (N2): - * the heading's own tail (the patrol's inline dialect), a line - * keyed `verdict:` in any case, under a list bullet or emphasis, - * and a line that opens with a bare `FAIL` and nothing but a - * separator after it. A record carrying one never clears beside - * its one PASS line: it contradicts itself; + * failSpellings the trimmed lines that read FAIL OUTSIDE the explicit form (N2), + * in every verdict-bearing shape measured: any heading's own + * tail (the patrol's inline dialect); a `verdict` key in any + * case, under a heading mark, quote, list bullet or emphasis, + * after up to two words (`Overall verdict:`), with `:`, a dash + * or `=` (`Verdict — FAIL`); a table row with a verdict cell and + * a FAIL cell; a line that opens with a bare `FAIL` and nothing + * but a separator or a full stop after it. A record carrying one + * never clears beside its one PASS line: it contradicts itself; * findings the must-fix and should-fix grades (`contract-review.md`: a * must-fix is a FAIL, a should-fix earns a delta review of its * fix, nits alone end the round). Read per mention of the * hyphenated word, case-insensitive: - * open a finding NAMED with its grade, the line's lead - * (after quote, bullet, emphasis): `S1 (should-fix) —`, - * `**M2 (must-fix, rules face)**`, `- should-fix: …`; - * negated `no must-fix`, `no should-fix`, `no must-fix or - * should-fix` — the shape a clean round states; + * open a finding NAMED with its grade at the line's lead + * (after heading mark, quote, bullet, emphasis): + * `S1 (should-fix) —`, `**M2 (must-fix, rules face)**`, + * `- should-fix: …`; + * closed a named finding whose line goes on to say + * `closed` and nothing before it but punctuation: + * `- **S1 (should-fix): closed.**` — a delta record + * closing what an earlier one raised; + * none a named grade whose value is `none` (`must-fix: none`); + * cited a mention inside the citation of an earlier + * record, `(record 6891274033: PASS, should-fix S3, …)`, + * the preamble a delta record opens with; + * negated `no must-fix`, `no new should-fix`, `neither must-fix + * nor should-fix`, `0 must-fix`, and a second grade + * carried by `or` or `/` (`no must-fix or should-fix`). + * After a comma or `and` the second grade needs its own + * `no` — `No must-fix, should-fix S1 and S2 below.` + * names findings, it does not deny them; * unreadable any other mention (`Two should-fix, both …`): the * grade is there and this reader cannot say whose, * so the record fails CLOSED. - * A delta record names the findings it closes by id alone - * (`S1: closed.`, the measured shape), which mentions no grade. - * - * Grammar measured on the records of PRs #33686, #33687, #33688 (both rounds) - * and #33711 (2026-11-15): `**S1 (should-fix) — …**`, `- **S2 (should-fix) — …**`, - * `- nit: …`, `- N1 (nit, prose face): …`, `No must-fix, no should-fix.`, - * `Findings: no must-fix, no should-fix.`, `No must-fix. S1 and S2 each earn …`, - * `- **S1: closed.** …`; nits are never read. Pure. - */ -const CONTRACT_REVIEW_LINE_LEAD = String.raw`^[ \t]*(?:>[ \t]*)*(?:(?:[-*+]|\d+[.)])[ \t]+)?[*_]{0,3}[ \t]*`; -const CONTRACT_REVIEW_FAIL_KEYED = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`verdict[ \t]*[*_]{0,3}[ \t]*[::][ \t]*[*_` + '`' + String.raw`]{0,3}[ \t]*fail\b`, 'i'); -const CONTRACT_REVIEW_FAIL_BARE = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`FAIL[*_]{0,3}[ \t]*(?:$|[—–·::|]|-[ \t])`); + * A delta record may also name what it closes by id alone + * (`S1: closed.`), which mentions no grade. + * + * Grammar measured on the records of PRs #33686, #33687, #33688 (both rounds), + * #33711 (all three rounds), #33720, #33726 and #33736 (2026-11-15); nits are + * never read. Pure. + */ +const CONTRACT_REVIEW_LINE_LEAD = String.raw`^[ \t]*(?:#{1,6}[ \t]+)?(?:>[ \t]*)*(?:(?:[-*+]|\d+[.)])[ \t]+)?[*_]{0,3}[ \t]*`; +const CONTRACT_REVIEW_FAIL_KEYED = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`(?:[A-Za-z-]+[ \t]+){0,2}verdict[ \t]*[*_]{0,3}[ \t]*(?:[::=]|[—–]|-(?=[ \t]))[ \t]*[*_` + '`' + String.raw`]{0,3}[ \t]*fail\b`, 'i'); +const CONTRACT_REVIEW_FAIL_CELL = /^[ \t]*\|.*\bverdict\b[^|]*\|[ \t]*[*_`]{0,3}[ \t]*fail\b/i; +const CONTRACT_REVIEW_FAIL_BARE = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`FAIL[*_]{0,3}[ \t]*(?:$|[—–·::|.。]|-[ \t])`); const CONTRACT_REVIEW_GRADE = /\b(must|should)-fix(?:es)?\b/gi; -const CONTRACT_REVIEW_GRADE_NAMED = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`(?:([A-Z]{1,3}\d+)[*_]{0,3}[ \t]*(?:[(\[][ \t]*|[—–:][ \t]*)?)?[*_]{0,3}(must|should)-fix\b`, 'i'); -const CONTRACT_REVIEW_GRADE_NEGATED = /\b(?:no|nor|zero)[ \t]+(?:(?:must|should)-fix(?:es)?[ \t]*(?:,|\/|or|and)[ \t]*(?:no[ \t]+)?)?$/i; +const CONTRACT_REVIEW_GRADE_NAMED = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`(?:([A-Z]{1,3}\d+)[*_]{0,3}[ \t]*([(\[][ \t]*|[—–:][ \t]*)?)?[*_]{0,3}(must|should)-fix\b`, 'i'); +const CONTRACT_REVIEW_GRADE_NAMED_STATE = /^[^\S\n]*[*_::—–.,-]*[ \t]*[*_]{0,3}(closed|none)\b/i; +const CONTRACT_REVIEW_GRADE_NEGATED = /\b(?:no|nor|neither|zero|0)[ \t]+(?:(?:new|open|further|remaining|other|outstanding)[ \t]+)?(?:(?:must|should)-fix(?:es)?[ \t]*(?:(?:or|nor|\/)[ \t]*|(?:,|and)[ \t]*(?:no|nor)[ \t]+(?:(?:new|open|further|remaining|other|outstanding)[ \t]+)?))?$/i; +const CONTRACT_REVIEW_RECORD_CITATION = /\(record[ \t]+\d{6,}\b[^()]*\)/gi; export function contractReviewRecordReading(body) { const text = String(body ?? ''); - const m = CONTRACT_REVIEW_HEADING_MARKER.exec(text); - if (!m) return null; - const headingTail = text.slice(m.index + m[0].length).split(/\r?\n/)[0]; - const lines = text.split(/\r?\n/); + if (!CONTRACT_REVIEW_HEADING_MARKER.test(text)) return null; const verdicts = []; const failSpellings = []; const open = []; const unreadable = []; - if (CONTRACT_REVIEW_VERDICT_INLINE.exec(headingTail)?.[1] === 'FAIL') failSpellings.push(`## Contract review${headingTail}`.trim()); - for (const line of lines) { + const headingLine = new RegExp(CONTRACT_REVIEW_HEADING_MARKER.source); + for (const line of text.split(/\r?\n/)) { + // Every heading's own tail is read for an inline FAIL, not only the first one's (nit N3, review 6891926185). + const heading = headingLine.exec(line); + if (heading && CONTRACT_REVIEW_VERDICT_INLINE.exec(line.slice(heading.index + heading[0].length))?.[1] === 'FAIL') failSpellings.push(line.trim()); const explicit = CONTRACT_REVIEW_VERDICT_EXPLICIT.exec(line); if (explicit) verdicts.push(explicit[1]); - else if (CONTRACT_REVIEW_FAIL_KEYED.test(line) || CONTRACT_REVIEW_FAIL_BARE.test(line)) failSpellings.push(line.trim()); + else if (!heading && (CONTRACT_REVIEW_FAIL_KEYED.test(line) || CONTRACT_REVIEW_FAIL_CELL.test(line) || CONTRACT_REVIEW_FAIL_BARE.test(line))) failSpellings.push(line.trim()); + const cited = [...line.matchAll(CONTRACT_REVIEW_RECORD_CITATION)].map((c) => [c.index, c.index + c[0].length]); const named = CONTRACT_REVIEW_GRADE_NAMED.exec(line); // The NAMED mention is the one the lead regex ended on; every other mention on the line is read on its own. - const namedAt = named ? named[0].length - `${named[2]}-fix`.length : -1; + const namedAt = named ? named[0].length - `${named[3]}-fix`.length : -1; for (const mention of line.matchAll(CONTRACT_REVIEW_GRADE)) { - if (mention.index === namedAt) open.push({ id: named[1] ?? null, grade: `${named[2].toLowerCase()}-fix`, line: line.trim() }); - else if (!CONTRACT_REVIEW_GRADE_NEGATED.test(line.slice(0, mention.index))) unreadable.push(line.trim()); + if (cited.some(([from, to]) => mention.index >= from && mention.index < to)) continue; + if (mention.index === namedAt) { + // What follows the grade: past the bracket the finding opened with, then `closed` or `none` and only punctuation before it. + let rest = line.slice(named[0].length); + if (named[2] && /[(\[]/.test(named[2])) rest = rest.slice(rest.search(/[)\]]/) + 1 || rest.length); + const state = CONTRACT_REVIEW_GRADE_NAMED_STATE.exec(rest)?.[1]?.toLowerCase(); + if (state === undefined) open.push({ id: named[1] ?? null, grade: `${named[3].toLowerCase()}-fix`, line: line.trim() }); + } else if (!CONTRACT_REVIEW_GRADE_NEGATED.test(line.slice(0, mention.index))) unreadable.push(line.trim()); } } return { verdicts, failSpellings, findings: { open, unreadable: [...new Set(unreadable)] } }; @@ -32924,6 +32948,9 @@ async function selfTest() { t43('#33604 grades: a clean round reads none — `No must-fix, no should-fix.`, `Findings: no must-fix, no should-fix.`, `no must-fix or should-fix`, `No must-fix. S1 and S2 each earn …`, the closing `- **S1: closed.**`, and nits', ['No must-fix, no should-fix.', 'Findings: no must-fix, no should-fix.', 'There is no must-fix or should-fix.', 'No must-fix. S1 and S2 each earn a delta review of their fix.', '- **S1: closed.** Every knock names a key.', '- N1 (nit, prose face): the body overstates.\n- nit: the compare is sent first.'].map(grades43).join(), '|0,|0,|0,|0,|0,|0'); t43('#33604 grades: a mention the reader cannot attribute is UNREADABLE (fail closed) — the count line `Two should-fix, both …` beside two named ones', grades43('No must-fix. Two should-fix, both in `readArmLanding`.\n\n**S1 (should-fix) — x.**\n**S2 (should-fix) — y.**'), 'S1:should-fix+S2:should-fix|1'); t43('#33604 N2: FAIL read outside the explicit line — heading tail, lower-case key, bullet, emphasis, a bare line; prose that only mentions the word is not one', [contractReviewRecordReading(PASS43.replace('## Contract review', '## Contract review — **FAIL**')).failSpellings.length, ...['verdict: fail', '- **VERDICT: FAIL**', '**Verdict:** FAIL', 'FAIL', '**FAIL** — x'].map((l) => read43(l).failSpellings.length), ...['- Newest FAIL over an older PASS.', 'FAIL, none or two refuse.', 'The fail-closed verdict: holds.'].map((l) => read43(l).failSpellings.length)].join(), '1,1,1,1,1,1,0,0,0'); + t43('#33604 S1 (review 6891926185): the measured delta preamble cites, a named finding whose line says closed is closed, `No new should-fix` denies', ['DELTA review from `42323f34` (record 6891274033: PASS, should-fix S3, nits N7 and N8) to this head.', '- **S1 (should-fix): closed.**', 'S1 (should-fix) — closed on this head', 'No new should-fix.', 'must-fix: none'].map(grades43).join(), '|0,|0,|0,|0,|0'); + t43('#33604 S2 (review 6891926185): `No must-fix, should-fix S1 and S2 below.` is unreadable (a comma carries no denial); its own `no` after `and` does', [grades43('No must-fix, should-fix S1 and S2 below.'), grades43('No must-fix and no should-fix.')].join(), '|1,|0'); + t43('#33604 S2 (review 6891926185): heading-led key, table cell, words before the key, a dash, a bare `FAIL.` and a second heading read FAIL', ['### VERDICT: FAIL', '## Verdict: FAIL', '| Verdict | FAIL |', 'Overall verdict: FAIL', 'Verdict — FAIL', 'FAIL.', '**FAIL.**', '## Contract review — FAIL', '| Verdict | PASS |'].map((l) => read43(l).failSpellings.length).join(), '1,1,1,1,1,1,1,1,0'); t43('#33604 reading: no heading is no record (null); the template record reads one PASS, no FAIL, no grade', [contractReviewRecordReading('**VERDICT: PASS**'), JSON.stringify(contractReviewRecordReading(PASS43))].join(), ',{"verdicts":["PASS"],"failSpellings":[],"findings":{"open":[],"unreadable":[]}}'); t43('H43 verdict: latestContractReviewOnHead now carries the verdict beside id and sha', [latestContractReviewOnHead(rows43(ACCEPT43, PASS43), HEAD43)?.verdict, latestContractReviewOnHead(rows43(FAIL43), HEAD43)?.verdict, latestContractReviewOnHead(rows43(PASS43), '0123456789abcdef')].join(), 'PASS,FAIL,'); // The row and the probe, gated on the reading. From 38cc292ac87504dfa8d38f53bf85403019032806 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 09:27:35 +0000 Subject: [PATCH 3/3] fix(pm): a closed or none state word must end the finding, and more FAIL spellings refuse Review 6892305129 on PR #33736, S1: a finding whose title opens with 'closed' or 'none' (closed in part, Closed PRs ..., none of ...) stays open; only closing emphasis, a full stop or semicolon, or the measured tails may follow the state word. N2: Verdict: FAILED, Verdict is FAIL, Verdict (delta): FAIL, a reversed table row, FAIL! and a late FAIL in a heading tail now read FAIL. Co-Authored-By: Claude --- scripts/pm/check-governed-queue-guard.mjs | 7 ++++ scripts/pm/check-half-states.mjs | 45 +++++++++++++++-------- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/scripts/pm/check-governed-queue-guard.mjs b/scripts/pm/check-governed-queue-guard.mjs index fbecc180a77..15a0c083329 100644 --- a/scripts/pm/check-governed-queue-guard.mjs +++ b/scripts/pm/check-governed-queue-guard.mjs @@ -5573,6 +5573,13 @@ export async function selfTest() { assert('#33604-S1-a-named-finding-whose-line-says-closed-and-no-new-or-open-should-fix-CLEAR', closedNamed.every((r) => r.exitCode === EXIT_CLEAR), closedNamed.map((r) => r.entries[0].record.verdictReason).join(' | ')); const citedThenOpen = await graded(['DELTA review from `9d13278d` (record 6890932729: PASS, should-fix S1 and S2, nits N1 to N6) to this head.', '**S3 (should-fix) — new at this head.**']); assert('⛔ #33604-S1-CONTROL-a-citation-excuses-only-itself-a-new-named-should-fix-beside-it-still-refuses', citedThenOpen.exitCode === EXIT_REFUSED_UNAPPROVED && /S3 \(should-fix\)/.test(renderGuardVerdict(citedThenOpen)), renderGuardVerdict(citedThenOpen)); + // ⛔ S1 of review 6892305129: the state word must END the finding — a title that opens with `closed` or `none` names an OPEN finding. + const titledOpen = await Promise.all(['S1 (should-fix): closed in part, still open for X', '- **S1 (should-fix) — closed in part; the table cell still clears.**', '**S2 (should-fix) — Closed PRs are still read as merged by the audit.**', '- **S2 (should-fix) — none of the three ablations ran on the committed head.**', 'S1 (should-fix) — closed on the prior head, reopened by this delta', '- should-fix: none of S1, S2 is fixed'].map((line) => graded([line]))); + assert('⛔ #33604-r3-a-finding-whose-TITLE-opens-with-closed-or-none-stays-OPEN-and-REFUSES', titledOpen.every((r) => r.exitCode === EXIT_REFUSED_UNAPPROVED && /names 1 open must-fix\/should-fix finding/.test(renderGuardVerdict(r))), titledOpen.map((r) => r.entries[0].record.verdictReason ?? 'CLEARED').join(' | ')); + const stateEnds = await Promise.all(['S1 (should-fix): closed here.', '- **S1 (should-fix): closed.** Every knock names a key.', 'S1 (should-fix): closed;'].map((line) => graded([line]))); + assert('#33604-r3-CONTROL-closed-that-ends-the-finding-or-the-bold-title-CLEARS', stateEnds.every((r) => r.exitCode === EXIT_CLEAR), stateEnds.map((r) => r.entries[0].record.verdictReason).join(' | ')); + const r3Fails = await Promise.all(['Verdict: FAILED', 'Verdict is FAIL', 'Verdict (delta): FAIL', '| FAIL | Verdict |', 'FAIL!', '## Contract review — PASS withdrawn, FAIL'].map((line) => graded([line]))); + assert('⛔ #33604-r3-N2-FAILED-is-a-parenthetical-a-reversed-table-row-FAIL-bang-and-a-late-FAIL-in-a-heading-tail-REFUSE', r3Fails.every((r) => r.exitCode === EXIT_REFUSED_UNAPPROVED && /yet it also reads FAIL/.test(renderGuardVerdict(r))), r3Fails.map((r) => r.entries[0].record.verdictReason ?? 'CLEARED').join(' | ')); // ⛔ S2 of review 6891926185: every verdict-bearing FAIL form refuses, and an ambiguous negation fails closed. const s2Fails = await Promise.all(['### VERDICT: FAIL', '## Verdict: FAIL', '| Verdict | FAIL |', 'Overall verdict: FAIL', 'Verdict — FAIL', 'FAIL.', '**FAIL.**', '## Contract review — FAIL'].map((line) => graded([line]))); assert('⛔ #33604-S2-heading-led-key-table-cell-words-before-the-key-a-dash-a-bare-FAIL-full-stop-and-a-second-heading-each-REFUSE', s2Fails.every((r) => r.exitCode === EXIT_REFUSED_UNAPPROVED && /yet it also reads FAIL/.test(renderGuardVerdict(r))), s2Fails.map((r) => r.entries[0].record.verdictReason).join(' | ')); diff --git a/scripts/pm/check-half-states.mjs b/scripts/pm/check-half-states.mjs index 41d947a413a..5b1ec46cc7b 100644 --- a/scripts/pm/check-half-states.mjs +++ b/scripts/pm/check-half-states.mjs @@ -12868,13 +12868,15 @@ export function contractReviewVerdictLines(body) { * * verdicts every explicit `VERDICT:` line's word, whole comment (N3); * failSpellings the trimmed lines that read FAIL OUTSIDE the explicit form (N2), - * in every verdict-bearing shape measured: any heading's own - * tail (the patrol's inline dialect); a `verdict` key in any - * case, under a heading mark, quote, list bullet or emphasis, - * after up to two words (`Overall verdict:`), with `:`, a dash - * or `=` (`Verdict — FAIL`); a table row with a verdict cell and - * a FAIL cell; a line that opens with a bare `FAIL` and nothing - * but a separator or a full stop after it. A record carrying one + * in every verdict-bearing shape measured: a caps FAIL anywhere + * in any heading's own tail (the patrol's inline dialect); a + * `verdict` key in any case, under a heading mark, quote, list + * bullet or emphasis, after up to two words (`Overall verdict:`), + * with a parenthetical (`Verdict (delta):`), with `:`, a dash, + * `=` or `is`, reading FAIL, FAILED or FAILS; a table row with a + * verdict cell and a FAIL cell in either order; a line that opens + * with a bare `FAIL` and nothing but a separator, a full stop or + * `!` after it. A record carrying one * never clears beside its one PASS line: it contradicts itself; * findings the must-fix and should-fix grades (`contract-review.md`: a * must-fix is a FAIL, a should-fix earns a delta review of its @@ -12885,10 +12887,15 @@ export function contractReviewVerdictLines(body) { * `S1 (should-fix) —`, `**M2 (must-fix, rules face)**`, * `- should-fix: …`; * closed a named finding whose line goes on to say - * `closed` and nothing before it but punctuation: + * `closed` and nothing before it but punctuation, and + * nothing after it but closing emphasis, `.`, `;` or + * `on this head` / `at this head` / `here` (a full stop + * ending the bold title may lead a new sentence): * `- **S1 (should-fix): closed.**` — a delta record - * closing what an earlier one raised; - * none a named grade whose value is `none` (`must-fix: none`); + * closing what an earlier one raised. `closed in part`, + * a title opening `Closed …` stay OPEN; + * none a named grade whose value is `none`, on the same + * terms (`must-fix: none`; `none of …` stays OPEN); * cited a mention inside the citation of an earlier * record, `(record 6891274033: PASS, should-fix S3, …)`, * the preamble a delta record opens with; @@ -12909,12 +12916,17 @@ export function contractReviewVerdictLines(body) { * never read. Pure. */ const CONTRACT_REVIEW_LINE_LEAD = String.raw`^[ \t]*(?:#{1,6}[ \t]+)?(?:>[ \t]*)*(?:(?:[-*+]|\d+[.)])[ \t]+)?[*_]{0,3}[ \t]*`; -const CONTRACT_REVIEW_FAIL_KEYED = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`(?:[A-Za-z-]+[ \t]+){0,2}verdict[ \t]*[*_]{0,3}[ \t]*(?:[::=]|[—–]|-(?=[ \t]))[ \t]*[*_` + '`' + String.raw`]{0,3}[ \t]*fail\b`, 'i'); -const CONTRACT_REVIEW_FAIL_CELL = /^[ \t]*\|.*\bverdict\b[^|]*\|[ \t]*[*_`]{0,3}[ \t]*fail\b/i; -const CONTRACT_REVIEW_FAIL_BARE = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`FAIL[*_]{0,3}[ \t]*(?:$|[—–·::|.。]|-[ \t])`); +const CONTRACT_REVIEW_FAIL_KEYED = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`(?:[A-Za-z-]+[ \t]+){0,2}verdict(?:[ \t]*\([^)]*\))?[ \t]*[*_]{0,3}[ \t]*(?:[::=]|[—–]|-(?=[ \t])|is(?=[ \t]))[ \t]*[*_` + '`' + String.raw`]{0,3}[ \t]*fail(?:ed|s)?\b`, 'i'); +// A table row with a verdict cell and a FAIL cell, in either order (the word may carry emphasis or a code mark). +const CONTRACT_REVIEW_FAIL_CELL = { test: (line) => /^[ \t]*\|/.test(line) && line.split('|').some((cell) => /\bverdict\b/i.test(cell)) && line.split('|').some((cell) => /^[ \t]*[*_`]{0,3}[ \t]*fail(?:ed|s)?\b/i.test(cell)) }; +const CONTRACT_REVIEW_FAIL_BARE = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`FAIL(?:ED)?[*_]{0,3}[ \t]*(?:$|[—–·::|.。!!]|-[ \t])`); const CONTRACT_REVIEW_GRADE = /\b(must|should)-fix(?:es)?\b/gi; const CONTRACT_REVIEW_GRADE_NAMED = new RegExp(CONTRACT_REVIEW_LINE_LEAD + String.raw`(?:([A-Z]{1,3}\d+)[*_]{0,3}[ \t]*([(\[][ \t]*|[—–:][ \t]*)?)?[*_]{0,3}(must|should)-fix\b`, 'i'); -const CONTRACT_REVIEW_GRADE_NAMED_STATE = /^[^\S\n]*[*_::—–.,-]*[ \t]*[*_]{0,3}(closed|none)\b/i; +// ⛔ The state word must END the finding (review 6892305129): nothing but closing emphasis, a full stop or a +// semicolon may follow it, or the measured tails `on this head` / `at this head` / `here`; a full stop that +// closes the bold title may then be followed by a new sentence. `closed in part`, `Closed PRs are …` and +// `none of the three ablations ran` are titles, and the finding they name stays OPEN. +const CONTRACT_REVIEW_GRADE_NAMED_STATE = /^[^\S\n]*[*_::—–.,-]*[ \t]*[*_]{0,3}(closed|none)(?:[ \t]+(?:(?:on|at)[ \t]+this[ \t]+head|here))?(?:[*_]{0,3}[.;。]?[*_]{0,3}[ \t]*$|[.。](?:\*\*|__)[ \t]+\S)/i; const CONTRACT_REVIEW_GRADE_NEGATED = /\b(?:no|nor|neither|zero|0)[ \t]+(?:(?:new|open|further|remaining|other|outstanding)[ \t]+)?(?:(?:must|should)-fix(?:es)?[ \t]*(?:(?:or|nor|\/)[ \t]*|(?:,|and)[ \t]*(?:no|nor)[ \t]+(?:(?:new|open|further|remaining|other|outstanding)[ \t]+)?))?$/i; const CONTRACT_REVIEW_RECORD_CITATION = /\(record[ \t]+\d{6,}\b[^()]*\)/gi; export function contractReviewRecordReading(body) { @@ -12928,7 +12940,8 @@ export function contractReviewRecordReading(body) { for (const line of text.split(/\r?\n/)) { // Every heading's own tail is read for an inline FAIL, not only the first one's (nit N3, review 6891926185). const heading = headingLine.exec(line); - if (heading && CONTRACT_REVIEW_VERDICT_INLINE.exec(line.slice(heading.index + heading[0].length))?.[1] === 'FAIL') failSpellings.push(line.trim()); + // …and a caps FAIL anywhere in that tail, not only the first verdict word (`— PASS withdrawn, FAIL`, nit N2 of review 6892305129). + if (heading && (CONTRACT_REVIEW_VERDICT_INLINE.exec(line.slice(heading.index + heading[0].length))?.[1] === 'FAIL' || /\bFAIL(?:ED)?\b/.test(line.slice(heading.index + heading[0].length)))) failSpellings.push(line.trim()); const explicit = CONTRACT_REVIEW_VERDICT_EXPLICIT.exec(line); if (explicit) verdicts.push(explicit[1]); else if (!heading && (CONTRACT_REVIEW_FAIL_KEYED.test(line) || CONTRACT_REVIEW_FAIL_CELL.test(line) || CONTRACT_REVIEW_FAIL_BARE.test(line))) failSpellings.push(line.trim()); @@ -32951,6 +32964,8 @@ async function selfTest() { t43('#33604 S1 (review 6891926185): the measured delta preamble cites, a named finding whose line says closed is closed, `No new should-fix` denies', ['DELTA review from `42323f34` (record 6891274033: PASS, should-fix S3, nits N7 and N8) to this head.', '- **S1 (should-fix): closed.**', 'S1 (should-fix) — closed on this head', 'No new should-fix.', 'must-fix: none'].map(grades43).join(), '|0,|0,|0,|0,|0'); t43('#33604 S2 (review 6891926185): `No must-fix, should-fix S1 and S2 below.` is unreadable (a comma carries no denial); its own `no` after `and` does', [grades43('No must-fix, should-fix S1 and S2 below.'), grades43('No must-fix and no should-fix.')].join(), '|1,|0'); t43('#33604 S2 (review 6891926185): heading-led key, table cell, words before the key, a dash, a bare `FAIL.` and a second heading read FAIL', ['### VERDICT: FAIL', '## Verdict: FAIL', '| Verdict | FAIL |', 'Overall verdict: FAIL', 'Verdict — FAIL', 'FAIL.', '**FAIL.**', '## Contract review — FAIL', '| Verdict | PASS |'].map((l) => read43(l).failSpellings.length).join(), '1,1,1,1,1,1,1,1,0'); + t43('#33604 r3 (review 6892305129): the state word must end the finding — `closed in part`, `Closed PRs …`, `none of …` stay open; `closed here.`, a closed bold title then a sentence, `closed;` close', ['S1 (should-fix): closed in part, still open for X', '**S2 (should-fix) — Closed PRs are still read as merged.**', '- should-fix: none of S1, S2 is fixed', 'S1 (should-fix): closed here.', '- **S1 (should-fix): closed.** Every knock names a key.', 'S1 (should-fix): closed;'].map(grades43).join(), 'S1:should-fix|0,S2:should-fix|0,-:should-fix|0,|0,|0,|0'); + t43('#33604 r3 N2: `Verdict: FAILED`, `Verdict is FAIL`, `Verdict (delta): FAIL`, `| FAIL | Verdict |`, `FAIL!` and a late FAIL in a heading tail read FAIL', ['Verdict: FAILED', 'Verdict is FAIL', 'Verdict (delta): FAIL', '| FAIL | Verdict |', 'FAIL!', '## Contract review — PASS withdrawn, FAIL', 'The verdict is PASS.'].map((l) => read43(l).failSpellings.length).join(), '1,1,1,1,1,1,0'); t43('#33604 reading: no heading is no record (null); the template record reads one PASS, no FAIL, no grade', [contractReviewRecordReading('**VERDICT: PASS**'), JSON.stringify(contractReviewRecordReading(PASS43))].join(), ',{"verdicts":["PASS"],"failSpellings":[],"findings":{"open":[],"unreadable":[]}}'); t43('H43 verdict: latestContractReviewOnHead now carries the verdict beside id and sha', [latestContractReviewOnHead(rows43(ACCEPT43, PASS43), HEAD43)?.verdict, latestContractReviewOnHead(rows43(FAIL43), HEAD43)?.verdict, latestContractReviewOnHead(rows43(PASS43), '0123456789abcdef')].join(), 'PASS,FAIL,'); // The row and the probe, gated on the reading.