Expand description
Local document-history recording (best-effort attach hook).
Wraps the zenith-session subsystem with the real OS adapters and the
resolved data directory. Every successful write-through edit (tx --apply,
library add) calls record_edit: it reconciles the document’s identity
(minting and stamping a doc-id on first edit) and records the new state as
a Tier-1 session snapshot and a Tier-2 version. Recording is best-effort:
failures become a warning message on Recorded::warning — they never block
the edit.
Navigation functions (history_view, undo_edit, redo_edit) expose
the session history to the CLI subcommands.
Structs§
- Ensured
DocId - The result of an
ensure_doc_id_incall. - History
Line - One line in a history listing (maps 1-to-1 to a Tier-2
HistoryRecord). - History
View - History listing for a single document.
- Recorded
- The result of a best-effort history recording.
- Restore
Outcome - Outcome of a
restoreorrestore_incall.
Enums§
- NavOutcome
- Outcome of a
undo_editorredo_editnavigation call. - Sync
Outcome - Outcome of a
sync_externalorsync_external_incall.
Functions§
- ensure_
doc_ id_ in - Ensure the document at
doc_pathcarries adoc-id, attaching one if absent. - history_
view - Build the history view for the document at
doc_path. - history_
view_ in - Same as
history_viewbut with an explicit store root (used by tests). - name_
version - Save the current on-disk content of
doc_pathas a NAMED Tier-2 version. - name_
version_ in - Same as
name_versionbut with an explicit store root (used by tests). - read_
doc_ id - Public thin wrapper around
doc_id_atfor use by sibling command modules. - record_
edit - Resolve the data directory and record
content(the about-to-be-written.zenbytes) as history for the document atdoc_path. - record_
edit_ in - Same as
record_editbut with an explicit store root (used by tests). - redo_
edit - Redo the last undone edit for the document at
doc_path, rewriting the file in place. - redo_
edit_ in - Same as
redo_editbut with an explicit store root (used by tests). - restore
- Resolve
specto a past version, write its content back todoc_path, and record the restore as a new (undoable) edit. - restore_
in - Same as
restorebut with an explicit store root (used by tests). - sync_
external - Capture the current on-disk content of
doc_pathinto Tier-1 history as an external change, if it differs from the session HEAD. Resolves the real data dir. - sync_
external_ in - Testable variant with an explicit store root.
- undo_
edit - Undo the last edit for the document at
doc_path, rewriting the file in place. - undo_
edit_ in - Same as
undo_editbut with an explicit store root (used by tests).