pub struct Item {
pub id: String,
pub kind: String,
pub version: Option<String>,
pub content_hash: String,
pub files: Vec<String>,
pub file_hashes: BTreeMap<String, String>,
pub locator: Option<String>,
pub meta: String,
}Expand description
One PROVIDER item — a message, an event, a chat message, a recording
session, a file version. Identity is source instance + kind + id
(ADR 0001); run ids, filenames and bundle names are never identity.
Serde defaults keep legacy aggregate manifests parseable.
Fields§
§id: StringStable provider id — engine-owned cross-run dedup keys on this.
kind: StringProvider kind: email, event, chat-message, transcript,
recording, file… Empty = legacy aggregate-manifest item.
version: Option<String>Provider version (an eTag) when the provider has one.
content_hash: Stringsha256 (hex) of the item’s canonical PRIMARY content — the locator- selected record’s compact JSON when a locator names one in a JSON bundle, the first file’s bytes otherwise. The version of last resort and the primary evidence-integrity anchor. Empty = legacy.
files: Vec<String>Files written, relative to the run dir.
file_hashes: BTreeMap<String, String>sha256 (hex) of each SECONDARY file — every entry of files beyond
the first — keyed by its run-relative path (ADR 0006). Extends the
primary anchor’s integrity discipline to transcripts, attendance
reports, attachments: the engine refuses a fetch whose digests don’t
match the bytes, and they join the item-version fingerprint (see
Item::version_fingerprint). REQUIRED for multi-file items; empty
on single-file items and on manifests that predate per-file hashes,
whose secondary files read as unverified until re-fetched.
locator: Option<String>Where the item lives WITHIN a bundle file (e.g. the record’s provider id in a JSON array) — bundles are storage, not identity.
meta: StringItem metadata (a recording’s start instant, a subject line…).
Implementations§
Source§impl Item
impl Item
Sourcepub fn version_fingerprint(&self) -> String
pub fn version_fingerprint(&self) -> String
The item-VERSION fingerprint — what “same version” means for cross-
run dedup and evaluation keys. An aggregate of the primary anchor
(content_hash, a LOGICAL record digest for bundle items — never the
physical bundle file, which would bump every sibling record when one
changes) and the secondary-file digests in canonical (sorted) path
order, so a plugin reordering its files fabricates nothing. A changed
transcript is therefore a NEW version (new curation work) even while
the primary record stands. With no secondary digests the fingerprint
IS the bare content_hash, keeping single-file items’ versions and
evaluation keys exactly as they were before per-file hashes.