fix(dev-lead): disposition a fixed bot issue comment, and sweep claim replies posted as PR comments (#2261)
Summary
Reworked after #2156 merged as 9adfeed3 (PR #2231). main now sweeps this pass's disposition=fixed replies on PR issue comments and re-points one whose commit the push guard rebased, which covers part of what this PR first did. What is left:
- Prompt (
prompts/dev-lead/fix-bot-comment.md, unchanged from the first version): a new section, "Fixing a finding posted as a PR issue comment". It applies to every registered reviewer bot, says the addressed-marker and claim are for review threads only, and requires exactly one reply ending in onedev-lead:comment-disposition … disposition=fixed sha=<40-hex>marker, with a runnable example keyed on${COMMENT_NODE_ID}. - Claim sweep over PR issue comments (
retract_unlanded_claims):mainsweeps onlydisposition=fixedreplies there. An addressed/claim reply posted as a PR comment, the PR #2205 shape, is now re-pointed or retracted like a thread reply. - One writer per reply. A PR comment that carries a
fixeddisposition is left to #2156'ssweep_fixed_dispositions, which now also moves a claim citing the same commit on a re-point and removes the addressed-marker and claim on a retraction. The claim sweep skips those replies (cl_without_fixed_dispositions), so a comment listing that lags the first edit cannot make the second sweep overwrite it. cl_retract_bodyno longer strips a different marker that shares a line with the claim, and removes a claim whose JSON spans lines whole (CodeRabbit). Its stripping is nowcl_strip_claim_markers.
Removed in the rework: rdc_repoint_rebased_fixed, cdv_rewrite_disposition_sha and their tests. retract_unlanded_claims runs sweep_fixed_dispositions before resolve_dispositioned_comments, and the resolver re-reads the PR's comments, so it already judges the re-pointed sha. The updateIssueComment call CodeAnt flagged went with them. The sentence in docs/pr-review-agent/maintainer-comment-gate.md now describes that order and cites #2156.
Problem
Closes #2261. On PR #2205 dev-lead fixed a CodeAnt issue-comment finding and answered with the thread-style addressed-marker and claim. The gate does not read that, so the comment stayed open and the retry sweep ran out of attempts. The claim cited f8f0b54, a commit the push guard had rebased to 3e5025bd; nothing checked or corrected it, because the claim sweep only read review-thread replies.
Against the issue's acceptance criteria: 1 is the prompt change here, 2 is met by #2156 on main, 3 is the claim sweep here.
Risk
Medium. It changes the dev-lead harness's claim sweep and a prompt.
- The claim sweep now edits PR issue comments, but only ones our account posted since the pass start that carry the addressed-marker or a claim and no
fixeddisposition. An unreadable issue-comment listing makes the sweep report "NOT verified" and return non-zero; thread replies are still swept. sweep_fixed_dispositionsbehaves as onmainfor a reply with no addressed-marker or claim:main's 23 tests intest_claim_sweep.batspass unchanged.
Known limits:
- This does not by itself clear the PR #2205 comment. That fix only added a line, and the #2004 content rule accepts a
fixeddisposition only when the diff removes a token the finding names. That is #2269; the maintainer has chosen its option 1, and it is not implemented here. sweep_earlier_claimsis unchanged: a claim an earlier or cancelled pass posted as an issue comment is still not swept. The stale claim on PR #2205 (comment 6102259888) is one, and stays as it is.- That the resolver sees the re-pointed sha was checked by reading the call order and the resolver's own comment fetch on
main, not by an end-to-end test. - The tests are function-level against a bare remote with a real push-guard rebase. The existing full-script tests stub
git push.
Test plan
tests/dev-lead/unit/test_claim_sweep.bats: 35/35,main's 23 plus 12 new. All 12 fail without their source change.- CI caught one regression in the first reworked push: the new
cl_without_fixed_dispositionsrejected a comment listing that was JSON but not a list, which failed the sweep and made a pushed pass read as failed (resolve_deferred_bot_threads (#2045): … keyed to the pushed head, whoseghstub answers with an object). It now passes such a payload through, asmain's sweep does. That test and a new one for the case pass. They cover a claim that never landed, a rebased one, selection (ours, this pass, landed left alone), a claim on the second page of the listing, a non-fixeddisposition surviving on the claim's line, a thread claim with a second marker on its line, a reply carrying both a claim and afixeddisposition (re-pointed once and retracted once), an unreadable listing,cl_without_fixed_dispositions, and a claim whose JSON spans lines. - The gh stub serves the same listing after a PATCH, which is what a lagging listing returns, so the two "both markers" tests also show the reply is written once.
test_claim_landing45/45,test_comment_disposition_verify60/60 (both as onmain), the two#2261prompt tests intest_fix_reviews2/2; both fail againstmain's prompt.shellcheck --severity=warning -xon the three scripts: clean.scripts/check-duplicate-decls.sh: pass.markdownlint-cli2on the doc: clean.- Not re-run here: the full
test_fix_reviews.bats, which has about 10 failures on this Mac from BSDsed; CI is the authority.
Rollback
Revert this PR. A reply already re-pointed or retracted stays valid under the old code.
Monitoring
In a fix-bot-comment run log: retracted PR-comment claim reply … or PR-comment claim reply … claim updated. Inert until the dev-lead channel tag moves onto it (next autocut to dev-lead/v139-next, then ring promotion).
Interaction contract
- N/A: no agentic role added or changed.
🤖 Generated with Claude Code