export type LearningCandidateState = 'observed' | 'candidate' | 'shadow' | 'evaluated' | 'active' | 'rejected' | 'retired'; export type LearningCandidateKind = 'convention' | 'workflow' | 'tool_preference' | 'correction'; export type LearningEvidencePolarity = 'supporting' | 'contradicting'; export type LearningOutcomeState = 'positive' | 'negative' | 'unknown'; export interface LearningCandidateRecord { id: string; projectRoot: string; scope: 'project' | 'global'; state: LearningCandidateState; kind: LearningCandidateKind; trigger: Record; instruction: string; confidence: number; overlayVersion: number; supportingSessions: number; successfulOutcomes: number; contradictions: number; manualOnly: boolean; risk: 'low' | 'medium' | 'high'; graderReceipt?: string; expiresAt?: number; createdAt: number; updatedAt: number; } export interface LearningCandidateVersionRecord { candidateId: string; version: number; trigger: Record; instruction: string; createdAt: number; } export interface LearningCandidateEvidenceRecord { id: string; candidateId: string; projectRoot: string; sessionId: string; executionId?: string; memoryObservationId?: string; outcomeId?: string; sourceType: 'memory' | 'correction' | 'workflow_outcome' | 'tool_preference' | 'convention' | 'grader' | 'manual'; polarity: LearningEvidencePolarity; outcome: LearningOutcomeState; evidenceHash: string; receipt?: string; payload: Record; createdAt: number; resolvedAt?: number; } export interface UpsertLearningCandidateInput { id: string; projectRoot: string; scope: 'project' | 'global'; kind: LearningCandidateKind; trigger: Record; instruction: string; confidence: number; manualOnly?: boolean; risk?: 'low' | 'medium' | 'high'; expiresAt?: number; } export interface AddLearningCandidateEvidenceInput { id: string; candidateId: string; projectRoot: string; sessionId: string; executionId?: string; memoryObservationId?: string; outcomeId?: string; sourceType: LearningCandidateEvidenceRecord['sourceType']; polarity: LearningEvidencePolarity; outcome?: LearningOutcomeState; evidenceHash: string; receipt?: string; payload?: Record; createdAt?: number; } export interface TransitionLearningCandidateInput { target: LearningCandidateState; reason: string; graderReceipt?: string; manualApproval?: boolean; changedAt?: number; } export declare function mapLearningCandidateRow(row: Record): LearningCandidateRecord; export declare function mapLearningEvidenceRow(row: Record): LearningCandidateEvidenceRecord; export declare function mapLearningVersionRow(row: Record): LearningCandidateVersionRecord; export declare function stableLearningJson(value: unknown): string;