Skip to content

feat: implement issue #1425 — [Phase 4] A review bot that can create blocking threads but is not in dev-lead's TRUSTED_BOTS creates an unclearable merge block (graphite-app; root cause of the 2026-08-02 deadlock) - #1497

Merged
don-petry merged 5 commits into
mainfrom
dev-lead/issue-1425-20260812-0038
Aug 12, 2026

Conversation

@don-petry

@don-petry don-petry commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

User description

Closes #1425

Implemented by dev-lead agent. Please review.


CodeAnt-AI Description

Prevent review bots from creating merge blocks that dev-lead cannot clear

What Changed

  • Added graphite-app, qodo-code-review, and codeant-ai to the trusted review-bot set so their blocking review threads are handled by dev-lead
  • Made the reviewer-source registry the default source for trusted bots, advisory checks, and scorecards instead of maintaining separate lists
  • Added a validation rule that rejects any bot able to create review threads unless dev-lead is trusted to act on them
  • Added automated checks covering registry consistency and graphite-app review handling

Impact

✅ Fewer uncleareable merge blocks
✅ Review threads from supported bots are actionable
✅ No drift between bot trust and review gates

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • Improvements

    • Automated review handling now derives trusted and advisory review sources from a centralized registry.
    • Added support for additional review bots, including Graphite, Qodo, and CodeAnt.
    • Review routing remains configurable through existing settings, with safe fallback behavior when registry data is unavailable.
    • Added validation to ensure review sources are consistently recognized across automated checks.
  • Tests

    • Expanded coverage for reviewer registration, trust rules, formatting, routing, and configuration behavior.

…blocking threads but is not in dev-lead's TRUSTED_BOTS creates an unclearable merge block (graphite-app; root cause of the 2026-08-02 deadlock)
@don-petry
don-petry requested a review from a team as a code owner August 12, 2026 00:55
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@codeant-ai

codeant-ai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 157387e Aug 12, 2026 · 00:55 00:57

@codeant-ai

codeant-ai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@don-petry, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 29eabc79-0036-4463-85aa-cf19f928a17c

📥 Commits

Reviewing files that changed from the base of the PR and between 5bb0d00 and c22ef7a.

📒 Files selected for processing (3)
  • scripts/lib/advisory-review-gate.sh
  • scripts/lib/reviewer-sources.sh
  • tests/test_reviewer_sources.bats
📝 Walkthrough

Walkthrough

The change adds a shared reviewer-source registry helper, derives dev-lead and advisory bot lists from registry data, validates the thread-creator trust invariant, and adds documentation and Bats coverage.

Changes

Reviewer registry integration

Layer / File(s) Summary
Reviewer-source registry contract
scripts/lib/reviewer-sources.sh
The helper resolves the TSV manifest, queries reviewer flags, formats trusted bots, and validates that thread creators are dev-lead trusted.
Consumer list derivation
.github/workflows/dev-lead-reusable.yml, scripts/dev-lead-intent.sh, scripts/lib/advisory-review-gate.sh
Dev-lead derives trusted bots from the registry when unset. The advisory gate derives advisory and rate-limit bot lists, with literal fallbacks when the helper is unavailable.
Registry validation and coverage
docs/dev-lead/spec.md, tests/test_reviewer_sources.bats, tests/dev-lead/unit/test_intent_reviews.bats, tests/dev-lead/unit/test_advisory_review_gate.bats, .github/workflows/lint.yml
Documentation records the invariant. Tests validate registrations, consumer projections, shellcheck diagnostics, and Graphite routing. The new registry test runs in lint CI.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant dev-lead-reusable.yml
  participant dev-lead-intent.sh
  participant reviewer-sources.sh
  participant reviewer-sources.tsv
  participant advisory-review-gate.sh

  dev-lead-reusable.yml->>dev-lead-intent.sh: provide empty TRUSTED_BOTS default
  dev-lead-intent.sh->>reviewer-sources.sh: request trusted-bot CSV
  reviewer-sources.sh->>reviewer-sources.tsv: read reviewer registrations
  reviewer-sources.tsv-->>reviewer-sources.sh: return flagged sources
  reviewer-sources.sh-->>dev-lead-intent.sh: return trusted bot list
  advisory-review-gate.sh->>reviewer-sources.sh: request advisory and all logins
  reviewer-sources.sh-->>advisory-review-gate.sh: return derived bot lists
Loading

Possibly related PRs

Suggested labels: standards-sync

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The registry, trust invariant, and tests are covered, but no changes address the #1424 fallback or the documented contradiction required by AC4 and AC5. Add the #1424 unactionable-thread signal integration and update docs/adding-an-agentic-role.md to remove the contradiction and unblock #1421.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies issue #1425 and the main change: preventing unactionable review-bot merge blocks through shared trust handling.
Description check ✅ Passed The description clearly states the issue, changes, and impact, but it omits the template's interaction-contract and checklist sections.
Out of Scope Changes check ✅ Passed The reviewed changes support the linked issue by centralizing reviewer sources, enforcing trust consistency, and adding targeted tests.
Docstring Coverage ✅ Passed Docstring coverage is 81.82% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-1425-20260812-0038

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Aug 12, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) August 12, 2026 00:56
Comment thread scripts/dev-lead-intent.sh
Comment thread scripts/lib/reviewer-sources.sh
@don-petry
don-petry disabled auto-merge August 12, 2026 00:57

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces a centralized reviewer-source registry (reviewer-sources.tsv and reviewer-sources.sh) to prevent configuration drift among third-party review bots, resolving issue #1425. It updates dev-lead-intent.sh to dynamically derive trusted bots and adds comprehensive BATS tests to enforce registry invariants. The review feedback highlights critical shell scripting issues where short-circuit && operators under set -e could cause premature script termination, and recommends refactoring the BATS tests to utilize $BATS_TEST_TMPDIR instead of manual mktemp and rm operations for better test isolation and automatic cleanup.

Comment thread scripts/lib/reviewer-sources.sh
Comment thread scripts/lib/reviewer-sources.sh
Comment thread tests/dev-lead/unit/test_intent_reviews.bats Outdated
Comment thread tests/dev-lead/unit/test_intent_reviews.bats Outdated
Comment thread tests/test_reviewer_sources.bats Outdated
Comment thread tests/test_reviewer_sources.bats Outdated
Comment thread tests/test_reviewer_sources.bats
Comment thread tests/test_reviewer_sources.bats Outdated
Comment thread tests/test_reviewer_sources.bats Outdated
Comment thread tests/test_reviewer_sources.bats Outdated
@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

1 similar comment
@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 12, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

- Replace `&&`-short-circuit guards with `if` statements in
  reviewer-sources.sh so `set -e` cannot swallow the diagnostic
  path when the manifest is absent or the invariant is violated.
- Switch BATS temp files from `mktemp` to `$BATS_TEST_TMPDIR` in
  test_reviewer_sources.bats and test_intent_reviews.bats; drop the
  manual `rm -f` calls that BATS_TEST_TMPDIR makes redundant (and
  that leave files behind on test failure). Also plugs the previously
  leaked `GITHUB_OUTPUT` temp file in the TRUSTED_BOTS derivation test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) August 12, 2026 01:19
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 12, 2026
@don-petry
don-petry disabled auto-merge August 12, 2026 01:20
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: fix-reviews)

PR: #1497
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-08-12T01:54:06Z

@don-petry
don-petry enabled auto-merge (squash) August 12, 2026 01:24
@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #1497
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-08-12T06:30:41Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-08-12T06:30:41Z

@don-petry
don-petry enabled auto-merge (squash) August 12, 2026 06:00
coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 12, 2026

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/lib/reviewer-sources.sh`:
- Around line 81-87: The reviewer-registry projections currently hide read
failures through process substitutions, allowing empty advisory data to pass;
update scripts/lib/reviewer-sources.sh:81-87 in
reviewer_sources_trusted_bots_csv to propagate projection failures, update
scripts/lib/advisory-review-gate.sh:35-43 and :203-207 to capture and validate
projection output before assigning ADVISORY_BOTS and RATE_LIMIT_NOTICE_BOTS, and
add missing-manifest coverage for all three projections in
tests/test_reviewer_sources.bats:38-62.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a661fd27-740b-4871-92cd-d4b45dc05dfc

📥 Commits

Reviewing files that changed from the base of the PR and between 4e0e0cb and 5bb0d00.

⛔ Files ignored due to path filters (1)
  • scripts/lib/reviewer-sources.tsv is excluded by !**/*.tsv
📒 Files selected for processing (9)
  • .github/workflows/dev-lead-reusable.yml
  • .github/workflows/lint.yml
  • docs/dev-lead/spec.md
  • scripts/dev-lead-intent.sh
  • scripts/lib/advisory-review-gate.sh
  • scripts/lib/reviewer-sources.sh
  • tests/dev-lead/unit/test_advisory_review_gate.bats
  • tests/dev-lead/unit/test_intent_reviews.bats
  • tests/test_reviewer_sources.bats

Comment thread scripts/lib/reviewer-sources.sh
@don-petry
don-petry disabled auto-merge August 12, 2026 06:05
@donpetry-bot

Copy link
Copy Markdown
Contributor

CI checks on this PR are still running. Once they complete, re-mention @donpetry-bot to trigger a fresh review.

Posted by the donpetry-bot PR-review cascade.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 12, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@donpetry-bot
donpetry-bot dismissed coderabbitai[bot]’s stale review August 12, 2026 06:16

Auto-dismissed (#617): coderabbitai[bot] CHANGES_REQUESTED on a superseded commit. The bot re-reviews the new head automatically — a valid concern will return as a fresh review.

@don-petry
don-petry disabled auto-merge August 12, 2026 06:16
@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: fix-reviews)

PR: #1497
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-08-12T06:46:54Z

@don-petry
don-petry enabled auto-merge (squash) August 12, 2026 06:16
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-08-12T07:18:57Z.

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: c22ef7accacd24f753c615d8a2d032db1084c072
Review mode: triage-approved (single reviewer)

Summary

Implements the #1425 fix: a single reviewer-source registry (scripts/lib/reviewer-sources.tsv + reviewer-sources.sh) from which dev-lead's TRUSTED_BOTS, the advisory gate's ADVISORY_BOTS/RATE_LIMIT_NOTICE_BOTS, and the scorecard's REVIEWER_BOTS are derived, adding graphite-app, qodo-code-review, and codeant-ai to the trusted set and enforcing the invariant (creates review threads ⇒ dev-lead trusted) in CI. Design is sound, tests are thorough, all threads resolved, CI green.

Linked issue analysis

Closes #1425 (root cause of the 2026-08-02 merge-queue deadlock: graphite-app created blocking review threads dev-lead was not allowed to act on). The PR substantively addresses it: (1) graphite-app/qodo-code-review/codeant-ai are now dev-lead-trusted; (2) the trusted set defaults to a registry projection instead of a hardcoded list, eliminating the drift that caused the incomplete #1355 integration; (3) reviewer_sources_assert_invariant + tests/test_reviewer_sources.bats enforce the invariant so a future reviewer-source registration cannot land half-done; (4) a regression test reproduces the exact deadlock scenario (graphite inline comment → fix-reviews). Docs updated in docs/dev-lead/spec.md.

Findings

No blocking findings.

  • Trust-set expansion (deliberate, per issue): dev-lead will now act on review comments from graphite-app, qodo-code-review, and codeant-ai. This is the explicit intent of owner-authored issue #1425; the intent classifier still verifies sender login and Bot type. AgentShield, Agent Security Scan, and CodeQL all pass.
  • Failure-mode handling is correct: registry sourcing/parse failures hard-fail with ::error:: diagnostics rather than silently falling back; the literal fallbacks apply only when the helper file itself is absent (stripped test env), and they match the registry projections exactly.
  • Minor (non-blocking): tests/dev-lead/unit/test_advisory_review_gate.bats relaxes shellcheck to --severity=warning for advisory-review-gate.sh; repo-wide shellcheck lint still runs and passes.
  • Secret scan: MCP run_secret_scanning tool unavailable in this environment; gitleaks CI check passed (SUCCESS).

CI status

All checks green on c22ef7a: shellcheck, bats, unit-tests, actionlint, CodeQL (actions+python), SonarCloud quality gate, agent-shield, Agent Security Scan, gitleaks secret scan, lint, validate-* suite — all SUCCESS. CANCELLED entries are superseded duplicate runs; SKIPPED entries are ecosystem-specific dependency audits not applicable here. All 14 review threads resolved; no human-reviewer questions outstanding.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

2 participants