fix(merge): make --allow-plausible actually control track matching#26
Merged
Conversation
- Gate _match_branch on inputs.allow_plausible in _analyze_tracks; the flag was inert because internal matching hardcoded exact_only=False while the function returned a separate exact-only match set - Thread allow_plausible through ThreeWayInput and validate_three_way into the CLI merge guide and plan subcommands - Fix input role label in validate_three_way: a bad ours input reported itself as theirs in snapshot validation errors - Capture the --output value in _merge_guide so the filename is no longer parsed as a positional snapshot argument - Reject unknown options and more than three positional args in merge guide and plan - Add tests/test_merge_option_contract.py covering the option contract, input role labels, and guided-merge argument parsing Default matching is now exact-only; six tests in test_merge_phase2.py pass allow_plausible=True to retain their prior assertions.
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.
Summary
Fixes three defects in the three-way merge option contract. The headline one is that
--allow-plausibledid nothing.1.
--allow-plausiblewas inert_analyze_tracksinsrc/alscan/merge/analysis.pyhardcodedexact_only=Falsewhen building its internalmatches, then separately computed anexact_only=Trueset and returned that. Two consequences:_analyze_track_order) was a stricter, different set than the one the rest of the analysis used.Both the CLI and the GUI already exposed the option —
src/alscan/gui/workers.pycarries anallow_plausiblefield and the three-way page has a checkbox — so the setting appeared functional at both surfaces while having no effect.Now a single match set is computed with
exact_only=not inputs.allow_plausibleand returned consistently.allow_plausibleis threaded throughThreeWayInputandvalidate_three_way.Behaviour change: default matching is now exact-only. Six tests in
tests/test_merge_phase2.pynow passallow_plausible=Trueto retain their previous assertions.2. Input role mislabel
validate_three_wayiterated[(base_p, "base"), (ours_p, "theirs"), (theirs_p, "theirs")], so a malformed ours snapshot produced an error blaming theirs.3.
--outputcorrupted argument parsingIn
_merge_guide, the--outputbranch was a barepassthat did not setskip_next. The output filename therefore fell through intoclean_argsand was parsed as a positional snapshot input. The value is now captured and the following argument skipped.Also adds unknown-option rejection and a too-many-positional-args guard to both
merge guideandmerge plan, and removes a deadallow_unrelated_valassignment that was never read.Tests
Adds
tests/test_merge_option_contract.py(504 lines) covering exact-vs-plausible matching, input role labels, and guided-merge argument parsing.Local verification mirroring
ci.ymlexactly, including-W error:pytest -W error --ignore=tests/gui— 791 passedQT_QPA_PLATFORM=offscreen pytest -W error -x --timeout=120 --timeout_method=thread tests/gui/ tests/test_services.py— 267 passedKnown gap
--outputonmerge guideis now parsed correctly but still never used — the value is captured and ignored, so no file is written. This is an improvement on the previous behaviour, which corrupted positional parsing, but the flag remains inert. Tracked separately in #25.