Skip to main content

Module export

Module export 

Source
Expand description

Mem-archive export.

The folder-shaped export (the gix-free path) lives here so the unified Engine::export_mem can call it without crossing into memstead-git-branch. The git-branch-shaped variant (export_mem_from_branch) stays in memstead-git-branch::ops::export because it walks a gitdir.

Output wire shape is deterministic and matches the git-branch variant byte-for-byte for equivalent input: .memstead/config.json carries the whitelist-projection of the author’s MemConfig, .memstead/schema/ embeds the pinned schema’s source files, and the mem’s .md blobs land at their mem-relative paths. Entries are sorted by path and zip-stamped with a fixed mtime so identical input produces byte-identical archives.

Structs§

MemExportBytes
Byte-shaped output of export_mem_to_bytes. Bundles the produced archive bytes with the same metadata MemExportResult reports for path-based exports.

Enums§

MemExportError

Functions§

build_archive_provenance
Build the per-entity authoring-provenance payload from a backend’s mutation log (read_provenance). Keys by each entity’s mem-relative path (EntityId::path) so the payload survives a remount under a different mem name. For each entity, keeps the most recent record that carries a non-empty note — the entity’s current rationale.
build_redacted_archive_provenance
The builder proper: every rationale passes through the private-pattern redaction (ops::redaction, the leak scan’s classes) before it is summarised, so an archive never carries a span the public tree refuses; the per-class counts of the rationales that ship travel to the export result (a superseded note’s redactions never reach the archive and are not counted).
export_entries_to_bytes
Seal already-collected entity bytes into a portable .mem archive — the storage-agnostic core shared by the folder exporter (export_mem_to_bytes, which walks a directory) and the in-memory exporter (which lists entities from a crate::backend::MemBackend holding them in RAM). Same wire format either way: whitelist config projection, embedded schema source, deterministic path-sorted entries, fixed mtime, and the same pre-write lenient validation pass.
export_mem
Export a mem directory as a portable .mem archive.
export_mem_to_bytes
Produce a portable .mem archive as bytes for a folder-backed mem. Same wire format as export_mem — same whitelist projection, same embedded schema source, same deterministic sort order and fixed mtime — but the output stays in memory so the bridge / WASM consumers can return it directly over HTTP.