/** * Noah — SQLite Store Type Definitions * * Row types matching the SQLite schema tables. * BB Spec v1.1 §4.2 + Amendments 1, 3. */ export interface CorridorThresholds { green_min: number; yellow_min: number; red_below: number; } export interface TdiThresholds { warning: number; critical: number; } export interface LifecycleStateRow { agent_id: string; phase: string; operational_age_days: number; total_cycles: number; yellow_count: number; last_assessment: string | null; last_veto: string | null; last_red_alert: string | null; updated_at: string; } export type AssessmentSource = 'grillo_scheduled' | 'grillo_adhoc' | 'mighty_mark_probe' | 'manual'; export interface AssessmentRecordRow { id: number; run_id: string; agent_id: string; timestamp: string; fleet_day: number; lifecycle_phase: string; score_lying: number; score_cheating: number; score_stealing: number; score_harm: number; overall_score: number; classification: string; passed: number; corridor_status: string; tdi: number; prev_hash: string; record_hash: string; source?: AssessmentSource; created_at: string; /** * Scoring methodology version that produced the score_* fields. * 1 = legacy binary-derived (pre-Phase-2 records) * 2 = graduated personality distribution (Phase 2 onward) * * Optional / nullable. SQLite returns `undefined` for rows persisted * before this column existed, which is exactly the "version-agnostic" * case the cross-version comparison guard treats as compatible. * * SPEC: docs/specs/SPEC-scoring-unification-graduated-personality-v1.0.md * (v1.2 — BB Q3 amendment + Section 8.9 Correction 1). */ scoring_version?: number; } export interface FleetTemporalStateRow { id: number; fleet_birthday: string; fleet_day: number; lifecycle_phase: string; phase_started: string; fleet_tdi: number; fleet_corridor: string; drift_direction: string; inertial_state: string; updated_at: string; } export interface DeviationSnapshotRow { id: number; agent_id: string; timestamp: string; fleet_day: number; expected_scores: string; observed_scores: string; corridor_status: string; tdi: number; velocity: string; acceleration: string; created_at: string; } export interface CronJobRow { id: string; agent_id: string; name: string; enabled: number | boolean; constitutional: number | boolean; schedule_kind: string; schedule_expr: string; schedule_tz: string; payload_kind: string; payload_action: string; payload_data: string | null; last_run: string | null; next_run: string | null; run_count: number; last_status: string | null; last_error: string | null; created_at?: string; updated_at?: string; } export interface CronRunRow { id: number; job_id: string; started_at: string; finished_at: string | null; status: string; error: string | null; duration_ms: number | null; prev_hash: string; record_hash: string; } export interface SqliteStoreConfig { dataDir: string; dbFilename?: string; } //# sourceMappingURL=sqlite-types.d.ts.map