Skip to content

Commit 168cb1e

Browse files
committed
pm-dispatch(review): bound the window-red anchor to first-touch grading, restore triage's scope bound, and read a hold per head so an unreadable line voids nothing
triage-duties.md: the window line files an anchor for every unanchored red and grades it as first touch does (main full red and a deterministic queue red p0, a flake anchor raised only once read as deterministic), so it no longer grades wider than the line two below. A first line restores a true scope bound: this file plus the clauses elsewhere in the skill that name triage (review, answering pm:retriage, convention 3) are the seat's whole remit. Paid by folding the decision-batching line, whose home is the director charter's ruling duty (batches of at most five, one reply per batch) under SKILL.md's one presenting seat. record-recognisers.mjs: contractReviewHold reads per head. The newest readable hold naming the current head is live whatever is posted after it; a newer hold naming an earlier head or a line that cannot be read voids nothing; every unreadable hold line is returned by comment id on every reading; only unreadable lines read unreadable and hold nothing. Self-test: hold battery 19 -> 23 cases. check-owed-reviews.mjs: the row carries the unreadable hold lines and prints them beside a live or stale hold. Self-test: hold battery 13 -> 14. Claude-Session: https://claude.ai/code/session_01QSeKYmhU5KEj1nukYhp1Tg Co-authored-by: Claude <noreply@anthropic.com>
1 parent 167b002 commit 168cb1e

3 files changed

Lines changed: 98 additions & 43 deletions

File tree

‎.claude/skills/pm-dispatch/references/triage-duties.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 分诊座位职责
22

3+
- 本文与技能他处点名分诊之条(复审、摘 `pm:retriage`、约定③ 等)即分诊座位的全部职责。
34
- fire 开局只按名加载互斥检查所需工具,`ToolSearch` 用 `select:`;判定本轮有活才加载其余。
45
- ⛔ 分诊 fresh session 开局不做泛关键词 ToolSearch;可验判据:空转轮 ~4 万 token 以内。
56
- 两级盘点:小时轮以 `since` 窗口读增量,锚 = 座位贴上一份收班简报的时间戳。
@@ -24,7 +25,7 @@
2425
- 裸卡数 >15 ⇒ 下一 fire 整轮改域分批集中模式,每批 ≤5 张同族卡,照样跑到清空。
2526
- 紧急卡直接分诊:维护者点名或 p0 嫌疑 ⇒ 立即起默认判断档分诊子代理,不等定时轮。
2627
- 每轮读上份轮次记录 fire 以来全部 main push、schedule 与队列结论,⛔ 不只读最新一跑。
27-
- 窗内无锚红当轮立 p0 锚卡,main 已转绿照立并点名承修卡;逾 90 分钟无记录则记明断档。
28+
- 窗内无锚红当轮立锚卡、照首触定级,转绿照立并点名承修卡;逾 90 分钟无记录记明断档。
2829
- main-red 锚卡由席位先立先派,首触事后补作记录级:可改域,⛔ 不改动作,在飞照补。
2930
- 主干全量红与确定性队列红首触定 p0(锚卡、根因卡、full-run 卡);flake 锚卡判确定性才升。
3031
- 车道席自分诊:本车道卡挡自有在飞(认领卡/PR/落地/拆分链)且证据清楚,方可首触定 p1/p2。
@@ -96,7 +97,6 @@
9697
- 轮次报告设呈裁清单专节(卡、推荐、所引权威),⛔ 无代裁清单、无追认表。
9798
- 回翻条款:实施中发现契约终究要动 ⇒ dev 停手,卡回决策箱,⛔ 永不静默重裁。
9899
- 请示纪律:方向性授权覆盖整条执行链一并做完,⛔ 不逐项回问。
99-
- 需裁事项攒批(≤5 项/批,每项一行带推荐),一句同意即全链执行。
100100
- 中间状态与限流/重试类运维细节只进座位贴和触发器,⛔ 不弹给维护者。
101101
- 汇报只在里程碑、真阻塞、被问到时。
102102
- 人工地板项(发版、天花板、契约扩大)仍需明确字句,但攒批不逐项弹。

‎scripts/pm/check-owed-reviews.mjs‎

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,16 @@
4141
* `unreadable`.
4242
* claim the `Contract-review-claim:` lines: `live` (who holds the head,
4343
* the lane winning a tie), `lapsed`, `none`.
44-
* hold the newest `Contract-review-hold:` line, as `contractReviewHold`
45-
* reads it: `live` (it names the current head: trigger (b) does not
46-
* fire, and its age is printed), `stale` (the head moved: cleared),
47-
* `absent`, `unreadable` (it holds nothing). A live hold at
48-
* `CONTRACT_REVIEW_HOLD_LIST_HOURS` or older on a WAIT row is LISTED,
49-
* for the triage round record — the age is a reading, never a lapse.
44+
* hold the `Contract-review-hold:` lines, as `contractReviewHold` reads
45+
* them, per head: `live` (a readable hold names the current head:
46+
* trigger (b) does not fire, and its age is printed), `stale` (the
47+
* head moved past every readable hold: cleared), `absent`,
48+
* `unreadable` (every hold line is unreadable: it holds nothing). An
49+
* unreadable line beside a live or stale reading voids nothing and is
50+
* PRINTED on the row by comment id, so the gap is never silent. A live
51+
* hold at `CONTRACT_REVIEW_HOLD_LIST_HOURS` or older on a WAIT row is
52+
* LISTED, for the triage round record — the age is a reading, never a
53+
* lapse.
5054
* lane seat the lane of the PR's card (`domain:*`) against the open seat
5155
* posts: `seated`, `stood-down`, `absent`, `unknown`.
5256
* status `TAKE` (owed, nobody on it, a trigger holds), `WAIT` (owed,
@@ -81,6 +85,7 @@ import { parseSeat } from './fleet-roster.mjs';
8185
import { ghApi, readAllPages } from './gh-pages.mjs';
8286
import {
8387
CONTRACT_REVIEW_HOLD_LIST_HOURS,
88+
CONTRACT_REVIEW_HOLD_TEMPLATE,
8489
REVIEWED_BY_LINE,
8590
contractReviewClaims,
8691
contractReviewHandoff,
@@ -278,6 +283,7 @@ export function owedReviewRow(pull, { now, seats, repo = DEFAULT_REPO }) {
278283
holds: hold.state === 'live' ? roundWaited : null,
279284
listed,
280285
gaps: hold.gaps ?? [],
286+
unreadable: hold.unreadable ?? [],
281287
},
282288
lane: lane.lane,
283289
laneSeat: lane.seat,
@@ -329,13 +335,21 @@ function holdAge(hold) {
329335
return hold.ageMinutes === null ? 'age unknown' : `${Math.floor(hold.ageMinutes / 60)} h old`;
330336
}
331337

332-
/** The hold part of a row: who holds, since when, until what, and the (b) it holds. Pure. */
338+
/**
339+
* The hold part of a row: who holds, since when, until what, and the (b) it holds — and, beside a live
340+
* or stale reading, every hold line that could not be read, by comment id: it voided nothing, and
341+
* it is printed so the gap is seen. Pure.
342+
*/
333343
function holdText(hold) {
344+
const unread = hold.unreadable ?? [];
345+
const gap = hold.state !== 'unreadable' && unread.length > 0
346+
? ` ⚠️ ${unread.length} unreadable hold line(s) (${unread.map((u) => u.id ?? '?').join(', ')})`
347+
: '';
334348
if (hold.state === 'live') {
335349
const holds = hold.holds === null ? '' : `, holds ${hold.holds}`;
336-
return `live ${hold.session} (${hold.id}, ${holdAge(hold)}${holds}) until ${hold.until}`;
350+
return `live ${hold.session} (${hold.id}, ${holdAge(hold)}${holds}) until ${hold.until}${gap}`;
337351
}
338-
if (hold.state === 'stale' || hold.state === 'unreadable') return `${hold.state}${hold.id === null ? '' : ` (${hold.id})`}`;
352+
if (hold.state === 'stale' || hold.state === 'unreadable') return `${hold.state}${hold.id === null ? '' : ` (${hold.id})`}${gap}`;
339353
return hold.state;
340354
}
341355

@@ -463,7 +477,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
463477
'the live instance: two Tier H drafts with a hand-off on the current head list as TAKE under (a)': 4,
464478
'the live read: every read through one reader; a failed read is INCOMPLETE, never clean': 6,
465479
'the report: one line per owing PR, TAKE first, exit 0': 5,
466-
'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': 13,
480+
'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,
467481
});
468482
const SELF_TEST_BATTERY_FLOOR = 9;
469483
const UNATTRIBUTED_BATTERY = '(no battery open)';
@@ -622,6 +636,10 @@ export function selfTest() {
622636
t('⭐ (a) still fires under a live hold — the label or a hand-off on this head is the holding lane ending its hold ⇒ TAKE', row({ headCommittedAt: ripe, labels: [{ name: WAITING_LABEL }], comments: [holdRow(HEAD, heldAt)] }).trigger === '(a) label' && row({ headCommittedAt: ripe, comments: [holdRow(HEAD, heldAt), handoff(HEAD, '2026-10-28T12:40:00Z')] }).trigger === '(a) hand-off');
623637
t('(c) still fires under a live hold — a lane seat that is gone holds nothing', row({ headCommittedAt: ripe, comments: [holdRow(HEAD, heldAt)] }, [{ lane: 'domain:ui', status: 'paused' }]).trigger === '(c) lane seat stood-down');
624638
t('⛔ an unreadable hold holds nothing ⇒ (b) fires, and the row names the hold comment as unreadable', (() => { const r = row({ headCommittedAt: ripe, comments: [{ id: 7701, created_at: heldAt, body: 'Contract-review-hold: soon' }] }); return r.hold.state === 'unreadable' && r.status === 'TAKE' && renderRow(r).includes('hold unreadable (7701)'); })());
639+
// A later comment quoting the template line at a line start (a round record, a seat note, a review) is unreadable.
640+
const quotedTemplate = { id: 7701, created_at: '2026-10-28T12:40:00Z', body: `triage#1 · os-zhuang · ${TRIAGE}\n\nRound record: lanes hold a head with\n- \`${CONTRACT_REVIEW_HOLD_TEMPLATE}\`` };
641+
const voided = row({ headCommittedAt: ripe, comments: [holdRow(HEAD, heldAt), quotedTemplate] });
642+
t('⭐ an unreadable hold line NEWER than a live hold on this head voids nothing — the row stays WAIT under the live hold and PRINTS the unreadable line by comment id; the control (no such line) is WAIT with no mark', voided.status === 'WAIT' && voided.trigger === 'none yet' && voided.hold.state === 'live' && voided.hold.id === 6472451890 && voided.hold.holds === '(b) waited 61 min' && voided.hold.unreadable.length === 1 && voided.hold.unreadable[0].id === 7701 && renderRow(voided).includes('until the last sibling PR merges ⚠️ 1 unreadable hold line(s) (7701)') && held.status === 'WAIT' && held.hold.unreadable.length === 0 && !renderRow(held).includes('unreadable'), renderRow(voided));
625643
t('a hold changes neither a live claim (HELD) nor a record on this head (DONE)', row({ headCommittedAt: ripe, comments: [holdRow(HEAD, heldAt), claimRow(TRIAGE, HEAD, '2026-10-28T12:18:56Z', `triage#1 · os-zhuang · ${TRIAGE}`)] }).status === 'HELD' && row({ headCommittedAt: ripe, comments: [holdRow(HEAD, heldAt), recordRow(HEAD)] }).status === 'DONE');
626644
const aged = row({ headCommittedAt: '2026-10-27T08:00:00Z', comments: [holdRow(HEAD, '2026-10-27T13:00:00Z')] });
627645
t('⭐ at 24 hours the hold reads overdue and STILL holds — the row stays WAIT, no fifth status — and the row is LISTED for the round record', aged.status === 'WAIT' && aged.hold.state === 'live' && aged.hold.overdue === true && aged.hold.listed === true && renderRow(aged).includes('⏳ HOLD 24 h old — list it in the triage round record'), renderRow(aged));
@@ -654,7 +672,7 @@ export function selfTest() {
654672
+ 'the Clause-② line and the label, drafts included; the record on this head, an earlier head, none, unjudged; '
655673
+ 'the (a) / (b) / (c) triggers; claims holding and lapsing, the lane winning a tie; the two live drafts as TAKE; '
656674
+ 'every read through one reader with failures as gaps; the report, exit 0; a lane\'s live hold holding (b) alone, '
657-
+ 'cleared by a new head, listed at 24 hours and still WAIT).',
675+
+ 'cleared by a new head, an unreadable hold line voiding nothing and printed, listed at 24 hours and still WAIT).',
658676
);
659677
selfTestReachedVerdict = true;
660678
return 0;

0 commit comments

Comments
 (0)