Repository navigation
Treat touching edits as a merge conflict - #349
Closed
ThePumpingLemma wants to merge 1 commit into
Closed
ThePumpingLemma wants to merge 1 commit into
ThePumpingLemma wants to merge 1 commit into
Conversation
- MergeText and the editor's mergeText combined an insert at a replacement's edge, and abutting replacements, splicing text neither author wrote ('twice daily' + 'weekly' -> 'twice weekly').
- Edits must now be separated by unchanged text to combine, as in diff3.
5 tasks done
HamptonMakes
requested changes
Nov 24, 2026
HamptonMakes
left a comment
Collaborator
There was a problem hiding this comment.
Yeah, this is going to be a 'no' for me.
In the current implementation, if you were a human editor, you would SEE the result of the merge... both of the editors would. It would visibly be wrong.
In this proposal, one of them silently is ignored and... neither author can address the actual meaning conflict they had on that content.
Further, we don't even have multi-author editing right now... though it is coming and will be a feature, so the overall intention is right.
But yeah- we have live updating on both reader and editor human views and this is just NOT a bug.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
When a web save is stale, Coplan merges the draft with the current version three ways, on the server (
Plans::MergeText) and in the editor (merge_text.js). Both treated edits that touch as separate, and combined them:Neither person wrote the result. It's saved as a human version, so it also blocks agent writes until someone reads it, and nothing tells either person their text was combined.
Now both merges treat edits that touch as a conflict, as diff3 does: an insert at the edge of a replacement, and two replacements that abut. Edits still combine when unchanged text separates them, even one character. A conflict shows the existing review step, as overlapping edits already did.
Found in the Coplan STPA review (finding content-edits-6): https://coplan.sqprod.co/dgrochowski/reliability-analyses/coplan-stamp-stpa-analysis-service-review
Evidence
The editor's
mergeText, run with Bun on main and on this branch:spec/services/plans/merge_text_spec.rbcovers the same cases on the server, in both orders.How to try it
This raises
Coplan::Plans::MergeText::Conflict. On main it prints "Run the backfill twice weekly.".In the browser:
hampton@example.com.Tab B should ask you to review the conflict instead of saving "twice weekly".
Testing
merge_text_spec.rb. The old "combines adjacent replacements and boundary insertions" example pinned the behaviour this PR removes, so it now expects a conflict.bundle exec rspec --exclude-pattern "spec/system/**/*_spec.rb": 2,929 examples, 0 failures. System specs can't start Chrome locally, so CI covers them.