Skip to main content

Module drift

Module drift 

Source
Expand description

Oath drift detection — port of drift.ts / Drift.java. A paragraph the committed varar.lock.json baseline recorded as an example that now matches no step. Byte-identical to the other ports (FNV-1a fingerprint, insertion-ordered lockfile serializer, Jaccard word-similarity re-identification).

Structs§

BaselineExample
One example-producing paragraph, as recorded in the baseline.
Drifted
A paragraph the baseline says was an example and now matches no step.
LockFile
The whole varar.lock.json: every oath keyed by its POSIX path.
OathBaseline
The committed baseline for one oath file.

Constants§

SIMILARITY_THRESHOLD
The word-similarity threshold for re-identifying a moved/reworded example.

Traits§

BaselineStore
Persistence port for varar.lock.json. The core owns the format; adapters move only raw text.

Functions§

derive_oath_baseline
The full baseline record for an oath: fingerprint plus live examples.
detect_drift
Paragraphs the baseline recorded as examples that now match zero steps.
live_examples
The current example-producing paragraphs, in document order.
message
The human-readable message for a drift.
parse_lock_file
Parses varar.lock.json; None on malformed input (treated as no baseline).
prune_baselines
The whole-lock counterpart of reconcile_drift, run ONCE per run rather than per oath: reconciliation cannot see paths that no longer exist, so without this the lock silently accumulates dead entries and stops being a faithful inventory of the oath set (#70).
prune_lock_file
Drops every baseline whose oath path is not in keep_paths — the entries left behind when an oath is deleted or moved. Pure counterpart of parse_lock_file / stringify_lock_file; the caller decides what “still exists” means.
reconcile_drift
One oath’s baseline reconciliation against a BaselineStore. update accepts all drift; otherwise detect drift and rewrite the baseline only on a clean run.
stringify_lock_file
Serializes varar.lock.json deterministically (fixed field order, sorted oath paths, two-space indent, trailing newline) — NOT [crate::canonical_json].