pr-review-loop: a body edit is not an entry point, and one PR holds one review #45

Merged
pit merged 1 commit from hermes/pr-review-edit-trigger into main 2026-11-08 11:25:27 +00:00
Owner

Summary

pull_request/edited
  ├── changes.body    a description rewrite          → not an entry point   (new)
  ├── changes.title   the draft's WIP prefix dropped → pr_opened             (unchanged)
  └── changes.ref     a retarget                     → pr_opened             (unchanged)

Decide · the duplicate guard
  a label write  → same route + same head
  an entry event → same route, whatever the head    (new: one review per PR in flight)

docs/automations/pr-review-loop.md records the rule; test-payloads/pr-edited-body.json is the event, replayable.

Evidence

Before — olympus/infra-secrets#30, two reviews of one commit, 989e247:

time (UTC) what
10:45:42 n8n exec 72241 — pull_request/opened → review dispatched, round 1
10:46:23 branch force-pushed (rebased onto SC-23's merge)
10:46:40 n8n exec 72247 — pull_request/edited, changes: {body: …} → review dispatched again, round 1
10:49:24 review #1: APPROVED
10:50:34 review #2: REQUEST_CHANGES

The push itself was ignored (pull_request_sync is not a trigger, exec 72246), and the true duplicate deliveries were absorbed (execs 72242, 72248) — but the dedupe was keyed on the head, and the rebase had moved it.

After — published, then a real body edit against the live webhook (pit/pr-loop-sandbox#6, a closed throwaway whose body was restored byte-for-byte afterwards):

exec 72303  nodes run: ['Parse event']  lastNodeExecuted: 200 ignored
Parse event -> {action: 'edited', proceed: false, kind: 'ignore',
                reason: 'pull_request/edited to the body is not an entry point'}

Nothing dispatched. The sandbox PR's body was verified identical to its previous value.

Suites, run against the published graph re-exported into the record (versionId == activeVersionId == d5d39d01-f7fe-40d9-a705-9bbf3a192d50):

  • node pr-review-loop/tests/parse.test.js — 17/17
  • node pr-review-loop/tests/decide.test.js — 100/100

New cases: a body edit refused; the readiness title edit still admitted; a retarget and a title+body edit still admitted; a body edit on a PR holding review state refused; a repeat open on a head a push moved absorbed with the marker intact; an open past the stale window still dispatches.

Merge Danger

Door: two-way for the record, and the behaviour is already live — the instance runs the published graph, so merging changes nothing in production and reverting this file does not revert the loop. The way back on the instance is publish_workflow with the previous version id 046970b1-acd6-4762-86ee-4b172720d25e.

Blast Radius: review dispatch

Two things the record now carries that are worth knowing:

  • The live Config node's notes read engage_bot_author, a stale canvas hand-edit (the field is engage_authors). No MCP operation reaches a node's notes, so the record mirrors the canvas rather than this PR fixing it.
  • A human duplicate now restores the in-flight marker it used to blank. Without that, the new open-path absorption would have left the marker empty and the 20-minute sweeper with nothing to escalate.
## Summary ``` pull_request/edited ├── changes.body a description rewrite → not an entry point (new) ├── changes.title the draft's WIP prefix dropped → pr_opened (unchanged) └── changes.ref a retarget → pr_opened (unchanged) Decide · the duplicate guard a label write → same route + same head an entry event → same route, whatever the head (new: one review per PR in flight) ``` `docs/automations/pr-review-loop.md` records the rule; `test-payloads/pr-edited-body.json` is the event, replayable. ## Evidence **Before** — `olympus/infra-secrets#30`, two reviews of one commit, `989e247`: | time (UTC) | what | | --- | --- | | 10:45:42 | n8n exec 72241 — `pull_request/opened` → review dispatched, round 1 | | 10:46:23 | branch force-pushed (rebased onto SC-23's merge) | | 10:46:40 | n8n exec 72247 — `pull_request/edited`, `changes: {body: …}` → **review dispatched again**, round 1 | | 10:49:24 | review #1: APPROVED | | 10:50:34 | review #2: REQUEST_CHANGES | The push itself was ignored (`pull_request_sync` is not a trigger, exec 72246), and the true duplicate deliveries were absorbed (execs 72242, 72248) — but the dedupe was keyed on the head, and the rebase had moved it. **After** — published, then a real body edit against the live webhook (`pit/pr-loop-sandbox#6`, a closed throwaway whose body was restored byte-for-byte afterwards): ```text exec 72303 nodes run: ['Parse event'] lastNodeExecuted: 200 ignored Parse event -> {action: 'edited', proceed: false, kind: 'ignore', reason: 'pull_request/edited to the body is not an entry point'} ``` Nothing dispatched. The sandbox PR's body was verified identical to its previous value. **Suites**, run against the published graph re-exported into the record (`versionId == activeVersionId == d5d39d01-f7fe-40d9-a705-9bbf3a192d50`): - `node pr-review-loop/tests/parse.test.js` — 17/17 - `node pr-review-loop/tests/decide.test.js` — 100/100 New cases: a body edit refused; the readiness title edit still admitted; a retarget and a title+body edit still admitted; a body edit on a PR holding review state refused; a repeat open on a head a push moved absorbed with the marker intact; an open past the stale window still dispatches. ## Merge Danger **Door:** two-way for the record, and the behaviour is already live — the instance runs the published graph, so merging changes nothing in production and reverting this file does not revert the loop. The way back on the instance is `publish_workflow` with the previous version id `046970b1-acd6-4762-86ee-4b172720d25e`. **Blast Radius:** review dispatch Two things the record now carries that are worth knowing: - The live `Config` node's **notes** read `engage_bot_author`, a stale canvas hand-edit (the field is `engage_authors`). No MCP operation reaches a node's notes, so the record mirrors the canvas rather than this PR fixing it. - A human duplicate now restores the in-flight marker it used to blank. Without that, the new open-path absorption would have left the marker empty and the 20-minute sweeper with nothing to escalate.
pr-review-loop: a body edit is not an entry point, and one PR holds one review
All checks were successful
pr-checks / loop-decide (pull_request) Successful in 10s
pr-checks / protect-main (pull_request) Successful in 17s
d2575e3344
Forgejo sends pull_request/edited for a rewritten description and for a draft's
title losing its WIP prefix, and Parse event admitted both. infra-secrets#30
rewrote its body 57 s after opening; the rebase in between had moved the head,
so the head-keyed dedupe found no run to absorb it and a second reviewer started
on the same commit — one approving, one blocking.

Parse event now refuses an edit whose only change is the body. Decide's
duplicate guard drops the head term for an entry event (an open, or the edit
that marks a draft ready) while a review is in flight for that PR: the reviewer
already reading the PR reads the head it finds, and a label write keeps the head
term so a reviewer's next finding on a moved head still reaches the fixer. A
human duplicate also restores the in-flight marker it used to blank.
Member

Review started (round 1/5) on d2575e3344 — reading the diff now.

**Review started** (round 1/5) on d2575e3344d1773c43c39aff5868bc4d2ceabe3c — reading the diff now.
bot-minos approved these changes 2026-11-08 11:18:02 +00:00
bot-minos left a comment

repo: olympus/workshop · PR: #45 · head: d2575e3344d1773c43c39aff5868bc4d2ceabe3c · round: 1/5 · verdict: APPROVE

Recommendation: merge


Standards

ADVISORY — pr-review-loop/workflows/forgejo-pr-review-loop.json:499 — the Config node's notes now name engage_bot_author, a field that does not exist. The same node declares engage_authors at :470, the Decide node's own header comment lists engage_authors, and docs/automations/pr-review-loop.md:101 documents engage_authors. The PR body says this is a stale canvas hand-edit mirrored because no MCP operation reaches a node's notes, and docs/automations/pr-review-loop.md:235 says the export is "the graph as the instance holds it" — so the mirror follows the stated policy. The cost is that the one place a reader looks up the knobs now names a field that will be silently ignored if they add it. Smallest fix: leave this hunk out until the canvas note is corrected, or correct the note on the canvas and re-export.

ADVISORY — docs/automations/pr-review-loop.md:74-76 — "An edited delivery counts only as the draft's readiness transition" is not the rule the code implements. Parse event refuses an edited delivery only when changes.body is present and changes.title is absent; a retarget (changes.ref) and an edit carrying no changes object at all still reach Decide as an open — and pr-review-loop/tests/parse.test.js:86-87 asserts the retarget case on purpose. Smallest fix: state what the code does ("a rewritten description — changes.body without a title change — is not an entry point") and drop "only".

Spec

No missing or partial requirement. All six behavioural claims reproduce (see below).

No scope creep requiring a change: the only hunks outside the rule are the export's own metadata — the notes line at :499 (already the finding above, not counted twice) and the versionId bump at :799, which is what re-exporting the graph carries.

Summary

Axis Findings Blockers Worst
Standards 2 0 :499 — a wrong config knob name in the record's own documentation
Spec 0 0 —

No blocker. Two advisories, both advice; the recommendation does not turn on the count.

Verified

  • mise exec -- node pr-review-loop/tests/decide.test.js → 100/100; …/parse.test.js → 17/17 (the two suites the pr-checks / loop-decide job runs).
  • Both suites re-run against the base workflow (git show cc7735f5:pr-review-loop/workflows/forgejo-pr-review-loop.json) → 97/100 and 16/17, failing exactly the new assertions: a body edit -> not a trigger, and the three 17b checks including the marker (sha1, not sha-moved). The new tests fail on the old code for the reason claimed, so they are not passing for the wrong reason.
  • pr-review-loop/test-payloads/pr-edited-body.json replayed through the workflow's real Parse event code with the headers send-test-event.sh n8n sends → proceed: false, reason: "pull_request/edited to the body is not an entry point", pr: 9999. The fixture does what the body says it does.
  • scripts/docs-check.py → 3/3 assertions hold; workflow JSON and fixture both parse.
  • Traced the new duplicate expression by hand over bot/human × pr_opened/label × same head/moved head/past-stale: the head term survives only where the docs say it does (label writes, fix routes, past the stale window), and the human branch's restore leaves the marker the sweeper escalates on.

Could not verify

  • The live-instance evidence — exec 72303, pit/pr-loop-sandbox#6, and versionId == activeVersionId == d5d39d01-f7fe-40d9-a705-9bbf3a192d50. No access to n8n at 10.12.0.128, so "the behaviour is already live" is taken as stated, not confirmed.
  • "Forgejo delivers every event twice" — accepted as given; the guard is correct whether or not a delivery is ever duplicated.
  • The two pr-checks contexts were still pending on d2575e3 when I started, so I ran both suites by hand as above.
`repo: olympus/workshop` · `PR: #45` · `head: d2575e3344d1773c43c39aff5868bc4d2ceabe3c` · `round: 1/5` · `verdict: APPROVE` Recommendation: merge --- ## Standards **ADVISORY — `pr-review-loop/workflows/forgejo-pr-review-loop.json:499`** — the Config node's notes now name `engage_bot_author`, a field that does not exist. The same node declares `engage_authors` at `:470`, the Decide node's own header comment lists `engage_authors`, and `docs/automations/pr-review-loop.md:101` documents `engage_authors`. The PR body says this is a stale canvas hand-edit mirrored because no MCP operation reaches a node's notes, and `docs/automations/pr-review-loop.md:235` says the export is "the graph as the instance holds it" — so the mirror follows the stated policy. The cost is that the one place a reader looks up the knobs now names a field that will be silently ignored if they add it. Smallest fix: leave this hunk out until the canvas note is corrected, or correct the note on the canvas and re-export. **ADVISORY — `docs/automations/pr-review-loop.md:74-76`** — "An `edited` delivery counts only as the draft's readiness transition" is not the rule the code implements. `Parse event` refuses an `edited` delivery only when `changes.body` is present *and* `changes.title` is absent; a retarget (`changes.ref`) and an edit carrying no `changes` object at all still reach `Decide` as an open — and `pr-review-loop/tests/parse.test.js:86-87` asserts the retarget case on purpose. Smallest fix: state what the code does ("a rewritten description — `changes.body` without a title change — is not an entry point") and drop "only". ## Spec No missing or partial requirement. All six behavioural claims reproduce (see below). No scope creep requiring a change: the only hunks outside the rule are the export's own metadata — the `notes` line at `:499` (already the finding above, not counted twice) and the `versionId` bump at `:799`, which is what re-exporting the graph carries. ## Summary | Axis | Findings | Blockers | Worst | | --- | --- | --- | --- | | Standards | 2 | 0 | `:499` — a wrong config knob name in the record's own documentation | | Spec | 0 | 0 | — | No blocker. Two advisories, both advice; the recommendation does not turn on the count. ## Verified - `mise exec -- node pr-review-loop/tests/decide.test.js` → **100/100**; `…/parse.test.js` → **17/17** (the two suites the `pr-checks / loop-decide` job runs). - Both suites re-run against the base workflow (`git show cc7735f5:pr-review-loop/workflows/forgejo-pr-review-loop.json`) → **97/100** and **16/17**, failing exactly the new assertions: `a body edit -> not a trigger`, and the three 17b checks including the marker (`sha1`, not `sha-moved`). The new tests fail on the old code for the reason claimed, so they are not passing for the wrong reason. - `pr-review-loop/test-payloads/pr-edited-body.json` replayed through the workflow's real `Parse event` code with the headers `send-test-event.sh n8n` sends → `proceed: false, reason: "pull_request/edited to the body is not an entry point", pr: 9999`. The fixture does what the body says it does. - `scripts/docs-check.py` → 3/3 assertions hold; workflow JSON and fixture both parse. - Traced the new `duplicate` expression by hand over bot/human × `pr_opened`/`label` × same head/moved head/past-stale: the head term survives only where the docs say it does (label writes, `fix` routes, past the stale window), and the human branch's restore leaves the marker the sweeper escalates on. ## Could not verify - The live-instance evidence — exec 72303, `pit/pr-loop-sandbox#6`, and `versionId == activeVersionId == d5d39d01-f7fe-40d9-a705-9bbf3a192d50`. No access to n8n at `10.12.0.128`, so "the behaviour is already live" is taken as stated, not confirmed. - "Forgejo delivers every event twice" — accepted as given; the guard is correct whether or not a delivery is ever duplicated. - The two `pr-checks` contexts were still `pending` on `d2575e3` when I started, so I ran both suites by hand as above.
pit merged commit 831eb14f49 into main 2026-11-08 11:25:27 +00:00
pit deleted branch hermes/pr-review-edit-trigger 2026-11-08 11:25:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
olympus/workshop!45
No description provided.