Expand description
Append-only version history for Global Memory entry content — mirrors
agent_native_memory_versions.rs’s shape exactly, adapted for a single
bundle_id key instead of that table’s composite (agent_id, filename)
(a Bundle’s identity is already a single id). See
docs/specs/SPEC_AGENT_FACING_GLOBAL_MEMORY_API_2026_09_15.md Phase 0 —
Global Memory (db_bundles) previously had no audit trail at all, only
updated_at; this exists specifically because Global Memory is about to
gain a write path an agent, not just a human in Memory, can reach.
The WRITE side (bundle_version_insert, called via
Store::bundle_upsert_with_version in bundles.rs on every
globalmemory.write AND Memory → Global’s own upsertmemory save path)
and the READ side (bundle_version_list/bundle_version_get, called by
global_memory_history_impl/global_memory_diff_impl/
global_memory_revert_impl in app_api/mod.rs, backing the
GlobalMemoryHistory/GlobalMemoryDiff/GlobalMemoryRevert MCP tools)
are both wired into the agent-facing MCP surface now — see
docs/specs/SPEC_AGENT_FACING_GLOBAL_MEMORY_API_2026_09_15.md. No
Memory pane surface for this yet — that remains out of scope (MCP/REST
only, per that spec’s own non-goals).
Structs§
- Bundle
Version - One version of one bundle’s Global Memory content, including its full
name/instructions. Deliberately no serde derives, same asNativeMemoryVersion— a wire type belongs inrpc_types, not here. - Bundle
Version Summary - A version’s metadata without its full
name/instructions— the list-view shape.
Functions§
- bundle_
version_ 🔒insert_ tx - Appends a version row within an ALREADY-OPEN transaction — the shared
implementation both
Store::bundle_version_insertbelow (opens its own transaction) andStore::bundle_upsert_with_version(bundles.rs, reuses the SAME transaction as its owndb_bundleswrite, so the bundle row and its version can never observably diverge under a concurrent writer — codex P2, PR #3237) call, rather than duplicating the parent-chain-lookup + INSERT SQL in two places.pub(crate), not private:bundles.rsis a sibling module in this same crate, not this one. - content_
hash 🔒 - Hashes
name+instructionstogether (notinstructionsalone) — unlike native memory, where a version’s whole identity IS its content, a bundle’snameis content too (renaming a Global Memory entry without touching its body is a real, meaningful edit an operator or agent might make, and should still produce a new version + a changed hash).