Skip to content

fix(pm): H48 and --handoff read a pull sent back for changes as bounced - #39606

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-ibc3un
Dec 4, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-ibc3un

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread
Fixes #39516

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:用户无感;席位巡查和交接工具不再对"已退回修改"的合并请求提示把待合并标签补回去。
  • 为什么做:替维护者解决待合并收件箱里混进未就绪请求的问题,是"退回即撤标签、复审通过再挂"规则的工具这一半。
  • 出错会怎样:最坏是把已退回的请求误读成未退回,巡查照旧提示补标签;只改内部巡查工具,可直接撤回。
  • 要你做什么:无。

What changes

A pull sent back for changes ("退回") now reads as BOUNCED in both readers that prescribe the hand-off's pieces, so neither asks for pm:awaiting-merge back before the re-review passes (landing-operations.md: 「复审过再挂、入队,其间不补四件」).

  • scripts/pm/bounce-reading.mjs (new, pure, no imports) holds the one "bounced since" reading, bouncedSince. Three triggers, each dated:
    1. queue-red: a red merge-queue build of the pull, read from the merge-queue-triage workflow's comment on the pull thread (its per-run merge-queue-triage:RUN marker, author github-actions[bot]). A comment carrying the workflow's infra:no-runner marker is the flake class and does not bounce (ruled term 3: a flake re-queue keeps the label).
    2. review-record: the newest trusted ## Contract review record (one that names a head) reads FAIL or carries an open must-fix or should-fix.
    3. changes-requested: a trusted reviewer's newest deciding review is CHANGES_REQUESTED (a later APPROVED or a dismissal by the same reviewer supersedes it; COMMENTED decides nothing).
      The bounce dates from the newest trigger and clears only on a trusted ## Contract review naming the CURRENT head, with one PASS line and no FAIL spelling or open/unreadable grade (the queue guard's standard), newer than that trigger. An unread thread, review page or author binding reads unread.
  • check-half-states.mjs: h48BounceReading is the ONE wiring (it hands the sibling this file's contract-review readers, so no import cycle with the file's top-level await). H48 takes the reading as a fourth argument and stays quiet while bounced; an unconsulted or unread leg is UNJUDGED (check:react-declaration-parity 是唯一没接进任何 workflow 的源码审计门禁,且无 MANIFEST 时静默 skip 退出 0 —— 它现在永远不可能红 #4690's three states). The sweep buys one submitted-review page only for a PR H48 would otherwise fire on (h48NeedsBounceRead), and the summary clause reports how many read bounced (briefBounced, on the forwarding contract).
  • label-write.mjs --handoff: the gate asks the same h48BounceReading over the thread and review page it already reads. A bounced pull is REFUSED with zero writes, exit 2, under --dry-run too, so the per-round reader never answers exit 7 and the real stroke never re-adds the label; the now H48 line reads ✓ on it.

Merge-queue source used: the merge-queue-triage workflow's comment on the pull thread, neither of the two the dispatch named. Measured on #39400 (2026-12-04): the REST timeline's removed_from_merge_queue event carries commit_id: null, no reason and no run, and it also fires when a person dequeues or the pull merges; GraphQL (which has beforeCommit/reason) is not reachable from a session; the queue's check-runs sit on the merge-group commit, never on the pull's head. The triage comment names the red run, is posted exactly for a merge_group CI run that concluded failure, and lives on the thread both readers already hold (zero new requests for it). Its five comments on #39400 read as five queue-red triggers through the new reader.

Tests

Self-tests on the final head (both green)
  • node scripts/pm/check-half-states.mjs --self-test → ✓ check-half-states self-test: 5505 cases pass (was 5476), new battery H48 bounced pull 29/29.
  • node scripts/pm/label-write.mjs --self-test → ✓ label-write self-test: 414 cases pass across 19 batteries (was 401); --handoff battery pin raised 68 → 81 (at the count).
Pins: one cell per trigger, one exit cell per trigger, the control

H48 (H48 bounced pull battery): control (unbounced ACCEPT, no label → today's finding with Remedy: add pm:awaiting-merge); ① queue-red → no finding, ① exit (newer PASS on current head) → finding; ② newest record FAIL → none, ② exit → finding; ② open should-fix → none, its closing delta → finding; ③ CHANGES_REQUESTED → none, ③ exit → finding. Controls that keep it a narrowing: no-runner red, foreign triage author, untrusted reviewer, later APPROVED, COMMENTED under a request, newer PASS on an older head, newer PASS by an untrusted author, red before a fix push (still bounced), unconsulted and unread legs UNJUDGED, the gathering policy, the triage workflow still printing both markers (source pin), the sweep wiring (source pin), the summary key.

--handoff --dry-run (label-write --handoff battery): control exit 7; ① dry run exit 2 with now H48 ✓ and zero sends, ① real stroke exit 2 with zero sends, ① exit → exit 7; ② newest record FAIL → exit 2, ② exit → 7; ② open should-fix → exit 2; ③ CHANGES_REQUESTED → exit 2, ③ exit → 7; controls: no-runner, foreign author, later APPROVED, untrusted reviewer → exit 7.

Red on main first (base 7039fd6)
  • The new label-write cells pasted into a detached worktree of 7039fd68 and run there: 5 red — ① dry got [7,0,0,false,false], ① real stroke got [0,1,0,false,false] (exit 0, the label put back), ② FAIL [7,…], ② open [7,…], ③ [7,…]; the exit cells and controls are green there (they describe today's behaviour).
  • main's H48 driven with the same trigger fixtures: ① queue-red, ② FAIL, ② open should-fix and ③ (main reads no reviews) each answer a finding whose remedy is add pm:awaiting-merge.
  • ⚠️ On --handoff, a FAIL or open-grade record naming the CURRENT head was already refused on main by the guard's PASS standard; the ② cells there use the shape main answered exit 7 on: the newest record names another head while the older same-head PASS still stands.
Ablation of the bounce read (committed head, restored byte-exact)

node scripts/ablation-replace.mjs replaced the no-trigger return in bouncedSince with an unconditional clear (anchor 1 → 0, blob 1f2afd85b88e → 715b4918b107), ran both self-tests, restored (blob == HEAD, git diff HEAD empty). check-half-states: 10 of 5505 red, every trigger cell and every "still quiet" cell; label-write: 5 of 414 red, every trigger cell (the real stroke got [0,1,0,…]). Exit cells and controls stayed green.

Acceptance notes

  • Queue-red is not narrowed to the same head. The card names "a red merge-queue removal on the same head"; the reader keeps any red bounced until a PASS on the current head newer than it. Narrowed, a fix pushed after the red would read clear before its re-review and H48 would ask for the label back, against 「复审过再挂」. The same-head case the card names is a subset and is pinned.
  • --handoff answers exit 2 on a bounced pull, not 0. A bounced pull is not a hand-off candidate, the same way a pull with no ACCEPT is refused today; the real stroke must not write the label either, so the refusal covers both.
  • CHANGES_REQUESTED is trusted through the record-author binding (relay identity + GOVERNED_APPROVERS), not author_association: the maintainer's own review on fix(spec)!: refuse a field whose inline options repeat a value #39400 reads CONTRIBUTOR.
  • The clearing PASS uses the guard's PASS-line standard but not its served-tier check; --handoff still applies its own stricter same-head PASS check, so the door never hands off on a weaker PASS than before.
  • Bound: the bounce reads the PULL thread only; a review record posted only on the card thread does not bounce here.
  • Not changed: H43 in the sweep does not read the bounce. On the measured bounce shape the approver requests stay pending, so H43 is already quiet; a bounced pull whose requests were also withdrawn would still be asked for a request. Noted, not filed.
  • The sibling module has no --self-test of its own: its pins live in its two readers' self-tests, as seat-record.mjs's do (a new CI step would touch a governed workflow).
  • No changeset: scripts/pm/** publishes nothing (skip-changeset on this pull).

Verification

Read first, by risk:

  1. scripts/pm/bounce-reading.mjs — bouncedSince: the trigger set, "newest trigger", and the clearing comparison.
  2. scripts/pm/label-write.mjs — the bounce refusal in handoffGate (after the PASS stands, before hand-off records ✓).
  3. scripts/pm/check-half-states.mjs — h48GovernedVerdictWithoutBrief's new bounce gate and the sweep's review-page buy.

Two-minute check: node scripts/pm/check-half-states.mjs --self-test — expect the last line to list H48 bounced pull 29/29.


Generated by Claude Code

A bounce-back takes pm:awaiting-merge off, and the label returns only after
the fix passes re-review. H48 and `label-write.mjs --handoff --dry-run` still
read an ACCEPT plus a same-head PASS with no label as a missing piece, so the
next patrol prescribed the label back on a pull the maintainer cannot merge.

One shared reader in scripts/pm/bounce-reading.mjs, wired once through
`h48BounceReading` in check-half-states, reads three triggers: a red
merge-queue build (the merge-queue-triage workflow's comment on the pull
thread), a newest contract-review record reading FAIL or carrying an open
must-fix or should-fix, and a member's CHANGES_REQUESTED review. A trusted
PASS on the current head newer than the newest trigger clears it. H48 stays
quiet while bounced and is unjudged when the leg could not be read; --handoff
refuses with zero writes (exit 2, never exit 7 under --dry-run).

Claude-Session: https://claude.ai/code/session_01L9qibwWshzDX2XGDrhKHAo
Measured on the bounced pull that prompted the card: the maintainer's own
review there reads author_association CONTRIBUTOR, so a member-association
filter would have ignored the maintainer asking for changes. The reviewer is
now trusted through the same binding the records are read through (the relay
identity and GOVERNED_APPROVERS), never a second login list.

Claude-Session: https://claude.ai/code/session_01L9qibwWshzDX2XGDrhKHAo
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Dec 4, 2026
@github-actions github-actions Bot added the size/m label Dec 4, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv

L1-a · ACCEPT · #39606 @ 428eb43d50 · Area: ot-build · read 2026-12-04T10:20Z

  • Face: scripts/pm/** only. The paths are not governed and no guard instrument is touched (check-half-states.mjs, label-write.mjs, the new bounce-reading.mjs). Clause-②: no, Metadata-protocol: none. So no L2 is owed, and this is not Tier H. This is the seat's TIER_DEFAULT read.
  • Card fit and Fixes: H48 and --handoff now read the same bounce reading (h48BounceReading, one wiring). The card asks for three triggers, each pinned with its exit, and an unbounced control. All are present in both batteries: H48 H48 bounced pull, 29 cells; --handoff battery 68 → 81. Fixes #39516 is right.
  • Deviations from the card text, weighed:
    1. Queue-red source = the merge-queue-triage comment, not the timeline event. Accepted. The dev measured that removed_from_merge_queue carries no head and also fires on merge and on manual dequeue. merge-queue-triage.yml at this head runs on workflow_run of CI, only for merge_group with conclusion failure, and prints the merge-queue-triage:RUN marker the reader greps. A source pin reds if either marker is renamed. The guard workflow is separate, so a missing-approval eviction writes no triage comment and does not bounce, which agrees with 「缺批准被踢不摘」.
    2. Queue-red not narrowed to the same head. Accepted. The exit is "a trusted PASS on the current head newer than the trigger", so a fix push leaves the PR bounced until its re-review. Narrowing would read it clear in between, which is the opposite of 「复审过再挂」. The pin a red before a fix push … still reads bounced holds this.
    3. --handoff refuses a bounced PR with exit 2 and zero writes, under --dry-run too. Accepted. This is what stops the per-round reader from answering exit 7 and the seat from filling the pieces back in (「其间不补四件」). An unread leg is unread (UNJUDGED), never exit 7.
    4. CHANGES_REQUESTED trusted through the record-author binding. Accepted. A stranger's request must not silence H48. author_association is measured unusable (CONTRIBUTOR on the maintainer). A later APPROVED or dismissal supersedes the request, and COMMENTED decides nothing, all pinned.
  • Observation (no change asked): every failure-class triage comment bounces, including a flaky test red that the seat re-enqueues on the same head while keeping the label (「flake … 被踢不摘」). With the label and brief on, H48 returns before it asks the bounce, so the patrol is unaffected. A --handoff re-run on such a PR would refuse until a same-head PASS newer than the red. This is fail-closed and cheap; record it if a seat meets it.
  • Out-of-scope notes, for the seat to file (my read: both should be cards):
    • H43 ignores the bounce. Its remedy (request the approver) is one of the four pieces 「其间不补四件」 forbids on a bounced PR, so it is the same defect class as this card.
    • H48 reads an older ACCEPT after a later REWORK. This predates the PR; a REWORK should void the earlier ACCEPT for H48.
  • Cost: the sweep buys one reviews page only for a PR H48 would otherwise fire on (h48NeedsBounceRead). A full page reads unread rather than short.
  • Changeset: skip-changeset, no published package touched. Right.
  • Gates at 428eb43d50 (l1-face.mjs --pr 39606, CLEAN): Lint & Repo Gates success, TypeScript Type Check success, 32 success · 23 expected-skip names · 0 failed · 0 pending, mergeable clean.

Not Tier H: the seat lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibxjHbaJSwcu6suJxbB

2026-12-04T10:22Z · Seat record · land PR #39606 (#39516) at head 428eb43d504d24b952539c3e9af4921a2461ce60.

  • Readings: NOT governed, no guard instrument (scripts/pm/bounce-reading.mjs new, check-half-states.mjs, label-write.mjs); CI 32 success / 27 skipped / 0 failed; no L2 owed.
  • domain:skills card on a pure scripts/pm/ surface: the seat read the diff itself (H48 quiet while bounced, one shared bounce reading for H48 and --handoff). K = 12 (first-parent from the merge base).
  • L1-a ACCEPT 7408593345 (four deviations accepted). Out-of-scope notes (a) H43 ignores the bounce, (b) H48 reads an older ACCEPT after a later REWORK → filed as cards by the seat.
  • Landing authority: the maintainer, project chat 2026-12-04T06:37Z, verbatim 「复审通过的 PR 座位自己落地」.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pm tooling: H48 and --handoff --dry-run re-add pm:awaiting-merge to a PR the seat sent back for rework

2 participants