Skip to content

Commit 7df996e

Browse files
committed
fix(pm-dispatch): a tied review claim is held by the earliest live claim, and the hand-off template is pinned
The rule text now says what the claim reader does: when two claims are live on one head the earliest holds and the later withdraws. The comments that said the lane wins a tie follow it; the claim reader is unchanged. The hand-off template is exported as CONTRACT_REVIEW_HANDOFF_TEMPLATE and pinned verbatim against the rule text, with a case proving the template sent unedited is unreadable. Claude-Session: https://claude.ai/code/session_01J8VVAka2VdDFVA5VvZmmgK Co-authored-by: Claude <noreply@anthropic.com>
1 parent cf3a139 commit 7df996e

3 files changed

Lines changed: 30 additions & 20 deletions

File tree

‎.claude/skills/pm-dispatch/references/contract-review.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- (c) 车道收班或离总表:欠审入交班简报待下席或复审席;清单 `scripts/pm/check-owed-reviews.mjs`。
2626
- 车道或复审席起审前读 PR:现 head 有记录或活认领 ⇒ ⛔ 不起;否则先落认领行,一 head 一行:
2727
- `Contract-review-claim: <session> · head <full sha> · <UTC>`
28-
- 认领随 head 移动或贴后 2 小时无记录失效;同 head 双认 ⇒ 车道胜,他方回帖撤回、弃产出。
28+
- 认领随 head 移动或贴后 2 小时无记录失效;双认 ⇒ 先贴者持有,后者回帖撤回、弃产出。
2929
- 车道暂缓本 head 送审落 `Contract-review-hold: <session> · head <sha> · <reason> · until <condition>`
3030
- 新 head 即清;点名现 head 时 (b) 不起;条件满足由持有车道挂等复核标记或落交接行。
3131
- 逾 24 小时条件未满的 hold 列入分诊轮次记录(`check-owed-reviews.mjs` 标出)。

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* to: `review#N` or `domain:<lane>#N`), `stale`, `absent`, `unreadable`
4343
* (a line still naming `triage` is unreadable: it hands to nobody).
4444
* claim the `Contract-review-claim:` lines: `live` (who holds the head,
45-
* the lane winning a tie), `lapsed`, `none`.
45+
* the earliest live claim), `lapsed`, `none`.
4646
* hold the `Contract-review-hold:` lines, as `contractReviewHold` reads
4747
* them, per head: `live` (a readable hold names the current head:
4848
* trigger (b) does not fire, and its age is printed), `stale` (the
@@ -332,7 +332,7 @@ export function renderRow(row) {
332332
const holder = row.claim.holder;
333333
const claim = holder === null
334334
? row.claim.state
335-
: `live ${holder.session} (${holder.side}${row.claim.tie ? ', lane wins the tie' : ''}, ${holder.id}, ${holder.time})`;
335+
: `live ${holder.session} (${holder.side}${row.claim.tie ? ', a triage claim yields' : ''}, ${holder.id}, ${holder.time})`;
336336
const parts = [
337337
`${row.status} #${row.pr} ${row.draft ? 'draft' : 'ready'}`,
338338
`face ${row.face.join('+')}`,
@@ -493,7 +493,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
493493
'the owed face: paths, the Clause-② line, the label — drafts included, nothing else owes': 9,
494494
'the record: on this head (by whom, as stated), on an earlier head, none, unjudged': 8,
495495
'the triggers: (a) hand-off or label the same round, (b) a full round, (c) the lane seat': 10,
496-
'a live claim holds the head and a record settles it; a lapsed claim holds nothing': 5,
496+
'a live claim holds the head and a record settles it; a lapsed claim holds nothing': 6,
497497
'the live instance: two Tier H drafts with a hand-off on the current head list as TAKE under (a)': 4,
498498
'the live read: every read through one reader; a failed read is INCOMPLETE, never clean': 6,
499499
'the report: one line per owing PR, TAKE first, exit 0': 5,
@@ -593,7 +593,8 @@ export function selfTest() {
593593

594594
battery('a live claim holds the head and a record settles it; a lapsed claim holds nothing');
595595
t('⭐ a live claim on the current head ⇒ HELD, naming the holder — whatever trigger holds', (() => { const r = row({ labels: [{ name: WAITING_LABEL }], comments: [claimRow(TRIAGE, HEAD, '2026-10-28T12:18:56Z', `triage#1 · os-zhuang · ${TRIAGE}`)] }); return r.status === 'HELD' && r.claim.holder.session === TRIAGE && r.trigger === null; })());
596-
t('⭐ the lane wins a tie: a `triage#N`-signed claim first (posted before triage stopped reviewing), lane later ⇒ the lane holds', (() => { const r = row({ comments: [claimRow(TRIAGE, HEAD, '2026-10-28T12:18:56Z', `triage#1 · os-zhuang · ${TRIAGE}`), { ...claimRow(LANE, HEAD, '2026-10-28T12:20:00Z', `domain:ui#1 · os-bill · ${LANE}`), id: 2 }] }); return r.status === 'HELD' && r.claim.holder.session === LANE && r.claim.tie === true; })());
596+
t('⭐ a legacy `triage#N`-signed claim yields: triage first (posted before triage stopped reviewing), lane later ⇒ the lane holds', (() => { const r = row({ comments: [claimRow(TRIAGE, HEAD, '2026-10-28T12:18:56Z', `triage#1 · os-zhuang · ${TRIAGE}`), { ...claimRow(LANE, HEAD, '2026-10-28T12:20:00Z', `domain:ui#1 · os-bill · ${LANE}`), id: 2 }] }); return r.status === 'HELD' && r.claim.holder.session === LANE && r.claim.tie === true; })());
597+
t('⭐ two live claims ⇒ the EARLIEST holds, no tie: a review seat first, the lane later ⇒ the review seat holds, and the row prints no tie', (() => { const r = row({ comments: [claimRow(REVIEWER, HEAD, '2026-10-28T12:18:56Z', `review#1 · os-zhuang · ${REVIEWER}`), { ...claimRow(LANE, HEAD, '2026-10-28T12:20:00Z', `domain:ui#1 · os-bill · ${LANE}`), id: 2 }] }); return r.status === 'HELD' && r.claim.holder.session === REVIEWER && r.claim.tie === false && !renderRow(r).includes('yields'); })());
597598
t('a record on the head settles it even beside a live claim ⇒ DONE', row({ comments: [claimRow(TRIAGE, HEAD, '2026-10-28T12:18:56Z', `triage#1 · os-zhuang · ${TRIAGE}`), recordRow(HEAD)] }).status === 'DONE');
598599
t('⛔ a claim two hours old with no record holds nothing ⇒ the trigger reads again', (() => { const r = row({ comments: [claimRow(TRIAGE, HEAD, '2026-10-28T10:30:00Z', `triage#1 · os-zhuang · ${TRIAGE}`)] }); return r.claim.state === 'lapsed' && r.status === 'TAKE'; })());
599600
t('⛔ a claim on an earlier head holds nothing — the head moved', row({ comments: [claimRow(TRIAGE, HEAD2, '2026-10-28T12:50:00Z', `triage#1 · os-zhuang · ${TRIAGE}`)] }).claim.state === 'none');
@@ -699,7 +700,7 @@ export function selfTest() {
699700
console.log(
700701
`✓ check-owed-reviews self-test: ${cases.length} cases pass in ${declared.length} batteries (the owed face from paths, `
701702
+ 'the Clause-② line and the label, drafts included; the record on this head, an earlier head, none, unjudged; '
702-
+ 'the (a) / (b) / (c) triggers and the taker — the named seat, the lane seat or a review seat, never triage; claims holding and lapsing, the lane winning a tie; the two live drafts as TAKE; '
703+
+ 'the (a) / (b) / (c) triggers and the taker — the named seat, the lane seat or a review seat, never triage; claims holding and lapsing, the earliest live claim holding; the two live drafts as TAKE; '
703704
+ 'every read through one reader with failures as gaps; the report, exit 0; a lane\'s live hold holding (b) alone, '
704705
+ 'cleared by a new head, an unreadable hold line voiding nothing and printed, listed at 24 hours and still WAIT).',
705706
);

0 commit comments

Comments
 (0)