reconcile

package
v0.17.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package reconcile adapts the flat snapshots the endpoint protocol carries to the nested tree Mutagen's reconciler operates on, and converts the changes it produces back into the transition the protocol applies.

The reconciliation itself is Mutagen's. What lives here is the shape conversion and the platform's own rules: two-way-safe, so a path changed on both sides is quarantined rather than resolved by guessing.

Index

Constants

Mode is two-way-safe: neither side wins automatically. A path changed on both sides becomes a conflict, which quarantines that path and leaves everything else syncing — the alternative resolves by policy and silently discards work.

Variables

This section is empty.

Functions

func DigestsNeeded

func DigestsNeeded(changes []*syncv1.Change) []string

DigestsNeeded returns the content digests a side must be given before the changes can be applied, so staging happens before the transition.

Types

type Conflict

type Conflict struct {
	Path         string
	LocalChange  string
	RemoteChange string
}

Conflict names a path both sides changed, with a human-readable account of what each did.

type Result

type Result struct {
	// ToLocal and ToRemote are the changes each side must apply.
	ToLocal  []*syncv1.Change
	ToRemote []*syncv1.Change
	// Conflicts are paths changed on both sides. They are quarantined, not
	// resolved: both versions survive and unrelated work is not held hostage.
	Conflicts []Conflict
	// Ancestor is the agreed state to record once the cycle completes. It is
	// committed only after both sides have applied, so an interruption
	// recomputes on the next pass rather than recording a state that is not
	// true on disk.
	Ancestor *core.Entry
}

Result is one reconciliation pass.

func Reconcile

func Reconcile(ancestor *core.Entry, local, remote Snapshot) *Result

Reconcile computes what each side must do to agree, given the ancestor from the last completed cycle.

type Snapshot

type Snapshot []*syncv1.Entry

Snapshot is a flat scan from either side.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL