Pull Request

feat: add three-way merge for text file conflicts

Author: @alice Branch: feat/three-way-merge → main Files changed: 3 Status: Open · Awaiting review

Why: Previously, when two clients modified the same text file concurrently, Acme Sync resolved the conflict by keeping both copies as duplicates (e.g., report.txt and report (conflict).txt). This bloated synced directories and confused users.

What: This PR introduces a three-way merge strategy using the common ancestor snapshot stored in the SQLite snapshots table. Text conflicts are merged in-memory; only genuinely unresolvable hunks are flagged and written to the conflict log.

Annotations:
NOTE informational, no action needed
WARN should address before merge
CRITICAL must fix before merge
src/conflict.ts new file
src/watcher.ts modified
Before → After
tests/conflict.test.ts new file

Review Focus

Pay attention to the ancestor lookup strategy and the binary file guard. The critical annotation on flagUnresolved() must be resolved before this merges — the conflict log write must happen before the function returns, not after.