Skip to main content

Module agent_native_memory_versions

Module agent_native_memory_versions 

Source
Expand description

Append-only version history for native memory content. See db_agent_native_memory_versions in migrations.rs (SHARED_STORE_SCHEMA_VERSION v8 / OBJECT_SCHEMA_VERSION v24 / IDENTITY_STORE_SCHEMA_VERSION v3) and docs/specs/SPEC_MEMORY_VERSION_CONTROL_AND_ARMORY_AUDIT_2026_08_19.md for the full design.

Additive to db_agent_native_memory (the current-value mirror in agent_native_memory.rs) — never read on that module’s hot path (list/read_file), only by the agent:memory:history/diff/revert RPCs. A version row is inserted on every agent:memory:write_file call (source-tagged; see the spec’s §4.1) and, separately, by agent:memory:revert (source "revert", never overwriting or deleting a prior row — a revert is always a new version, git-revert-style).

Structs§

NativeMemoryVersion
One version of one memory file’s content, including its full body.
NativeMemoryVersionSummary
A version’s metadata without its full content — the list-view shape, mirroring NativeMemoryMirrorRow’s own list_meta/read split in agent_native_memory.rs (a history view renders many rows at once; a diff/revert call reads exactly one or two full bodies).

Functions§

content_hash 🔒
SHA-256 hex digest of a memory file’s content — used both to populate content_hash on insert and, later, by §4.5 drift detection to compare a live file’s current hash against the last recorded version without storing the live content redundantly.