(flat entry I/O lives at this level once implemented — append, read-by-id, walk-parents, token-count-active-branch.)
Compaction
Per spec §2.7. shouldCompact(tokens, window, reserve) := tokens > window - reserve. Runtime-driven, not provider-driven. Produces compaction entries with firstKeptEntryId so pre-compact history is preserved in-tree.
Modes
global — one tree per aspect at <home>/session/global.jsonl + global.head.
thread — one tree per thread at <home>/session/threads/<thread_id>.jsonl + <thread_id>.head.