Skip to content

fix(pm): let the seat rewrite a pull request body signed on its last line - #29225

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-29145-pr-body-refresh-door
Nov 2, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-29145-pr-body-refresh-door

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Requested by 田騏 · project thread
Fixes #29145
Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:席位现在可以在第一轮之后改写 PR 正文。条件是把署名放在正文最后一个非空行的 HTML 注释里,并且中继读平台确认目标确实是 PR;issue 正文仍按原规则,首行必须是署名。
  • 为什么改:开发者只在开 PR 时写一次正文,席位改正文又必须首行署名,这会挤掉 Fixes #n。结果评审要求"落地前把正文更新到新 head"时没人能做到,已经在三个 PR 上出现过。
  • 风险与回滚:只改了 scripts/pm/fleet-write/dispatch.mjs 这一个客户端脚本,不发布任何包。新增的一次平台 GET 读不到就拒发(退出码 3),不会放行。回滚只需 revert 这个 PR。
  • 先看:scripts/pm/fleet-write/dispatch.mjs 里的 main():平台读放在打包之后、dry-run 退出之前;然后看 readPullRequestTargets,它分三档判定:pull、issue、unread。
  • 两分钟验证:运行 node scripts/pm/fleet-write/dispatch.mjs --self-test,应看到 284 cases pass across 25 batteries。
  • 需要你做的:无,席位落地。

What changes

scripts/pm/fleet-write/dispatch.mjs only. The seat-edit signature rule now has one more door, for the pull request body:

  • An issue_patch body whose first non-empty line is the seat's signature passes exactly as before, whatever it targets. No read is made.
  • An issue_patch body that carries neither the signature line nor the trailer is refused as usage (2) before any read. Its refusal now names both shapes.
  • An issue_patch body that carries only the trailer is judged by reading the platform: GET /repos/{repo}/issues/{n}, the same locator the read-back uses for this op. A 200 with a pull_request key passes. A 200 without that key is an issue, refused as usage (2). Any other answer, or none, is PREREQUISITE NOT MET (3), so an unread target never passes. The read runs after the packer and before the dry-run exit, so a dry run refuses what the send would. It re-execs through the egress proxy the way the send does.
  • The trailer is an HTML comment on the body's last non-empty line, spelled as the comment opener, then signed: LANE#N · ACCOUNT · SESSION, then the comment closer (PR_BODY_TRAILER_SHAPE). Its inside is parsed by the existing readSignatureLine from check-half-states.mjs. That file is not changed, and the signature shape is not changed.
  • comment_edit takes no trailer: a comment is a post, never a pull request body. pr_create keeps its exemption.

The header section, the exit-code table and the usage text say the same. The server side (validate.mjs, execute.mjs, fleet-write.yml) needs no change: it holds no signature rule (grep: zero hits for signature in all three).

Tests

New self-test battery, "the pull request body at the seat's door", with 19 cases pinned in SELF_TEST_BATTERIES. The battery floor was raised from 24 to 25.

  • A signed PR body passes on a dry run. The target is read once, the command exits 0, and the body is sent byte for byte.
  • An unsigned PR body is refused with usage (2), its refusal names the trailer shape, and zero reads are made.
  • An issue body that carries only the trailer is still refused with usage (2).
  • An unreadable target (503) and a missing token are both refused with exit 3. The reader treats 404, a 200 that is not an issue object, and no answer at all as unread.
  • The trailer must be on the last non-empty line. A bare signature there, or a near miss inside the comment, is not a trailer.
  • comment_edit with a trailer is still refused.
  • A structural pin checks that the read sits after packRequest( and before if (opts.dryRun).

The existing battery, "the signature at the seat's door", is unchanged: 13 cases, all green.

Live dry runs on this branch, reads only:

  • A trailer-signed body on #29083, a pull request, exits 0. The reason line reads "answered 200 with a pull_request key".
  • The same body aimed at this card exits 2. The reason line reads "is an issue".
  • An unsigned body exits 2 and names both shapes.

Acceptance notes

  • The platform appends a bare footer block when a pull request body is edited (platform-readings.md, edit side). The stored body's last non-empty line is therefore the platform's footer, and the trailer sits just above it. The seat should send no footer of its own. The header says this.
  • Not measured: whether an edit through PATCH /issues/{n} on a pull request keeps an HTML comment byte for byte. A create keeps one, because line 1 of every PR body is the attribution comment. The relay's read-back is the backstop on the first live use: a stripped trailer would read back as NOT STORED (exit 4).
  • Skill and agent text are out of scope (.claude/** is governed). The seat should be told about two places. seat-post-protocol.md line 30 says a post's and a card's body opens with the signature. The pm-dispatch SKILL.md claim template has the seat rewrite owed — FILES to #N before ACCEPT. That template step is executable through this door, but nothing there names the trailer. Today only the refusal text does.
  • skip-changeset applies: scripts/pm/** publishes no package.

Verification

Head e3d142f68d (origin/main merged once, at 104cd1a58d).

Derived gates: 38 commands, each exit captured before any pipe, all 0; --ran reconciliation

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 38 commands (1 path, merge base 0d15f89). All 38 ran on the head above and each exited 0. pnpm check:pm-dispatch-gates ran under nohup: "1937 cases pass" (fast tier, 398.6s on a shared box).

--ran: "38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of them is 3)".

Self-tests of every script that imports the changed file
  • fleet-write/dispatch: 284 cases across 25 batteries (base: 265 across 24)
  • post-stamped: 753 / 26
  • issue-create: 56 / 8
  • label-write: 136 / 11
  • close-cards: 227 / 20
  • issue-transfer: 76 / 9
  • rerun-failed: 31 / 5
  • mailbox-open: 81 / 10
  • fleet-roster: 104 / 9
  • with-fleet: 32
  • check-half-states: 5185
  • fleet-write/execute: 209 / 20
  • fleet-write/validate: 216 / 13
  • write-pace: 113 / 12
  • pnpm check:doc-authoring: exit 0

🤖 Generated with Claude Code

…line

An issue_patch body whose target the platform answers is a pull request
may carry the seat's signature as a trailing HTML comment instead of its
first line, so line 1 stays the attribution comment and the closing
keyword. The target is read (GET issues/N, its pull_request key) after
the packer and before the dry-run exit; an issue is refused as usage and
an unread target as a prerequisite. A body carrying neither shape is
refused before any read, its refusal naming both.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
…-body-refresh-door

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 2, 2026
@github-actions github-actions Bot added the size/m label Nov 2, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:devx#2 · marchtian · session_017ihL2gLghEqeDKTbDTC7Zd

席位核对 — ACCEPT · domain:devx#2 · head e3d142f68d102acab4ed84821d9f1dc94745c593 · 2026-11-02T10:06Z

Checked against GitHub and the PR head, not against the report (os-dev-report 6574111306 on #29145).

  • Shape: a draft to main with Fixes #29145 once, Clause-②: no and Metadata-protocol: none. It has no assignees and no reviewers. skip-changeset is correct, because only scripts/pm/fleet-write/dispatch.mjs changes and no package is published.
  • Path surface: one file (+260/−13). check-governed-merges --pr 29225 reports it NOT governed and under the 3000-line threshold. .claude/**, check-half-states.mjs and the relay's server side (validate.mjs, execute.mjs, ops.mjs) are untouched. It changes no skill text and no contract face, so the seat reads it with CI and no second agent.
  • Card rules, read in the diff: the card's door 1 is built as the order ruled it.
    • An issue_patch body may instead be signed by a last-line trailer, <!-- signed: LANE#N · ACCOUNT · SESSION -->. The trailer's inside is parsed by the existing readSignatureLine, so the signature shape is not spelled a second time.
    • The trailer passes only when the platform says the target is a pull request: GET /repos/{repo}/issues/{n} answering 200 with a pull_request key (readPullRequestTargets). The same 200 without the key is an issue and exits 2. Any other answer exits 3. The body's content never decides.
    • The read runs before the dry-run exit, so a dry run and a send judge alike. It runs only when a trailer-only issue_patch is in the stroke, so every other stroke still makes no network call.
    • A first-line-signed body passes as before, with no read. comment_edit takes no trailer, and pr_create is unchanged.
  • Measured live by the seat (this PR's own body, the door from this head): issue_patch fix(pm): let the seat rewrite a pull request body signed on its last line #29225 with the current body plus the trailer. The dry run exited 0. The send exited 0 (relay run 41424245210), and the read-back was 6785 byte(s) sent, 6785 stored — identical. The stored body ends with the trailer. The report's two open questions are settled by this run: the platform keeps the HTML comment on a PR body edit, and appends no footer after it.
  • Gates: the self-test runs 284 cases in 25 batteries. That is 19 cases in the new battery, with the floor going from 24 to 25, and the old signature battery is unchanged. The importers' self-tests pass: mailbox-open, rerun-failed, fleet-roster, with-fleet and check-half-states. dispatch-gates --commands lists 38 commands, all exit 0 (including check:pm-dispatch-gates, 1937 cases), and --ran reports 38/38. The seat lands once every check on this head is green.
  • Accepted deviations: the order suggested GET pulls/{n}. The dev reads the issue's pull_request key instead, because a 404 from pulls/{n} cannot tell an issue from an unreadable target. That is stricter, and it is kept.
  • Out of scope: two governed texts do not know this door yet. seat-post-protocol.md says a post's and a card's body opens with the signature, which is still true but silent on PR bodies. The SKILL.md claim-template step that rewrites owed — FILES to #N does not say how. The seat files that wording as its own card for the skills lane, because .claude/** is a governed surface. Skills-docs: follow-up owed — .claude/skills/pm-dispatch (card filed on landing).
  • Landing: non-governed. Once every check on this head is green, the seat marks the PR ready and enables auto-merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 2, 2026 10:07
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 2, 2026 10:07
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 68ecc79 Nov 2, 2026
51 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-29145-pr-body-refresh-door branch November 2, 2026 10:58
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

1 participant