feat: implement issue #1091 — [Phase 2] Issue-type classifier + specialist deep-review prompts via the rubric registry - #1223
Conversation
…alist deep-review prompts via the rubric registry
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 55 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds issue-type classification to triage and routes Tier 2 reviews to logic, performance, security, or style specialist prompts through registry-backed resolution, with fallback behavior and offline Bats coverage. ChangesDeep specialist routing
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request implements an issue-type classifier and specialist deep-review routing. The triage tier now classifies escalated diffs into one of four categories (security, logic, performance, or style) and routes the deep review to a corresponding specialist prompt resolved via the rubric registry, with a fallback to the monolithic deep review prompt. Feedback on the pull request identifies that the newly added specialist prompts expect the SAFETY_CHECKS_FILE and DOWNSTREAM_IMPACT_FILE environment variables to be set, but these are not currently exported in scripts/review-one-pr.sh. A code suggestion is provided to export these variables if the corresponding files exist.
Dev-Lead — review-changes (applied)Changes committed and pushed. |
There was a problem hiding this comment.
Pull request overview
Implements Phase 2 of #1091 by adding an issue-type classifier output to the triage tier and using rubric-registry data to route the deep-review tier to specialist prompts (security/logic/performance/style), with a safe fallback to the existing monolithic prompts/deep-review.md.
Changes:
- Extend triage output contract to include a
typelabel and define classification guidance inprompts/triage.md. - Add registry-driven deep-tier prompt routing via
deep_specialist:<type>entries and a newscripts/lib/deep-specialist.shhelper, wired intoscripts/review-one-pr.sh. - Add specialist deep-review prompt variants and bats coverage, and include the new test in the lint workflow.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_deep_specialist.bats | Adds bats coverage for type normalization, triage extraction, registry resolution, and fallback behavior. |
| scripts/review-one-pr.sh | Wires in classifier-based deep-tier prompt selection (registry-driven) and logs the chosen specialist. |
| scripts/lib/review-registry.tsv | Registers deep_specialist:<type> → specialist prompt mappings as data (no hardcoded switch). |
| scripts/lib/README.md | Documents the new deep_specialist:<type> registry convention and fallback behavior. |
| scripts/lib/deep-specialist.sh | Implements normalization, triage .type extraction, and registry-based specialist prompt resolution with fallback. |
| prompts/triage.md | Adds classifier instructions and updates triage JSON output schema to include "type". |
| prompts/deep-review-style.md | Introduces style/maintainability specialist deep-review prompt. |
| prompts/deep-review-security.md | Introduces security specialist deep-review prompt (aligned with security-audit lens). |
| prompts/deep-review-performance.md | Introduces performance/scalability specialist deep-review prompt. |
| prompts/deep-review-logic.md | Introduces logic/correctness specialist deep-review prompt. |
| .github/workflows/lint.yml | Adds the new bats test file to the lint workflow’s bats job list. |
Dev-Lead — review-changes (applied)Changes committed and pushed. |
Dev-Lead — waiting on PR blockers (intent: fix-reviews)PR: #1223 |
Dev-Lead — waiting on PR blockers (intent: review-changes)PR: #1223 |
|
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. |
Dev-Lead — waiting on PR blockers (intent: review-changes)PR: #1223 |
|
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. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
|
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: 034d8556b388f5a6e0bce2acd00277f91ab4dd6e
Review mode: triage-approved (single reviewer)
Summary
Implements the Phase-2 issue-type classifier: triage now emits a type label in {security, logic, performance, style}, and the deep tier routes to a specialist prompt resolved data-driven via deep_specialist: rows in the rubric registry, with a tested fallback to prompts/deep-review.md. Confirms the triage-approved assessment; risk noted as MEDIUM (touches the review pipeline) but all gates pass.
Linked issue analysis
Closes #1091. AC1 (classifier in triage output), AC2 (one specialist prompt per class), AC3 (registry-driven routing via review-registry.tsv + deep-specialist.sh, no switch in review-one-pr.sh), and AC4 (fallback on ambiguous/missing label, missing registry row, or missing prompt file) are all implemented and covered by 16 bats tests. AC5 (holdout eval no-regression) is not evidenced in the PR body, but the holdout-guard CI check passed.
Findings
- No blocking findings.
- Security: the LLM-produced `type` label is whitelist-normalized (`normalize_diff_type`) before any shell use, and `resolve_deep_specialist` verifies the specialist file exists under the repo root before routing — no injection surface.
- The added `SAFETY_CHECKS_FILE`/`DOWNSTREAM_IMPACT_FILE` export block closes a latent gap: main's comments claimed these paths were exported for the deep/audit tiers, but no export statement existed. Slightly beyond #1091 scope, but correct and beneficial.
- Minor (info): AC5 eval-run results are not documented in the PR body; consider noting holdout scores in future phase PRs.
- Both prior review threads (gemini-code-assist, copilot) are resolved; CodeRabbit approved.
- Secret scan: MCP run_secret_scanning tool unavailable in this run; gitleaks CI check passed.
CI status
All required checks green (agent-shield, SonarCloud, CodeQL, dependency-audit). shellcheck, ShellCheck, bats, unit-tests, Lint, gitleaks, holdout-guard, prompt-coverage, template-drift all SUCCESS. The two CANCELLED entries (dev-lead / dispatch, dev-lead / ci-relay) are non-required dev-lead automation relays, not blocking.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.
…alist deep-review prompts via the rubric registry (#1223) * feat: implement issue #1091 — [Phase 2] Issue-type classifier + specialist deep-review prompts via the rubric registry * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…alist deep-review prompts via the rubric registry (#1223) * feat: implement issue #1091 — [Phase 2] Issue-type classifier + specialist deep-review prompts via the rubric registry * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…alist deep-review prompts via the rubric registry (#1223) * feat: implement issue #1091 — [Phase 2] Issue-type classifier + specialist deep-review prompts via the rubric registry * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…alist deep-review prompts via the rubric registry (#1223) * feat: implement issue #1091 — [Phase 2] Issue-type classifier + specialist deep-review prompts via the rubric registry * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…alist deep-review prompts via the rubric registry (#1223) * feat: implement issue #1091 — [Phase 2] Issue-type classifier + specialist deep-review prompts via the rubric registry * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…alist deep-review prompts via the rubric registry (#1223) * feat: implement issue #1091 — [Phase 2] Issue-type classifier + specialist deep-review prompts via the rubric registry * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…alist deep-review prompts via the rubric registry (#1223) * feat: implement issue #1091 — [Phase 2] Issue-type classifier + specialist deep-review prompts via the rubric registry * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…alist deep-review prompts via the rubric registry (#1223) * feat: implement issue #1091 — [Phase 2] Issue-type classifier + specialist deep-review prompts via the rubric registry * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
…alist deep-review prompts via the rubric registry (#1223) * feat: implement issue #1091 — [Phase 2] Issue-type classifier + specialist deep-review prompts via the rubric registry * chore: dev-lead update (review-changes) [skip ci-relay] * chore: dev-lead update (review-changes) [skip ci-relay] --------- Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>



Closes #1091
Implemented by dev-lead agent. Please review.
Summary by CodeRabbit
New Features
Tests