Skip to main content

Module convergence

Module convergence 

Source
Expand description

Where the work of this repository is being held, and whether any of it is held somewhere it can be lost.

§The problem this exists for

project.a-worker-that-stops-leaves-its-work-behind is written down as advisory, and says why: “nothing can see the uncommitted half except somebody looking, which is exactly why the responsibility is written down rather than gated.” That premise was true when the rule was written and is not true now. crate::worktree already counts the uncommitted work of every registered worktree, and git answers in one call which commits of this repository have never reached a remote. What was missing was not a measurement but a verdict over the repository: one word that says whether every unit of work is somewhere another worker could find it.

§What a holding is

A holding is anything that can hold work: a worktree (its uncommitted files), a branch (its commits), a stash (its diff). Each is given a Disposition from the evidence, and a holding whose disposition is Disposition::LocalOnly or Disposition::Uncommitted is at risk: it exists on one disk, it is invisible to every other worker, and a worker that stops is not a rollback.

§What this is not

It is not a second reading of the topology — crate::worktree::WorktreeService is the only one, and this composes its answer. It is not a pull-request inventory: a pull request lives on a forge, reaching one is a network call, and the completion invariant already asks whether the trunk reaches a commit (integrated). This answers the half that is decidable offline, from this repository alone, in one pass.

use majordomus_cli::convergence::Disposition;

// the two dispositions that mean "this exists on one disk only"
assert!(Disposition::LocalOnly.at_risk() && Disposition::Uncommitted.at_risk());
// and the two that mean somebody else could pick it up
assert!(!Disposition::Integrated.at_risk() && !Disposition::Published.at_risk());

Structs§

ConvergenceReport
The repository’s convergence: every holding, and the one verdict over them.
Holding
One thing holding work, and what is known about where that work can be reached from.

Enums§

Disposition
Where the work a holding carries can be reached from.
HoldingKind
What kind of thing is holding the work.

Constants§

SCHEMA
The schema this module answers under.

Functions§

report
Measure the repository holding root.