monopam pull --auto: pluggable conflict-resolution strategies
Add a new Auto_resolve module with four strategies for resolving merge
conflicts surfaced by Pull.run:
- ours: always keep the local version of every conflicted region
- theirs: always take the upstream version
- union: emit both versions deduplicated (good for import lists,
changelog entries, lists of registered packages, etc.)
- claude: call the Claude CLI to summarise the two intents and
propose a merge, returning structured JSON for the resolution
The strategy is selected via the MONOPAM_AUTO environment variable
(default: claude). The CLI exposes --auto to opt in and --auto-yes
to skip the confirmation prompt for the claude strategy. The
deterministic strategies always auto-accept since their behaviour
is predictable.
Wiring:
- ocaml-git: Merge.conflict already carries the diff3 chunks plus
the three blob hashes (added in the previous commit), so the
resolver has everything it needs to either deterministically
transform the chunks or feed them to Claude as context.
- monopam: Pull.run takes an ?auto:auto_options arg with the client
plus the confirm callback. After the merge, conflicted blobs are
passed to the resolver one at a time and the accepted resolutions
are written back to the working tree.
- cmd_pull.ml: --auto resolves the strategy from MONOPAM_AUTO,
builds the appropriate client, and provides a confirm callback
that prints the rationale and (optionally) prompts.
Cram tests use the deterministic strategies — pull_auto_ours.t pins
both the ours and theirs paths end-to-end, no Claude API call, no
JSON fixtures needed.
Also: switched cram tests off /tmp/pull.out (which races between
parallel test runs) onto local pull.out / push.out paths inside
each cram sandbox.