Skip to content

Commit 7c76c75

Browse files
committed
pm-dispatch: an open PR names its owner — pr_create assigns the claim's Account, a hand-over re-assigns it, and H76 reports an unowned PR
Ruling record 6674390671 (letter A) on #29828. The dev's pr_create now carries the claim's Account as the PR's assignee (os-dev.md rule 2 and the write budget), the 认领 line in execution-duties.md says a hand-over re-assigns it in the same stroke as the claim change, SKILL.md's hand-off step keeps only "never request the seat's own account", and the runbook's thread rule names the card's assignee. check-half-states gains H76, a report-only state row: an open non-mailbox PR with no assignee. Claude-Session: https://claude.ai/code/session_016WV4d1MNyKiUFDBccFX8Cc Co-authored-by: Claude <noreply@anthropic.com>
1 parent 561d532 commit 7c76c75

5 files changed

Lines changed: 92 additions & 6 deletions

File tree

‎.claude/agents/os-dev.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ model: opus
3535
- 同批 agents 共用一个 scratchpad 目录,自然命名的文件会被彼此静默覆盖。
3636
2. **卡 assignee 归 PM。** 派发原子对已把它设好;共享身份下该字段答不了是谁。
3737
- 你的身份位是认领评论里的分支;仓 CLAUDE.md 的 claim-first 已由 PM 的认领满足。
38-
- 恒不写卡的 assignee(空也开工,报 `summary`);PR ⛔ 不带 `assignees`(中继虽收),席位交棒才派。
38+
- 恒不写卡的 assignee(空也开工,报 `summary`);PR 派认领 `Account:`(`pr_create` 带),交棒归席位。
3939
- 发现与他人在途工作重复,停下报 `blocked`。
4040
- PR 上不是你设置的状态属于另一个 actor:⛔ 永不去纠正;疑问进报告,挡住报 blocked。
4141
- 回退他人的操作(尤其 ready 翻转)永不轮到你;把意外写进 `summary`。
@@ -59,7 +59,7 @@ model: opus
5959
- 写工具自读所需变量;⛔ 永不打印环境变量的值,转录是 AGENTS.md 禁落令牌的日志行。
6060
- 拼法不限于 `env`、`printenv`、`set`、`export -p`、`echo $VAR`、`cat /proc/*/environ`。
6161
- 判存在只用不印值形式 `[ -n "${X+x}" ] && echo set`;已印出 ⇒ `deviations` 只点名变量名。
62-
- 写预算三笔:`git push`、`pr_create`(draft,含 labels、⛔ 无 assignees)、`os-dev-report` 评论。
62+
- 写预算三笔:`git push`、`pr_create`(draft,含 labels 与 assignees)、`os-dev-report` 评论。
6363
- 卡与线程只走 payload 档(公开仓单卡网页内嵌 JSON,拼写住 platform-readings)或单卡 REST 读。
6464
- 三类发现进报告交席位代立,不 `POST /issues`、⛔ 不静默弃报;PM 去重读数当既有事实用。
6565
- PR 正文 dev 只写一次,在开 PR 那一笔,⛔ 不 `PATCH`;事后要改的报告点名改法,席位代写。

‎.claude/skills/pm-dispatch/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ PM 的工作是循环:选卡 → 认领 → 派发 → 收集 → 复核 → 报
195195
- 批准判定单源 = 队列守卫常量 `GOVERNED_APPROVERS`:授权账户 APPROVED 即算,⛔ 不卡 `commit_id`。
196196
- 批准后再推亦不过期;席位落地 = 过落地前检、清标、ready、auto-merge,踢出/变基同法。
197197
- ③ 请审 = 席位交棒:ACCEPT 与现 head 同形 PASS 俱在案,同轮中继 `pr_request_reviewers` 请审批人。
198-
- 作者是审批人 ⇒ `assign` 它、请其余(请它必 422);⛔ 永不派/请席位自身账号;Tier S 不交人。
199-
- `pr_create` 不请不派;`pr_ready` 只补交棒漏;非例外 head 移 ⇒ 撤挂回等;脱中继 PR 自读请/派。
198+
- 作者是审批人 ⇒ `assign` 它、请其余(请它必 422);⛔ 永不请席位自身账号;Tier S 不交人。
199+
- `pr_create` 派不请;`pr_ready` 只补交棒漏;非例外 head 移 ⇒ 撤挂回等;脱中继 PR 自读请/派。
200200
- 速读「需要你做的」求批点名 PASS 评论 id+`Head-sha`;无 PASS ⇒ 写 contract review owed 不求批。
201201
- ④ 轮报单列 awaiting a human merge 并现读请审人;⛔ 未请审不在 chat 报「等你批」,先补请。
202202
- skills 车道自有 PR:纯代码面如 `scripts/pm/` 由本席按达档自审(清单不减)后落地。

‎.claude/skills/pm-dispatch/references/dispatch-runbook.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
- 席位留认领文本/派发令/契约复核/ACCEPT/落地;线程实施、开 draft PR、驱动 CI 与可合并。
138138
- 线程 ⛔ 不做 harness 开 PR 后指派/请审:「审核通过才会推送给我审核」,请审是席位交棒。
139139
- 派发令由 coordinator 写进线程开场消息,`Writes:` 行逐字在内,⛔ 不落共享目录;卡上留指针。
140-
- coordinator 开线程即读线程分支交席位(读不到则线程自报);⛔ 线程不认领、不写 assignee。
140+
- coordinator 开线程即读线程分支交席位(读不到则线程自报);⛔ 线程不认领、不写卡 assignee。
141141
- 席位写 assignee+`pm:dispatched`+带该 `Branch:` 的认领;线程核对最新认领指向本分支方开工。
142142
- 分支约定仍是 `claude/issue-<n>-<slug>`;线程只能推指定分支是实测平台例外,认领如实写。
143143
- worktree 照建;仓 `.claude/agents` 类型未加载(实测),线程照读 `os-dev.md`。

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
## 认领(先认领后动工)
6767

6868
- 归属 = session ID,⛔ 不认作者字段;`Account:` 派生自 assignee,不等即半态、持卡席下笔补正。
69-
- 卡 assignee 归 PM,dev 恒不写;PR ⛔ 不派席位账号;在飞 PR 读 `head:claude/` 开 PR 正文点名的卡。
69+
- 卡 assignee 归 PM,dev 恒不写;PR 派认领账号,交棒同笔改;在飞 PR = `head:claude/` 正文点名本卡。
7070
- 部分落地(PR 带 `Refs #N (item k)`,⛔ 不 `Fixes`)即释放:合入同笔回 `pm:queue` + 清 assignee。
7171
- `Release:` 行点名已落与余项;余项整落 `ui/**` 外他席树 ⇒ 点名其改标,拆分加 `pm:retriage`。
7272
- 派发前按序执行原子对:① Assign @me,并把 `pm:dispatched` 与摘 `pm:queue` 放进同一次标签写入。

‎scripts/pm/check-half-states.mjs‎

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15660,6 +15660,48 @@ export function h72OffTableMailboxLines(reading, nowMs = Date.now()) {
1566015660
);
1566115661
}
1566215662

15663+
// ---------------------------------------------------------------------------
15664+
// H76 — an OPEN PR with NO assignee, a `pm:mailbox` PR excepted. Ruling record
15665+
// 6674390671 (letter A): a PR names its owner — the dev's `pr_create` carries
15666+
// the claim's `Account:` as its assignee, and a hand-over (sibling takeover,
15667+
// release, reassignment) re-assigns the PR in the same stroke as the claim
15668+
// change (`references/execution-duties.md` 认领). The same ruling makes this
15669+
// row report-only, ⛔ no gate. A mailbox is a seat's doorbell, never a delivery
15670+
// (`project-forms.md` 〈信箱 PR〉), so it is exempt; its label is
15671+
// `mailbox-open.mjs`'s MAILBOX_LABEL, handed in by the sweep, never spelled
15672+
// here. When the sweep could not load that label the row cannot tell a mailbox
15673+
// from a delivery, so it fires UNJUDGED, never clean (#4690). Drafts are
15674+
// INCLUDED: a dev's PR stays a draft until its seat lands it. Free — it reads
15675+
// the open listing already in hand.
15676+
// ---------------------------------------------------------------------------
15677+
15678+
/**
15679+
* H76 — null when clean or out of scope, else the finding sentence.
15680+
*
15681+
* @param {object} pr — a `/pulls?state=open` list row.
15682+
* @param {string} mailboxLabel — `mailbox-open.mjs`'s MAILBOX_LABEL, handed in by the sweep; anything else is unread.
15683+
*/
15684+
export function h76OpenPrWithoutAssignee(pr, mailboxLabel) {
15685+
if (!pr || pr.state === 'closed') return null;
15686+
if ((pr.assignees ?? []).length > 0 || pr.assignee) return null;
15687+
if (typeof mailboxLabel !== 'string' || mailboxLabel === '') {
15688+
return (
15689+
`${UNJUDGED_MARKER} open PR with NO assignee, and the mailbox label could not be read this sweep — ` +
15690+
'whether it is an exempt mailbox PR is UNJUDGED, not settled. Read its labels by hand: a mailbox is ' +
15691+
'exempt, any other open PR owes its owner as assignee.'
15692+
);
15693+
}
15694+
if (labelNames(pr).includes(mailboxLabel)) return null;
15695+
return (
15696+
'open PR with NO assignee. A PR names its owner (ruling record 6674390671): the dev\'s `pr_create` carries ' +
15697+
'the claim\'s `Account:`, and a hand-over (sibling takeover, release, reassignment) re-assigns the PR in the ' +
15698+
'same stroke as the claim change. Remedy — WHO and HOW: the seat holding the card this PR names assigns that ' +
15699+
'card\'s assignee through the relay (`assign` op, the PR number as `issue`); a bot PR with no card takes its ' +
15700+
'owning lane seat\'s account, or stays unassigned with a note. ⛔ Report-only: nothing is written from this ' +
15701+
`script. Out of scope: a \`${mailboxLabel}\` PR (a seat's doorbell, never a delivery).`
15702+
);
15703+
}
15704+
1566315705
// ---------------------------------------------------------------------------
1566415706
// H64 (#18069, re-keyed by #18237) — a seat- or dev-signed artefact that names
1566515707
// no session.
@@ -19847,6 +19889,11 @@ export const HALF_STATE_FAMILY_BAND = Object.freeze({
1984719889
// is stopped (not `stall`), and no write on the board repairs a sent comment
1984819890
// (not `state`) — the repair is the next bell, spelled from the table.
1984919891
H72: 'inventory',
19892+
19893+
// H76 is a `state`, H1's band for H1's reason: a live PR half-written — the
19894+
// owner the ruling makes it name is missing, and the repair is one relay
19895+
// `assign` on the board. ⛔ Not `stall`: an unowned PR can still land.
19896+
H76: 'state',
1985019897
});
1985119898

1985219899
const FAMILY_BAND_RANK = new Map(HALF_STATE_FAMILY_BANDS.map((b) => [b.name, b.rank]));
@@ -23734,6 +23781,22 @@ async function sweepInto(findings, seen, seenPrs, seenMerged, seenUnscoped, seen
2373423781
}
2373523782
}
2373623783

23784+
// H76 — an open PR with no assignee, off the listing above, free. The mailbox
23785+
// label is imported LAZILY for H72's reason (banner above `h72NeedsThread`);
23786+
// a failed import leaves it unread, and every unowned PR then fires UNJUDGED.
23787+
{
23788+
let mailboxLabel = null;
23789+
try {
23790+
({ MAILBOX_LABEL: mailboxLabel } = await import('./mailbox-open.mjs'));
23791+
} catch {
23792+
mailboxLabel = null;
23793+
}
23794+
for (const pr of seenPrs.values()) {
23795+
const unowned = h76OpenPrWithoutAssignee(pr, mailboxLabel);
23796+
if (unowned) findings.push([pr, 'H76', unowned]);
23797+
}
23798+
}
23799+
2373723800
// H16 — the only predicate here whose input no listing carries:
2373823801
// `mergeable_state` lives on the single-PR endpoint alone. One GET per
2373923802
// CANDIDATE (the gathering policy is `h16NeedsDetail`, which answers from
@@ -25238,6 +25301,9 @@ export const SELF_TEST_BATTERIES = Object.freeze({
2523825301
// through this predicate — lives in record-recognisers.mjs's doorbell battery,
2523925302
// because this self-test cannot import that module (H62's banner).
2524025303
'H72 mailbox off-table bells': 20,
25304+
// Registered with the unowned-PR row, pin just under the count: the firing, the assignee/mailbox/closed
25305+
// exemptions, the unread-label UNJUDGED leg, the text, the band and the wiring.
25306+
'H76 unowned open PR': 11,
2524125307
// Registered with the ruled-card-in-the-box row (#29386), pin just under the
2524225308
// count: the firing case, the label / fence / anchoring / id controls each
2524325309
// beside its positive twin, the threshold boundary, the governing stamp, the
@@ -28582,6 +28648,26 @@ async function selfTest() {
2858228648
b(BATTERY28675, '⭐ H72: the sweep takes the ONE reader and the opener\'s label LAZILY — `mailboxEvents` from record-recognisers.mjs, MAILBOX_LABEL from mailbox-open.mjs — and spells no doorbell key of its own', (() => { const src = readFileSync(fileURLToPath(import.meta.url), 'utf8'); return src.includes("import('./record-recognisers.mjs')") && src.includes("import('./mailbox-open.mjs')") && !/^import [^\n]*from '\.\/(?:record-recognisers|mailbox-open)\.mjs'/mu.test(src) && !src.includes(['MAILBOX_KEYS', '='].join(' ')); })(), true);
2858328649
b(BATTERY28675, 'floor: this battery is DECLARED on the roster, with a positive pin', Object.prototype.hasOwnProperty.call(SELF_TEST_BATTERIES, BATTERY28675) && SELF_TEST_BATTERIES[BATTERY28675] > 0, true);
2858428650

28651+
// -- H76: an open PR with no assignee (ruling record 6674390671, letter A). The fixture is a relay-opened dev
28652+
// draft as the card measured them (26 of 27 open PRs unassigned), offline, never a live read.
28653+
const BATTERY76 = 'H76 unowned open PR';
28654+
const MAILBOX76 = 'pm:mailbox';
28655+
const pr76 = (extra = {}) => ({ number: 30778, state: 'open', draft: true, assignees: [], assignee: null, labels: [{ name: 'skip-changeset' }], user: { login: 'objectstack-fleet[bot]', type: 'Bot' }, ...extra });
28656+
const row76 = String(h76OpenPrWithoutAssignee(pr76(), MAILBOX76) ?? '');
28657+
b(BATTERY76, 'H76 fires: an open dev draft with no assignee and no mailbox label', row76.length > 0 && !isUnjudgedFinding(row76), true);
28658+
b(BATTERY76, 'H76 row: names the ruling, the claim\'s `Account:`, the relay `assign` op, the bot-PR arm and the report-only boundary', ['ruling record 6674390671', 'the claim\'s `Account:`', '`assign` op', 'owning lane seat\'s account', 'Report-only'].every((x) => row76.includes(x)), true);
28659+
b(BATTERY76, 'H76: a ready (non-draft) PR fires exactly like a draft — drafts are included, not the only population', typeof h76OpenPrWithoutAssignee(pr76({ draft: false }), MAILBOX76), 'string');
28660+
b(BATTERY76, '⛔ H76: a PR with an assignee is clean — the list field or the legacy single field', [h76OpenPrWithoutAssignee(pr76({ assignees: [{ login: 'os-elon-musk' }] }), MAILBOX76), h76OpenPrWithoutAssignee(pr76({ assignee: { login: 'os-elon-musk' } }), MAILBOX76)].join(), ',');
28661+
b(BATTERY76, '⛔ H76: an unassigned `pm:mailbox` PR is exempt, and its unlabelled twin is not', [h76OpenPrWithoutAssignee(pr76({ labels: [{ name: MAILBOX76 }, { name: 'pinned' }] }), MAILBOX76), typeof h76OpenPrWithoutAssignee(pr76({ labels: [{ name: 'pinned' }] }), MAILBOX76)].join(), ',string');
28662+
b(BATTERY76, '⛔ H76: a closed PR and a missing row are silent, never a crash', [h76OpenPrWithoutAssignee(pr76({ state: 'closed' }), MAILBOX76), h76OpenPrWithoutAssignee(undefined, MAILBOX76), h76OpenPrWithoutAssignee(null, MAILBOX76)].join(), ',,');
28663+
const unread76 = [null, undefined, ''].map((label) => String(h76OpenPrWithoutAssignee(pr76(), label) ?? ''));
28664+
b(BATTERY76, 'H76: an UNREAD mailbox label fires UNJUDGED, never clean — null, undefined and empty alike', unread76.every((t) => t.startsWith(UNJUDGED_MARKER) && isUnjudgedFinding(t)), true);
28665+
b(BATTERY76, '⛔ H76: …but an ASSIGNED PR stays clean with the label unread — the label is only the mailbox exemption', h76OpenPrWithoutAssignee(pr76({ assignees: [{ login: 'os-elon-musk' }] }), null), null);
28666+
b(BATTERY76, 'H76: not a loud finding — it never escalates a sweep', [isLoudFinding(row76), isLoudFinding(unread76[0])].join(), 'false,false');
28667+
b(BATTERY76, 'H76 band: registered as `state` (H1\'s), and the sweep really pushes it', `${familyBand('H76')}/${familyRegistryCoverage().emitted.includes('H76')}`, 'state/true');
28668+
b(BATTERY76, 'H76 wiring: every listed open PR is judged with the label taken LAZILY from mailbox-open.mjs, never spelled in the sweep', (() => { const src = readFileSync(fileURLToPath(import.meta.url), 'utf8'); return src.includes("({ MAILBOX_LABEL: mailboxLabel } = await import('./mailbox-open.mjs'));") && src.includes('const unowned = h76OpenPrWithoutAssignee(pr, mailboxLabel);'); })(), true);
28669+
b(BATTERY76, 'floor: this battery is DECLARED on the frozen roster with a positive pin', Object.hasOwn(SELF_TEST_BATTERIES, BATTERY76) && SELF_TEST_BATTERIES[BATTERY76] > 0 && Object.isFrozen(SELF_TEST_BATTERIES), true);
28670+
2858528671
// -- H73 (#29386): a RULED decision card still sitting in the decision box.
2858628672
// Positive controls beside every negative one: the label, the fence, the
2858728673
// anchoring, the id, the threshold, the governing stamp, the re-entry line.

0 commit comments

Comments
 (0)