Skip to main content

Module history

Module history 

Source
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§

EnsuredDocId
The result of an ensure_doc_id_in call.
HistoryLine
One line in a history listing (maps 1-to-1 to a Tier-2 HistoryRecord).
HistoryView
History listing for a single document.
Recorded
The result of a best-effort history recording.
RestoreOutcome
Outcome of a restore or restore_in call.

Enums§

NavOutcome
Outcome of a undo_edit or redo_edit navigation call.
SyncOutcome
Outcome of a sync_external or sync_external_in call.

Functions§

ensure_doc_id_in
Ensure the document at doc_path carries a doc-id, attaching one if absent.
history_view
Build the history view for the document at doc_path.
history_view_in
Same as history_view but with an explicit store root (used by tests).
name_version
Save the current on-disk content of doc_path as a NAMED Tier-2 version.
name_version_in
Same as name_version but with an explicit store root (used by tests).
read_doc_id
Public thin wrapper around doc_id_at for use by sibling command modules.
record_edit
Resolve the data directory and record content (the about-to-be-written .zen bytes) as history for the document at doc_path.
record_edit_in
Same as record_edit but 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_edit but with an explicit store root (used by tests).
restore
Resolve spec to a past version, write its content back to doc_path, and record the restore as a new (undoable) edit.
restore_in
Same as restore but with an explicit store root (used by tests).
sync_external
Capture the current on-disk content of doc_path into 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_edit but with an explicit store root (used by tests).