Skip to main content

Module sync

Module sync 

Source
Expand description

The full auto-sync pass: reconcile cross-references, linkify body prose, and relocate documents to their canonical layout path. Invoked by maybe_sync after every mutating command and by the opys sync command.

The pass runs over the in-memory store: reconstruct every doc, backfill timestamps, run the (unchanged) links reconcile/linkify engine on the reconstructed Docs, write the changed ones back via put_doc, point every doc at its canonical path, and flush. Relation-map / linkify logic stays in Rust — the store is the data layer feeding it.

Functions§

pass
Run the reconcile/linkify/backfill/relocate pass against an already-open store (no flush). Returns the document count. Used both by run and, on the invocation’s own store, after a mutating command.
run
Load the corpus, run the sync pass, and flush. Returns the document count. Errors (without writing) if any document fails to parse.
run_command
The opys sync command entry: open the project and run the full pass.