/** * Validation Session Domain Types + Metric Profiles * * Shared observable validation model for agent execution. * Every run path (delegate, agent_test, system_run, audit) feeds the same model. */ export type ExecutionStatus = 'started' | 'completed' | 'failed' | 'timeout'; export type ValidationOutcome = 'healthy' | 'improved' | 'regressed' | 'inconclusive'; export type ValidationTriggerType = 'agent_test' | 'delegate_run' | 'system_run' | 'audit'; export interface ApiSnapshot { agent?: { enabled?: boolean; version?: number; display_name?: string; }; activity?: { count?: number; latest_type?: string | null; latest_score?: number | null; }; summary?: { consecutive_errors?: number; error_rate?: number; }; } export interface CreateValidationSessionInput { id: string; agent_id: string; agent_version: number; trigger_type: ValidationTriggerType; goal?: string; metric_profile_json: string; baseline_version?: number; baseline_session_id?: string; execution_status: ExecutionStatus; validation_outcome: ValidationOutcome; summary?: string; recommendation?: string; before_snapshot_json?: string | null; after_snapshot_json?: string | null; report_json?: string | null; schema_version?: number; requires_approval?: number; started_at: number; ended_at?: number; } export interface ValidationSessionRow { id: string; agent_id: string; agent_version: number; trigger_type: string; goal: string | null; metric_profile_json: string; baseline_version: number | null; baseline_session_id: string | null; execution_status: string; validation_outcome: string; summary: string | null; recommendation: string | null; before_snapshot_json: string | null; after_snapshot_json: string | null; report_json: string | null; schema_version: number; requires_approval: number; started_at: number; ended_at: number | null; } export type MetricDirection = 'up_good' | 'down_good' | 'neutral'; export interface SaveValidationMetricInput { validation_session_id: string; name: string; value: number; baseline_value?: number | null; delta_value?: number | null; direction: MetricDirection; } export interface ValidationMetricRow { id: number; validation_session_id: string; name: string; value: number; baseline_value: number | null; delta_value: number | null; direction: string; created_at: number; } export interface AgentValidationStateRow { agent_id: string; trigger_type: string; approved_version: number | null; approved_session_id: string | null; current_status: string | null; last_validation_at: number | null; updated_at: number; } export interface UpdateValidationStateInput { approved_version?: number; approved_session_id?: string; current_status?: string; last_validation_at?: number; } export interface ValidationSessionDetail { session: ValidationSessionRow; metrics: ValidationMetricRow[]; } export interface MetricThreshold { warn: number; critical: number; } export interface MetricProfile { primary_metrics: string[]; thresholds: Record; directions?: Record; extensions?: string[]; } export declare function getMetricProfile(agentId: string): MetricProfile; export declare function guardJsonSize(json: string | undefined | null): string | null; export declare const SCHEMA_VERSION = 1; //# sourceMappingURL=types.d.ts.map