Merge Reconciliation¶
CommitMergeAnalyzer is an additive, application-level supervisor over the
public CommitDatabase API. The engine reduces concurrent streams
mechanically and signals no conflict; this layer reconstructs a notion of
conflict after a merge and lets a caller make a chosen value survive. It adds
no engine, storage-format, or runtime change.
See also
Supervised Reconciliation — the model, the headless identify / surface / reconcile triad, and its bounds.
Example¶
from dsviper import CommitMergeAnalyzer, CommitMergeResolution
merge = db.merge_commit("merge", ours, theirs)
analysis = CommitMergeAnalyzer.analyze_merge(db, merge)
# The supervisor decides per conflict; here, keep ours at every locus.
# A resolution pairs the conflict with the value to make survive at its
# path — ``ours_value()`` already reads that value at the conflict's locus.
resolutions = [
CommitMergeResolution(c, c.ours_value().unwrap())
for c in analysis.conflicts()
]
survivor = CommitMergeAnalyzer.reconcile(db, merge, resolutions, "reconcile")
Accepting the merge for every conflict makes reconcile return the merge
commit unchanged.
Classes¶
Additive, post-merge 3-way reconciliation over a CommitDatabase. |
|
The result of a 3-way merge analysis: the merge base and the list of reconstructed conflicts between the two branches. |
|
All conflicts of one document (attachment, key) — the unit reconcile operates on. |
|
A single locus, anchored on a path, where one branch's intent did not survive the merge, reconstructed as base/ours/theirs/merged values. |
|
A supervisor's decree for one conflict: the chosen value should survive at the conflict's locus. |