pub struct ArtifactCrudMeta {
pub version: u64,
pub updated_at: String,
pub session_id: String,
}Expand description
CRUD-surface bookkeeping for an ArtifactRow (ENG-115), carried inside
its opaque meta JSON string rather than as new ArtifactRow fields.
ArtifactRow is constructed via exhaustive struct literals in several
crates outside this lane’s file allowlist (storage::artifacts,
host-app/src/api_session_utils_artifacts.rs, and others) with no
..Default::default() spread. Adding a new required field there would be
a breaking change this lane cannot land, since fixing every call site is
out of scope. Piggybacking on meta — already a freeform per-artifact
JSON blob other producers (e.g. the browser-artifact writer) use the same
way — keeps artifact_crud additive.
A consumer that needs a typed edit counter or “session that produced
this” field on ArtifactRow itself should thread it through every
existing constructor in the same change, not add it silently.
Fields§
§version: u64Monotonic content version. Starts at 1 on creation and is incremented
by exactly one on every artifact_update that lands. Distinct from
content_hash-based trust binding: this is a plain edit counter the
CRUD surface’s optimistic-concurrency check compares cheaply without
hashing.
updated_at: StringWall-clock stamp (ISO-8601) of the most recent create/update.
session_id: StringSession that produced this artifact through the CRUD surface.
Implementations§
Source§impl ArtifactCrudMeta
impl ArtifactCrudMeta
Sourcepub fn from_meta_str(meta: &str) -> Self
pub fn from_meta_str(meta: &str) -> Self
Parse from ArtifactRow::meta. Any non-JSON or unrecognized shape
(e.g. another producer’s freeform meta) yields the version-1
default rather than an error — this is bookkeeping, not a contract
other producers must satisfy.