Skip to content

Commit 6755432

Browse files
refactor(pm): fleet-roster reads the mailbox constants from mailbox-open (#25506)
Fixes #25463 Clause-②: no Metadata-protocol: none ## What changed - `scripts/pm/fleet-roster.mjs` no longer declares `MAILBOX_LABEL`, `LEDGER_EXCLUSION` and `MAILBOX_BRANCH_PREFIX` itself. It imports them from `./mailbox-open.mjs`, their one owner since #25433 landed. Its own comment had asked for this ("once it lands, import them … and delete these"). - No caller imported the three from `fleet-roster.mjs`; `git grep` finds no import of that file. So nothing is re-exported. - The self-test pins that the three values are the opener's own. The battery "wall notes, closing refs, verdicts and mailboxes" goes 12 → 13. ## Verification - `node scripts/pm/fleet-roster.mjs --self-test` → 69 cases in 7 batteries pass. `node scripts/pm/mailbox-open.mjs --self-test` → 40 pass. - `git grep -n "'pm:mailbox'" -- scripts/pm`: the one declaration is in `mailbox-open.mjs`. The other hits are test fixtures. - `dispatch-gates --commands`: 30 derived families, all exit 0; `--ran` → 30 run, 0 NOT-MEASURED. - Not governed: one file under `scripts/pm`. No changeset, because nothing is published (`skip-changeset`). --- _Generated by [Claude Code](https://claude.ai/code/session_01LKHDniRQSWjRJyDtacwpEd)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0ec4c5a commit 6755432

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

‎scripts/pm/fleet-roster.mjs‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ import { fileURLToPath } from 'node:url';
8686

8787
import { isEntrypoint } from '../invoked-as.mjs';
8888
import { validateStroke } from './fleet-write/validate.mjs';
89+
// The mailbox label, its ledger exclusion and its branch prefix have ONE owner,
90+
// the mailbox opener (#25417); this file reads them, never re-spells them.
91+
import * as mailboxOpen from './mailbox-open.mjs';
92+
import { LEDGER_EXCLUSION, MAILBOX_BRANCH_PREFIX, MAILBOX_LABEL } from './mailbox-open.mjs';
8993

9094
const SELF_PATH = fileURLToPath(import.meta.url);
9195
const PM_DIR = dirname(SELF_PATH);
@@ -104,12 +108,6 @@ export const ROSTER_MARKER = '<!-- fleet-roster: generated by scripts/pm/fleet-r
104108
export const STALE_HOURS = 6;
105109
export const SUSPECTED_WALL = '疑似撞墙';
106110

107-
// The mailbox label and its ledger exclusion are owned by `mailbox-open.mjs`
108-
// (#25417). Until that file is on main they are spelled here under the same
109-
// names; once it lands, import them from './mailbox-open.mjs' and delete these.
110-
export const MAILBOX_LABEL = 'pm:mailbox';
111-
export const LEDGER_EXCLUSION = `-label:${MAILBOX_LABEL}`;
112-
const MAILBOX_BRANCH_PREFIX = 'mailbox/';
113111

114112
const CARD_BRANCH_PREFIX = 'claude/';
115113
const REPO_SHAPE = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;
@@ -525,7 +523,7 @@ let selfTestReachedVerdict = false;
525523
const SELF_TEST_BATTERIES = Object.freeze({
526524
'arguments: modes and every refusal': 9,
527525
'seat titles: lane, seat, repo, status, account, project': 13,
528-
'wall notes, closing refs, verdicts and mailboxes': 12,
526+
'wall notes, closing refs, verdicts and mailboxes': 13,
529527
'the fixture snapshot: rows for the three repos': 15,
530528
'the rendered body: marker, columns, footer, determinism': 8,
531529
'refusing to overwrite what is not the roster': 6,
@@ -597,6 +595,7 @@ async function selfTest() {
597595
t('席位核对 with REJECT is not', hasLandingVerdict([{ body: '## 席位核对\n\nREJECT · rework' }]), false);
598596
t('Contract review VERDICT: PASS is a verdict', hasLandingVerdict([{ body: '## Contract review\n\nServed-tier: x\n\n**VERDICT: PASS**' }]), true);
599597
t('an ACCEPT outside a seat record is not', hasLandingVerdict([{ body: 'ACCEPT this please' }]), false);
598+
t('the mailbox constants are the opener\'s own, imported not re-spelled', [MAILBOX_LABEL, LEDGER_EXCLUSION, MAILBOX_BRANCH_PREFIX], [mailboxOpen.MAILBOX_LABEL, mailboxOpen.LEDGER_EXCLUSION, mailboxOpen.MAILBOX_BRANCH_PREFIX]);
600599
t('a mailbox is read by head, then by body line; no label ⇒ none', [mailboxLogin({ labels: ['pm:mailbox'], head: { ref: 'mailbox/os-bill' } }), mailboxLogin({ labels: ['pm:mailbox'], head: { ref: 'claude/x' }, body: 'Mailbox-of: os-sales\n' }), mailboxLogin({ labels: [], head: { ref: 'mailbox/os-bill' } })], ['os-bill', 'os-sales', null]);
601600

602601
battery('the fixture snapshot: rows for the three repos');

0 commit comments

Comments
 (0)