pub struct DiffNode {Show 13 fields
pub action: String,
pub item_type: String,
pub path: String,
pub sources: Vec<Source>,
pub summary: Option<Summary>,
pub tags: BTreeSet<String>,
pub children: Vec<DiffNode>,
pub details: BTreeMap<String, Value>,
pub detail_blocks: Vec<DetailBlock>,
pub annotations: Vec<Annotation>,
pub source_items: Option<ItemPair>,
pub diagnostics: Vec<Diagnostic>,
pub artifacts: Vec<ArtifactDescriptor>,
}Expand description
A node in the projected diff tree — the durable changeset structure consumed by renderers, serializers, and bindings.
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”). /> marks a decompose boundary;
a literal segment beginning with > is escaped as \>.
sources: Vec<Source>Renderer-visible provenance for this projected node.
summary: Option<Summary>Optional structured one-liner describing the change. Set during
projection; renderers format each Segment by its
type. Build it with Summary’s builder, or pass a plain string —
impl Into<Summary> wraps it as a single Segment::Text.
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>Structured payload, schema determined by item_type/action convention.
detail_blocks: Vec<DetailBlock>Renderer-visible, structured evidence blocks. Rule packs populate these with bounded examples while they still have domain knowledge; renderers decide how much to display.
annotations: Vec<Annotation>Renderer-visible annotations supplied by rule packs.
source_items: Option<ItemPair>The original item pair associated with this projected node when one is
available. Session-scoped working data: available during a live run for
rules and extractors that need to re-read source data. Callers writing
changeset output must strip this via
DiffNode::strip_transient before serializing.
diagnostics: Vec<Diagnostic>Node-scoped diagnostics emitted during a run.
Transient: the controller hoists them into Changeset::diagnostics
at the end of the diff, then clears this field so the output shape
stays as one durable top-level diagnostics list.
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<Summary>) -> 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_detail_block(self, block: DetailBlock) -> Self
pub fn with_annotation_from( self, package: impl Into<String>, key: impl Into<String>, value: Value, ) -> Self
pub fn with_source(self, source: Source) -> Self
pub fn with_sources(self, sources: Vec<Source>) -> Self
pub fn with_source_items(self, items: ItemPair) -> Self
pub fn with_diagnostic(self, diagnostic: Diagnostic) -> Self
pub fn with_artifact(self, artifact: ArtifactDescriptor) -> Self
pub fn push_diagnostic(&mut self, diagnostic: Diagnostic)
pub fn push_source(&mut self, source: Source)
pub fn primary_from_source(&self) -> Option<&Source>
pub fn annotate_from( &mut self, package: impl Into<String>, key: impl Into<String>, value: Value, )
pub fn annotation(&self, package: &str, key: &str) -> Option<&Annotation>
pub fn binoc_annotation(&self, key: &str) -> Option<&Annotation>
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,
diagnostics, 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).