fix(protocol): a failing semantic resolver must not publish conflict markers (closes #94) - #95
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ignoredresolve_fn's exit status and never checked for leftover markers — unconditionaladd+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.mdpromises), unresolved files are listed with recovery instructions, andwiki_pushreturns 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.mdedit; reporter holds different index/log entries + a same-paragraph edit; resolver = documentedllm_resolve):semantic-resolvedfor a failed resolve, markers reached origin, worktree not left conflicted. Faithful to the field report line by line.wiki_push) converges with unions intact — the reporter's manual fix, now as the designed flow.Scenario 10 added to
TEMPLATE_SHARED_INFRA(the #84-era lesson), so derived repos receive it on sync.