GH#18815: fix(pulse-merge): file-overlap verification before auto-closing conflicting worker PRs#18820
Conversation
…icting worker PRs The deterministic merge pass closed PR #18760 with a false 'work has already landed on main' claim, citing PR #18749 as the merging PR. PR #18749 was a planning-only PR (added briefs, modified TODO.md) — it touched zero implementation files. The closing PR's task ID appeared in #18749's commit subject ('plan(t2059, t2060): file follow-ups...') and the task-ID grep matched, but no implementation work had landed. Fix: require non-planning file overlap between the closing PR and the matching commit before claiming 'work landed on main'. On overlap miss OR file-lookup failure, fail CLOSED — leave the PR open and post a one-time rebase nudge instead of discarding work. Three new helpers: - _is_planning_path_for_overlap: classifies TODO.md, README.md, CHANGELOG.md, VERSION, todo/**, and simplification-state.json as planning paths that cannot satisfy the duplicate-work signal. - _verify_pr_overlaps_commit: fetches the closing PR's files and the matching commit's files, returns 0 only on non-planning intersection; returns 1 on lookup failure (fail-CLOSED). - _post_rebase_nudge_on_worker_conflicting: idempotent rebase nudge modelled on _post_rebase_nudge_on_interactive_conflicting, posted exactly once per affected worker PR. Refactored _close_conflicting_pr to fetch (sha, subject) JSON from gh api commits and use jq for word-boundary matching, so the matching commit's files can be looked up by SHA. Test coverage: extends test-close-conflicting-pr-wording.sh from 3 to 7 assertions covering 4 new GH#18815 regressions: - Planning-only match leaves PR open (the #18760 incident exactly) - Real implementation overlap still closes PR - commit-files lookup failure → fail-CLOSED - PR-files lookup failure → fail-CLOSED
Completion Summary
|
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughEnhanced the conflicting-PR auto-close heuristic to exclude planning-only paths (docs, config files) from overlap verification. Added file-overlap validation requiring matching commits to share non-planning files with the PR. When overlap fails, the PR remains open and a rebase nudge comment is posted instead of auto-closing. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
✨ 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 |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report SonarCloud: 0 bugs, 0 vulnerabilities, 231 code smells Tue Apr 14 03:04:30 UTC 2026: Code review monitoring started 📈 Current Quality Metrics
Generated on: Tue Apr 14 03:04:33 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
Up to standards ✅🟢 Issues
|



Summary
Fixes the false-positive in _close_conflicting_pr that closed PR #18760 (t2060 task-complete-helper implementation) by claiming the work had landed on main via PR #18749 — when in fact #18749 was a planning-only PR. Implementation files were never touched on main. The fix adds file-overlap verification: a matching commit must share at least one non-planning file with the closing PR before the auto-close fires. On overlap miss or file lookup error, fail CLOSED (leave PR open, post rebase nudge). Recovery for the existing victim is in PR #18760 (reopened).
Files Changed
.agents/scripts/pulse-merge.sh,.agents/scripts/tests/test-close-conflicting-pr-wording.sh
Runtime Testing
Resolves #18815
aidevops.sh v3.8.18 plugin for OpenCode v1.4.3 with claude-opus-4-6 spent 21m and 64,602 tokens on this with the user in an interactive session.
Summary by CodeRabbit