Skip to content

docs: capture merge-conflict learning (extraction vs semantic change)#1374

Merged
gsxdsm merged 3 commits into
mainfrom
gsxdsm/merge-conflict-learning
Jun 4, 2026
Merged

docs: capture merge-conflict learning (extraction vs semantic change)#1374
gsxdsm merged 3 commits into
mainfrom
gsxdsm/merge-conflict-learning

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

What

Adds the merge-conflict-resolution learning doc that was committed to the #1345 branch two minutes after that PR merged — the push silently re-created the deleted branch, so the doc never reached main.

docs/solutions/best-practices/merge-conflict-extraction-vs-semantics-and-parallel-bootstrap.md documents two patterns from resolving #1345's conflicts with main:

  • Extraction vs upstream-semantic-change: when one branch extracts code into a helper and main changes that block's semantics (FN-5902 here), neither conflict side is correct verbatim — port the semantic change into the helper at its new location, sweep the moved code's doc comments, and verify with the union test suite. Keeping "our side" silently reverts the upstream change with a clean-looking diff.
  • Parallel-bootstrap add/add on accretive docs: union CONCEPTS.md clusters under one preamble, take the diff-minimizing wording for near-identical pointer lines, and sweep merged prose for statements the incoming commits falsified. Session history shows four parallel branches bootstrapped CONCEPTS.md the same day, so this collision will recur as they land.

Docs-only; no changeset per repo convention.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added a best-practices guide for resolving merge conflicts when code refactoring and semantic changes occur in parallel, including strategies for handling documentation conflicts and validation techniques.

Document the refactor-vs-semantics merge resolution pattern (port the
upstream semantic change into the extracted helper, never pick a side)
and the parallel-bootstrap CONCEPTS.md add/add union, with the FN-5902 /
runFeatureValidation merge as the worked example.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

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

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ 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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a15c8e81-7d1d-4950-a7fc-1fc60b005431

📥 Commits

Reviewing files that changed from the base of the PR and between d188f7c and c6b4897.

📒 Files selected for processing (1)
  • docs/solutions/best-practices/merge-conflict-extraction-vs-semantics-and-parallel-bootstrap.md
📝 Walkthrough

Walkthrough

This PR adds a new best-practice documentation page guiding developers through resolving merge conflicts that arise when one branch extracts code into a helper while another branch modifies the semantics of that extracted code. The guide provides conflict resolution criteria, concrete examples showing incorrect and correct resolutions, and references to related documentation.

Changes

Merge Conflict Extraction-vs-Semantics Best-Practice Guide

Layer / File(s) Summary
Problem definition and document structure
docs/solutions/best-practices/merge-conflict-extraction-vs-semantics-and-parallel-bootstrap.md
Document metadata and main explanation introduce the extraction-vs-semantic conflict pattern: one branch refactors code into a helper while another modifies the original code's semantics, causing the conflict where naive resolution preserves the refactor but loses the semantic change. The "Why This Matters" section explains why such resolutions appear syntactically clean while reverting behavior.
Resolution criteria, examples, and references
docs/solutions/best-practices/merge-conflict-extraction-vs-semantics-and-parallel-bootstrap.md
"When to Apply" criteria and explicit guidance against simple --ours/--theirs resolutions. Concrete example shows the conflict as Git presents it (call-site vs. inline block), the correct resolution by moving semantics into the helper body, a union diff approach for accretive documentation conflicts (e.g., CONCEPTS.md), and a "Related" section linking to AGENTS.md, a logic-error document, and specific merge commits.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A refactor here, a semantic change there,
When branches conflict, let's teach devs to care!
Extract with grace, then port the new logic,
Sweet docs prevent the merge-conflict tragic. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the primary change: adding documentation about merge-conflict resolution patterns, specifically extraction vs. semantic change conflicts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gsxdsm/merge-conflict-learning

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.

@greptile-apps

greptile-apps Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This docs-only PR adds a best-practices guide for a tricky class of merge conflict that arises when one branch structurally refactors code (extraction to a helper) while another branch simultaneously changes that same code's semantics — a case where accepting either hunk verbatim silently reverts one of the changes. It also covers the parallel-bootstrap add/add collision pattern for accretive docs like CONCEPTS.md.

  • Extraction-vs-semantic guidance: keep the refactor's call site, port the semantic change into the helper body, sweep doc comments, and run the union test suite — with a concrete example from FN-5902 and runFeatureValidation.
  • Add/add accretive-doc guidance: union the clusters under one preamble, take the diff-minimizing wording for near-identical pointer lines, and sweep for prose falsified by the incoming commits.
  • Cross-references verified: docs/solutions/logic-errors/mission-autopilot-stalled-by-stranded-done-feature.md and the AGENTS.md → "Merging Branches Into Main" section both exist; no changeset is needed per repo convention for internal docs.

Confidence Score: 5/5

Docs-only change with no runtime impact; safe to merge.

The change adds a single markdown document with no code modifications. All cross-referenced files exist, the frontmatter follows the conventions used by sibling docs, and no changeset is required under repo policy for internal docs. The only annotations previously flagged as noise ((session history)) have already been raised in prior review threads and are not new findings.

No files require special attention.

Important Files Changed

Filename Overview
docs/solutions/best-practices/merge-conflict-extraction-vs-semantics-and-parallel-bootstrap.md New best-practices guide documenting extraction-vs-semantic-change conflict resolution; docs-only, cross-references verified, follows existing frontmatter conventions

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Merge conflict encountered] --> B{What shape is the conflict?}
    B -->|One side: call/one-liner\nOther side: multi-line block| C[Extraction-vs-semantic conflict]
    B -->|Both sides added content\nto the same file| D[Add/add collision on accretive doc]
    B -->|Other| E[Standard conflict resolution]

    C --> C1[Keep the call site\npreserve the refactor]
    C1 --> C2[Port semantic change\ninto helper body]
    C2 --> C3[Sweep moved code's\ndoc comments for lies]
    C3 --> C4[Run union test suite\nboth branches' tests]
    C4 --> C5[Name merge commit\nafter adopted change]

    D --> D1[Merge as union\nkeep one preamble]
    D1 --> D2[Take diff-minimizing wording\nfor near-identical pointer lines]
    D2 --> D3[Sweep merged prose for\nstatements incoming commits falsified]

    C5 --> F[Resolution complete]
    D3 --> F
    E --> F
Loading

Reviews (2): Last reviewed commit: "Update docs/solutions/best-practices/mer..." | Re-trigger Greptile

@coderabbitai coderabbitai 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@docs/solutions/best-practices/merge-conflict-extraction-vs-semantics-and-parallel-bootstrap.md`:
- Line 65: Remove the authoring artifact "(session history)" from the sentence
in the paragraph that begins "The collision class is not hypothetical or rare
here: four parallel branches bootstrapped or substantially extended
`CONCEPTS.md` on the same day..." so the doc reads as a clean statement; simply
delete the parenthetical, ensure spacing/punctuation remains correct, and commit
the updated sentence (no code changes required).
- Line 70: Remove the editorial artifact "(session history)" from the sentence
that reads "One branch moved/extracted/renamed code that the other branch
changed the behavior of. A prior incident in the merger had the same shape in
reverse: a refactor that merged two distinct error cases into one throw site
silently changed error semantics downstream. (session history)"; simply delete
the parenthetical note so the paragraph ends with "downstream." and no authoring
annotation remains.
- Line 42: Remove the authoring annotation artifact "(auto memory [claude])"
from the example merge-commit line so the documentation only shows the intended
commit-name example (e.g. "Merge main: adopt FN-5902 lazy assertion linkage in
shared runFeatureValidation"); update the sentence containing that example to
delete the trailing annotation and ensure punctuation/spaces remain correct.
- Line 31: Update the branch name typo from "gsxdsm/missonsdebug" to
"gsxdsm/missionsdebug" wherever it appears in this doc sentence describing the
merge (the observed merging line referencing merge `60c307320`); ensure the
corrected branch name is used in the description that mentions the extracted
helper `runFeatureValidation` and the conflicting FN-5902 changes so the text
consistently reads "gsxdsm/missionsdebug".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ff12630a-d095-4efc-85a5-5e52473e3682

📥 Commits

Reviewing files that changed from the base of the PR and between 4aa9048 and d188f7c.

📒 Files selected for processing (1)
  • docs/solutions/best-practices/merge-conflict-extraction-vs-semantics-and-parallel-bootstrap.md

gsxdsm and others added 2 commits June 3, 2026 15:26
…antics-and-parallel-bootstrap.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…antics-and-parallel-bootstrap.md

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@gsxdsm
gsxdsm merged commit e01848c into main Jun 4, 2026
8 checks passed
@gsxdsm
gsxdsm deleted the gsxdsm/merge-conflict-learning branch July 24, 2026 06:08
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.

1 participant