pub struct CortexSessionCommitTool {
pub pool: Arc<Mutex<Pool>>,
pub session_token: Arc<RwLock<Option<String>>>,
pub auto_commit: bool,
}Expand description
cortex_session_commit tool handler.
Verifies the operator-supplied confirmation token and then bulk-promotes
all pending_mcp_commit memories to active (ADR 0047 §2 Path A).
rusqlite::Connection is Send but not Sync; the Mutex provides the
Sync bound required by ToolHandler while keeping the connection
single-threaded at the call site (the stdio loop is single-threaded).
Fields§
§pool: Arc<Mutex<Pool>>SQLite connection guarded by a mutex so the struct satisfies Sync.
session_token: Arc<RwLock<Option<String>>>The confirmation token generated at server startup (ADR 0047 §3).
Held in an Arc<RwLock<Option<String>>> so serve.rs can write the
token once at startup and this tool can read it on each call.
None while the server is initialising; always Some before the
stdio loop starts.
auto_commit: boolWhen true, the ADR 0047 §3 token check is bypassed.
Set by serve.rs when CORTEX_MCP_AUTO_COMMIT=1 is present in the
environment. This is an explicit operator override of the safety
guarantee; it MUST only be used in operator-controlled CI contexts.