/**
 * Pi Judgment Integration for Bolloon
 *
 * Core module for capturing, distilling, and applying human judgment.
 *
 * Architecture:
 * Human Input → Distillation Trigger → LLM Extraction → Judgment YAML
 *                              ↓
 *                      ValueFunction
 *                              ↓
 *                    Runtime Decision
 *
 * Storage: Hybrid mode
 * - High-frequency rules: Embedded in context-fragments/*.md YAML frontmatter
 * - Long-term preferences: .bolloon/judgments/*.yaml
 */
export type JudgmentType = 'rule' | 'preference' | 'trajectory' | 'reward';
export type JudgmentSource = 'human' | 'agent' | 'collaboration';
export type DistillationTrigger = 'explicit' | 'implicit' | 'trajectory';
export interface Judgment {
    id: string;
    type: JudgmentType;
    content: string;
    source: JudgmentSource;
    confidence: number;
    context?: string;
    createdAt: string;
    updatedAt: string;
    evidence?: JudgmentEvidence;
    metadata?: Record<string, unknown>;
}
export interface JudgmentEvidence {
    trajectory?: TrajectoryPoint[];
    preference_pair?: PreferencePair[];
    correction?: Correction;
}
export interface TrajectoryPoint {
    timestamp: string;
    action: string;
    outcome: string;
    approved: boolean;
}
export interface PreferencePair {
    query: string;
    chosen: string;
    rejected: string;
    context?: string;
}
export interface Correction {
    original: string;
    corrected: string;
    reason?: string;
    timestamp: string;
}
export interface JudgmentFile {
    judgments: Judgment[];
    filePath: string;
    lastModified: string;
}
export interface DistillationRequest {
    rawInput: string;
    trigger: DistillationTrigger;
    context: string;
    conversationHistory?: string[];
    agentPrediction?: string;
}
export interface ValueFunction {
    judgments: Judgment[];
    contextWeights: Record<string, number>;
    lastUpdated: string;
}
/**
 * Load all judgments from YAML files
 */
export declare function loadJudgments(): Promise<Map<string, Judgment[]>>;
/**
 * Create a new judgment
 */
export declare function createJudgment(params: {
    type: JudgmentType;
    content: string;
    source: JudgmentSource;
    confidence: number;
    context?: string;
    evidence?: JudgmentEvidence;
}): Promise<Judgment>;
/**
 * Update judgment confidence based on feedback
 */
export declare function updateJudgmentConfidence(id: string, delta: number, feedbackType: 'approve' | 'reject' | 'correct'): Promise<Judgment | null>;
/**
 * Get all judgments
 */
export declare function getAllJudgments(): Promise<Judgment[]>;
/**
 * Get judgments by type
 */
export declare function getJudgmentsByType(type: JudgmentType): Promise<Judgment[]>;
/**
 * Get judgments relevant to a context
 */
export declare function getJudgmentsForContext(context: string): Promise<Judgment[]>;
/**
 * Calculate confidence score for a decision
 */
export declare function calculateConfidence(judgments: Judgment[]): number;
/**
 * Build ValueFunction from judgments
 */
export declare function buildValueFunction(context?: string): Promise<ValueFunction>;
/**
 * Get cached ValueFunction
 */
export declare function getValueFunction(context?: string): Promise<ValueFunction>;
/**
 * Extract judgments from context fragment YAML frontmatter
 */
export declare function extractFromFragment(fragmentPath: string): Promise<Judgment[]>;
/**
 * Load judgments from all context fragments
 */
export declare function loadFragmentJudgments(): Promise<Judgment[]>;
/**
 * Get combined judgments (file + fragments)
 */
export declare function getCombinedJudgments(): Promise<Judgment[]>;
/**
 * Get judgment statistics
 */
export declare function getJudgmentStats(): Promise<{
    total: number;
    byType: Record<JudgmentType, number>;
    bySource: Record<JudgmentSource, number>;
    averageConfidence: number;
}>;
/**
 * Clear judgment cache
 */
export declare function clearCache(): void;
