Skip to content

Add headless overwrite semantics to merge_conflicts and the merge CLI verb - #28

Merged
TheValiantOne merged 2 commits into
mainfrom
feature/headless-overwrite
Aug 11, 2026
Merged

Add headless overwrite semantics to merge_conflicts and the merge CLI verb#28
TheValiantOne merged 2 commits into
mainfrom
feature/headless-overwrite

Conversation

@TheValiantOne

Copy link
Copy Markdown
Owner

Summary

Fixes the "Related, lesser finding" from docs/bugs/function-level-merge-gap-handling.md (the doc itself lands with PR #27): headless/MCP merges could never refresh an existing merged file. The overwrite YesNo prompt fell through to HeadlessMergeNotifier's fixed non-destructive default (No), so any conflict whose merged output already existed was skipped with the reason visible only as stderr prompt text — and dryRun could only predict that skip, never whether an already-merged file would actually auto-solve. For a mod manager re-merging after a source mod updates (the Vortex extension's whole flow), that made refresh impossible.

Changes

  • FileMerger.MergeConflictsHeadless gains overwrite (default false). Without it, an existing output is a clearly reported skip (ReportOutputExistsSkip: names the file and the way out — --overwrite / overwrite: true) instead of an unanswerable prompt. With it, the merge refreshes the existing output. The interactive GUI paths keep their real, answerable prompt unchanged.
  • MCP merge_conflicts gains overwrite (echoed in the result object alongside dryRun); dryRun + overwrite now answers "would this auto-solve?" for already-merged files.
  • CLI merge gains --overwrite in both hosts; usage text updated.
  • Vortex extension: the resolve flow passes overwrite: true for both the preview and the confirmed merge — the preview must predict what the real run will do. MergeConflictsArgs.overwrite's doc comment covers version skew: a pre-overwrite WSM server ignores the unknown argument and degrades to its previous skip behavior rather than erroring.

Tests

New integration test (real spawned Headless process): double-merge round trip — skip-with-reason and unchanged mtime without overwrite, dry-run predictions both ways, actual refresh with overwrite: true. Full pipelines green: dotnet test 128/128, extension 200 unit / 215 with integration, dotnet format --verify-no-changes clean.

Note: two pre-existing integration tests were failing before this change on this machine — a populated MergeInventory.xml left in bin/Debug by the live bug-session run was leaking into "empty mods folder" fixtures. Deleted the stale build-output file (backed up beforehand); not a code issue.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GXAuGMLB44T5Zv5o5ZzKah

Chris Knight and others added 2 commits August 10, 2026 23:58
… verb

Headless/MCP merges could never refresh an existing merged file: the
overwrite YesNo prompt fell through to HeadlessMergeNotifier's fixed
non-destructive default (No), with the reason buried in stderr prompt text
- and dryRun could only predict that skip, never whether an already-merged
file would auto-solve (docs/bugs/function-level-merge-gap-handling.md,
"Related, lesser finding").

- FileMerger.MergeConflictsHeadless gains an overwrite parameter; without
  it an existing output is a clearly-reported skip (ReportOutputExistsSkip,
  naming the way out) instead of an unanswerable prompt; with it the merge
  refreshes the existing output. Interactive GUI paths keep their real
  prompt unchanged.
- MCP merge_conflicts gains overwrite (echoed in the result); CLI merge
  gains --overwrite in both hosts.
- The Vortex extension's resolve flow passes overwrite: true for both the
  preview and the confirmed merge - a Vortex-driven re-merge after a mod
  update is exactly the refresh case. Documented version-skew behavior
  against pre-overwrite servers.
- New integration test: real double-merge round trip (skip-with-reason
  without overwrite, dry-run prediction either way, actual refresh with).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXAuGMLB44T5Zv5o5ZzKah
@TheValiantOne
TheValiantOne merged commit 3a72997 into main Aug 11, 2026
1 check passed
@TheValiantOne
TheValiantOne deleted the feature/headless-overwrite branch August 11, 2026 11:44
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.

1 participant