Sessions are the unit of conversation in MRP-VM. A session owns the chat log, staged and committed session KUs, selected plugin preferences, mounted KB metadata, and the explainability registry for recent turns. Spec: DS019.
A session is created when a chat request arrives without a usable session_id. The browser stores the current session id in local state so the tab can continue the same conversation until the session expires or the page state is reset.
Reusable facts, constraints, definitions, and execution guidance extracted from chat turns become session KUs. They are staged first and committed only when the turn succeeds.
@k1 ku atomic "session::turn::unit-000"
@k2 set $k1 sourceId session
@k3 set $k1 chunkId session::turn
@k4 set $k1 role Constraint
@k5 set $k1 topic "deployment environment"
@k6 set $k1 claim "The system must run on CPU only."
@k7 set $k1 utilityActs [verify]
@k8 set $k1 phaseScopes [kb-plugin gs-plugin]
On success the engine commits:
Failed turns do not append assistant text to the message log, but they still enter the explainability registry so the UI can inspect why the request failed.
Each session keeps a bounded per-turn explainability log. Every entry records request metadata, selected plugin ids, answer status, optional error details, and the canonical executionTrace.graph payload used by the Explainability panel.
{
sessionId: "sess-abc123",
createdAt: "2026-03-27T10:00:00Z",
lastActivityAt: "2026-03-27T10:05:00Z",
expiresAt: "2026-03-27T10:35:00Z",
preferredModel: "test-fast",
preferredPlannerPlugin: "planner-default",
preferredSeedDetectorPlugin: "sd-symbolic",
preferredKBPlugin: "kb-fast",
preferredGoalSolverPlugin: "gs-symbolic",
mountedKbId: "kb-...",
messageLog: [{ role, content }, ...],
sessionContextUnits: [ContextUnit, ...],
explainabilityLog: [ExplainabilityTurn, ...]
}