Repository navigation
Commit 39064f6
feat(pm): a claim names the files it will touch; the claim door refuses a wide surface with no reason and a claim with no surface line (#38673)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi98ZAtPQK4A8ABvN79TALFDE)_
Fixes #38333
Clause-②: no
Metadata-protocol: none
Rule-change: yes
## 维护者速读
- 用户能看到什么变化:用户无感;席位认领一张卡时只写要改的文件,写整个模块却不说明理由、或干脆不写占用范围,发出前会被当场退回。
- 为什么做:这是「认领只写要改的文件」那张卡的规则文本一半,替多席位并行派发解决宽认领挡住别人的问题;代码对账那一半已先合入。
- 出错会怎样:最坏是某次认领被误退回,补一句理由或改成文件清单即可重发;已在板上的认领不受影响,本改动可直接撤回。
- 要你做什么:批准并合并这份规则文本改动(受管面)。
## What changes
This is **PR B** of the card: part 1 (the rule text) and the two
write-time refusals left over from part 2. PR A (pull 38345, merged)
built the reader and the reconciliation; nothing of it is redone here.
**Rule text (`.claude/skills/pm-dispatch/`)**
- `SKILL.md`, the claim template's `File surface:` line. It now names
FILES: two `FILE` code spans stand where the directory placeholder
stood. Its guidance says a directory entry is directly followed by
`(reason: …)`, and that a test named after a claimed file, a generated
output and the changeset are not listed. An unfilled template still
names no path, so the door still refuses it.
- `references/execution-duties.md`, the first of the four
parallel-discipline rules: a claim declares its surface at file level,
where it said area level.
- `references/area-lease.md`, one new line, the widening step. Before a
claim is amended wider (`Claim amendment`), `check-handover.mjs
--inflight` is re-run with only the new files in `--paths` and the
card's own number in `--card`. Clear: amend. Meets another claim: that
part queues behind it (`Notify: serial`) or is split to its own card
with `Blocked-by:`. It never proceeds over the other claim.
**The claim door (`scripts/pm/post-stamped.mjs`, `fileSurfaceRefusal`)**
Two new rows, on a comment that OPENS with `Claim:` and nowhere else.
`label-write.mjs --comment-file` inherits both through `judgeBody`.
- **wide, no reason.** An entry that the in-flight check's own
classifier (`surfaceWidth`, imported from `check-handover.mjs`) reads as
`wide` is refused unless a reason follows it. `wide` is a whole package,
a top-level directory, a directory holding packages, or a package-wide
`**`.
- A reason reads as one spelling only: `(reason: TEXT)` directly after
the entry's code span, on its line. A full-width bracket or colon reads
the same. An empty reason is none.
- Any other parenthesis is not a reason. The template's own `(stop on
breach; …)` follows the last entry of every claim, so "any parenthesis"
would have let every claim through.
- A sub-directory (`dir`) is not refused. The template asks its reason
too; the door enforces the three shapes the card names.
- Packages are the globs of the `pnpm-workspace.yaml` in the checkout
the tool runs from, read through the in-flight check's own parser. With
that file unreadable a package reads `dir` and passes; a top-level
directory is refused all the same.
- **absent.** A claim being made with no `File surface` line at all is
refused (seat ruling 7242530793 on this card). The in-flight check reads
such a claim as a surface naming no path on every later dispatch.
Each refusal row now carries a `kind` (`absent`, `unreadable`,
`no-path`, `wide`), so a test asserts the kind and not the prose. Claims
already on the board, and claims quoted down a report, are not judged.
## Byte ratchet (`scripts/pm/check-skill-line-ratchet.mjs`)
| file | on main `4d5cfa9f` | on this head | delta | ceiling |
|:--|--:|--:|--:|:--|
| `SKILL.md` | 33327 | 33327 | 0 | unchanged, 33327 |
| `references/execution-duties.md` | 22434 | 22434 | 0 | unchanged,
22434 |
| `references/area-lease.md` | 6957 | 7220 | +263 | raised 6957 → 7220 |
- **`SKILL.md`: paid by deletion in the same file, no raise.** The
template line grows by 69 bytes. Two edits pay exactly 69:
- −53: the state-model bullet that restated two rows of the table above
it (`needs-user-decision` is a decision to make, `pm:on-hold` a decision
made) keeps only its rule, and that rule now names its key:
`Restart-when: manual — …` is not a legal exit.
- −16: the in-flight check line drops the `node scripts/pm/` prefix and
names the script as `references/execution-duties.md` already does.
- **`execution-duties.md`: byte-neutral.** One word changes (area level
→ file level), the same length in bytes. The dispatch order assumed this
file had no ceiling row; it has one, at headroom 0. Pull 38592 merged
while this was built and raised that row to its own landed size, 22434;
main is merged into this branch once, and the file is exactly 22434
there.
- **`area-lease.md`: a ruled raise of +263 bytes, the landed size of the
one new line.** Ruling of record: the maintainer's 「立 B 并派发」, quoted in
the body of the card and recorded by claim comment 7240306887. Option
B's text orders the widening step into this file. The ceiling row moves
by exactly the measured delta and its comment names the id. Nothing else
in the file could be deleted without losing a rule.
## Tests
- `node scripts/pm/post-stamped.mjs --self-test`: **844 cases pass
across 30 batteries** (831 on the merge base). The keyed-lines battery
pin goes from 44 to 57.
- `node scripts/pm/label-write.mjs --self-test`: **407 cases pass across
19 batteries**.
- New cases, each row with its CONTROL:
- wide with no reason is refused, for nine entries alone and beside
files; CONTROL: the same nine pass once `(reason: …)` follows the span.
- a sub-directory, a `**` over one and a glob over one directory's files
are not refused.
- the reason spellings that read, and eight lines that are not a reason
(the template's own last parenthesis, an empty reason, prose with no
parenthesis, a reason on the next line, a reason before the entry,
another entry's reason).
- absent is refused, named `absent` and not `unreadable`; CONTROL: the
same claim with one surface line passes.
- write time only: a no-path line, a wide entry and a missing line are
untouched in a claim quoted down a report, in a `Claim amendment`, and
in a report.
- CONTROL: the template form filled in passes, and so do two measured
claim lines as written: the claim this pull was dispatched under
(comment 7265551402) and PR A's.
- **Existing tests changed** (all in `post-stamped.mjs`, battery "the
keyed lines", unless said):
- FLIPPED: "ABSENCE is not this row's … passes" now asserts the refusal,
kind `absent`.
- "prose naming the key mid-sentence is no near miss" asserted `null`;
it now asserts kind `absent` (still not `unreadable`).
- "CONTROL — the claim template's current form passes" is split in two:
the new template form filled in, and the measured lines plus the form
the template had before.
- "a surface line that NAMES NO PATH is refused" gains today's unfilled
template and asserts kind `no-path`.
- "a key spelled so the reader sees NO line" asserts kind `unreadable`
where it matched the prose.
- "the refusal prints the spelling that reads" also asserts that the
classifier is named.
- "WRITE TIME only" covers the two new rows.
- "structural: the surface reader is IMPORTED" pins the new import line
and call.
- Fixtures only, assertions unchanged: the `CLAIM` helper appends a
surface line unless the case spells the key itself; `MISLAID_SEAT`,
three raw `Claim: x …` strings and `BARE` gain one; in the batteries
"the one judge" and "the claim stroke", `ok`, `claimOf` and `CLAIM` gain
one.
- `label-write.mjs`: the two fold `CLAIM` fixtures gain a surface line.
Nothing else in that file moves.
<details><summary>Ablation: ten arms, each red without its code and each
restored to HEAD</summary>
Run through `scripts/ablation-replace.mjs` at `ab0ebf2f`, the
implementation commit (the head adds only the merge of main, which
touches neither file); every arm ends `ok restored: blob == HEAD` and
`git status` is empty after the last.
| arm | mutation | red cases |
|:--|:--|:--|
| P1 | the absent row answers null | ABSENCE; prose mid-sentence |
| P2 | the wide row never refuses | 7, the wide battery |
| P3 | any parenthesis is a reason | WIDE with no reason; what is NOT a
reason |
| P4 | a reason is never read | 7, both CONTROLs among them |
| P5 | the row runs on any claim, not only an opening one | WRITE TIME
only; the structural pin |
| P6 | the workspace is not passed to the row | 4: WIDE with no reason
and the checkout case among them |
| P7 | no checkout default | the checkout case alone |
| P8 | `dir` refused too | 8, the sub-directory case and the control of
the former template form among them |
| P9 | a reason counts for every entry on the line | 3: what is NOT a
reason and the code-span-inside-a-reason case among them |
| L1 | the two `label-write.mjs` fixtures lose their surface line | the
self-test stops, exit 1 |
Two notes on the arms. L1's first run was void: the tool refused an
empty replacement, nothing ran, and the arm was run again with
`--delete`. L1 reds as an exit 1 from a later case reading the refused
fold's result, not as a failed-case line.
</details>
## Acceptance notes
- **The rule-change declaration above is `yes`, by my reading of the
diff.** The rule content is the ruled option B. Three things in the text
are this pull's wording and not the card's: the `(reason: …)` spelling
of "a reason on the line", and the two paying edits in `SKILL.md`. The
seat may read it as ruled text and say so on its record.
- **A code span inside a reason.** The reader takes a code-spanned path
as an entry wherever it stands on the line (reading (b) of PR A, left as
built). So a wide path in a code span inside a reason is refused, and
the same words with no code span pass. A file or a sub-directory there
is untouched. This is one of the seat's two open questions without a
ruling; the reader itself is unchanged.
- **A reading-only dispatch.** The other open question (a dedicated
`none` spelling) carries no ruling and nothing is built for it. With
absence refused, such a claim has no accepted spelling at this door and
must name a path.
- **`Claim amendment` is not judged.** It does not open with `Claim:`,
so a widening amendment naming a wide entry passes the door; the new
`area-lease.md` line is what governs it.
- **The workspace is this checkout's.** The door reads the package globs
of the checkout it runs from, whichever repository the card is in. For a
sister repository's card a `packages/NAME` entry is judged by these
globs; a top-level directory is wide in any repository.
- **The refusal heading.** The shared heading said the keyed lines
"cannot be read"; a wide entry is read and refused, so the heading now
says both.
- Not touched, as the card orders: `record-recognisers.mjs`,
`dispatch-gates.mjs`, `check-handover.mjs`.
## Verification
**Read first, by risk:**
1. `scripts/pm/post-stamped.mjs`, `fileSurfaceRefusal` and
`wideEntriesWithoutReason`: the absent branch (it turns a pass into a
refusal for every claim written from now on) and the reason regex.
2. `.claude/skills/pm-dispatch/SKILL.md`: the template line, and the two
paying edits (the state-model bullet, the in-flight check line).
3. `scripts/pm/check-skill-line-ratchet.mjs`: the `area-lease.md` row.
**Two-minute check:** `node scripts/pm/post-stamped.mjs --self-test`
prints `844 cases pass across 30 batteries`. Or write a claim whose
surface line is one package in a code span and nothing else, and run
`node scripts/pm/post-stamped.mjs --dry-run --comment=38333
--file=THAT_FILE`: it exits 2 and prints `[File surface]` with "reads as
a whole package".
<details><summary>Local gates at head <code>a9784a6b</code>: 71 derived,
71 run, 71 exit 0, 0 NOT-MEASURED</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` (no paths; merge base `4d5cfa9f`, 6 files)
derives 71 commands. Each was run with its exit recorded before any
pipe, and `--ran` reads the record:
```text
Run reconciliation — 71 derived, 71 run, 0 NOT-MEASURED, 0 UNRUN.
✓ dispatch-gates --ran: 71 derived famil(ies) accounted for — 71 run, 0 NOT-MEASURED (a DERIVED zero — all 71 recorded an exit code and none of them is 3).
```
- `pnpm check:pm-post-stamped` exit 0: `844 cases pass across 30
batteries`.
- `pnpm check:pm-label-write` exit 0: `407 cases pass across 19
batteries`.
- `pnpm check:pm-skill-ratchet`, `pnpm check:pm-skill-id-lint`, `pnpm
check:skill-frame-sync`, `pnpm check:pm-governed-prose`, `pnpm
check:nul-bytes`: exit 0 each.
- `pnpm check:pm-dispatch-gates`, under the shared verify lock: `VERDICT
command-exit 0`, fast tier 2686 cases.
- `pnpm check:i18n-coverage` and the lint package's
`check:doc-formula-expressions` read built packages. On the first pass,
with nothing built, both answered exit 3 (PREREQUISITE NOT MET). The
packages they name were then built under the lock and the whole list was
run again; the record above is that later pass, after the one merge of
main.
- `node scripts/pm/overlap-check.mjs --branch=HEAD` before each of the
two pushes and once more at this head: `VERDICT clean exit 0`.
- `node scripts/check-platform-checklist.mjs --changed-from
origin/main`: exit 0, 0 anchored files in the change set.
CI on this pull was not waited on.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmRJUY9Ncce14hVHd25)_
<!-- signed: repo:objectstack#3 · os-steve ·
session_01ADHkmRJUY9Ncce14hVHd25 -->
Co-authored-by: Claude <noreply@anthropic.com>1 parent c35318c commit 39064f6
6 files changed
Lines changed: 139 additions & 50 deletions
File tree
- .claude/skills/pm-dispatch
- references
- scripts/pm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3681 | 3681 | | |
3682 | 3682 | | |
3683 | 3683 | | |
3684 | | - | |
| 3684 | + | |
3685 | 3685 | | |
3686 | 3686 | | |
3687 | 3687 | | |
| |||
4082 | 4082 | | |
4083 | 4083 | | |
4084 | 4084 | | |
4085 | | - | |
| 4085 | + | |
4086 | 4086 | | |
4087 | 4087 | | |
4088 | 4088 | | |
| |||
0 commit comments