Skip to content

fix(review-remote-pr): triage CodeRabbit findings posted as issue comments - #575

Merged
thewrz merged 11 commits into
mainfrom
feat/issue-566
Aug 30, 2026
Merged

fix(review-remote-pr): triage CodeRabbit findings posted as issue comments#575
thewrz merged 11 commits into
mainfrom
feat/issue-566

Conversation

@thewrz

@thewrz thewrz commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

This was written agentically; verify its assertions:

Why

pr-to-green triage read CodeRabbit reviews and inline threads only. CodeRabbit also posts findings as plain issue comments — chat replies, @user I found one blocking issue, "outside diff range" notes — and those never entered triage: PR #552 (2026-08-28) was declared settled with an unaddressed P1 sitting in its conversation tab, and the operator reported the same miss on #555/#558.

Stacked on #572 — merge that PR first. Agent-driven merges run chain-advance.sh --retarget --pr <this-PR> --base main and require its full proof before merging; interactive human merges may merge then delete the predecessor branch for GitHub's automatic retarget.

What

  • New review-remote-pr/scripts/classify-issue-comment-findings.sh (list / count / mark-answered): one finding per **P[0-9] —** / **Actionable** / "outside diff range" block in coderabbitai[bot] or github-code-quality[bot] issue comments, keyed comment_id#index, surface=issue-comment; a local append-only answered-ledger since no thread exists to resolve.
  • gh-pr-state.sh digest gains an unconditional issue-comment-findings: N open line (REST evidence, independent of GraphQL thread capability) and --issue-comment-answered FILE.
  • provider-rules.md: "Issue-comment finding handling" (assess → reply quoting the header + fix SHA → mark-answered) and the settle rule; the PR-loop-setup template reports icf-open: N.
  • 27 new classifier assertions (incl. the fix(parallel-issues): operator-named issues with stale In-progress status are dropped as active under --fast-mode #552 fixture → exactly one P1), +8 gh-pr-state assertions, helper inventory ratchet updated.

Decisions

  • The provider-login predicate sources the shared provider-identity.sh (matches gh-pr-state.sh/classify-author.sh) rather than a duplicated regex.
  • finding-ledger.sh / review-ledger.sh untouched on purpose: both track different concepts (adversarial verdicts; review coverage); issue-comment answered-state got its own small ledger.
  • SKILL.md bodies untouched (review-remote-pr's sits at its exact ratchet, 8337/8337); detail lives in the references those bodies already delegate to.
    base=26ee61ba6b76302681bf83ff80ce1e0168e63206
    files=7
    total.insertions=572
    total.deletions=4
    total.lines=576
    operational.files=7
    operational.insertions=572
    operational.deletions=4
    operational.lines=576
    generated.files=0
    generated.insertions=0
    generated.deletions=0
    generated.lines=0
    lockfile.files=0
    lockfile.insertions=0
    lockfile.deletions=0
    lockfile.lines=0
    fixture.files=0
    fixture.insertions=0
    fixture.deletions=0
    fixture.lines=0
    non_operational.files=0
    non_operational.insertions=0
    non_operational.deletions=0
    non_operational.lines=0

Testing

  • tests/test-classify-issue-comment-findings.sh (27) and extended tests/test-gh-pr-state.sh green
  • Full agent-run.sh --cmd test ALL GREEN on the final tree (.agent/logs/20260830T064513Z-test.log)
  • CI green on this PR
  • Sol xhigh adversarial review receipt posted

🤖 Co-authored by Claude Fable 5 (root) / claude-sonnet-5 high (worker).

Closes #566

mergetest and others added 6 commits August 29, 2026 22:15
…review-ledger.sh cover

A one-shot adversarial receipt writes covered_heads exactly once, at publish time. Any later fix, merge-down, or retarget makes review-ledger.sh status report stale, and the one-spend rule forbids re-reviewing to clear it -- deadlocking green, reviewed PRs (issue #567, evidence from #552/#555/#558/#562). Add a `cover` subcommand that appends {sha, reason, covered_at} onto the latest matching entry after proving the new head is a git descendant of the reviewed head, wire a best-effort call site into chain-advance.sh retargets, and document the pr-to-green fix-batch/merge-down call sites so a later transition is recorded instead of falsified or parked.

Co-Authored-By: Claude claude-sonnet-5 <noreply@anthropic.com>
…er in review-ledger.sh cover

Adversarial-review fix batch on PR #569 (four findings, root-accepted). F1: cmd_cover proved ancestry only against an entrys original head_sha, so a force-push that dropped an already-covered fix commit could still pass cover for a sibling child of that head_sha; ancestry is now proven against the entire covered frontier (head_sha plus every already-covered SHA). F2: idempotence keyed on the SHA alone, silently dropping the coverage event for the ordinary head-unchanged/base-changed retarget case; it now keys on the (sha, reason) pair. F3: chain-advance.sh unfiltered cover call could extend a non-adversarial (e.g. bot) entry instead of the receipt; it now passes --kind adversarial, documented at the auto-merge.md call site too. F4: the retarget lineage hooks gh api --paginate call emitted one bare JSON array per page instead of the single array review-ledger.sh requires; it now slurps and flattens with --slurp --jq add.

Co-Authored-By: Claude claude-sonnet-5 <noreply@anthropic.com>
…ged base branch

merge-pr.sh --delete-branch deleted a merged head without checking for open PRs still based on it; GitHub closes such a dependent instead of retargeting when it is a draft or not cleanly mergeable, silently ending a chain (issue #564, evidence: PR #484, #561). --delete-branch now checks for open dependents first: by default it retargets each to the merge target before deleting (or, with --no-retarget, refuses the delete and names them); a post-delete safety net recovers any dependent GitHub still closed via a new chain-advance.sh --recover-closed helper. authorize-queue.sh additionally records a per-PR deleteBranch of "deferred" (from pr-queue.sh's new hasOpenSuccessor fact) when a confirmed predecessor still has an open successor in the same queue, so merge-pr.sh can refuse the delete from the authorization record alone.

Co-Authored-By: Claude claude-sonnet-5 <noreply@anthropic.com>
… --kind adversarial, paginate fix)

# Conflicts:
#	tests/test-chain-advance.sh
# Conflicts:
#	agentkit/skills/parallel-issues/scripts/chain-advance.sh
#	agentkit/skills/pr-to-green/SKILL.md
#	tests/test-chain-advance.sh
…ments

CodeRabbit and github-code-quality[bot] sometimes post a real finding (a
"**P1 -- ...**" call-out, an "**Actionable**" block, or an "outside diff
range" note) as a plain issue comment instead of a review or inline thread --
agent-kit PR #552s blocking P1 landed exactly that way and was never
triaged. Add classify-issue-comment-findings.sh (list/count/mark-answered)
to turn each matching block into a comment_id#index-keyed finding with
surface=issue-comment; wire its open count into gh-pr-state.sh's digest
(independent of GraphQL thread availability) and pr-loop-setups icf-open
terminal signal; document the assess/reply/mark-answered cycle and the
settle rule (a PR is not settled while any issue-comment finding is open)
in provider-rules.md. Closes #566.

Co-Authored-By: Claude claude-sonnet-5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a6ff19a1-a2a4-4d28-9936-fbce05c3efe8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

mergetest and others added 3 commits August 29, 2026 23:56
…r-closed cleanup/resume

Adversarial-review fix batch for PR #572 (three root-accepted P2 findings). F1: merge-pr.sh raw-PATCH-retargeted open dependents before their own merge-down/ancestry proof, which can reintroduce the predecessor's diff into an unrebuilt dependent and leave its CI evidence stale after a squash merge; refusing the delete is now the default, and the PATCH retarget moves behind an explicit --retarget-dependents opt-in documented as safe only after the caller has already merged the updated default branch into each dependent and completed chain-advance.sh --retarget's proof for it. F2: chain-advance.sh --recover-closed deleted its temporary base ref unconditionally, even when this invocation only reused a pre-existing one; it now tracks whether this run created the ref and re-verifies the ref still points at the recreated SHA before ever deleting it. F3: a partial recovery that reopened the PR but failed before retargeting left it permanently refused on retry; recover-closed now recognises that verified state (open, live base ref still at the recorded base SHA) and resumes at the retarget step instead of refusing.

Co-Authored-By: Claude claude-sonnet-5 <noreply@anthropic.com>
Adversarial review of the issue-comment finding classifier (agent-kit#566)
found four accepted P2s:

F1: pr-loop-setup called classify-issue-comment-findings.sh count with no
--answered, so any finding a prior cycle already answered read open
forever. Define one durable per-PR answered-ledger path
($RUN_DIR/state/pr_<N>_issue_comment_answered.ndjson) and thread it through
every count/list/mark-answered call in the template and prose.

F2: "**Actionable comments posted: 0**" -- CodeRabbits own zero-findings
summary -- classified as a finding. Parse the count and only emit a finding
for N>0; a bare "**Actionable**" block elsewhere in the comment is matched
separately so real blocks are never dropped.

F3: a priority call-out silently suppressed every other finding in the same
comment (an exclusive if/else). Collect all three finding shapes
independently per comment, then dedupe only overlapping/identical header
text -- genuinely distinct findings in one comment now all survive.

F4: identity was comment_id#index alone, so a bot editing a comment at the
same index would read as already answered. Add a sha256 content
fingerprint (kind+priority+header) to every finding; list/count/mark-answered
now require id AND fingerprint to match before treating a finding as
answered -- an edited comment correctly reopens.

Tests: zero-count summary (F2), mixed priority+actionable comment (F3), an
overlap case verifying dedup still collapses truly identical blocks, and an
edited-comment-same-index case proving the finding reopens (F4) and that
re-answering it under its new fingerprint is a fresh ledger record. Also
hardened a related gap found in review: a missing sha256sum/shasum now
fails closed with a diagnosed evidence-unavailable message instead of an
unexplained set -e abort mid-fingerprint.

Co-Authored-By: Claude claude-sonnet-5 <noreply@anthropic.com>
@thewrz

thewrz commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator Author

This was written agentically; verify its assertions:

Adversarial review receipt

  • Reviewer: provider=openai; model=gpt-5.6-sol; effort=xhigh; mode=cross-provider (reason: peer CLI present; roster cross-harness candidate)
  • Counts: P1=0; P2=4; total=4
  • Confirmed finding: Setup never passed --answered so answered findings stayed open — verdict=fixed; fix commit SHA(s)=09753b1544888ce634370ccc962d08a1256beee9
  • Confirmed finding: Actionable comments posted: 0 counted as a finding — verdict=fixed; fix commit SHA(s)=09753b1544888ce634370ccc962d08a1256beee9
  • Confirmed finding: Priority match suppressed other finding forms in the same comment — verdict=fixed; fix commit SHA(s)=09753b1544888ce634370ccc962d08a1256beee9
  • Confirmed finding: Finding identity lacked a content fingerprint — verdict=fixed; fix commit SHA(s)=09753b1544888ce634370ccc962d08a1256beee9

🤖 Co-authored by Claude Fable 5 (root).

@thewrz

thewrz commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator Author

This was written agentically; verify its assertions:

Review ledger

Machine-readable record of every review already performed on this PR.

{
  "version": 1,
  "pr": 575,
  "repo": "wrzonance/agent-kit",
  "reviews": [
    {
      "kind": "adversarial",
      "provider": "openai",
      "model": "gpt-5.6-sol",
      "effort": "xhigh",
      "mode": "cross-provider",
      "harness": "claude",
      "head_sha": "09753b1544888ce634370ccc962d08a1256beee9",
      "covered_heads": [
        "09753b1544888ce634370ccc962d08a1256beee9",
        "15965d2194ddb316d89170f824fe732bf79feca8",
        "a4d1a2a20e15e92ca052c7c581b1eb290a9bf755"
      ],
      "diff_payload": "wrzonance/agent-kit:575:cac002d018a0354eaeca3f4cd16f9e5dccb8996dccec99c18f3bf030a49bee3b",
      "counts": {
        "p1": 0,
        "p2": 4
      },
      "reviewed_at": "2026-08-30T07:21:18Z",
      "coverage": [
        {
          "sha": "15965d2194ddb316d89170f824fe732bf79feca8",
          "reason": "merge-down:ed78b46669c85b94f9b3b1525d7ed20797d4a0d2",
          "covered_at": "2026-08-30T07:43:14Z"
        },
        {
          "sha": "a4d1a2a20e15e92ca052c7c581b1eb290a9bf755",
          "reason": "merge-down:3d82486e8057f8fcbf5a10800f5b051cec7ca972",
          "covered_at": "2026-08-30T07:54:31Z"
        }
      ]
    }
  ]
}

🤖 Co-authored by Claude Fable 5 (root).

@thewrz
thewrz changed the base branch from feat/issue-564 to main August 30, 2026 07:43
@thewrz
thewrz marked this pull request as ready for review August 30, 2026 07:54
@thewrz
thewrz merged commit f076e97 into main Aug 30, 2026
4 checks passed
@thewrz
thewrz deleted the feat/issue-566 branch August 30, 2026 07:54
thewrz pushed a commit that referenced this pull request Aug 30, 2026
…cks stop growing

wait-ci settled the instant zero checks were pending, so a repo whose four-check
matrix registers one workflow at a time (agent-kit#571/#574/#575) reported ci=1/4
as done before the other three checks even existed, costing the caller a second
wait and a false red at the merge gate. Settling now requires the registered
check count to be identical across two consecutive rounds with nothing
queued/in_progress, plus an optional --expect-checks floor (defaulted from the
base branch's own head) that refuses to settle below it before the round
budget is exhausted. Closes #578.

Co-Authored-By: Claude claude-sonnet-5 <noreply@anthropic.com>
thewrz added a commit that referenced this pull request Aug 30, 2026
… the first zero-pending snapshot (#580)

* fix(review-remote-pr): gh-pr-state.sh --wait-ci settles only once checks stop growing

wait-ci settled the instant zero checks were pending, so a repo whose four-check
matrix registers one workflow at a time (agent-kit#571/#574/#575) reported ci=1/4
as done before the other three checks even existed, costing the caller a second
wait and a false red at the merge gate. Settling now requires the registered
check count to be identical across two consecutive rounds with nothing
queued/in_progress, plus an optional --expect-checks floor (defaulted from the
base branch's own head) that refuses to settle below it before the round
budget is exhausted. Closes #578.

Co-Authored-By: Claude claude-sonnet-5 <noreply@anthropic.com>

* fix(review-remote-pr): honor --expect-checks floor and stop inferring a default

gh-pr-state.sh --wait-ci settled ci=0/0 as none-configured after the zero-check grace window even when an --expect-checks floor was set and real checks were still about to register, hiding the exact evidence the floor exists to protect (F1). Separately, the default floor auto-resolved from ALL of the base branchs completed check-runs over-counted push-only workflows (e.g. deploy), so a PR with one green check could never settle and would burn its whole --rounds budget (F2). Keep polling past the grace window whenever a floor is set, report the shortfall instead of settling early when the round budget runs out, and drop the auto-resolved default entirely so --expect-checks only ever reflects what the caller explicitly asked for.

Co-Authored-By: Claude claude-sonnet-5 <noreply@anthropic.com>

---------

Co-authored-by: mergetest <merge@test.local>
Co-authored-by: Claude claude-sonnet-5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(pr-to-green): CodeRabbit findings posted as issue comments (outside review threads) never enter triage

1 participant