You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dev-lead fix-bot reverts its own fix on neutral Copilot 'overview' comments → net no-op PRs that falsely close compliance issues #1340
The dev-lead fix-bot step misinterprets a neutral Copilot "pull request overview" comment (state COMMENTED, merely describing the diff) as a change-request, and reverts the exact lines its own feat commit added. The base…head compare then returns zero changed files. Because the PR body says Closes #N, merging the no-op would auto-close the compliance issue while the drift/finding remains unfixed — the idempotent audit then re-opens it, and the cycle repeats.
Confirmed evidence (found during a 50-cap open-PR drain, 2026-07-20)
ContentTwin#355 (issue petry-projects — workflow failures detected 2026-05-21 #344, concurrency drift): commit 26002d8 removed the 17-line drifted concurrency: block (the correct fix); 0c88012 ('fix(bot): address bot feedback') re-added the identical 17 lines → empty net diff. pr-review verdict: do-not-merge. Closed.
In both cases pr-review's cascade caught the no-op (MAJOR finding), but the PRs then sat at fix-requested indefinitely because dev-lead's fix pass reads only reviewThreads (see #1290) and found nothing actionable.
Root cause
fix-bot treats any reviewer comment referencing a removed/added block as an instruction to restore/revert it, without checking the reviewer's review state (a COMMENTED overview is not CHANGES_REQUESTED) or whether reverting nets the diff to zero.
Proposed fixes
Never act on COMMENTED/overview reviews as change-requests — only CHANGES_REQUESTED (or explicit actionable thread comments).
No-op guard: after fix-bot runs, if base…head diff is empty, abort and flag rather than pushing — a PR that nets to zero must never carry Closes #N.
Systemic: this is a likely contributor to the broad fix-requested PR backlog that fills the 50-PR automation cap. Closing the no-op PRs is only a temporary drain — regeneration will reproduce them until fix-bot stops self-cancelling.
Thanks for the thorough write-up and the concrete PR evidence — this is a well-documented root cause report. To help us reproduce and patch this reliably: can you share the exact condition in fix-bot's comment-parsing logic that causes it to treat a COMMENTED-state overview as a change-request (e.g., a specific field check or regex match in the script)?
Issue:#1340 — dev-lead fix-bot reverts its own fix on neutral Copilot 'overview' comments → net no-op PRs that falsely close compliance issues
Scope
Stop the dev-lead fix pass from self-cancelling a PR: (1) never treat a neutral COMMENTED/overview review as a change-request, and (2) add a script-level no-op guard that refuses to push a fix whose net base…head diff is empty, flagging it for a human instead.
scripts/dev-lead-fix-reviews.sh — wire the guard into the active commit_and_push for fix-reviews/fix-bot-comment intents: after commit, before push, abort+flag on net-zero (return 3)
scripts/dev-lead-fix-reviews.sh — teach the fix-reviews and fix-bot-comment call sites to handle rc=3 (no applied/no-changes/retry marker, no auto-merge re-enable)
prompts/dev-lead/fix-reviews.md — Phase-0 + constraint: a COMMENTED/overview review is neutral, never a change-request; never revert the PR's own changes to satisfy it
prompts/dev-lead/fix-bot-comment.md — same guidance: a neutral overview/summary is not an actionable finding
Tests to Write
no-op guard: fix-reviews net-zero diff flags PR (needs-human comment + disable-auto) and does NOT push
no-op guard: fix-bot-comment net-zero diff flags and does NOT push
no-op guard: non-empty net diff pushes normally and posts applied (guard does not fire)
no-op guard: net-zero path does not re-enable auto-merge
prompt: fix-reviews.md instructs not to treat COMMENTED/overview reviews as change-requests
prompt: fix-bot-comment.md states a neutral overview is not an actionable finding
Problem. The fix-bot/fix-reviews pass could misread a neutral Copilot "pull request overview" (review state = COMMENTED, which only describes the diff) as a change-request and revert the exact lines its own feat commit added. That nets the origin/<base>...HEAD diff to zero. Because the PR body says Closes #N, merging that no-op auto-closes the compliance issue while the finding stays unfixed (the idempotent audit then re-opens it) — the fix silently cancels itself.
Fix — two layers (defense in depth):
1. Prevention (prompts). Both prompts/dev-lead/fix-reviews.md and prompts/dev-lead/fix-bot-comment.md now state that a COMMENTED/"pull request overview" review is neutral and must never be treated as a change-request — the agent must not revert/undo its own committed changes to "address" it. Added both as an inline blockquote (right after the Tier-1/CHANGES_REQUESTED guidance) and a Constraints bullet, each citing #1340.
pr_nets_to_zero [base] — returns true when git diff --name-only origin/<base>...HEAD is empty. Fails safe: if the base ref can't be resolved (no ref, fetch fails, no common ancestor) it warns and returns false, so an unverifiable state never blocks a legitimate push.
flag_noop_pr <intent> — posts one deduped needs-human-review comment (marker-keyed per PR+intent), adds the label, and runs gh pr merge --disable-auto. Sets _AM_NEEDS_RESTORE=0 so the EXIT-trap auto-merge restore can't silently re-enable a self-cancelling PR. Honors DEV_LEAD_DRY_RUN.
Wired into commit_and_pushafter the commit and beforepush_no_clobber, scoped to fix-reviews|fix-bot-comment only. On net-zero it flags and returns new code 3 (0=pushed, 1=nothing to push, 3=no-op aborted). Both call sites branch on cp_rc==3: emit a warning, post no applied/no-changes marker, and skip thread-resolution + try_enable_auto_merge.
Tests (TDD, written first). Added 6 tests to tests/dev-lead/unit/test_fix_reviews.bats:
fix-reviews net-zero → flags PR, does not push, disables auto-merge, no false applied
fix-bot-comment net-zero → same
non-empty net diff → pushes normally, posts applied, guard does not fire
Full bats tests/dev-lead/unit/ → only pre-existing failure #260 (REVIEW_MCP_DEBUG, unrelated — confirmed failing on a clean tree via git stash); zero regressions from this change
Activity
github-actions commentedon Jul 21, 2026
Thanks for the thorough write-up and the concrete PR evidence — this is a well-documented root cause report. To help us reproduce and patch this reliably: can you share the exact condition in fix-bot's comment-parsing logic that causes it to treat a
COMMENTED-state overview as a change-request (e.g., a specific field check or regex match in the script)?don-petry commentedon Jul 21, 2026
Dev-Lead Implementation Plan
Issue: #1340 — dev-lead fix-bot reverts its own fix on neutral Copilot 'overview' comments → net no-op PRs that falsely close compliance issues
Scope
Stop the dev-lead fix pass from self-cancelling a PR: (1) never treat a neutral
COMMENTED/overview review as a change-request, and (2) add a script-level no-op guard that refuses to push a fix whose net base…head diff is empty, flagging it for a human instead.Implementation Checklist
scripts/dev-lead-fix-reviews.sh— addpr_nets_to_zerohelper (empty netorigin/<base>...HEADdiff = net-zero)scripts/dev-lead-fix-reviews.sh— addflag_noop_prhelper (deduped human-attention comment +needs-human-reviewlabel + disable auto-merge + suppress the EXIT-trap auto-merge restore)scripts/dev-lead-fix-reviews.sh— wire the guard into the activecommit_and_pushforfix-reviews/fix-bot-commentintents: after commit, before push, abort+flag on net-zero (return 3)scripts/dev-lead-fix-reviews.sh— teach thefix-reviewsandfix-bot-commentcall sites to handle rc=3 (no applied/no-changes/retry marker, no auto-merge re-enable)prompts/dev-lead/fix-reviews.md— Phase-0 + constraint: aCOMMENTED/overview review is neutral, never a change-request; never revert the PR's own changes to satisfy itprompts/dev-lead/fix-bot-comment.md— same guidance: a neutral overview/summary is not an actionable findingTests to Write
fix-reviewsnet-zero diff flags PR (needs-human comment + disable-auto) and does NOT pushfix-bot-commentnet-zero diff flags and does NOT pushapplied(guard does not fire)fix-reviews.mdinstructs not to treatCOMMENTED/overview reviews as change-requestsfix-bot-comment.mdstates a neutral overview is not an actionable findingTest Command
bats tests/dev-lead/unit/test_fix_reviews.bats+bash .dev-lead/scripts/dev-lead-lint.shdon-petry commentedon Jul 21, 2026
Dev-Lead: issue #1340 implemented — no-op guard + neutral-overview prompt guidance
Problem. The
fix-bot/fix-reviewspass could misread a neutral Copilot "pull request overview" (reviewstate = COMMENTED, which only describes the diff) as a change-request and revert the exact lines its ownfeatcommit added. That nets theorigin/<base>...HEADdiff to zero. Because the PR body saysCloses #N, merging that no-op auto-closes the compliance issue while the finding stays unfixed (the idempotent audit then re-opens it) — the fix silently cancels itself.Fix — two layers (defense in depth):
1. Prevention (prompts). Both
prompts/dev-lead/fix-reviews.mdandprompts/dev-lead/fix-bot-comment.mdnow state that aCOMMENTED/"pull request overview" review is neutral and must never be treated as a change-request — the agent must not revert/undo its own committed changes to "address" it. Added both as an inline blockquote (right after the Tier-1/CHANGES_REQUESTED guidance) and a Constraints bullet, each citing #1340.2. Backstop (code no-op guard).
scripts/dev-lead-fix-reviews.sh:pr_nets_to_zero [base]— returns true whengit diff --name-only origin/<base>...HEADis empty. Fails safe: if the base ref can't be resolved (no ref, fetch fails, no common ancestor) it warns and returns false, so an unverifiable state never blocks a legitimate push.flag_noop_pr <intent>— posts one dedupedneeds-human-reviewcomment (marker-keyed per PR+intent), adds the label, and runsgh pr merge --disable-auto. Sets_AM_NEEDS_RESTORE=0so the EXIT-trap auto-merge restore can't silently re-enable a self-cancelling PR. HonorsDEV_LEAD_DRY_RUN.commit_and_pushafter the commit and beforepush_no_clobber, scoped tofix-reviews|fix-bot-commentonly. On net-zero it flags and returns new code 3 (0=pushed, 1=nothing to push, 3=no-op aborted). Both call sites branch oncp_rc==3: emit a warning, post noapplied/no-changesmarker, and skip thread-resolution +try_enable_auto_merge.Tests (TDD, written first). Added 6 tests to
tests/dev-lead/unit/test_fix_reviews.bats:appliedapplied, guard does not firegh pr merge --autoVerification.
bats tests/dev-lead/unit/test_fix_reviews.bats→ 93/93 passbats tests/dev-lead/unit/→ only pre-existing failure#260(REVIEW_MCP_DEBUG, unrelated — confirmed failing on a clean tree viagit stash); zero regressions from this changeshellcheck scripts/dev-lead-fix-reviews.sh→ clean (only pre-existing SC1091 info)dev-lead-lint.sh→ passedFiles changed:
scripts/dev-lead-fix-reviews.sh,prompts/dev-lead/fix-reviews.md,prompts/dev-lead/fix-bot-comment.md,tests/dev-lead/unit/test_fix_reviews.bats.No commit/push performed — CI handles git operations.
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
fix: restore trunk scripts to single-definition state — surgical dedu…
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
feat: implement issue #1340 — dev-lead fix-bot reverts its own fix on…
fix: restore trunk scripts to single-definition state — surgical dedu…
fix: match automation logins without [bot] and tolerate version skew (#…
feat: implement issue #2017 — A lost fix-bot-comment run is never ret…