/** * Canonical trajectory.db schema definition (PRI-774; SPEC: * docs/specs/trajectory-data-plane-single-truth.md). * * Single source of truth for the schema applied by BOTH build paths: * - openclaw-plugin applyTrajectorySchema() → Profile B/C (views: true) * - principles-core ensureTrajectorySchema() → Profile A (views: false, * pain-record path) * * Ownership: * - owns: CREATE TABLE/INDEX/VIEW statements, column-migration blocks, the * evolution_tasks column backfill, TRAJECTORY_SCHEMA_VERSION and * TRAJECTORY_TABLES declarations. * - does NOT own: path resolution, directory creation, connection lifecycle, * WAL/pragmas, schema_version ROW writes (TrajectoryDatabase.initSchema and * initTrajectorySchema keep that), v_daily_metrics (plugin migrateSchema), * governance_* tables (host-runtime stores). * * Zero pathways are abolished: both paths keep their exact pre-PRI-774 * behavior; only the definition-text copies converge (SPEC v3, Owner-approved). */ import type { Database } from 'better-sqlite3'; export interface TrajectorySchemaApplyOptions { /** * Profile B (runtime-init): also create the three analytics views. * Default false (Profile A, core pain-record path — views are * plugin-read conveniences). */ views?: boolean; } export interface TrajectorySchemaApplyResult { tables: string[]; warnings: string[]; } /** trajectory.db schema version. Row writes stay with the two existing owner entry points. */ export declare const TRAJECTORY_SCHEMA_VERSION = 1; /** Fresh-schema table list, in creation order (single derived source). */ export declare const TRAJECTORY_TABLES: readonly ['schema_version', 'ingest_checkpoint', 'sessions', 'assistant_turns', 'user_turns', 'tool_calls', 'pain_events', 'gate_blocks', 'trust_changes', 'principle_events', 'task_outcomes', 'correction_samples', 'sample_reviews', 'signal_confirmations', 'exports_audit']; export declare function applyTrajectorySchemaBase(db: Database, opts?: { views?: boolean; }): { tables: string[]; warnings: string[]; }; //# sourceMappingURL=trajectory-schema.d.ts.map