Skip to main content

Module journal

Module journal 

Source
Expand description

Session tree journal placeholder (issue #5262).

The journal is append-only with an in-memory tree projection: every non-header entry carries id + parentId, the active position is a leafId, appending creates a child of the leaf, and branching only moves the leaf — it never rewrites history. This file lands the entry shape that #5262’s tree operations hang off of; compaction and branch-summary entry kinds are included as first-class kinds but their strategies are deferred.

Re-exports the protocol journal as the canonical shape so protocol and core agree on the wire. core adds the SessionJournal wrapper that owns the current_leaf_id column in state.threads.

Structs§

Journal
Append-only journal with a leafId cursor. The tree projection is derived root→leaf; moving leaf_id branches without rewriting history.
JournalEntry
One journal entry. All entries except the root header have id + parent_id.
ThreadLeafState
Persisted thread metadata extension for the tree. This is the current_leaf_id column added to state.threads; None before the first turn, Some(id) after. The existing threads JSON shape is otherwise unchanged (back-compat: old rows read as None and the next append mints the header leaf).

Enums§

JournalKind
First-class journal entry kinds (data shape lands now; strategies later).