Module reconcile

Source
Expand description

The git log backstop for the commit journal (D-98).

The post-commit hook only writes the journal on a box that mounts the vault. Everywhere else the row is lost, and once the config was copied onto those boxes it started being lost silently — which is worse, because a journal that quietly stops looks exactly like a quiet week.

This module is the other half of the ruling: a pass that reads the history reachable from a repository’s HEAD and appends whatever row the day note is missing. It needs no broker and no network, so it works on the day the wire is down and on the day the wire does not exist yet.

§What it will not do

It only ever appends. It never rewrites, reorders or reformats a row that is already in a note. The day notes are hand-readable files a human keeps, so a backfill that touched existing rows would be a far worse defect than a missing one.

It sees only what HEAD reaches, which is narrower than “the repository’s history” and is stated here because the difference bites in exactly the workflow this fleet uses: a commit on an unmerged lane branch is not journalled, and if that branch is squash-merged it never becomes reachable at all. Point a pass at each worktree, not only at the main clone. Widening it to every local branch is a decision about what belongs in the journal, not a bug fix, so it is not taken here.

Identity is the commit hash column, which is why a row written by the hook and a row this pass would have written collapse to one: whichever arrives first wins, and the other is recognised as already present. That is the dedup rule D-98 named as the thing that must be exactly right.

Structs§

ReconcileReport
What one reconcile pass over one repository did.

Functions§

hashes_in_note
Every commit hash already recorded as a row in a day note.
last_table_column 🔒
The final cell of a Markdown table row, or None if the line is not one.
looks_like_object_id 🔒
Whether a cell could be a git object id.
reconcile_all
Reconciles every repository in repo_paths, in order.
reconcile_repo
Appends every row a repository’s day notes are missing, for the history HEAD can reach.