From b4c170a6b75e2b8aac6ed74d3f81ec42dc194561 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 3 Dec 2026 14:39:01 +0000 Subject: [PATCH 1/2] =?UTF-8?q?fix(pm):=20settle=20the=20decision-analysis?= =?UTF-8?q?=20tier-line=20gaps=20=E2=80=94=20the=20newest=20analysis=20gov?= =?UTF-8?q?erns,=20a=20Ruling-ref=20comment=20is=20a=20ruling,=20the=20sub?= =?UTF-8?q?-agent=20Analysed-by=20value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - decision-analysis.md: Analysed-by is one session id (a sub-agent's analysis carries the session that dispatched and posts it, as Reviewed-by does); a refused transcript means a sub-agent re-run at tier, never a relabel; the newest analysis governs, and a changed recommendation refreshes the card-top summary body first, the delta in a later minute. - check-owed-reviews --decisions: a newer analysis with no line of the pair supersedes the older carrier and reads missing; a comment whose first content line is Ruling-ref: is a ruling after the carrier (stale). Self-test +5. - label-write: usage and both --tier-evidence refusals name the decision analysis beside the contract review record. - ratchet: decision-analysis.md 5855 -> 6146 (+291) under ruling 7303021478. Refs #38874 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Utp6CaUYMgihyBHZ33ewFC --- .../references/decision-analysis.md | 3 +- scripts/pm/check-owed-reviews.mjs | 51 +++++++++++++++---- scripts/pm/check-skill-line-ratchet.mjs | 3 +- scripts/pm/label-write.mjs | 13 ++--- 4 files changed, 52 insertions(+), 18 deletions(-) diff --git a/.claude/skills/pm-dispatch/references/decision-analysis.md b/.claude/skills/pm-dispatch/references/decision-analysis.md index 3067c48de04..d92f7f5b866 100644 --- a/.claude/skills/pm-dispatch/references/decision-analysis.md +++ b/.claude/skills/pm-dispatch/references/decision-analysis.md @@ -19,9 +19,10 @@ - 问题写客户看到的症状、谁碰到、多频繁;选项句写选了客户看到什么、约几个 PR。 - ⛔ 速读不写代码名、文件路径、命令、裁决字母、裸卡号;点到的卡配一句中文说明。 - 四轴、四棱块、自检行、置信缺口、工作量先例归英文分析段,⛔ 不删。 -- 英文段首两行 `Served-tier: `、`Analysed-by: `(执笔会话或子代理),⛔ 不写模型 id;标 `CONTRACT_REVIEW_TIER` 须执笔转录过 `verify-review-tier.mjs`(评论、新卡、新引入该行的正文刷新经 `--tier-evidence=` 写入即判)。 +- 英文段首两行 `Served-tier: `、`Analysed-by: `(执笔会话;子代理执笔写派它并贴出的会话,同 `Reviewed-by:`),值恰一 token,⛔ 不写散文、模型 id;标 `CONTRACT_REVIEW_TIER` 须执笔转录过 `verify-review-tier.mjs`(评论、新卡、新引入该行的正文刷新经 `--tier-evidence=` 写入即判),拒即子代理达档重跑 ⛔ 不改档名。 - 呈维护者前读该行(`check-owed-reviews.mjs --decisions` 逐卡列):缺或未达档 ⇒ 达档重跑,贴带两行的 delta 评论(逐棱同异)再呈;⛔ 永不呈读不出档的分析。 - 达档且仍现行(载行后无裁决、正文未改)⇒ 照原样呈,只跑前提 re-check,⛔ 不重跑;前提已变 ⇒ 达档重跑。 +- 最新一份分析为准:读最新带两行者,其后无行的分析读作缺行;推荐变了同笔改速读,先刷正文、隔分钟再贴 delta(同分钟读 stale)。 分析段骨架:背景 / Governing text(引文 + grep,或 none found + 检索式)/ 协议声明、是否改协议 / 带 re-check 命令的前提 / 具体问题 / 选项 / 推荐 / 相关单与 PR。正文六项: diff --git a/scripts/pm/check-owed-reviews.mjs b/scripts/pm/check-owed-reviews.mjs index 54916b021cd..81481135881 100644 --- a/scripts/pm/check-owed-reviews.mjs +++ b/scripts/pm/check-owed-reviews.mjs @@ -109,11 +109,15 @@ * the NEWEST text on the card that carries a line of the pair — the body, or a comment (a delta * re-analysis is newer than the body it re-runs): `at-tier`, `below-tier`, `unreadable`, `missing` * (no line anywhere; the row says whether the card carries an analysis at all), or `unjudged` (the - * thread could not be read). Read through the queue guard's author binding, as records are: a body + * thread could not be read). ⛔ The newest ANALYSIS governs, not the newest line: an analysis posted + * after the carrier with no line of the pair reads `missing` (it names the analysis it supersedes and + * the line it leaves unread), never the older line it was written to replace. Read through the queue guard's author binding, as records are: a body * or comment by any other author is never the carrier, and the drops are counted on the row. * carrier the comment id that carries the line, or `body`. * current whether the analysis is still the card's question: `stale` when a ruling comment - * (`classifyRulingComment`, the prior-rulings reader's three measured shapes) follows the carrier, + * (`classifyRulingComment`, the prior-rulings reader's three measured shapes, or a comment whose first + * content line is `Ruling-ref:` — the maintainer ruling a seat records on the card, a grade ruling + * included: the safe direction) follows the carrier, * when the body carries a `Ruled:` record (`ruledRecords`) at or after it, or, for a comment * carrier, when the body's newest protocol stamp (`lastWriteStamp`) is at or after its minute — a * body written since. ⚠️ A body edit that writes no stamp is NOT seen: the REST issue carries no @@ -137,7 +141,7 @@ import process from 'node:process'; import { isEntrypoint } from '../invoked-as.mjs'; import { cardIntakeKeys, CONTRACT_REVIEW_HEADING_MARKER, contractReviewVerdictLines, DECISION_INBOX_LABEL, latestMarkedComment, readSignatureLine, ruledRecords, seatNameId, seatIntakeKeys, signedSeatId, withSeatNumbers } from './check-half-states.mjs'; -import { classifyRulingComment } from './check-prior-rulings.mjs'; +import { classifyRulingComment, firstContentLine } from './check-prior-rulings.mjs'; import { lastWriteStamp } from './post-stamped.mjs'; import { repoIdForSlug } from './check-governed-merges.mjs'; import { GOVERNED_APPROVERS, NARROWING_FACE_LINE, narrowingDeclarationsIn, recordAuthorTrusted, recordTrustedAuthors } from './check-governed-queue-guard.mjs'; @@ -572,6 +576,16 @@ const createdMs = (row) => { const byThreadOrder = (a, b) => createdMs(a) - createdMs(b) || Number(a?.id) - Number(b?.id); const minuteFloor = (ms) => Math.floor(ms / 60000) * 60000; +/** + * A comment that records a maintainer ruling on its first content line, `Ruling-ref: …` (a grade set on a decision + * card, a ruling quoted where a seat executes it). ⛔ Read on the first content line only, after the signature line + * (`firstContentLine`): a claim or a triage audit carrying a `Ruling-ref:` line further down cites a ruling, and is + * not one. Local to this reader: the prior-rulings reader keeps its three shapes. + */ +export function isRulingRefComment(body) { + return /^Ruling-ref\s*[::]/.test(firstContentLine(body)); +} + /** * Whether the analysis on `carrier` is still the card's question — the reasons it is not, empty when it is. Pure. * The bound (an unstamped body edit is unseen) is the header's. @@ -580,8 +594,8 @@ export function decisionCurrency(card, comments, carrier) { const reasons = []; const at = carrier.where === 'body' ? Number.NEGATIVE_INFINITY : createdMs(carrier.row); const after = carrier.where === 'body' ? comments : comments.filter((c) => byThreadOrder(c, carrier.row) > 0); - const ruling = after.find((c) => classifyRulingComment(c?.body) !== null); - if (ruling) reasons.push(`ruling comment ${ruling.id ?? '?'} after it`); + const ruling = after.find((c) => classifyRulingComment(c?.body) !== null || isRulingRefComment(c?.body)); + if (ruling) reasons.push(`ruling comment ${ruling.id ?? '?'} after it${isRulingRefComment(ruling.body) ? ' (`Ruling-ref:`)' : ''}`); const ruled = ruledRecords(card?.body ?? '').find((r) => r.at === null || r.at >= minuteFloor(at)); if (ruled) reasons.push(`body \`Ruled: ${ruled.id}\`${ruled.at === null ? ' (unstamped)' : ''} at or after it`); if (carrier.where === 'comment') { @@ -597,14 +611,18 @@ export function decisionCurrency(card, comments, carrier) { */ export function decisionAnalysisRow(card, comments, trusted = RECORD_AUTHORS) { const base = { card: card?.number ?? null, title: String(card?.title ?? '') }; - if (!Array.isArray(comments)) return { ...base, state: 'unjudged', analysis: null, carrier: null, analysedBy: null, current: null, act: DECISION_ACT_RERUN, ignored: 0, bodyRead: false }; + if (!Array.isArray(comments)) return { ...base, state: 'unjudged', analysis: null, carrier: null, uncarried: null, analysedBy: null, current: null, act: DECISION_ACT_RERUN, ignored: 0, bodyRead: false }; const kept = comments.filter((c) => recordAuthorTrusted(c, trusted)).sort(byThreadOrder); const bodyRead = recordAuthorTrusted(card, trusted); const texts = [ ...(bodyRead ? [{ where: 'body', id: null, row: card, reading: readDecisionAnalysisTier(card.body) }] : []), ...kept.map((c) => ({ where: 'comment', id: c.id ?? null, row: c, reading: readDecisionAnalysisTier(c.body) })), ]; - const carrier = [...texts].reverse().find((x) => x.reading.carriesLine) ?? null; + // The newest ANALYSIS governs: one with no line of the pair supersedes an older carrier and reads `missing`. + const newest = [...texts].reverse().find((x) => x.reading.analysis) ?? null; + const older = [...texts].reverse().find((x) => x.reading.carriesLine) ?? null; + const carrier = newest?.reading.carriesLine ? newest : null; // a line rides only on an analysis, so no analysis ⇒ no line + const uncarried = carrier === null && newest !== null && older !== null ? { where: newest.where, id: newest.id, supersedes: older.where === 'body' ? 'body' : older.id } : null; const state = carrier === null ? 'missing' : carrier.reading.state; const current = carrier === null ? null : decisionCurrency(card, kept, carrier); const by = carrier?.reading.analysedBy; @@ -613,6 +631,7 @@ export function decisionAnalysisRow(card, comments, trusted = RECORD_AUTHORS) { state, analysis: texts.some((x) => x.reading.analysis), carrier: carrier === null ? null : { where: carrier.where, id: carrier.id, at: carrier.row?.created_at ?? null }, + uncarried, analysedBy: by === undefined ? null : by.state === 'read' ? by.value : by.state, current, act: state === 'at-tier' && current?.state === 'current' ? DECISION_ACT_PRESENT : DECISION_ACT_RERUN, @@ -633,6 +652,7 @@ export function renderDecisionRow(row) { const where = row.carrier === null ? null : row.carrier.where === 'body' ? 'line in the body' : `line on comment ${row.carrier.id}`; const parts = [`#${row.card} ${row.state}`]; if (row.state === 'unjudged') parts.push('thread not read'); + else if (row.uncarried) parts.push(`newer analysis ${row.uncarried.where === 'body' ? 'in the body' : `on comment ${row.uncarried.id}`} carries no Served-tier / Analysed-by line (supersedes the line ${row.uncarried.supersedes === 'body' ? 'in the body' : `on comment ${row.uncarried.supersedes}`})`); else if (row.carrier === null) parts.push(row.analysis ? 'analysis carries no Served-tier / Analysed-by line' : 'no analysis found on the card'); else parts.push(`${where} (Analysed-by ${row.analysedBy})`, row.current.state === 'current' ? 'current' : `stale: ${row.current.reasons.join('; ')}`); const dropped = row.ignored > 0 || (row.bodyRead === false && row.state !== 'unjudged') ? ` (${row.bodyRead ? '' : 'body by an untrusted author not read; '}${row.ignored} comment(s) by an untrusted author not read)` : ''; @@ -653,7 +673,7 @@ export function renderDecisionReport(rows, { repo, now, gaps }) { if (gaps.length > 0) lines.push('', `⚠️ sweep INCOMPLETE — ${gaps.length} read(s) failed; the rows above are not the whole answer:`, ...gaps.map((g) => ` - ${g}`)); lines.push( '', - '`current` reads ruling comments, `Ruled:` records and the body\'s newest stamp; a body edit that writes no stamp is not seen (REST carries no body-edit time) — the premise re-check covers it.', + '`current` reads ruling comments (a first-line `Ruling-ref:` too), `Ruled:` records and the body\'s newest stamp; a body edit that writes no stamp is not seen (REST carries no body-edit time) — the premise re-check covers it.', 'Report-only: exit 0, nothing written. The rule is `references/decision-analysis.md` 〈落卡分析模板〉.', ); return lines; @@ -807,7 +827,7 @@ const SELF_TEST_BATTERIES = Object.freeze({ 'the report: one line per owing PR, TAKE first, exit 0': 5, 'the hold: a live hold on this head holds (b) alone, (a) and (c) still fire; a new head clears it; at 24 hours it is listed, still WAIT': 14, // The decision box (`--decisions`): the analysis tier read by the record's own parser, its carrier, its currency. - 'the decision box: each open needs-user-decision card\'s analysis tier on its newest carrier — at tier, below, missing, unjudged — whether it is still current, and what the seat does with it': 16, + 'the decision box: each open needs-user-decision card\'s analysis tier on its newest carrier — at tier, below, missing, unjudged — whether it is still current, and what the seat does with it': 21, }); const SELF_TEST_BATTERY_FLOOR = 10; const UNATTRIBUTED_BATTERY = '(no battery open)'; @@ -1074,6 +1094,17 @@ export function selfTest() { t('⭐ MISSING — an analysis with no line ⇒ re-run, and the row says the card does carry an analysis', r4.state === 'missing' && r4.carrier === null && r4.analysis === true && r4.act === DECISION_ACT_RERUN && renderDecisionRow(r4).includes('analysis carries no Served-tier')); t('…and a card with no analysis at all says so', renderDecisionRow(decisionAnalysisRow(card({ body: `${DSIG}\nA plain question.` }), [])).includes('no analysis found on the card')); t('⭐ the NEWEST carrier governs, both ways — an at-tier body under a TIER_DEFAULT delta is below tier, and the reverse is at tier', decisionAnalysisRow(card({ body: analysisBody(AT) }), [delta(7301, '2026-11-30T09:00:00Z', 'TIER_DEFAULT')]).state === 'below-tier' && decisionAnalysisRow(card({ body: analysisBody('TIER_DEFAULT') }), [delta(7301, '2026-11-30T09:00:00Z')]).state === 'at-tier'); + // A later analysis with no line of the pair supersedes the older carrier (#38874 N-a): the newest ANALYSIS governs. + const bare = (id, at) => cmt(id, at, `${DSIG}\n## Re-analysis\n\nos-decision-facets\n- ① 项目长远合理性:changed.\n\nThis seat now recommends **B**.`); + const r5 = decisionAnalysisRow(card(), [delta(7301, '2026-11-30T09:00:00Z'), bare(7303, '2026-11-30T11:00:00Z')]); + t('⛔ a NEWER analysis with no line supersedes the at-tier carrier ⇒ missing, re-run; the row names both comments', r5.state === 'missing' && r5.carrier === null && r5.act === DECISION_ACT_RERUN && r5.uncarried?.id === 7303 && r5.uncarried?.supersedes === 7301 && renderDecisionRow(r5).includes('newer analysis on comment 7303') && renderDecisionRow(r5).includes('line on comment 7301'), JSON.stringify(r5)); + t('…while a newer comment that is no analysis (a plain note) leaves the carrier governing', decisionAnalysisRow(card(), [delta(7301, '2026-11-30T09:00:00Z'), cmt(7304, '2026-11-30T11:00:00Z', `${DSIG}\nPremise re-checked: holds.`)]).act === DECISION_ACT_PRESENT); + // A maintainer ruling recorded on its first content line as `Ruling-ref:` (#38874 N-b, e.g. a grade ruling). + const ref = (id, at, first) => cmt(id, at, `${DSIG}\n\n${first}\nQuestion, verbatim: 「x」`); + t('⛔ a comment whose FIRST content line is `Ruling-ref:` after the carrier is a ruling ⇒ stale, and the reason says so', (() => { const r = decisionAnalysisRow(card(), [delta(7301, '2026-11-30T09:00:00Z'), ref(7305, '2026-11-30T10:00:00Z', 'Ruling-ref: priority:p2 · 2026-11-30T09:59Z · a grade set by the maintainer.')]); return r.current.state === 'stale' && r.current.reasons[0].includes('7305') && r.current.reasons[0].includes('Ruling-ref') && r.act === DECISION_ACT_RERUN; })()); + t('…while a claim that CITES a ruling on a later line is not one ⇒ still current', decisionAnalysisRow(card(), [delta(7301, '2026-11-30T09:00:00Z'), ref(7306, '2026-11-30T10:00:00Z', 'Claim: PM loop round 4\nRuling-ref: 7300000001')]).current.state === 'current' && isRulingRefComment(`${DSIG}\n**Ruling-ref:** 7303021478`) && !isRulingRefComment('Claim: x\nRuling-ref: 1')); + // The refresh order the rule states (#38874 N-c): body first, the delta in a LATER minute; the same minute reads stale. + t('⭐ body refreshed first, delta posted in a later minute ⇒ current; the same minute ⇒ stale (stamps read to the minute, the safe direction)', decisionAnalysisRow(card({ body: analysisBody(null, 'Refreshed 2026-11-30T09:00Z.') }), [delta(7301, '2026-11-30T09:01:10Z')]).current.state === 'current' && decisionAnalysisRow(card({ body: analysisBody(null, 'Refreshed 2026-11-30T09:01Z.') }), [delta(7301, '2026-11-30T09:01:50Z')]).current.state === 'stale'); t('⛔ the author binding: an at-tier delta by an untrusted author is never the carrier, and the drop is counted and printed', (() => { const r = decisionAnalysisRow(card(), [delta(7301, '2026-11-30T09:00:00Z')].map((c) => ({ ...c, user: { login: 'drive-by' } }))); return r.state === 'missing' && r.ignored === 1 && renderDecisionRow(r).includes('1 comment(s) by an untrusted author not read'); })()); t('⛔ …and a body by an untrusted author is not read either', (() => { const r = decisionAnalysisRow(card({ body: analysisBody(AT), user: { login: 'drive-by' } }), []); return r.state === 'missing' && r.bodyRead === false && renderDecisionRow(r).includes('body by an untrusted author not read'); })()); t('⛔ a `## Contract review` record on the card is not an analysis\'s carrier', decisionAnalysisRow(card(), [recordRow(HEAD)]).state === 'missing'); @@ -1112,7 +1143,7 @@ export function selfTest() { + 'the (a) / (b) / (c) triggers and the taker — the seat a hand-off names, an L2 seat on the delta of its own record, else the lane seat, never triage; claims holding and lapsing, the earliest live claim holding; the two live drafts as TAKE; ' + 'every read through one reader with failures as gaps; the report, exit 0; a lane\'s live hold holding (b) alone, ' + 'cleared by a new head, an unreadable hold line voiding nothing and printed, listed at 24 hours and still WAIT; ' - + 'the decision box — each analysis\'s tier on its newest trusted carrier, at tier, below, missing or unjudged, stale after a ruling or a body written since, and present-as-it-stands only at tier and current).', + + 'the decision box — each analysis\'s tier on its newest trusted carrier, at tier, below, missing or unjudged, a newer analysis with no line reading missing, stale after a ruling (a first-line `Ruling-ref:` too) or a body written since, and present-as-it-stands only at tier and current).', ); selfTestReachedVerdict = true; return 0; diff --git a/scripts/pm/check-skill-line-ratchet.mjs b/scripts/pm/check-skill-line-ratchet.mjs index a2e14732e26..1984a8462a6 100644 --- a/scripts/pm/check-skill-line-ratchet.mjs +++ b/scripts/pm/check-skill-line-ratchet.mjs @@ -85,7 +85,7 @@ export const CEILINGS = new Map([ ['.claude/skills/pm-dispatch/references/dispatch-runbook.md', 20483], // raised 20070 → 20354 (+284) by ruling record 7075909669 (#36203 items 1-5: 「同意五条都改」): a card thread confirms Actions started after each push; the seat reads pr-state of every in-flight card PR; lowered 20354 → 20344 by the PR that moved the tier and effort values to the one home; raised 20344 → 20483 (+139) by ruling record 7076315104 (Q13, the decision card 「定一下:五条新增规则要不要写进技能」: 「五条都写」): the thread's first report carries the served tier and the seat writes it into the claim ['.claude/skills/pm-dispatch/references/state-machine.md', 4243], // raised 4189 → 4243 (+54, the landed bytes) by the maintainer's ruling quoted in the body of the rule card and recorded by triage record 7254553088 (「立卡改技能,现在就派发」): lane seats unlock their own blocked cards every round and first-touch the cards they file ['.claude/skills/pm-dispatch/references/contract-review.md', 6420], // raised 6419 → 6420 (+1) by ruling record 7249169754 (Q1 A: 「同意,立卡派发」): the hand-off line names its target seat `LANE@ACCOUNT`, the template `record-recognisers.mjs` holds verbatim - ['.claude/skills/pm-dispatch/references/decision-analysis.md', 5855], // raised 5580 → 5855 (+275, the landed bytes) by ruling record 7303021478 (「升 p2,交 fleet 区现在做」, with the maintainer's 「之前已经用 fable 分析过的不用重复分析吧?」): an analysis at tier and still current is presented as it stands with a premise re-check, the per-card reading that says so is named, and the `--tier-evidence=` parenthetical now names the three writes that judge an analysis (a comment, a new card, a body refresh introducing the line) — recorded under `ruledRaises` on this file's move declaration below; before that: lowered 5589 → 5580 by the decision-analysis tier-line PR (its worked 速读 example deleted to pay for the `Served-tier:` / `Analysed-by:` lines); before that: raised 5023 → 5589 (+566) by the declared cross-file move from SKILL.md (CROSS_FILE_MOVES below); before that: raised 4892 → 5023 (+131) by ruling record 7076338827, the addendum to 7076315104 (a simple question goes to the maintainer in chat after the at-tier analysis: 「不一定要写成文件吧?简单的问题是不是直接和我沟通就可以」) + ['.claude/skills/pm-dispatch/references/decision-analysis.md', 6146], // raised 5855 → 6146 (+291, the landed bytes) by ruling record 7303021478 again, for the gaps its scope left in the same lines (card #38874): the `Analysed-by:` value for a sub-agent's analysis, the refused-transcript branch of the `--tier-evidence=` check, and which analysis a later reader takes and in what order a refresh is written — recorded under `ruledRaises` below; before that: raised 5580 → 5855 (+275, the landed bytes) by ruling record 7303021478 (「升 p2,交 fleet 区现在做」, with the maintainer's 「之前已经用 fable 分析过的不用重复分析吧?」): an analysis at tier and still current is presented as it stands with a premise re-check, the per-card reading that says so is named, and the `--tier-evidence=` parenthetical now names the three writes that judge an analysis (a comment, a new card, a body refresh introducing the line) — recorded under `ruledRaises` on this file's move declaration below; before that: lowered 5589 → 5580 by the decision-analysis tier-line PR (its worked 速读 example deleted to pay for the `Served-tier:` / `Analysed-by:` lines); before that: raised 5023 → 5589 (+566) by the declared cross-file move from SKILL.md (CROSS_FILE_MOVES below); before that: raised 4892 → 5023 (+131) by ruling record 7076338827, the addendum to 7076315104 (a simple question goes to the maintainer in chat after the at-tier analysis: 「不一定要写成文件吧?简单的问题是不是直接和我沟通就可以」) ['.claude/skills/pm-dispatch/references/platform-readings.md', 1082], ['.claude/skills/pm-dispatch/references/readings-queue.md', 9074], ['.claude/skills/pm-dispatch/references/readings-channels.md', 7138], @@ -200,6 +200,7 @@ export const CROSS_FILE_MOVES = new Map([ sources: [['.claude/skills/pm-dispatch/SKILL.md', 33919]], ruledRaises: [ { ruling: 'ruling record 7303021478 — 「升 p2,交 fleet 区现在做」: an at-tier, still-current analysis is presented as it stands, with a premise re-check', date: '2026-12-01', delta: 275 }, + { ruling: 'ruling record 7303021478 — 「升 p2,交 fleet 区现在做」: the tier-line gaps its scope left (#38874 — the sub-agent `Analysed-by:` value, the refused-transcript branch, the newest analysis governs and the refresh order)', date: '2026-12-03', delta: 291 }, ], }], ]); diff --git a/scripts/pm/label-write.mjs b/scripts/pm/label-write.mjs index 0e8cd6f0836..2e078806d47 100644 --- a/scripts/pm/label-write.mjs +++ b/scripts/pm/label-write.mjs @@ -166,8 +166,9 @@ * * judged by post-stamped's `judgeBody`, the ONE path its own `--comment` takes: the stamp contract with * `{{NOW}}` read by this act, the signature first line, a claim's keyed lines, a record's line, - * a record's tier (a record naming `CONTRACT_REVIEW_TIER` folds only with `--tier-evidence PATH`, - * the reviewing run's transcript `verify-review-tier.mjs` passes), the decision facets. A refusal + * a record's tier (a record or a decision analysis naming `CONTRACT_REVIEW_TIER` folds only with + * `--tier-evidence PATH`, the reviewing or analysing run's transcript `verify-review-tier.mjs` passes), + * the decision facets. A refusal * is exit 2 with zero writes, its text post-stamped's own, naming this tool. * paced as every stroke: the dispatch POST behind `write-pace`, every write in it spaced by the executor. * read back after a success run, each part on its own line: `④ labels` and `④ assignees` against the ② @@ -1325,8 +1326,8 @@ export function parseOptions(argv) { if (opts.clearAssignees && (opts.assign.length || opts.unassign.length)) { return { ok: false, error: '--clear-assignees cannot be combined with --assign/--unassign' }; } - if (opts.tierEvidence !== null && !opts.commentFile) return { ok: false, error: '--tier-evidence PATH is the transcript behind a `## Contract review` record and travels with --comment-file PATH; alone it judges nothing' }; - if (opts.tierEvidence === '') return { ok: false, error: '--tier-evidence names no file: pass the reviewing run\'s transcript, --tier-evidence PATH' }; + if (opts.tierEvidence !== null && !opts.commentFile) return { ok: false, error: '--tier-evidence PATH is the transcript behind a `## Contract review` record or a decision analysis naming CONTRACT_REVIEW_TIER, and travels with --comment-file PATH; alone it judges nothing' }; + if (opts.tierEvidence === '') return { ok: false, error: '--tier-evidence names no file: pass the reviewing or analysing run\'s transcript, --tier-evidence PATH' }; // ── `--handoff` owns its plan (header): the label is fixed, the reviewers and the author's assignment are read ── if (opts.handoff) { if (opts.land) return { ok: false, error: '--handoff leaves a Tier H pull DRAFT for the maintainer\'s merge and --land readies and arms one — the two never share a stroke' }; @@ -1372,8 +1373,8 @@ const USAGE = [ ' pr_ready then automerge_enable on a pull request. RELAY-ONLY; every part is read back on its own ④ line.', ' --land on a pull whose title carries `!` or whose Clause-② line a (narrowing) arm first needs a `success` check run', ' named `Dogfood battery (opt-in)` on the head sha (label `needs:dogfood-battery`), and a diff that leaves that lane alone; else exit 2.', - ' A `## Contract review` record naming CONTRACT_REVIEW_TIER folds only with --tier-evidence PATH, the reviewing run\'s', - ' transcript, passed by verify-review-tier.mjs (post-stamped\'s rule; the path stays local).', + ' A `## Contract review` record or a decision analysis naming CONTRACT_REVIEW_TIER folds only with --tier-evidence PATH,', + ' the reviewing or analysing run\'s transcript, passed by verify-review-tier.mjs (post-stamped\'s rule; the path stays local).', ' --handoff hands a Tier H pull to its approvers in ONE stroke: the request comment, `pm:awaiting-merge`, the', ' author-approver assigned, every other uncovered GOVERNED_APPROVERS account requested; read back with H43 and H48.', ' Refused (exit 2, zero writes) unless check-governed-merges --pr reads Tier H (or the size limb) and the thread holds', From c9ca2157acc2252b953484a769c774779765eecf Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 3 Dec 2026 14:41:36 +0000 Subject: [PATCH 2/2] =?UTF-8?q?fix(pm):=20the=20decision=20listing=20state?= =?UTF-8?q?s=20its=20scope=20=E2=80=94=20this=20repository=20only=20(#3887?= =?UTF-8?q?4=20N-f)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Utp6CaUYMgihyBHZ33ewFC --- scripts/pm/check-owed-reviews.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/pm/check-owed-reviews.mjs b/scripts/pm/check-owed-reviews.mjs index 81481135881..c460c9dc683 100644 --- a/scripts/pm/check-owed-reviews.mjs +++ b/scripts/pm/check-owed-reviews.mjs @@ -664,7 +664,7 @@ export function renderDecisionReport(rows, { repo, now, gaps }) { const n = (pred) => rows.filter(pred).length; const present = n((r) => r.act === DECISION_ACT_PRESENT); const lines = [ - `check-owed-reviews --decisions — ${repo}, ${new Date(now).toISOString().replace(/:\d\d\.\d{3}Z$/, 'Z')}: ${rows.length} open \`${DECISION_INBOX_LABEL}\` card(s); ` + `check-owed-reviews --decisions — ${repo}, ${new Date(now).toISOString().replace(/:\d\d\.\d{3}Z$/, 'Z')}: ${rows.length} open \`${DECISION_INBOX_LABEL}\` card(s), this repository only (another repository's box: --repo OWNER/NAME); ` + `${present} at tier and current (${DECISION_ACT_PRESENT}), ${rows.length - present} to re-run at tier — ` + `${n((r) => r.state === 'at-tier') - present} at tier but stale, ${n((r) => r.state === 'below-tier')} below tier, ${n((r) => r.state === 'missing')} missing, ${n((r) => r.state === 'unreadable')} unreadable, ${n((r) => r.state === 'unjudged')} unjudged.`, '', @@ -827,7 +827,7 @@ const SELF_TEST_BATTERIES = Object.freeze({ 'the report: one line per owing PR, TAKE first, exit 0': 5, 'the hold: a live hold on this head holds (b) alone, (a) and (c) still fire; a new head clears it; at 24 hours it is listed, still WAIT': 14, // The decision box (`--decisions`): the analysis tier read by the record's own parser, its carrier, its currency. - 'the decision box: each open needs-user-decision card\'s analysis tier on its newest carrier — at tier, below, missing, unjudged — whether it is still current, and what the seat does with it': 21, + 'the decision box: each open needs-user-decision card\'s analysis tier on its newest carrier — at tier, below, missing, unjudged — whether it is still current, and what the seat does with it': 22, }); const SELF_TEST_BATTERY_FLOOR = 10; const UNATTRIBUTED_BATTERY = '(no battery open)'; @@ -1118,6 +1118,7 @@ export function selfTest() { }; const out = []; const code = main(['--decisions', '--now', '2026-12-01T00:00:00Z'], { get: boxGet, log: (l) => out.push(l) }); + t('the report states its SCOPE — one repository, and how to read another (#38874 N-f)', renderDecisionReport([], { repo: 'objectstack-ai/objectstack', now: Date.parse('2026-12-01T00:00:00Z'), gaps: [] })[0].includes('this repository only')); t('the live read: the label listing through the one reader, a PR dropped, a failed thread a GAP and its card unjudged, exit 0', code === EXIT_OK && boxPaths[0].includes(`labels=${encodeURIComponent(DECISION_INBOX_LABEL)}`) && boxPaths[0].includes('state=open') && out.some((l) => l.startsWith('#38700 unjudged')) && out.some((l) => l.includes('sweep INCOMPLETE')) && !out.some((l) => l.startsWith('#1 ')), out.join(' | ')); t('the report: re-run rows first, the present row last, and the bound on body edits printed', (() => { const i = out.findIndex((l) => l.startsWith('#38700')); const j = out.findIndex((l) => l.startsWith('#38624')); return i > 0 && j > i && out[j].endsWith('A decision') && out[j].includes(DECISION_ACT_PRESENT) && out.some((l) => l.includes('a body edit that writes no stamp is not seen')); })(), out.join(' | ')); }