Repository navigation
Commit 9e7fbd3
pm(scripts): retired lane aliases are written as domain:server at the label doors; domain:rest joins the retired block (#30841)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoHnQXbeW1Xvd4ozovU9hTSm)_
Fixes #30827
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:给卡片打标签的三个入口(issue-create、label-write、fleet-write 中继 CLI)遇到退役车道标签
`domain:engine` / `domain:services` / `domain:cli` / `domain:rest`
时,自动改写成 `domain:server` 再写,并在输出里写一行 `label domain:engine → domain:server
(retired alias)`;`domain:rest` 补进退役标签清单。
- 为什么改:退役标签对象按规则保留,GitHub 打标签时又会静默新建不存在的标签,所以删不掉也拦不住误用;11-05/06 一个席位新开的
7 张卡全打了 `domain:engine`,每张都要分诊手工改标。
- 风险与回滚:只改写、从不拒绝,不是新门禁;`--remove` / `labels_remove`
保持原样,分诊照旧能摘掉旧标签;回滚即还原本 PR,五个文件均为内部工具脚本,不发布。
- 先看:`scripts/pm/fleet-write/dispatch.mjs` 的
`rewriteRetiredLaneLabels`(唯一改写函数);`scripts/pm/label-write.mjs` 的
`parseOptions`(改写放在算目标集之前,回读才对得上);`scripts/pm/check-half-states.mjs` 的
`LANE_LABEL_ALIASES`(唯一别名表,新增 `domain:rest` 一行)。
- 两分钟验证:`node scripts/pm/label-write.mjs --self-test`,预期最后一行 `✓
label-write self-test: 144 cases pass across 12 batteries`。
- 需要你做的:无,席位落地。
## What changes
- **One alias table.** `LANE_LABEL_ALIASES` in
`scripts/pm/check-half-states.mjs` already maps the retired lane
spellings to `domain:server` for every lane comparison on the board. It
gains one row, `'domain:rest': 'domain:server'`, and its self-test pin
now names the four spellings. No second table and no new module: all
three doors already import from this module's graph.
- **One rewrite function.** `rewriteRetiredLaneLabels` and
`retiredLaneRewriteLine` in `scripts/pm/fleet-write/dispatch.mjs` read
that map. A retired spelling becomes `domain:server`. A duplicate that
the rewrite itself made (`domain:engine` next to `domain:server`)
collapses to one, so the validator's "named twice" never fires on it. A
duplicate the caller wrote is still left for the validator. ⛔ It
rewrites and never refuses.
- **Three doors**, each printing the read-back words `label
domain:engine → domain:server (retired alias)`:
- `fleet-write/dispatch.mjs` CLI (`--actions-file`): rewrites the
`labels` of `labels_add`, `issue_create` and `pr_create` before packing,
with one stderr line per rewrite, dry run included. `labels_remove` is
deliberately left literal.
- `issue-create.mjs`: `planFrom` rewrites `--label`, so both the direct
and relay transports send `domain:server`. The dry run adds a `rewritten
:` line and the read-back line appends the rewrite.
- `label-write.mjs`: `parseOptions` rewrites `--add` before step ②
computes the target, so step ④'s read-back diffs against the label that
really lands. Step ② prints `② rewritten — …`. `--remove` stays literal,
so triage's relabel (`--add domain:server --remove domain:engine`) works
as before.
- The rewrite sits at the doors, ⛔ not inside `packRequest`. label-write
diffs its read-back against the target it computed, so a rewrite below
that target would read back as a stripped label (re-add once, then exit
4).
- **`scripts/pm/ensure-pm-labels.sh`:** `domain:rest` joins the retired
block next to the other three, with the same description shape: "Retired
2026-11-06, alias of domain:server (rest surface); the relay writes
domain:server instead" (97 characters). The header comments now say four
alias rows and name the write doors.
- No change to `fleet-write/{ops,validate,execute}.mjs`, no new gate, no
workflow change.
## Tests
New self-test batteries, each declared on its file's frozen roster with
the floor raised by one:
- `fleet-write/dispatch.mjs`: "retired lane aliases at the seat's door",
13 cases. Covers each of the four spellings, the rows read from the map,
live `domain:*` and non-lane controls, rewrite-made vs caller-made
duplicates, the three adding ops vs `labels_remove`, the rewritten
stroke packing through the shared validator, and an end-to-end CLI dry
run whose payload carries `domain:server` with the stderr line. Floor 27
→ 28.
- `issue-create.mjs`: "the retired lane aliases", 8 cases. Covers each
spelling, collapse beside `domain:server`, a live-label control, the
dry-run lines, a direct create's POST body and read-back line, a
no-alias control, and a relay create whose ONE dispatch carries
`domain:server`. Floor 8 → 9.
- `label-write.mjs`: "the retired lane aliases", 8 cases. Covers each
spelling at parse, collapse, a live-label control, `--remove` kept
literal, a direct write landing `domain:server` with a clean read-back
and the ② line, triage's relabel unchanged, and a relay write. Floor 11
→ 12.
- `check-half-states.mjs` "domain:server lane aliases" battery: one new
case (`domain:rest` reads as `domain:server`). The map pin now names
four spellings (26 cases vs floor 22).
## Acceptance notes
- **Residue for the seat to route:** the retired-lane line of
`.claude/skills/pm-dispatch/SKILL.md` (「退役 `domain:*`
只退流通,对象保留;`domain:engine`/`domain:services`/`domain:cli` 读作
`domain:server`」) names three aliases, and the machine table now holds
four. That line is `.claude/skills/**` text, outside this card's
surface, so it is left untouched.
- The rewrite runs at the SEAT side, in the doors on the sender's
checkout. A seat on a checkout older than this merge, or a raw
`repository_dispatch` that bypasses these scripts, still writes the
literal label. The executor (`fleet-write/execute.mjs`) is unchanged by
design (no gate; the order kept the surface to the doors).
- `close-cards.mjs` and `issue-transfer.mjs` also pack through
`packRequest`. Neither adds a `domain:*` label, so they are untouched.
- The line
`ui/scripts/__tests__/cross-file-line-citation-census.test.ts` cites
`scripts/pm/check-half-states.mjs` as a path string only (bucket
classification) and does not exercise its behaviour, so it was not
re-run.
## Verification
Local, on head `95a02ba0` (the branch with `origin/main` merged in;
`fleet-write/validate.mjs` had moved on main). The same 57 also ran
green on the pre-merge head `e38a555d`, and the derivation is identical
on both:
<details><summary>Self-tests of the edited scripts</summary>
```
node scripts/pm/fleet-write/dispatch.mjs --self-test :: exit 0 ✓ 331 cases pass across 28 batteries
node scripts/pm/issue-create.mjs --self-test :: exit 0 ✓ 64 cases pass across 9 batteries
node scripts/pm/label-write.mjs --self-test :: exit 0 ✓ 144 cases pass across 12 batteries
node scripts/pm/check-half-states.mjs --self-test :: exit 0 ✓ 5253 cases pass (domain:server lane aliases 26/22)
node scripts/pm/check-label-desc-cap.mjs :: exit 0 46 descriptions ≤100 characters
bash -n scripts/pm/ensure-pm-labels.sh :: exit 0
npx eslint --no-inline-config FOUR_MJS_FILES :: exit 0
```
</details>
<details><summary>Derived gates — 57 of 57 exit 0</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 57 commands for this diff, and each
ran with stdin redirected from /dev/null. Reconciliation:
`dispatch-gates.mjs --ran`, "57 derived famil(ies) accounted for — 57
run, 0 NOT-MEASURED".
```
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-declaration-mirrors.mjs :: exit 0
node scripts/check-declaration-mirrors.mjs --self-test :: exit 0
node scripts/check-issue-citations.mjs :: exit 0
node scripts/check-platform-checklist-watchdog.mjs :: exit 0
node scripts/check-platform-checklist-watchdog.mjs --self-test :: exit 0
node scripts/check-release-section-coverage.mjs :: exit 0
node scripts/check-release-section-coverage.mjs --strict :: exit 0
node scripts/check-self-test-wired.mjs :: exit 0
node scripts/check-self-test-wired.mjs --self-test :: exit 0
node scripts/check-self-test-workflow-commands.mjs :: exit 0
node scripts/check-self-test-workflow-commands.mjs --self-test :: exit 0
node scripts/check-whole-set-label-write.mjs :: exit 0
node scripts/check-whole-set-label-write.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/scheduled-full-run.mjs --self-test :: exit 0
node scripts/pm/bare-root-worklist.mjs --self-test :: exit 0
node scripts/pm/board-snapshot.mjs --self-test :: exit 0
node scripts/pm/sweep-closed-cards.mjs --self-test :: exit 0
node scripts/render-release-coverage-anchor.mjs --self-test :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:bash32-floor :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:cli-command-ids :: exit 0
pnpm check:closing-target-claim :: exit 0
pnpm check:commit-card-trailers :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:entry-guard :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:issue-citations :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:parse-guard :: exit 0
pnpm check:partof-closing-keyword :: exit 0
pnpm check:platform-checklist :: exit 0
pnpm check:pm-close-cards :: exit 0
pnpm check:pm-dispatch-gates :: exit 0
pnpm check:pm-fleet-write-dispatch :: exit 0
pnpm check:pm-fleet-write-execute :: exit 0
pnpm check:pm-fleet-write-validate :: exit 0
pnpm check:pm-half-states :: exit 0
pnpm check:pm-issue-create :: exit 0
pnpm check:pm-issue-transfer :: exit 0
pnpm check:pm-label-desc-cap :: exit 0
pnpm check:pm-label-write :: exit 0
pnpm check:pm-post-stamped :: exit 0
pnpm check:pm-record-recognisers :: exit 0
pnpm check:pm-write-pace :: exit 0
pnpm check:pnpm-filter-targets :: exit 0
pnpm check:pnpm-flag-spellings :: exit 0
pnpm check:ratchet-remedy-authority :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:scripts-symbol-anchors :: exit 0
pnpm check:single-claim-paths :: exit 0
pnpm check:watch-hint-literal :: exit 0
```
</details>
`node scripts/pm/check-governed-merges.mjs --test FIVE_PATHS --additions
201 --deletions 21`: "0 of 5 path(s) hit the register … NOT governed";
size 222 ≤ 3000.
Changeset: none. `skip-changeset`, because every path is under
`scripts/pm/**`, which publishes nothing.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibvJcUgxPPZNDodAhy1)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent de0f692 commit 9e7fbd3
5 files changed
Lines changed: 201 additions & 21 deletions
File tree
- scripts/pm
- fleet-write
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1109 | 1109 | | |
1110 | 1110 | | |
1111 | 1111 | | |
1112 | | - | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
1113 | 1115 | | |
1114 | 1116 | | |
1115 | | - | |
| 1117 | + | |
1116 | 1118 | | |
1117 | 1119 | | |
1118 | 1120 | | |
1119 | 1121 | | |
1120 | 1122 | | |
1121 | 1123 | | |
1122 | | - | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1123 | 1129 | | |
1124 | 1130 | | |
1125 | 1131 | | |
1126 | 1132 | | |
1127 | 1133 | | |
| 1134 | + | |
1128 | 1135 | | |
1129 | 1136 | | |
1130 | 1137 | | |
| |||
32036 | 32043 | | |
32037 | 32044 | | |
32038 | 32045 | | |
| 32046 | + | |
32039 | 32047 | | |
32040 | 32048 | | |
32041 | 32049 | | |
32042 | 32050 | | |
32043 | 32051 | | |
32044 | | - | |
| 32052 | + | |
32045 | 32053 | | |
32046 | 32054 | | |
32047 | 32055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
536 | 541 | | |
537 | 542 | | |
538 | 543 | | |
539 | 544 | | |
540 | 545 | | |
541 | 546 | | |
| 547 | + | |
542 | 548 | | |
543 | 549 | | |
544 | 550 | | |
| |||
0 commit comments