* feat: auto-resolve issues-table modify/modify conflicts by LWW (updated_at)
Add an issues case to TryAutoResolveMergeConflicts that auto-resolves
modify/modify conflicts on the issues table using row-wise last-write-wins
by updated_at. This eliminates the biggest remaining manual wall in
multi-clone sync: the issues-table conflicts that follow routine cross-clone
pulls (GH#4698).
Safety predicate (issuesConflictsAreLWWSafe):
- Only modify/modify (base_id valid, both our_id and their_id valid)
- Reject add/add (no base row), delete/modify (one side NULL)
- Reject equal updated_at (ambiguous)
Resolution (resolveIssuesLWWConflicts):
- For rows where ours wins: DELETE the conflict row from
dolt_conflicts_issues (working set already holds our values)
- For remaining rows (theirs wins): DOLT_CONFLICTS_RESOLVE('--theirs')
- Stage with DOLT_ADD('issues')
Updated TestPullFromReportsOperatorConflicts to pin updated_at to equal
values on both sides, making the conflict ambiguous so the safety check
rejects it — the test exercises the operator-conflict reporting path which
requires a conflict the auto-resolver declines.
Added four new tests covering theirs-wins, ours-wins, ambiguous, and
add/add scenarios.
Agent-Signature: amp-gpt-5.4-2026-03-05-high on behalf of maphew
* feat: narrow issues LWW auto-resolve to losing-side-predates-merge-base
Tighten the issuesConflictsAreLWWSafe predicate so a modify/modify
issues-table conflict is only auto-resolved by last-write-wins when the
losing side's updated_at predates the merge base (equals the base row's
updated_at). If the losing side also moved its updated_at past the base
value, both sides made real edits since the last sync and row-level LWW
would silently drop the losing side's field-level changes — that
concurrent-edit case is now left for the operator (GH#4698 Risk
mitigation).
This preserves the common case the basic LWW fix targets: one side's
conflict is a migration artifact (the row was rewritten by a schema
change but updated_at did not move) and the other side made the only
real edit. bd is primarily single-user-multi-machine, so concurrent
same-issue edits since a shared merge base are rare.
Implementation: issuesConflictsAreLWWSafe now also selects
base_updated_at from dolt_conflicts_issues and, after the existing
modify/modify and unequal-timestamp checks, verifies the losing side's
(older) updated_at does not exceed the base value. The resolution
function (resolveIssuesLWWConflicts) is unchanged — it already does
row-wise LWW; only the safety gate is stricter.
Tests:
- Updated setupIssueMergeConflict to seed a controlled base updated_at
(the helper now explicitly sets updated_at on the seed row instead of
relying on CURRENT_TIMESTAMP, which made the base value timing-
dependent).
- Existing theirs-wins/ours-wins tests set the losing side's updated_at
equal to the base so they exercise the auto-resolve path.
- New TestTryAutoResolveMergeConflicts_IssuesConcurrentEditLeftAlone:
both sides' updated_at > base → left for the operator.
Agent-Signature: amp-gpt-5.4-2026-03-05-high on behalf of maphew