Repository navigation
feat: implement issue #614 — [Phase 2] Register plan_json artifact type (plan rubric + structured-findings channel) - #761
Conversation
…pe (plan rubric + structured-findings channel)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
More reviews will be available in 48 minutes and 39 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?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 credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. 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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a Changesplan_json Review Artifact Type
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 introduces Phase 2 of the review registry by adding support for the plan_json artifact type. It registers a new adversarial plan rubric (prompts/plan-review.md), implements a content-ref adapter (review-plan.sh) and a structured-findings output channel (post-plan-findings.sh), and adds comprehensive BATS tests. Feedback on the changes highlights the need to print error logs to stderr when run_agentic fails to prevent debugging logs from being lost in the temporary directory, and to ensure the parent directory is created and file identity is checked before writing findings to avoid truncation issues.
Dev-Lead — review-changes (applied)Changes committed and pushed. |
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: LOW
Reviewed commit: 2004b137d1e3cef0ad8fe74e3f3362cd7e6ff53c
Review mode: triage-approved (single reviewer)
Summary
Phase 2 of the review-registry epic: registers the plan_json artifact type additively beside pr_diff. Adds a fixed adversarial plan rubric (prompts/plan-review.md), a content_ref adapter (review-plan.sh) reusing engine.sh deep-tier routing, and a structured-findings output channel (post-plan-findings.sh) that emits machine-readable findings for the planner and never posts a GitHub review. Clean, well-tested, additive change with all substantive CI green.
Linked issue analysis
Closes #614. All 5 acceptance criteria are met: (1) plan_json registry row maps to the plan rubric + structured-findings channel; (2) review-plan.sh feeds a plan.json into the rubric, reusing scripts/engine.sh run_agentic at the deep tier with no separate model selector; (3) post-plan-findings.sh delivers machine-readable findings JSON the planner consumes pre-apply-plan.sh, never calling post-pr-review.sh; (4) pr_diff is untouched — its cascade/channel guard stays green and the prior "sole type" test was correctly relaxed to a "never removed/renamed" guard; (5) tests/test_plan_review.bats (226 lines) exercises registry resolution, driver wiring, and output-channel behavior, and is registered in lint.yml.
Findings
No blocking issues. The two advisory findings from gemini-code-assist on the prior commit (3ab7bf7) were both resolved in the head commit (2004b13): (a) HIGH — error logs lost in the trap-deleted temp dir are now cat'd to stderr on failure (review-plan.sh, run_agentic failure + invalid-JSON fallback branches); (b) MEDIUM — the findings write now does mkdir -p on the parent and an -ef same-file identity check to avoid truncation (post-plan-findings.sh). Both fixes have dedicated regression tests. SonarCloud quality gate passed (0 new issues, 0 hotspots); CodeRabbit and Codex comments are rate-limit/usage notices, not findings.
CI status
All substantive checks green: ShellCheck, bats, CodeQL (actions + python), SonarCloud, gitleaks secret scan, agent-shield, dependency-audit, holdout-guard, and the dev-lead test suite. The only non-success entries are two CANCELLED dev-lead relay jobs (dev-lead / dispatch, dev-lead / ci-relay) — concurrency self-cancellations triggered by the [skip ci-relay] head commit, not real failures. SKIPPED entries are inapplicable language-specific audit stubs and dependabot-automerge. mergeStateStatus is BEHIND (base moved ahead); a rebase/merge of main resolves it and does not affect this review.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
Dev-Lead — waiting on PR blockers (intent: review-changes)PR: #761 |
|
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 — fix-bot-comment (no-changes)Agent reasoning |
Dev-Lead — waiting on PR blockers (intent: review-changes)PR: #761 |
|
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. |
There was a problem hiding this comment.
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/initiative-planner/review-plan.sh`:
- Around line 74-75: The EXIT trap removes the entire WORK_DIR directory, but
PLAN_FINDINGS_OUTPUT defaults to a path within WORK_DIR (plan-findings.json).
This means the findings file is deleted before callers can consume it when
PLAN_FINDINGS_OUTPUT is not explicitly provided. Modify the trap cleanup logic
to preserve the findings file by either excluding it from the rm command,
copying it to a location outside WORK_DIR before cleanup, or by only deleting
specific subdirectories within WORK_DIR while preserving the findings output
file. Apply this fix to all instances where this pattern occurs (trap statement
around lines 74-75 and other occurrences referenced at lines 100-103).
🪄 Autofix (Beta)
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
Run ID: 14b610e4-c0a3-4a2c-ada8-8778804a4a16
⛔ Files ignored due to path filters (1)
scripts/lib/review-registry.tsvis excluded by!**/*.tsv
📒 Files selected for processing (7)
.github/workflows/lint.ymlprompts/plan-review.mdscripts/initiative-planner/review-plan.shscripts/lib/README.mdscripts/post-plan-findings.shtests/test_plan_review.batstests/test_review_registry.bats
e396628
|
Dev-Lead — waiting on PR blockers (intent: fix-reviews)PR: #761 |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-17T18:08:10Z. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: LOW
Reviewed commit: e3966286106f740f589d3ea1f8e5e28f6493fc90
Review mode: triage-approved (single reviewer)
Summary
Phase 2 of epic #610 additively registers a new plan_json review artifact type: a fixed adversarial/semantic plan rubric (prompts/plan-review.md) bound to a machine-readable structured-findings output channel (post-plan-findings.sh), with a content_ref adapter (review-plan.sh) that reuses engine.sh deep-tier routing. pr_diff behavior is untouched and the change is fully covered by new bats tests registered in lint.yml. Triage cleared this as low-risk; confirmation review agrees.
Linked issue analysis
Closes #614. All five ACs are satisfied: (1) plan_json registry row maps to the plan rubric + structured-findings channel (review-registry.tsv, README); (2) review-plan.sh adapter feeds a plan.json into the rubric via run_agentic deep tier, introducing no separate model selector; (3) post-plan-findings.sh emits machine-readable findings JSON for the planner and never posts a GitHub review; (4) pr_diff is untouched — the 'sole type' guard was correctly relaxed to a 'never removed/renamed' guard and additive guards were added; (5) bats coverage (test_plan_review.bats) exercises registry resolution, driver wiring, and output-channel behavior, and is registered in lint.yml's bats list.
Findings
No blocking findings. Observations: (a) Shell scripts use set -euo pipefail with careful quoting and sensible edge-case handling — the EXIT-trap WORK_DIR removal is guarded so the default PLAN_FINDINGS_OUTPUT lands outside WORK_DIR, and the same-file (-ef) case avoids truncation; both are explicitly tested. (b) No security surface: no auth/secrets/credentials, no migrations, no network mutations; the output channel is a local artifact write and statically guarded against calling post-pr-review.sh or the GitHub review API. (c) Static-guard tests rely on grep patterns against the driver; acceptable for wiring locks. CodeRabbit's earlier CHANGES_REQUESTED was resolved and dismissed, ending in APPROVED.
CI status
All required checks green (shellcheck, bats, unit-tests, CodeQL, SonarCloud, gitleaks, AgentShield, validate-fixtures, prompt-coverage, and more). The CANCELLED dev-lead/review dispatch jobs are superseded re-runs; the final review/review check is SUCCESS. dependency-audit ecosystems SKIPPED as expected (no matching manifests).
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.



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