Repository navigation
feat: implement issue #2169 — pr-review reaches approve but cannot post it (approval marker missing), and the same head gets approve/LOW in one run and escalate/HIGH in the next - #2190
Conversation
…st it (approval marker missing), and the same head gets approve/LOW in one run and escalate/HIGH in the next
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Code Review
This pull request addresses issue #2169 by ensuring that the approval marker decision word is normalized to "approved" (instead of "approve") to satisfy the formatting guard. It updates prompts/cascade-action.md to map the decision value before substitution, adds a normalization step in scripts/post-pr-review.sh using sed, and introduces comprehensive BATS tests to verify this behavior. Feedback on the changes highlights an issue in scripts/post-pr-review.sh where Bash command substitution strips trailing newlines, causing the comparison check to incorrectly evaluate to true and strip trailing newlines from the body even when no substitution occurred, and provides a suggestion to preserve them.
This comment has been minimized.
This comment has been minimized.
Dev-Lead — review-changes (partial)A commit was pushed, but not every requested change was applied. Per requested item:
The unaddressed items above still need work. |
QA Lead — test-risk advisoryRisk tier: MEDIUM — this is the auto-approval gate. The fix is narrow and fails closed, but nothing tests the contract between the script that writes the marker and the scripts that read it. What I'd shore up (highest leverage first):
Escalate? no. The rewrite only runs on an approve verdict for the current head sha and cannot upgrade an escalation; the gaps above are about coverage, not unsafe approvals. Advisory only — I comment, I do not change code. Ground: BMAD Test Architecture |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-10T13:58:29Z. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
This comment has been minimized.
This comment has been minimized.
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
No description provided. |
|
CodeAnt assessment is a neutral overview with no specific code defects identified. The PR risk assessment (Low Risk) is informational; all CI checks pass and no blockers remain. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
No description provided. |
Dev-Lead — fix-reviews (no-changes)Agent reasoning |
|
No description provided. |
|
This is a rate-limit operational notice from CodeRabbit indicating that the free OSS review quota was reached. The notice contains no code findings or actionable defects — all CI checks pass and there are no Tier 1 blockers. No code changes are needed. |
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: 66299e780a6ed17f434323410be2cbb5bb0d8e16
Review mode: triage-approved (single reviewer)
Summary
Fixes the deterministic approval-marker mismatch from #2169. prompts/cascade-action.md now maps the verdict word to the marker vocabulary (approve→approved, escalate→escalated) before running sed. scripts/post-pr-review.sh now normalizes decision=approve to decision=approved, but only inside the current-head-SHA v1 marker and only when the verdict JSON says approve. The #1754 guard is unchanged and still fails closed. Rated MEDIUM (not LOW) because the change sits on the auto-approval gate. It cannot upgrade an escalation, a stale SHA, or a marker that contradicts the verdict.
Linked issue analysis
Closes #2169. The issue's sequencing note asks for acceptance criterion 1 first: a deterministic marker derived from the verdict, a mapped word in cascade-action.md, the #1754 guard still failing closed, and a bats regression test. All of that is done. AC3 (a visible note on post failure) and AC2 (the risk-class policy for tier 3) are left out of this pass on purpose and tracked in follow-up #2189, as the issue asked. The new decision=escalated word in the prompt matches what the consumers already expect (carry-forward.sh:45, review-cycle.sh, review-one-pr.sh).
Findings
No blocking findings.
- Correct:
sed -E -znormalization is anchored tosha=${PR_HEAD_SHA}.[^>]*keeps the match inside one marker. The([[:space:]]|-->)suffix rejectsapprovedX-style tokens.cmpagainst temp files avoids false positives from trailing newlines, which resolves the earlier gemini thread. Both prior bot threads are resolved. - Tests: six new bats cases cover normalization, the
decision=approve-->edge, a stale SHA, a contradictorydecision=escalatemarker, prose-only text (fails closed), and the prompt mapping. - Non-blocking (carried from the QA-lead advisory): when a model puts
risk=beforedecision=, the posted marker passes the #1754 guard. However, readers that requiresha=<SHA>\\s+decision=won't recognise it (carry-forward.sh,review-cycle.sh,pr-review-miss-rate.sh). This ordering gap predates the PR, and the cascade template already putsdecisionright aftersha, so it is a follow-up rather than a blocker. Running the prompt snippet in a test, instead of grepping its text, would also strengthen coverage. - Note: the issue asks the PR to state that the fix reaches consumers only after the
pr-review/v1-nextchannel tag and rings are promoted. The PR body doesn't say this. It has no effect on correctness. - Secret-scan MCP tool not available in this run; gitleaks CI check passed.
CI status
Every code-quality and security check passed: Lint, shellcheck/ShellCheck, bats, unit-tests, CodeQL, SonarCloud (Quality Gate passed), gitleaks, actionlint, AgentShield, and the validate-* checks. The dev-lead / dispatch|ci-relay|resume runs show CANCELLED, which is normal concurrency cancellation for that automation and not a code check. The dependency-audit ecosystem jobs were SKIPPED as not applicable. There are no unresolved review threads.
Reviewed automatically by the PR-review agent (single-reviewer mode: opus 5.5 [opus 4.8, opus 4.7]). Reply if you need a human review.
|
pr-review approved on PARTIAL advisory evidence: 3/5 required advisory bots reported before the gate's head-age-timeout fallback proceeded. Recorded for the miss-rate metric (#1596). |



Problem
pr-review reaches approve but cannot post it (approval marker missing), and the same head gets approve/LOW in one run and escalate/HIGH in the next
From the issue: A pr-review cascade can reach an approve verdict and then fail to post it, because the synthesized approval body does not contain a complete approval marker. The #1754 guard correctly refuses to submit, but the run then exits 1 with nothing written to the PR. A re-run redoes the whole cascade and can reach a different verdict, so the outcome for the same head SHA depends on which run happens to post.
Risk
Low — changes automation shell logic under scripts/, covered by shellcheck (--severity=warning) and the bats suite.
Test plan
Tests added/updated:
tests/test_post_pr_review_escalation.bats. Verification:bash scripts/dev-lead-lint.sh(shellcheck --severity=warning) ran pre-commit; the bats suite runs in CI.Rollback
Revert this PR. No non-revertible side effects (no tags, migrations, or external state).
Monitoring
This PR's Lint (shellcheck) and bats checks show pass/fail; watch subsequent dev-lead / pr-review runs for behavioral regressions.
Closes #2169