pub struct DiffNode {Show 13 fields
pub action: String,
pub item_type: String,
pub path: String,
pub source_path: Option<String>,
pub summary: Option<String>,
pub tags: BTreeSet<String>,
pub children: Vec<DiffNode>,
pub details: BTreeMap<String, Value>,
pub annotations: BTreeMap<String, Value>,
pub comparator: Option<String>,
pub transformed_by: Vec<String>,
pub source_items: Option<ItemPair>,
pub artifacts: Vec<ArtifactDescriptor>,
}Expand description
A node in the diff tree — the central data structure of the system. Every comparator emits it, every transformer rewrites it, and serializers or bindings read it.
Fields§
§action: StringOpen enum: “add”, “remove”, “modify”, “move”, “reorder”, “schema_change”, etc. Plugins may define new actions.
item_type: StringOpen string: “directory”, “file”, “tabular”, “zip_archive”, etc. No built-in types — conventions, not enforcement.
path: StringLocation within snapshot (logical path, including interior paths like “archive.zip/data/file.csv”).
source_path: Option<String>For moves/renames: the original path.
summary: Option<String>Optional human-readable one-liner describing the change. Set by comparator or transformer; used by renderers for narrative rendering.
Open bag of semantic tags, namespaced by convention. e.g. “binoc.column-reorder”, “biobinoc.gap-change”
children: Vec<DiffNode>Child diff nodes forming the tree structure.
details: BTreeMap<String, Value>Comparator-specific payload, schema determined by item_type convention.
annotations: BTreeMap<String, Value>Transformer-added metadata.
comparator: Option<String>Which comparator produced this node (provenance for extract chain).
transformed_by: Vec<String>Transformers that modified this node, in order (provenance for extract chain).
source_items: Option<ItemPair>The original item pair that produced this node. Session-scoped working
data: available during a live diff/transform session for transformers
and extractors that need to re-read source data, and carried across the
plugin ABI wire so separately-compiled plugins can access it. Callers
writing changeset output must strip this via
DiffNode::strip_transient before serializing.
artifacts: Vec<ArtifactDescriptor>Published artifacts for this node. Session-scoped working data: carried
across the plugin ABI wire as descriptors (the bytes live in the shared
data_root cache), but not meaningful outside a session. Callers
writing changeset output must strip this via
DiffNode::strip_transient before serializing.
Implementations§
Source§impl DiffNode
impl DiffNode
pub fn new( action: impl Into<String>, item_type: impl Into<String>, path: impl Into<String>, ) -> Self
pub fn with_summary(self, summary: impl Into<String>) -> Self
pub fn with_tag(self, tag: impl Into<String>) -> Self
pub fn with_detail(self, key: impl Into<String>, value: Value) -> Self
pub fn with_children(self, children: Vec<DiffNode>) -> Self
pub fn with_source_path(self, source: impl Into<String>) -> Self
pub fn with_source_items(self, items: ItemPair) -> Self
pub fn with_artifact(self, artifact: ArtifactDescriptor) -> Self
pub fn node_count(&self) -> usize
Sourcepub fn strip_transient(&mut self)
pub fn strip_transient(&mut self)
Recursively clear session-scoped transient fields (source_items,
artifacts) on this node and all descendants.
These fields are wire-visible so the plugin ABI can move them across process-ready boundaries, but they are not meaningful outside a live session and must be stripped before writing changeset output intended for users (JSON files, renderer output, Python return values).