mnemo_cma/lib.rs
1//! v0.4.1 (P0-2) — Anthropic CMA-Memory compat shim.
2//!
3//! Anthropic shipped Context-Managed Agent (CMA) Memory in public
4//! beta on 2026-04-23 with `anthropic-sdk-python 0.97.0` +
5//! `claude-agent-sdk 0.1.68`. The data model is a Markdown filesystem
6//! tree at `<root>/.memory/` with a sibling `audit.jsonl` log. The
7//! beta is the most direct competitive surface mnemo has seen all
8//! month — operators who pick CMA for Anthropic's branding can keep
9//! using the SDK while mnemo provides:
10//!
11//! 1. The Markdown tree on disk (read-through / write-through /
12//! mirror modes — see [`SyncMode`]).
13//! 2. A bridged audit log: every CMA write produces exactly one
14//! `mnemo` `AuditEvent` whose `prev_hash` chains into the engine's
15//! HMAC ledger.
16//! 3. A one-shot importer that walks an existing CMA tree, ingests
17//! every Markdown file as a Mnemo memory, and stamps the bridge
18//! head into the audit log.
19//! 4. An export back to a byte-identical CMA tree so users can
20//! leave mnemo cleanly.
21//!
22//! Tested against `claude-agent-sdk-python==0.1.68` (pinned dev-dep
23//! in the repo's Python SDK + a "tested-against" badge in the
24//! README — drift-watcher CI is tracked under issue #cma-drift).
25
26pub mod audit_bridge;
27pub mod migrate;
28pub mod tree;
29
30pub use audit_bridge::{BridgeError, BridgedEvent, CmaSource, bridge_event};
31pub use migrate::{ImportSummary, export_to_tree, import_cma_tree};
32pub use tree::{CmaTreeRoot, SyncMode};