Repository navigation
feat: implement issue #2156 — dev-lead claim retraction does not cover issue-comment dispositions: a fixed reply for a commit that never landed stays up - #2231
Conversation
…r issue-comment dispositions: a fixed reply for a commit that never landed stays up
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Code Review
This pull request adds support for sweeping and verifying fixed disposition replies posted as PR issue comments, ensuring that unlanded commits are retracted and rebased commits are updated. Feedback on the changes includes improving the portability of base64 decoding by adding a fallback command, and using prefix/suffix parameter expansion instead of pattern replacement in cl_rewrite_disposition_sha to robustly handle special characters in user-supplied comment bodies.
This comment has been minimized.
This comment has been minimized.
QA Lead — test-risk advisoryRisk tier: LOW. This only touches the bot's own PR-comment automation. If it misfires, the worst case is a wrongly kept or wrongly retracted "fixed" reply, which is recoverable. Its pure helpers ( What I'd shore up (highest leverage first):
Escalate? no Advisory only — I comment, I do not change code. Ground: BMAD Test Architecture |
…nding Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Dev-Lead — review-changes (applied)Changes committed and pushed. Requested items addressed:
|
|
|
No description provided. |
|
No description provided. |
|
Neutral overview — the PR appears safe to merge. No actionable findings to address. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
This comment has been minimized.
This comment has been minimized.
|
This is a usage-limit notice from the bot's service — no code changes needed. The bot will resume reviewing after the quota resets. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
This comment has been minimized.
This comment has been minimized.
|
This is a quota limit notice from the code review bot — an operational notice, not a code finding. No changes to the PR are needed. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
This comment has been minimized.
This comment has been minimized.
|
Rate-limit notice — no code changes needed. The PR is ready for review once the bot's quota resets in 24 hours. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
No description provided. |
|
Rate-limit notice only: CodeRabbit reached its free OSS review quota and paused the code review. This is an operational throttle message with no code findings to address. The PR's CI checks all pass, and there are no actionable issues in the changed files. |
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: f7b0cf11a25f37d58bc65c7118bb9f00da504453
Review mode: triage-approved (single reviewer)
Summary
Extends both dev-lead claim sweeps (the end-of-pass retract_unlanded_claims and the start-of-pass sweep_earlier_claims) to PR issue-comment replies marked disposition=fixed. A new sweep_fixed_dispositions uses the same landing rules as review-thread claims: a reply whose cited commit is not on the remote head is retracted, a reply whose commit was rebased by the push guard is re-pointed at the landed commit, and an earlier reply is skipped when the checkout is shallow or GitHub knows the commit. The logic is fully contained in the bot's own automation. A wrong decision costs one kept or retracted reply, which can be recovered. Rated MEDIUM because the logic change is non-trivial.
Linked issue analysis
Closes #2156. All four acceptance criteria are met:
- Retraction shape:
cl_retract_disposition_bodyremoves every comment-disposition marker, adds a retraction notice, quotes the original text and appends<!-- dev-lead:retracted reason=… -->. - Both sweeps: the sweep is wired into
retract_unlanded_claims(pass) andsweep_earlier_claims(earlier), against the same reference head as the review-thread claims. - Other dispositions untouched: the selector matches only
disposition=fixed. Tests cover invalid, answered, informational and out-of-scope replies in both windows. - Tests: bats tests with a
ghstub cover an unlanded commit (retracted), a landed commit (kept), a commit GitHub knows (kept), a rebase (re-pointed), a failed listing (reported) and other dispositions (left alone). There are also unit tests for the pure helpers.
Findings
No blocking findings.
- Correctness:
failedis now declared before the new sweep runs, and the sweep's result is folded into it. Both callers return it, including the[ -z "$rows" ] && return "$failed"path insweep_earlier_claims, so a failed issue-comment listing is not read as a clean pass.retract_unlanded_claimshas no early return on empty rows, so the folded status survives there too. - Downstream behaviour: removing the marker is the right thing for the other consumers.
bot-comment-retry.shtreats a comment with nocomment-disposition id=reply as un-dispositioned, so it is answered again, andmaintainer-comment-gate.shstops counting it as answered. - Both earlier Gemini threads are resolved and fixed in code:
base64 --decodenow falls back to-d, and the SHA rewrite uses a quoted literal slice instead of a pattern substitution on the whole body. - Source order: moving
comment-disposition-verify.shahead ofclaim-landing.shis safe.claim-landing.shalso guards withdeclare -F cdv_parse_disposition. - Security: the retraction reason is restricted to
[a-z-], so it cannot break out of the HTML comment. Bodies go togh api -f body=as arguments, not through the shell. No secrets, workflow or permission changes. - Non-blocking: for review-thread claims,
cl_restore_bodyrestores a wrongly retracted reply. Theearliersweep has no such step for disposition replies. The issue does not ask for it, and the comment is answered again anyway, so this is acceptable as a follow-up. shellcheck --severity=warningis clean locally on both changed scripts. bats is not installed on this runner; the CIbatsandunit-testsjobs pass.
CI status
All required checks pass: Lint, ShellCheck, shellcheck, bats, unit-tests, CodeQL, SonarCloud (quality gate passed), gitleaks, AgentShield, actionlint and the stub/standards validators. The dev-lead / dispatch|ci-relay|resume runs were cancelled by the orchestration's concurrency control; these are not failures. The dependency-audit ecosystems that do not apply were skipped, and cubic reported neutral.
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: 4/5 required advisory bots reported before the gate's head-age-timeout fallback proceeded. Recorded for the miss-rate metric (#1596). |
…2263) main gained three negated commands that cannot fail their test after this branch's CI last ran: two in test_claim_sweep.bats (#2231) and one in test_engine_new_models.bats (#2241). The bats-negation job runs on the merge with main, so it would have failed on the next run. Each is now `! cmd || false`; all three assertions hold (45/45 across the two suites). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>



Problem
dev-lead claim retraction does not cover issue-comment dispositions: a fixed reply for a commit that never landed stays up
From the issue: When a dev-lead pass answers a PR issue comment it posts a reply marked
disposition=fixedthat cites a commit. If that commit never lands, the reply stays up saying "fixed". The claim-retraction sweep from #2013 does not look at these replies:retract_unlanded_claims(scripts/dev-lead-fix-reviews.sh) lists onlypulls/{pr}/comments, the review-thread replies.Risk
Low — changes automation shell logic under scripts/, covered by shellcheck (--severity=warning) and the bats suite.
Test plan
Tests added/updated:
tests/dev-lead/unit/test_claim_landing.bats,tests/dev-lead/unit/test_claim_sweep.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 #2156