Skip to main content

Module divergence

Module divergence 

Source
Expand description

Drift detection for preprocessor outputs (the 4-state matrix).

Walks the per-pack baseline cache and compares each cached record against the current source file (in the pack) and the current deployed file (in the datastore). Classifies each pair into one of the four states defined in docs/proposals/preprocessing-pipeline.lex §6.1:

sourcedeployedstate
samesameSynced
newsameInputChanged
sameeditedOutputChanged
neweditedBothChanged

Plus two special states for missing files: a baseline whose source has been deleted (MissingSource) or whose deployed artifact is gone (MissingDeployed).

This module is read-only. It produces a DivergenceReport per cached baseline; the action layer (commands::transform::check) decides what to do with each report (apply a reverse-merge diff, emit a conflict block, etc).

Structs§

DivergenceReport
One row in dodot transform check’s report.

Enums§

DivergenceState
Where a single processed file sits in the 4-state matrix.

Functions§

classify_one
Classify a single baseline against the current state on disk.
collect_baselines
Walk the per-pack baseline cache directory and load every record.
collect_divergences
Walk every cached baseline and produce a divergence report.
find_baseline_for_source
Look up the baseline whose source_path matches target, plus the (pack, handler, filename) triple that identifies it in the cache layout.