Dashboard › opencode › Distillation
1e31ad04-8bdc-4a1d-a0cc-7c78053f10df["lore_tm_v1_5zrzblwaJ6J0doxqtHxHTGVSjI0y5FTKJHGbauCaZDM","lore_tm_v1_Sspe4s_kTA7LhI2nbx8CGh9iK9_pBByOctsvbRFA4CI","lore_tm_v1_WcByNEVhISyYRlqhzWZlZ25r7CI7FGPl7FAzn3FQepc","lore_tm_v1_xxWuzzNfMOBKNh3MXPyXMPDxcpjGRdE27lNe8C4utKs"]
Date: Sep 16, 2026
packages/core/src/session/sql.ts:23,63,69-72 showed MAX_WAKE_ATTEMPTS = Number.MAX_SAFE_INTEGER; SessionTable.wake_attempts defaults to 0 and is constrained to the inclusive range 0..MAX_WAKE_ATTEMPTS.packages/core/src/session/sql.ts:127-145 showed SessionMessageTable uses globally primary-keyed id, requires session_id, type, and seq, enforces unique (session_id, seq), and indexes (session_id, type, seq), (session_id, time_created, id), and time_created.packages/core/src/session/sql.ts:148-179 showed SessionInputTable stores prompt, delivery, admitted_seq, optional promoted_seq, and wake_pending defaulting to false; it uniquely constrains (session_id, admitted_seq) and (session_id, promoted_seq) and indexes pending-input lookup by (session_id, promoted_seq, delivery, admitted_seq) plus wake lookup by (wake_pending, promoted_seq, session_id).packages/core/src/session/sql.ts:182-217 showed SessionRecoveryTable is keyed by execution_id, references its Session, optionally references an assistant message, requires a unique continuation input via continuation_message_id, restricts phase to TypeScript type "ready" | "unknown" | "continue", defaults wake_pending=true and wake_attempts=0, and stores recovery_error plus time_created.SessionRecoveryTable recovery scanning is indexed by (wake_pending, recovery_error, wake_attempts, time_created, execution_id); wake_attempts is constrained to 0..Number.MAX_SAFE_INTEGER, exactly 0..9007199254740991.packages/core/src/session/sql.ts:220-240 showed SessionExecutionTable is keyed by execution id, enforces one execution row per Session through unique index session_execution_session_idx, indexes owner_id, and stores owner_id, optional assistant_message_id, time_created, expires_at, and optional recovery_error.SessionExecutionTable.phase permits exactly "ready", "safe", "unknown", or "continue" through session_execution_phase_check.packages/core/src/session/sql.ts:243 showed SESSION_EXECUTION_LEASE_MS = 30_000.packages/core/src/session/sql.ts:245-253 showed SessionContextEpochTable has one row per Session keyed by session_id and stores required baseline, JSON snapshot typed as SystemContext.Snapshot, and baseline_seq.packages/core/src/database/schema.gen.ts confirmed generated database schema creation for session_execution and session_recovery, including cascading Session foreign keys, execution phase check, recovery foreign keys, maximum wake-attempt checks, unique execution-per-Session and continuation-message indexes, and the composite recovery wake-scan index.