Skip to main content

Module session_tree

Module session_tree 

Source
Expand description

Compatibility path for canonical session trees.

Structs§

Branch
A named pointer into the tree: leaf is the node this branch currently ends at (its “current-leaf pointer”, module 21’s phrase). None only for a brand-new, still-empty tree’s implicit branch before any node exists.
BranchSummary
A branch-carried summary (module 21 “branch summaries”, the C7 lossy→sidecar-backed path): a short human-readable digest of a branch, paired with the pointer back to the full branch data (branch, a key into SessionTree::branches — the full nodes never move or get deleted, so this is always resolvable back to the source, §1.13).
SessionTree
The native in-place conversation tree (module 21). See the module doc comment for the full design (C7 tree-with-linear-projection, lossless rewind, branch summaries).
TreeNode
One addressable turn in the tree (module 21’s “entry”). Carries the full ChatMessage (this IS the full-fidelity source for a branched session — see the module doc’s “off by default” note: the plain linear transcript file remains the record for an UNBRANCHED session; this sidecar only exists once a tree operation actually ran), its parent/children links, and an optional human/agent-set label (module 21 “entry labels”).

Constants§

MAIN_BRANCH
The default/active branch name for a session that has never explicitly branched — the degenerate single-path tree’s one branch.

Traits§

BranchSummarizer
Injectable branch-summarization side-call (D-9), the module-21 analog of a caller-supplied branch summarizer — same shape, deliberately: a real implementation calls out to a cheap model; tests inject a deterministic fake. See SessionTree::summarize_branch_with’s doc comment for the “never blocks, never fails the caller” contract this trait’s Err feeds into.

Type Aliases§

NodeId
A tree-node id. Assigned by SessionTree’s monotonic allocator — a counter ("n0", "n1", …), not content-derived or random, so ids are deterministic and trivially testable, and so two nodes can never collide.