name: 02-fix-bot-comments description: Reads CodeRabbit and other bot review comments, addresses them, and pushes fix-up commits. kind: leaf executor: sonnet model: claude-sonnet-4-6
Fix Bot Comments
Reads CodeRabbit / bot comments on the PR, addresses each, and pushes fix-up commits.
Inputs
pipeline.py get pr_number→ PR number.
Plan
- Resolve the PR number → verify: integer captured.
- Fetch both bot-comment surfaces and union them — review-thread comments (
gh api repos/neohaskell/NeoHaskell/pulls/<N>/comments) AND general PR-timeline comments (gh api repos/neohaskell/NeoHaskell/issues/<N>/comments) → verify: both fetches return JSON arrays. - Address each bot comment with a code edit or a thread reply explaining false positive → verify: every bot comment has either a diff or a reply.
- Commit and push fix-ups → verify: branch updated.
Assumptions:
- Both PR comment surfaces are enumerated each cycle (review-thread
pulls/<N>/commentsand generalissues/<N>/comments) and merged into one bot list before filtering — a bot can post to either. - Max 5 cycles of bot-comment fixing. After the 5th cycle, escalate to the maintainer.
- False positives must be explained on the PR thread, never silently dismissed.
- Test files remain immutable unless a bot specifically flags a broken test in spec terms — in that case escalate.
If any assumption fails, refuse — do not guess.
Steps
NUM=$(python3 .claude/skills/feature-pipeline-preview/scripts/pipeline.py get pr_number).- Fetch review-thread comments:
gh api repos/neohaskell/NeoHaskell/pulls/$NUM/comments. - Fetch general PR-timeline comments:
gh api repos/neohaskell/NeoHaskell/issues/$NUM/comments. Merge the two arrays (dedup byid) before the next step — bots can post to either surface. - Filter the merged list to bot authors (CodeRabbit, etc.).
- For each comment, decide: real issue (fix with an edit) or false positive (reply on the thread explaining why).
- After all edits, run
nix develop --command cabal build allandnix develop --command cabal testto confirm nothing regressed. - Stage, commit with a
chore(review): address bot feedbackmessage, and push. - Increment the cycle counter via
pipeline.py iter 17. If > 5, refuse and escalate.
Output
Fix-up commit pushed; bot comments addressed; cycle counter advanced.
Refusals
- Cycle counter > 5 → refuse: "bot-comment cycle exhausted; escalate to maintainer".
ghnot on PATH → refuse: "gh not found".