Expand description
Tier-2 durable version history: a bounded, flat list of state snapshots in
versions.jsonl (the “light git per file” — a Google-Docs-style version
panel, NOT a full VCS: no branches/merge). Each version is a full content
snapshot (content-addressed); named versions carry a label. Restore returns
a past version’s content for the caller to write back to the .zen.
Structs§
- Version
Meta - Metadata recorded alongside a durable version: an optional human label, an optional op-kind tag, and optional agent-checkpoint metadata.
Enums§
- Version
Outcome - The outcome of a
record_versioncall.
Functions§
- list_
versions - List all durable versions for
doc_id, oldest first (append order). - record_
version - Record
contentas a new durable version.meta.labelnames it (a named version is retained forever by the retention pass).meta.op_kindis an optional category label. UNNAMED (auto) versions deduplicate against the LATEST version: ifcontentis byte-identical to it, the call returnsUnchangedand appends nothing. A NAMED version (meta.label.is_some()) is an explicit checkpoint and is ALWAYS recorded, even when its content matches the latest version. - resolve_
version - Resolve a revspec against the version list (HEAD = the latest version) to a
version id. Supports the same forms as the session resolver (
@head,@head~N, seq,@latest:<label>, id/prefix,@time:). - restore_
content - Restore: resolve
specto a version and return its content (the caller writes it back to the.zen). Does NOT itself mutate the working file or record a new version — that is the caller’s responsibility so the write-through stays in one place. - version_
content - The content of the version with the given id.