Skip to content

Commit c2792c0

Browse files
committed
feat(pm): a mailbox message opens To: <seat>; the rules text names the seat key and the hand-over close
record-recognisers.mjs: `readMailboxLine` reads a `To: <seat>` line after the optional signature and before the key, returns it as `to` (the mailbox opener's canonical `seatKey`, imported, never a second seat shape), and refuses a message without one, a `To:` naming a login, or a `To:` with no key under it. The byte cap still counts the key line only. The doorbell battery asks every key refusal under a `To:` line, so none can pass on the missing envelope, and gains six cases. mailbox-open.mjs: a seat's lane is one of the four a seat post names (`domain:<x>`, `repo:<x>`, `triage`, `director`), so a login is never read as a seat. project-forms.md 〈信箱 PR〉 and the mailbox body now say the same thing: one per seat, keyed by seat, branch `mailbox/<login>/<slug>`, body `Mailbox-of: <seat> · <login>`, messages `To: <seat>` then the key. seat-post-protocol.md 〈交接收尾清单〉 step 9 names the close and the successor's reopen. Both files keep their line count. Claude-Session: https://claude.ai/code/session_016WV4d1d1pooSGzvbJymLKy Co-authored-by: Claude <noreply@anthropic.com>
1 parent 87f02db commit c2792c0

4 files changed

Lines changed: 86 additions & 54 deletions

File tree

‎.claude/skills/pm-dispatch/references/project-forms.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333

3434
## 信箱 PR
3535

36-
- 每席一个 draft PR:分支 `mailbox/<login>`,标签 `pm:mailbox`+`pinned`,正文首行 `To: <login>`。
37-
- 坐席即开(`mailbox-open.mjs`)并订阅,存根指针行记其号;永不合并,移交或换账号关旧开新。
38-
- `pm:mailbox` PR 不欠 CI,一切落地与台账查询排除它。
39-
- 首行恒为下列七键之一(发→收;何时):一事一行 ≤200 字节,只写键与编号;表外即半态。
36+
- 每席一个 draft PR,键是席位 ⛔ 非账号:分支 `mailbox/<login>/<slug>`,标签 `pm:mailbox`+`pinned`。
37+
- 正文首行 `Mailbox-of: <席位> · <login>`;坐席即开(`mailbox-open.mjs`)并订阅,存根指针行记其号。
38+
- 永不合并,不欠 CI,落地与台账查询排除它;移交或换账号关旧开新;评论首行 `To: <席位>`。
39+
- 次行恒为下列七键之一(发→收;何时):一事一行 ≤200 字节,只写键与编号;表外即半态。
4040
- `Request: contract-review · PR #n · head SHA · REASON`:车道→分诊;本席复审档不可用,一 head 一次。
4141
- `Request: urgent-triage · #n · ONE-LINE-CRITERION`:任一席→分诊;p0 嫌疑、main 红、确定性队列红。
4242
- `Request: main-red · CHECK-NAME · anchor #n · suggested lane X`:发现席→分诊(缺则总监);锚卡立起时。

‎.claude/skills/pm-dispatch/references/seat-post-protocol.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
6. 贴正文改 `⏳ vacant` + 台账:前任会话 ID、注销时间、队列快照、串行队、跨车道备忘。
5252
7. 收班简报与审计评论存档;接任指引 = `/pm-dispatch 接手` + 先读座位贴。
5353
8. 在飞卡与留跑会话贴里点名(卡号+派发会话 ID);派出的会话离任 PM 自己 `archive_session`。
54-
9. 向维护者交最终报告。
54+
9. 关本席信箱(`mailbox-open.mjs --close N`),接任者坐席时按席重开;向维护者交最终报告。
5555

5656
## 座位 Routine 创建
5757

‎scripts/pm/mailbox-open.mjs‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@
4040
* was a per-seat one; the board falsified that premise, and nothing here reads
4141
* a login as a seat any more.
4242
*
43-
* A seat is spelled `LANE#N` — `domain:ui#4`, `repo:cloud#1`, `triage` — with
44-
* an absent number read as seat 1 (`seatKey`). It is compared lower-cased and
45-
* written canonically with its number (`triage#1`). Its SLUG is that key as one
46-
* ref segment, because a ref cannot carry `:` or `#`: the default `domain:`
47-
* kind dropped, every other `:` and the `#` turned into `-` (`ui-4`,
48-
* `repo-cloud-1`, `triage-1`). No live lane is named both `domain:X` and `X`,
49-
* which is what keeps the slug one-to-one.
43+
* A seat is spelled `LANE#N` — `domain:ui#4`, `repo:cloud#1`, `triage` — its
44+
* lane one of the four a seat post's title names (`domain:<x>`, `repo:<x>`,
45+
* `triage`, `director`), so a login never reads as a seat, and an absent
46+
* number read as seat 1 (`seatKey`). It is compared lower-cased and written
47+
* canonically with its number (`triage#1`). Its SLUG is that key as one ref
48+
* segment, because a ref cannot carry `:` or `#`: the default `domain:` kind
49+
* dropped, every other `:` and the `#` turned into `-` (`ui-4`,
50+
* `repo-cloud-1`, `triage-1`). No `domain:` lane is named `triage`,
51+
* `director` or `repo-…`, which is what keeps the slug one-to-one.
5052
*
5153
* ## What it does, in order (open)
5254
*
@@ -156,8 +158,9 @@ const REPO_SHAPE = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;
156158
const LOGIN_SHAPE = /^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$/;
157159
const BRANCH_SHAPE = /^(?!\/|.*\/\/|.*\.\.|.*[\s~^:?*[\\]|.*\.lock$|.*\/$)[A-Za-z0-9._/-]+$/;
158160
const SESSION_SHAPE = /^(?:session|cse)_[A-Za-z0-9]+$/;
159-
// A seat: its lane (`domain:ui`, `repo:cloud`, `triage`, `director`), then `#N`; absent = seat 1. Read lower-cased.
160-
const SEAT_SHAPE = /^([a-z]+(?::[a-z0-9._-]+)?)(?:#([1-9][0-9]*))?$/;
161+
// A seat: its lane — `domain:<x>`, `repo:<x>`, `triage`, `director`, the four a seat post's title names — then `#N`;
162+
// absent = seat 1. Read lower-cased. The bare lanes are a closed pair, so a login is never read as a seat.
163+
const SEAT_SHAPE = /^((?:domain|repo):[a-z0-9._-]+|triage|director)(?:#([1-9][0-9]*))?$/;
161164
/** A per-seat mailbox body's first line, `Mailbox-of: <seat> · <login>`. */
162165
const MAILBOX_OF_LINE = /^Mailbox-of:[ \t]*(\S+)[ \t]*·[ \t]*(\S+)$/;
163166
/** The first lines a legacy per-login mailbox opened with: `To: <login>` (this file's), `Mailbox-of: <login>`. */
@@ -501,7 +504,7 @@ async function selfTest() {
501504
t('no --repo is refused', parseArgs(['--seat', 'triage', '--login', 'a']).errors.some((e) => e.includes('--repo')), true);
502505
t('a repo not shaped owner/name is refused', parseArgs(['--repo', 'nope', '--seat', 'triage', '--login', 'a']).errors.some((e) => e.includes('owner/name')), true);
503506
t('⭐ open without --seat is refused, naming why — the mailbox is the seat\'s, never the login\'s', parseArgs(['--repo', 'o/r', '--login', 'os-bill']).errors.some((e) => e.includes('--seat <seat> is required') && e.includes('never the login')), true);
504-
t('a --seat that is not LANE#N is refused', ['ui 4', 'domain:ui#0', '#4', 'domain:', 'domain:ui#4#5'].every((s) => parseArgs(['--repo', 'o/r', '--seat', s, '--login', 'a']).errors.some((e) => e.includes('is not a seat'))), true);
507+
t('a --seat that is not LANE#N is refused, a login among them', ['ui 4', 'domain:ui#0', '#4', 'domain:', 'domain:ui#4#5', 'os-bill', 'marchtian'].every((s) => parseArgs(['--repo', 'o/r', '--seat', s, '--login', 'a']).errors.some((e) => e.includes('is not a seat'))), true);
505508
t('open without --login is refused', parseArgs(['--repo', 'o/r', '--seat', 'triage']).errors.some((e) => e.includes('--login')), true);
506509
t('a login GitHub would refuse is refused', parseArgs(['--repo', 'o/r', '--seat', 'triage', '--login', '-bad--']).errors.some((e) => e.includes('not a GitHub login')), true);
507510
t('a seat whose branch is no legal ref is refused', parseArgs(['--repo', 'o/r', '--seat', 'repo:a..b#1', '--login', 'a']).errors.some((e) => e.includes('not a legal ref')), true);
@@ -515,7 +518,7 @@ async function selfTest() {
515518
t('an absent number is seat 1, spelled', [seatKey('triage'), seatKey('domain:skills')], [{ key: 'triage#1', slug: 'triage-1' }, { key: 'domain:skills#1', slug: 'skills-1' }]);
516519
t('another kind keeps its name, its colon turned into a hyphen', [seatKey('repo:cloud#1').slug, seatKey('repo:www.objectos.ai#2').slug], ['repo-cloud-1', 'repo-www.objectos.ai-2']);
517520
t('read lower-cased, so one seat has one key', [seatKey('Domain:UI#4').key, seatKey(' domain:ui#4 ').key], ['domain:ui#4', 'domain:ui#4']);
518-
t('not a seat ⇒ null', ['', 'ui 4', 'domain:ui#0', '#4', 'domain:', null].map(seatKey), [null, null, null, null, null, null]);
521+
t('not a seat ⇒ null — ⛔ a login above all, the confusion a per-login mailbox made', ['', 'ui 4', 'domain:ui#0', '#4', 'domain:', null, 'os-bill', 'marchtian', 'epic:#12'].map(seatKey), [null, null, null, null, null, null, null, null, null]);
519522
t('the branch is mailbox/<login>/<slug> — no `:` and no `#` in a ref', mailboxBranch('os-bill', seatKey('domain:ui#4')), 'mailbox/os-bill/ui-4');
520523
t('⭐ two seats under ONE login get two branches', [mailboxBranch('os-sales', seatKey('domain:server#1')), mailboxBranch('os-sales', seatKey('domain:ui#1'))], ['mailbox/os-sales/server-1', 'mailbox/os-sales/ui-1']);
521524

0 commit comments

Comments
 (0)