Skip to main content

Module context_store

Module context_store 

Source
Expand description

The Context Store: one access contract over the stores that already hold LeanCTX state. It is a logical layer, not another database.

StateAuthoritative store
decisions, plans, invocations, outcomesexecution ledger (core::execution_ledger)
what reached the model, under which policyDecision Receipts (core::context_admission::receipt_store)
learned planner statecontext_kernel::autopilot::learning_store
knowledgecore::knowledge (KnowledgeStore)
relationscore::property_graph
per-task runtime signals (bounce, expand, edit failure)task_signals

Search, graph and vector indexes are derived from these and rebuildable. Modules here read and join; they never become a second copy of that state. lean-ctx engine context-lineage and context-policy-evidence expose the joins read-only (docs/contracts/engine-context-store-v1.md).

Modules§

lineage
Decision lineage of one task: what was planned, returned or prepared, what it cost and which outcome followed — joined by TaskId from the execution ledger and the Context Gateway’s Decision Receipts.
task_signals
Per-task runtime signals that say whether a compressed read served the model: a full re-read of the same file (bounce), an edit that failed after a compressed read, or an expansion of a file handle that was read compressed.

Functions§

task_scope
The tenant/project scope a task belongs to, as one opaque key. Task-keyed state (receipt indexes, learning) is always looked up under this scope, so equal task ids in different projects never meet.