Repair conflict markers already pushed to a shared Ledger (sageox/ox#1258)
Outcome
ox doctor --fix-slug=session-conflict-markers resolves sessions/*/meta.json files whose
committed content holds git conflict markers, whether the markers are unpushed (today) or
already on the remote (new). One teammate's repair heals the team; concurrent repairs converge.
Changes
- Scan the HEAD tree, not just @{u}..HEAD.
git grep -l '^<<<<<<< ' HEAD -- 'sessions/*/meta.json'unioned with the existing unpushed delta scan. Tree read, so sparse checkout is irrelevant. - One deterministic, JSON-aware resolver (shared by the unpushed fallback):
- stack parser handles nested blocks (Ryan's 49th file);
- candidates: all-stash side, all-upstream side; keep those that are valid JSON;
- pick higher
summary_attempts; tie -> stash (local) side, matching the Ledger's rebase accept-theirs policy and Ryan's manual repair; - neither valid -> unrepairable, file untouched. Unpushed files still prefer the clean version upstream already holds.
- No lock. Output is a pure function of the marked bytes, so every clone writes identical bytes and a concurrent repair merges cleanly on rebase.
- No sidecar. Repair is one additive commit; replaced blob ids go in the commit message so
git show <blob>recovers the original bytes. - Fix level stays Suggested. Doctor commits; daemon sync pushes.
Tests (E2E, real bare remote)
- markers already on origin -> repaired -> pushed -> third clone pulls clean
- two clones repair concurrently -> both push, no conflict, identical content
- nested markers; neither side valid JSON; uncommitted working-copy edit
- red-first: disable the HEAD-tree scan, the already-pushed test fails
Out of scope
raw.jsonl: empty file unreadables; a server-side repair job (private-owner follow-up).

