From 8046a777af418ae92738c5f6af0a4b9482aeae02 Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Tue, 7 Jul 2026 11:29:51 +0000 Subject: [PATCH] fix: refine conflict merge policy --- devs.md | 14 ++++++++++++++ src/lib | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/devs.md b/devs.md index d994d5e..bb74a1c 100644 --- a/devs.md +++ b/devs.md @@ -148,6 +148,20 @@ Hence, the new feature should be implemented as follows: - **Service Hub** (`src/modules/services/`): Central service registry using dependency injection - **Common Library** (`src/lib/`): Platform-independent sync logic, shared with other tools +### Conflict Merge Policy + +Markdown conflict auto-merge should behave like a conservative three-way merge. The guiding rule is to merge changes when they touch non-overlapping regions, and to keep a manual conflict when the edits overlap semantically. + +When in doubt, prefer the safer outcome: preserve data, keep the conflict visible, and ask the user rather than silently discarding content or choosing one side. + +- If one side deletes a line and the other side leaves that same line unchanged, treat it as a safe deletion. The deleted line must not be reintroduced into the merged result. +- If one side inserts new content in a different region while the other side deletes an unchanged old region, preserve the insertion and the deletion. +- If one side deletes a line and the other side modifies that same line, keep the conflict for user resolution. +- If both sides insert different content at the same position, keep both insertions in a deterministic order unless the surrounding deletion context indicates that they are competing replacements. +- Avoid resolving conflicts by simply choosing the newest revision unless the user has explicitly selected that behaviour. + +This policy is intentionally aligned with the conflict checkboxes and compatibility settings: automatic merge should remove avoidable prompts, but it must not silently choose between overlapping user intentions. + ### File Structure Conventions - **Platform-specific code**: Use `.platform.ts` suffix (replaced with `.obsidian.ts` in production builds via esbuild) diff --git a/src/lib b/src/lib index be43ca7..6bba9fd 160000 --- a/src/lib +++ b/src/lib @@ -1 +1 @@ -Subproject commit be43ca7686a4c820bced87d7a95c4e48604b3a2c +Subproject commit 6bba9fd237c7008bcf4e58470bbb21a059ca241b