Repository navigation
Commit 003104e
fix(pm): a claim its own session later yielded is not the card's claim (#26016)
Fixes #25791
Clause-②: no
Metadata-protocol: none
## What this changes
A `Claim:` comment that its own session later yielded is no longer read
as a claim of the card. This applies in both claim readers in
`scripts/pm/check-half-states.mjs`, and through them in the
closing-target guard (`scripts/check-closing-target-claim.mjs`,
check-run "The card this PR closes must claim this branch").
- New export `yieldedClaimIndexes(commentRows)`, the only recogniser. It
takes REST rows or bare bodies and returns the indexes of yielded
claims. A claim counts as yielded only when all three of these hold:
1. a comment's first non-blank line reads the protocol's `already
claimed — yielding` (`CLAIM_YIELD_MARKER`, read through the shipped
`markerMatches` decoration reading; no dash or wording dialect);
2. that first line names exactly one distinct session id
(`SEAT_SESSION_ID`);
3. the claim's own session (`claimSessionId`: the first session id on
its `Session:` line) is that session, and the claim precedes the yield
(`created_at` when both parse and differ, thread order otherwise, the
same rule `claimGovernance` uses).
- `claimGovernance` skips yielded claims for both of its readings
(`governing` and the newest-claim `malformed` reading).
- `h46ClaimNamesBranch` skips yielded claims, so H46 leg (b) and the
guard's positive predicate agree with governance.
- The guard imports the same predicate. It does not fork one. Its "no
claim at all" failure sentence now says that a yielded claim does not
count.
What the card's "Wanted" section asked to keep, kept: a yield naming no
session, a yield naming two sessions, a hyphen-written yield, a yield by
another session, and a `Claim:` the yielding session posts after its
yield all keep today's reading. Only the yield's first line is read. The
measured yield names the winning claim and its session in its body, and
reading the whole body would withdraw the winner's claim.
The yield spelling already in use was machine-readable enough, so
`execution-duties.md` is not touched, and this PR changes no governed
surface.
## Mechanism, measured on PR #25780's thread (card #25729) at
`origin/main` `05f7758f`
Readers run over the live comment rows of #25729:
| thread | `claimGovernance` before | after | `h46ClaimNamesBranch(loser
branch)` before | after |
|:--|:--|:--|:--|:--|
| up to the yield (claim A on a card-thread branch, claim B, B yields) |
governing = B's branch, `malformed` null, so the guard said UNCLAIMED
(red, run 40183909709) | governing null, `malformed` = A, so
UNDETERMINED (pass, warned) | true | false |
| with the hand re-post of A | `malformed` = re-post (UNDETERMINED) |
`malformed` = re-post (unchanged) | true | false |
All three PM hypotheses held. (1) `CLAIM_BRANCH_SHAPE` gives zero
branches for `claude/project-thread-biervl`. (2) The `.some` counted the
yielded claim. (3) `newest` included the yielded claim. With the yield
skipped in both readers, the measured red goes away, and a PR on the
yielded branch no longer passes on a claim whose session yielded it.
## Tests
- `node scripts/check-closing-target-claim.mjs --self-test`: 121 cases
pass. New battery "A claim its own session later YIELDED is not the
card's claim" (16 cases, pinned at 16; the roster floor goes 12 to 13).
It covers the acceptance pair: claim A on a protocol branch, claim B, B
yields. The guard is CLEAN for A (one comment page) and a FINDING for B,
and the failure names A's branch. It also covers the card-thread winner
(no red; UNDETERMINED, warned), the five today's-reading controls, and
the no-fork pin: CLAIMED equals the shipped `h46ClaimNamesBranch` over
every yield fixture.
- `node scripts/pm/check-half-states.mjs --self-test`: 4962 cases pass.
New battery "Yielded claim reading" with 21 cases (pinned at 19). It
holds the measured #25729 race verbatim in the lines the readers read, a
protocol-branch control, the decoration, precedence and bare-body cases,
and the controls that must withdraw nothing. Every pre-existing case
stays green.
- No ablation: the diff is scripts only (os-dev: scripts are not
ablated).
## Gates (local, at `f32ecea4`)
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 43 families from the two changed
paths. Each was run with its exit code captured before any pipe, and all
43 exited 0. That includes `pnpm check:closing-target-claim`, `pnpm
check:pm-half-states` and `pnpm check:pm-dispatch-gates`, the last under
`os-verify-lock`: "VERDICT command-exit 0", fast tier 1917 cases.
- `--ran` reconciliation: "✓ dispatch-gates --ran: 43 derived famil(ies)
accounted for — 43 run, 0 NOT-MEASURED (a DERIVED zero — all 43 recorded
an exit code and none of them is 3)."
- Changeset: none. `scripts/pm/**` and `scripts/check-*` publish
nothing, so the PR carries `skip-changeset`.
## Acceptance notes
- Out of scope and deliberately not changed: `CLAIM_BRANCH_SHAPE` parses
only the `claude/issue-N-slug` shape. A claim naming a card-thread
branch (`claude/project-thread-…`) therefore gives no branch, and every
such PR reads UNDETERMINED in this guard. That includes this PR, whose
card claim names `claude/project-thread-1r3slx`. On a race whose winner
is on such a branch, the loser's PR also reads UNDETERMINED rather than
red. The self-test pins that it is no longer CLAIMED, and nothing
further. The guard header records why the branch reader is not widened
here (the 2026-08-11 ruling; the repair direction is the write side).
The report carries it as a finding for the seat.
- A yield comment whose body happens to contain a line starting `Claim:`
would still be read as a claim, as today. No such yield was measured.
This is noted only.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01LqKsGyMNFwwnbF5FTAqyPn)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 431f065 commit 003104e
2 files changed
Lines changed: 243 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
| |||
281 | 289 | | |
282 | 290 | | |
283 | 291 | | |
284 | | - | |
| 292 | + | |
285 | 293 | | |
286 | 294 | | |
287 | 295 | | |
| |||
314 | 322 | | |
315 | 323 | | |
316 | 324 | | |
| 325 | + | |
317 | 326 | | |
318 | 327 | | |
319 | 328 | | |
320 | 329 | | |
321 | | - | |
| 330 | + | |
322 | 331 | | |
323 | 332 | | |
324 | 333 | | |
| |||
618 | 627 | | |
619 | 628 | | |
620 | 629 | | |
621 | | - | |
622 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
623 | 633 | | |
624 | 634 | | |
625 | 635 | | |
| |||
1245 | 1255 | | |
1246 | 1256 | | |
1247 | 1257 | | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
1248 | 1318 | | |
1249 | 1319 | | |
1250 | 1320 | | |
| |||
0 commit comments