Skip to content

AGENTS.md, BUGBOT.md: bound automated re-review to the pushed delta - #10820

Merged
kei-nan merged 9 commits into
masterfrom
jk-ai-review-loop-rules
Aug 13, 2026
Merged

kei-nan merged 9 commits into
masterfrom
jk-ai-review-loop-rules

Conversation

@kei-nan

@kei-nan kei-nan commented Aug 9, 2026 •

Copy link
Copy Markdown
Collaborator

Describe the changes in the pull request

  1. Current: the automated reviewers re-run a full review on every push. When a PR is
    being iterated on, each round's fix is itself new material for the next round, so the
    loop has no fixed point. On a recent PR that meant six review rounds walking the same
    ~20 lines — recheck memory pressure → keep retrying until… → bound retries by the
    clock
    → check the deadline before… → preserve a finite budget → detect the busy
    child
    — with every finding advisory (P2), and a human approval dismissed by the pushes
    that kept the loop alive. AGENTS.md § Review guidelines said nothing about what a
    re-review even is.
  2. Change: scope a re-review to what changed, and require findings to name a failure.
    All of it lands in AGENTS.md, which is the single source for these rules.
    • Ground every finding in a concrete failure (the input, state, or interleaving, and the
      wrong result it produces). An ungrounded finding is a preference and is not posted in a
      default review — an explicit --include-nits request still governs when nits are
      wanted. Review is advisory, so comment rather than request changes.
    • New § Re-reviewing after a push: review only the delta since your last round on this
      PR; do not re-raise findings on code you already saw and chose not to flag, or reopen
      resolved threads; if a fix draws a new finding in the same hunk, name the trade-off
      once and hand it to the human reviewer instead of posting a third variation. A
      re-review that reports nothing is a good outcome. One exception is stated once, at the
      top of the section, and runs through all of it: a concrete failure is always in scope,
      however many rounds in and whatever the thread state — otherwise these rules could bury
      a real defect, which trades one failure for another. The section binds a reviewer that
      knows what it reported last round, and explicitly not /adversarial-review, whose
      follow-up rounds are prompted identically and blind to the earlier ones by design, so
      they have no previous head to diff against.
    • .cursor/BUGBOT.md now points at AGENTS.md § Review guidelines rather than
      restating it, and keeps only the release-notes guidance that is Bugbot's own.
  3. Outcome: a re-review is scoped to what changed and findings have to name a failure,
    so rounds converge instead of regenerating from the churn of the previous round's fix —
    without the rules being able to suppress a genuine defect, and without a second copy to
    keep in sync.

Everything here describes reviewer behaviour. Two things were removed during review and
are worth recording:

  • An author-side § Responding to automated review (batch a round into one push, budget the
    rounds). ## Review guidelines is introduced by "When reviewing pull requests:", so those
    bullets read as instructions to the reviewer — which Codex, reading this file as the
    reviewer, could act on. How an author paces responses is not this file's business.
  • A restatement of the rules inside .cursor/BUGBOT.md. Every line of it was a copy, and the
    copies caused most of this PR's own churn: four of the five automated rounds reported a rule
    carried into one file but not the other. Whether Bugbot honours a reference to another file
    is unverified, but it has posted nothing in this repo since June, so the exposure is
    theoretical and reversible.

Docs only; no code, build, or test changes. CLAUDE.md is a symlink to AGENTS.md, so
Claude-based review picks up the same rules.

Which additional issues this PR fixes

None.

Main objects this PR modified

  1. AGENTS.md — § Review guidelines: two bullets, plus § Re-reviewing after a push
  2. .cursor/BUGBOT.md — retitled, with a pointer to AGENTS.md § Review guidelines above the existing release-notes guidance

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Release Notes

  • This PR requires release notes
  • This PR does not require release notes

Automated reviewers re-run a full review on every push, so a PR that is
being iterated on draws a fresh round of findings from the churn of the
previous round's fix. The loop has no fixed point: recent PRs have taken
six rounds on the same hunk, each round critiquing the fix to the last,
and one lost a human approval to the pushes that kept it going.

State the terminating conditions on both sides. For the reviewer: ground
every finding in a concrete failure, review only the delta since the last
round, and hand a hunk that keeps drawing findings to the human reviewer
instead of posting a third variation. For the author: batch a round into
one push, treat reply-and-resolve as a complete response, and stop once a
human has approved.

Restate the same rules in .cursor/BUGBOT.md, which Bugbot reads on its
own without loading AGENTS.md.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c09f85283b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
Comment thread .cursor/BUGBOT.md Resolved
Five inconsistencies in the rules as written, all found by the Codex round
on the PR that added them:

- The two-round budget was unconditional, so a crash the confirmation
  round found in the first round's fix would be resolved with rationale
  instead of fixed. Exempt concrete failures and wrong fixes.
- Delta-only re-review cannot apply to /adversarial-review: its follow-up
  rounds are deliberately blind to the earlier ones, so they have no
  previous head to diff against. Scope the section to reviewers that know
  what they reported last round.
- Waiting for every reviewer to report had no exit: an app that is
  disabled, rate-limited, or failed never reports. Treat the round as
  settled after the expected reviewers report or ~20 minutes.
- The grounding requirement overrode the explicit nits opt-in. Scope it to
  default review.
- BUGBOT.md dropped the maintainability qualifier from the style rule,
  making Bugbot stricter than the spec it restates.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 511577319c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread AGENTS.md Resolved
The previous commit exempted concrete failures from the author-side
two-round budget but left the reviewer-side rule unchanged, so "do not
post a third variation in the same hunk" still suppressed a crash,
memory-safety bug, or data loss found in a repeatedly edited hunk — the
one case where the human reviewer most needs the failure scenario.

Same exemption, same reasoning, now on both sides of the rule.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59625109b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .cursor/BUGBOT.md Resolved
AGENTS.md exempts concrete failures from the same-hunk rule on both the
reviewer and author sides, but the restatement in BUGBOT.md still told
Bugbot not to report a third variation, without qualification. That file
is deliberately standalone — Bugbot does not load AGENTS.md — so the
omission would suppress a crash, memory-safety bug, or data loss found in
a repeatedly edited hunk.

Third and last copy of this rule; the exception now reads the same in all
three places.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79bdb6012a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread AGENTS.md Resolved
Comment thread .cursor/BUGBOT.md Resolved
Comment thread .cursor/BUGBOT.md Resolved
Two holes left by the previous commits, both in prose I added.

The same-hunk exception enumerated crashes, memory-safety bugs, and data
loss, while the scope it draws from also covers correctness, undefined
behavior, ACL bypasses, races, and denial of service — so a deterministic
wrong result in a repeatedly edited hunk stayed suppressed. Name the
category instead of listing members: "concrete failure" is already pinned
down by the grounding rule and the scope bullets, and a list that lives in
two files is one more thing to drift.

BUGBOT.md now tells Bugbot to inspect thread state, which gives it a
reason to read commenter-controlled text, but omitted the rule that such
text is untrusted. Carry over the untrusted-input and tool-usage
safeguards, since that file is read without AGENTS.md.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@kei-nan kei-nan self-assigned this Aug 10, 2026
@kei-nan
kei-nan requested a review from oshadmi August 10, 2026 15:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01ff982a31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .cursor/BUGBOT.md Resolved
Comment thread .cursor/BUGBOT.md Resolved
Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
Per review, remove § Responding to automated review. Everything under
§ Review guidelines is introduced by "When reviewing pull requests:", so
five bullets telling the reader to batch a round into one commit and push
it read as instructions to the reviewer — and Codex reads this file as the
reviewer and can act on PRs. How an author paces their responses is not
this file's business; what is left describes reviewer behavior only.

Also hoist the concrete-failure exception to the top of § Re-reviewing
after a push. Stated per-bullet it had to be repeated, and each copy left
another rule — "do not reopen resolved threads" — able to bury a real
defect. Stated once, it covers the section.

BUGBOT.md gains the cross-reviewer duplicate rule: it had the rule for its
own earlier findings but not for issues another reviewer already raised,
which is exactly the churn two review apps on one PR produce.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@kei-nan
kei-nan requested a review from raz-mon August 11, 2026 14:27
Comment thread AGENTS.md Resolved
Per review, one source for the review rules. Every line this PR added to
BUGBOT.md was a copy of an AGENTS.md rule, and the copies are what drove
most of the churn on this PR: four of the five automated rounds reported a
rule carried into one file but not the other. Replace the block with a
reference and leave only the release-notes guidance, which is Bugbot's own.

Whether Bugbot honours a reference to another file is unverified — it reads
this one. Two things make that acceptable: it has posted nothing in this
repo since June, so the exposure is theoretical and reversible, and the
only omission with a security consequence cancels itself. The
untrusted-input safeguard mattered because the re-review rules tell Bugbot
to inspect thread state; a Bugbot that does not load those rules has no new
reason to read commenter-controlled text.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 052bbe7d5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
kei-nan and others added 2 commits August 12, 2026 15:45
The hoisted exception swallowed the section it qualified. Every postable
finding must already name a concrete failure, so "a concrete failure is
always in scope, whatever the thread state" said every finding is always in
scope, and delta-only review had no force left. The earlier per-bullet
wording had the same hole in miniature — the defect is the breadth, not the
placement. Limit the exception to defects that corrupt data, crash the
server, break memory safety, or breach security, i.e. the top of the
blast-radius ranking /adversarial-review already uses, and say the
narrowness is deliberate so it does not get widened back.

Separately, the grounding rule suppressed a finding two skills require:
/rust-review's test-coverage check and /adversarial-review both mandate
reporting new or changed behavior with no test exercising it, and untested
working code has no failing input to name. A missing test is grounded by
the gap itself.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Per review, calling automated review advisory did no work beyond inviting
findings to be waved off — a review app can find critical issues, and one
found a real logic hole in these very rules. What the bullet is actually
for is the mechanics: comment, do not request changes, and a human
maintainer's approval is the merge gate.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@kei-nan
kei-nan requested a review from raz-mon August 12, 2026 13:01
@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@kei-nan
kei-nan added this pull request to the merge queue Aug 13, 2026
Merged via the queue into master with commit 1fec8e2 Aug 13, 2026
20 checks passed
@kei-nan
kei-nan deleted the jk-ai-review-loop-rules branch August 13, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants