Skip to content

fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal - #812

Merged
don-petry merged 2 commits into
mainfrom
claude/github-discussion-735-yvc0iq
Jun 20, 2026
Merged

don-petry merged 2 commits into
mainfrom
claude/github-discussion-735-yvc0iq

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Why

The #737 auto-rebase health report (tracking issue #767) shows 0% applied every day despite 50–86 conflict sentinels/week and ~70% "responses". Investigation (discussion #735) found the agentic conflict-resolution path is both mis-instrumented and carrying a real conflict-detection bug — so "0% applied" was not a clean signal that resolution fails, but it was hiding genuine breakage.

Root cause

  1. Bogus conflict-file detection. scripts/dev-lead-fix-reviews.sh used the deprecated 3-arg git merge-tree <base> HEAD <base> and parsed it with grep "^changed in both" | awk '{print $NF}'. The last field of the changed in both section header is the literal word both — the filenames are on the indented our/their lines. So CONFLICTING_FILES was set to both (a nonexistent path) on every conflict.
  2. Prompt then weaponized the garbage. prompts/dev-lead/rebase.md injected that list and constrained the engine to "only modify the conflicting files listed above" — i.e. only both — so the engine couldn't touch the actually-conflicted files and aborted → no-changes.
  3. applied was structurally unreachable. The prompt has the engine force-push the rebased branch itself (step 6), so on success commit_and_push finds nothing to push and posts no-changes. status=applied only fired if the engine committed but forgot to push — so even successful rebases were recorded as no-changes, making the metric ~0 by construction.

Changes

  • scripts/dev-lead-fix-reviews.sh
    • New detect_conflicting_paths <base_ref> helper: version-robust trial merge (git merge --no-commit --no-ff → git diff --name-only --diff-filter=U → git merge --abort).
    • Rebase path uses it for CONFLICTING_FILES, and after a successful run re-checks the base conflict state to record applied (no conflicts remain) vs no-changes (conflicts persist) instead of relying on commit_and_push seeing leftover work.
  • prompts/dev-lead/rebase.md
    • Conflicting-file list is now advisory (may be empty/incomplete/stale); the engine is told to resolve whatever git rebase actually flags and not to skip a real conflict just because it isn't listed.

Verification

  • shellcheck --severity=warning -x scripts/dev-lead-fix-reviews.sh — clean.
  • bats tests/dev-lead/unit/test_fix_reviews.bats (86), test_intent_reviews.bats, test_auto_rebase_retry.bats — pass.
  • tests/dev-lead/integration/test_prompt_coverage.sh — pass (rebase.md variable declarations intact).

Note for the initiative (epic #736 / story #739)

This corrects the premise behind the earlier "0% applied" reading: that number was not evidence that agentic conflict-resolution is non-functional — it was a measurement artifact plus the detection bug. Story #739's decision record should source resolution-rate numbers from the post-fix report window, not the broken metric.

🤖 Generated with Claude Code


Generated by Claude Code

… signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ
@don-petry
don-petry requested a review from a team as a code owner June 20, 2026 00:35
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 46 minutes and 21 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: bfe7f7a2-7190-4b3d-9f5f-398f451a687c

📥 Commits

Reviewing files that changed from the base of the PR and between 9cb66bb and cbe4442.

📒 Files selected for processing (2)
  • prompts/dev-lead/rebase.md
  • scripts/dev-lead-fix-reviews.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/github-discussion-735-yvc0iq

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 20, 2026 00:36
@don-petry
don-petry disabled auto-merge June 20, 2026 00:37
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-20T01:37:13Z.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
Files changed: None
Skipped (informational): 0
Status: No action required — Quality Gate passed with zero issues.
```

@don-petry
don-petry enabled auto-merge (squash) June 20, 2026 00:37

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the merge conflict detection and rebase handling in the dev-lead agent. It replaces a fragile git merge-tree parser with a robust trial-merge helper (detect_conflicting_paths) and updates the rebase prompt to clarify that the conflicting files list is advisory. Additionally, it fixes a telemetry bug where successful force-pushed rebases were incorrectly reported as having "no changes" by re-checking the conflict state after the run. Feedback was provided to add a defensive guard clause in the new helper function to handle empty arguments.

Comment thread scripts/dev-lead-fix-reviews.sh
@don-petry
don-petry disabled auto-merge June 20, 2026 00:38
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 20, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 20, 2026 00:46

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: cbe4442a705e79bde8885c88d387ccdf46b465a1
Review mode: triage-approved (single reviewer)

Summary

Two-file fix (34+/5-) to the dev-lead auto-rebase path. Replaces a broken 3-arg git merge-tree | grep 'changed in both' | awk '{print $NF}' parser (which always yielded the literal path "both") with a version-robust trial-merge helper detect_conflicting_paths, and fixes a telemetry artifact where engine-self-force-pushed rebases were always recorded as no-changes (the "0% applied" signal) by re-checking base conflict state to emit applied vs no-changes. The rebase prompt's conflicting-file list is downgraded to advisory. Triage cleared this as low-risk; confirmation review agrees.

Linked issue analysis

No formal closing-issue reference, but the PR is well-anchored to discussion #735 and tracking issues #737/#767/#739. The change directly addresses the documented root cause (bogus both path + structurally-unreachable applied status). The PR body also correctly flags that the prior '0% applied' metric was a measurement artifact, not proof that resolution fails — a useful correction for story #739's decision record.

Findings

No blocking issues.

  • detect_conflicting_paths guards empty input ([[ -z "$base" ]] && return 0), redirects merge noise, and aborts the trial merge so the worktree is left clean. This satisfies Gemini's only review note (defensive guard), which was addressed in the follow-up commit.
  • All git refs are quoted; $BASE_REF/$CONFLICTING_FILES come from PR metadata and are not interpolated into a shell-eval context — no injection surface. No secrets, auth, crypto, or migrations touched. shellcheck + bats (86) + prompt-coverage all pass in CI.
  • Non-blocking observation: the post-run applied re-check merges origin/$BASE_REF into the local HEAD. If the engine force-pushes the rebased branch without the local checkout advancing, a successful rebase could still read as conflicts-persist → no-changes. The relevant bats suites pass, so this appears handled, but it is the main correctness assumption worth keeping an eye on in the post-fix telemetry window.

CI status

All required checks green (shellcheck/ShellCheck, bats, unit-tests, unit, prompt-coverage, CodeQL, SonarCloud, agent-shield, Agent Security Scan, gitleaks secret scan, validate-* etc.); dependency-audit/dependabot/ci-relay jobs SKIPPED as expected. No failures. mergeStateStatus=BLOCKED is the pending human/required-review gate, not a check failure. Note: MCP secret scan unavailable (no GitHub Advanced Security); gitleaks CI check covers secret detection and passed.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry
don-petry merged commit cfbe24e into main Jun 20, 2026
38 checks passed
@don-petry
don-petry deleted the claude/github-discussion-735-yvc0iq branch June 20, 2026 01:37
don-petry pushed a commit that referenced this pull request Jun 21, 2026
`.github-private` is ring 0 in the agentic release strategy — the self-host
canary that runs a release before it is centrally promoted to `dev-lead/stable`
for consumer repos. The caller was pinned to `@dev-lead/stable`, so this repo
was running the same channel as consumers and never actually exercised new
releases first.

Point the `uses:` ref and `agent_ref` at `@dev-lead/next` so self-host runs the
canary channel. Concretely this picks up dev-lead v1.4.0, which contains the
auto-rebase conflict-detection + applied-rate fixes (#812) — so the rebase path
and the #737/#767 instrumentation start reflecting the corrected behavior here
before stable promotion.

Stub validator (tests/dev-lead/integration/test_dev_lead_stub.sh) passes — it
accepts any first-party channel tag.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ
don-petry added a commit that referenced this pull request Jun 21, 2026
…859)

`.github-private` is ring 0 in the agentic release strategy — the self-host
canary that runs a release before it is centrally promoted to `dev-lead/stable`
for consumer repos. The caller was pinned to `@dev-lead/stable`, so this repo
was running the same channel as consumers and never actually exercised new
releases first.

Point the `uses:` ref and `agent_ref` at `@dev-lead/next` so self-host runs the
canary channel. Concretely this picks up dev-lead v1.4.0, which contains the
auto-rebase conflict-detection + applied-rate fixes (#812) — so the rebase path
and the #737/#767 instrumentation start reflecting the corrected behavior here
before stable promotion.

Stub validator (tests/dev-lead/integration/test_dev_lead_stub.sh) passes — it
accepts any first-party channel tag.


Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
don-petry added a commit that referenced this pull request Aug 2, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 3, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 3, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 7, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 7, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 7, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 7, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 7, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 7, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 8, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 8, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 8, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Aug 18, 2026
… signal (#812)

* fix(dev-lead): repair auto-rebase conflict detection and applied-rate signal

The auto-rebase agentic conflict-resolution path was effectively broken and
mis-instrumented, surfacing as 0% "applied" in the #737 health report
(discussion #735, tracking issue #767).

Three fixes:

1. Conflict detection (scripts/dev-lead-fix-reviews.sh): the old
   `git merge-tree <base> HEAD <base>` 3-arg form prints a "changed in both"
   section header whose last field is the literal word "both" (the filename is
   on the indented our/their lines), so `awk '{print $NF}'` fed a bogus "both"
   path into the rebase prompt. Replace with a version-robust trial merge
   (`git merge --no-commit` → `git diff --diff-filter=U` → `git merge --abort`)
   via a new detect_conflicting_paths helper.

2. Prompt hardening (prompts/dev-lead/rebase.md): make the conflicting-file
   list advisory ("may be empty/incomplete/stale") and instruct the engine to
   resolve whatever `git rebase` actually flags, so a bad/empty hint can no
   longer silently block resolution.

3. Applied-rate signal (rebase path): the prompt has the engine force-push the
   rebased branch itself, so commit_and_push finds nothing to push on success
   and every successful rebase was recorded as "no-changes" (0% applied). After
   a successful run, re-check the base conflict state — if no conflicts remain,
   record status=applied; otherwise no-changes.

Verified: shellcheck --severity=warning -x clean; dev-lead bats unit suites and
prompt-coverage pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QrRBgQJ7QqjMsRySzkPqwJ

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <{}+donpetry-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants