/** * Global-scope `cleo.db` — cross-project **session manifest** mirror (1 table). * * EP-SESSION-MANIFEST (epic T11638, task T11639). The `session_manifest` table is * a CROSS-PROJECT MIRROR of the per-project `tasks_sessions` rows: each project's * authoritative session lives in that project's `tasks_sessions` table (PROJECT * scope `cleo.db`), and a best-effort writer copies a compact projection into this * GLOBAL-scope row so the fleet has a single, machine-wide view of every session * across every project — without ATTACHing N per-project DBs. * * ## NOT named `sessions` (AC1) * * The table is deliberately `session_manifest`, NOT `sessions`. The authoritative * project-tier table is `tasks_sessions`; naming the global mirror `sessions` would * invite a future reader to mistake the mirror for the source of truth. The name * encodes its role: a manifest (an index/catalog), never the authority. * * ## MIRROR, never authoritative (AC4) * * Every column here is derived from the project row. The mirror writer is * best-effort (a failure NEVER fails the underlying session op) and reconcile-on- * start re-reads the authoritative project row and OVERWRITES the manifest row, so * a stale or partially-written manifest entry can never drift into being treated as * truth. Consumers needing exact session state MUST read the project's * `tasks_sessions`; this table answers "which sessions exist, where, and how are * they forked" cheaply across projects. * * ## Identity (`project_id`) * * `project_id` is the canonical `nexus_project_registry.project_id` (12-hex) for * the project that owns the session — a soft FK into the global registry table in * THIS same `cleo.db`. It is reused (never minted here) so the manifest joins * cleanly to the registry. Nullable: a session started outside any resolvable * registered project still mirrors, with `project_id` NULL. * * ## Fork tree (`parent_session_id`) * * `parent_session_id` mirrors the project row's own `parent_session_id` * (populated from `CLEO_PARENT_SESSION_ID`, stamped by the supervisor — PR #996 / * T11629). It reconstructs the orchestrator→worker fork tree machine-wide without * a per-project DB scan. Soft self-reference to `session_manifest.session_id`; * NULL for a root session. * * @task T11639 * @epic T11638 * @saga T11242 * @see ../cleo-project/tasks-core.ts — `tasksSessions` (the authoritative source) * @see ./nexus.ts — `nexusProjectRegistry` (the `project_id` SSoT) * @see ../../sessions/session-manifest-mirror.ts — the best-effort mirror writers */ /** * `session_manifest` — cross-project mirror of per-project `tasks_sessions` rows. * * A best-effort projection: one row per session, keyed on the session id, carrying * just enough to answer fleet-wide "what sessions exist, in which project, and how * are they forked" without opening every project's `cleo.db`. NOT authoritative — * the project's `tasks_sessions` row is the source of truth; this row is overwritten * on reconcile-on-start so it can never drift into authority (AC4). * * @task T11639 */ export declare const sessionManifest: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{ name: "session_manifest"; schema: undefined; columns: { sessionId: import("drizzle-orm/sqlite-core").SQLiteColumn<{ name: string; tableName: "session_manifest"; dataType: "string"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}>; projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{ name: string; tableName: "session_manifest"; dataType: "string"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}>; parentSessionId: import("drizzle-orm/sqlite-core").SQLiteColumn<{ name: string; tableName: "session_manifest"; dataType: "string"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}>; name: import("drizzle-orm/sqlite-core").SQLiteColumn<{ name: string; tableName: "session_manifest"; dataType: "string"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}>; status: import("drizzle-orm/sqlite-core").SQLiteColumn<{ name: string; tableName: "session_manifest"; dataType: "string"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}>; projectPath: import("drizzle-orm/sqlite-core").SQLiteColumn<{ name: string; tableName: "session_manifest"; dataType: "string"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}>; startedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{ name: string; tableName: "session_manifest"; dataType: "string"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}>; endedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{ name: string; tableName: "session_manifest"; dataType: "string"; data: string; driverParam: string; notNull: false; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}>; mirroredAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{ name: string; tableName: "session_manifest"; dataType: "string"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [string, ...string[]]; baseColumn: never; identity: undefined; generated: undefined; }, {}>; }; dialect: "sqlite"; }>; /** Row type for `session_manifest` SELECT queries (mirror shape). */ export type SessionManifestRow = typeof sessionManifest.$inferSelect; /** Row type for `session_manifest` INSERT/UPSERT operations (mirror shape). */ export type NewSessionManifestRow = typeof sessionManifest.$inferInsert; //# sourceMappingURL=session-manifest.d.ts.map