Skip to content

fix(protocol): a failing semantic resolver must not publish conflict markers (closes #94) - #95

Merged
psaboia merged 1 commit into
mainfrom
fix/protocol-resolver-failure-leak
Jul 20, 2026
Merged

fix(protocol): a failing semantic resolver must not publish conflict markers (closes #94)#95
psaboia merged 1 commit into
mainfrom
fix/protocol-resolver-failure-leak

Conversation

@psaboia

@psaboia psaboia commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Closes #94. Field-reported on naval-sensor-fusion: a real multi-writer collision where the reporter's resolver callback "correctly reported failure, and the wrapper committed anyway" — raw <<<<<<< markers pushed to the shared wiki.

Root cause

wiki_push's semantic branch ignored resolve_fn's exit status and never checked for leftover markers — unconditional add + commit + push-retry. The documented production resolver (llm_resolve() { return 1; }, "defer to agent turn") was precisely the trigger, so the canonical path published markers on every real semantic collision. None of the 9 CI scenarios used a failing resolver, so the path had never been red.

Fix

Resolver non-zero, or markers remaining after a claimed success, marks the file unresolved. After the conflict loop: the merge is left in its conflicted state (exactly what wiki-write-protocol.md promises), unresolved files are listed with recovery instructions, and wiki_push returns new code 4 — nothing committed, nothing pushed. Union-merged index/log files stay staged so the agent's resolution commit completes the whole merge. Headers + protocol doc name exit 4.

Evidence

New scenario 10 reproduces the field anatomy (collaborator lands a new page + index/log entries + an OSPA-Metric.md edit; reporter holds different index/log entries + a same-paragraph edit; resolver = documented llm_resolve):

  • Red (unfixed): 4 failures — returned 0, wrapper printed semantic-resolved for a failed resolve, markers reached origin, worktree not left conflicted. Faithful to the field report line by line.
  • Green (fixed): PASS — exit 4, origin marker-free, worktree conflicted with instructions printed, and the recovery leg (hand-resolve keeping both sides, commit, re-run wiki_push) converges with unions intact — the reporter's manual fix, now as the designed flow.
  • Stash contrast brings the 4 failures back. All 10 scenarios green; full harness 1168 / 0 / 0.

Scenario 10 added to TEMPLATE_SHARED_INFRA (the #84-era lesson), so derived repos receive it on sync.

…markers

closes #94

wiki_push's semantic branch ignored resolve_fn's exit status and never
checked for leftover markers: the documented production resolver
(llm_resolve returning 1, 'defer to agent turn') triggered an
unconditional add+commit+push of files still containing <<<<<<< markers
— reported from the field on naval-sensor-fusion after a real
multi-writer collision on OSPA-Metric.md, where the wrapper printed
'semantic-resolved' and pushed markers to the shared wiki.

Now: resolver non-zero, OR markers remaining after a claimed success,
marks the file unresolved; after the conflict loop the merge is left in
its conflicted state (exactly what wiki-write-protocol.md promises),
the unresolved files are listed with recovery instructions, and
wiki_push returns the new code 4 without committing or pushing. Headers
and the protocol doc updated to name exit 4.

Red-first: new scenario 10-semantic-resolver-defers reproduces the
field anatomy (new page + index/log union collisions + a same-section
semantic conflict, resolver = documented llm_resolve). Against the
unfixed protocol: 4 failures — returned 0, markers reached origin, B's
edit leaked, worktree not left conflicted. With the fix: PASS,
including the recovery leg (hand-resolve both sides, commit, re-run
wiki_push; unions intact, origin marker-free). Stashing the fix brings
the 4 failures back. All 10 scenarios green.
@psaboia
psaboia merged commit 879c413 into main Jul 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wiki_push publishes raw conflict markers when the semantic resolver fails — resolve_fn's status is ignored

1 participant