import type { PrincipleStatus } from './types/principle-enums.js'; export type { PrincipleStatus }; export type PruningRiskLevel = 'none' | 'watch' | 'review'; export interface PrinciplePruningSignal { principleId: string; status: PrincipleStatus; createdAt: string; updatedAt: string; derivedCandidateIds: string[]; derivedPainCount: number; matchedCandidateCount: number; recentCandidateCount: number; orphanCandidateCount: number; ageDays: number; riskLevel: PruningRiskLevel; reasons: string[]; } export interface PruningHealthSummary { totalPrinciples: number; byStatus: Record; watchCount: number; reviewCount: number; orphanDerivedCandidateCount: number; averageAgeDays: number; activeL1Count: number; l1Cap: number; generatedAt: string; } export interface OrphanDerivedCandidate { candidateId: string; principleId: string; reason: string; sourceRef?: string; status?: string; } export interface OrphanDetectionResult { candidates: OrphanDerivedCandidate[]; dbReadable: boolean; } export interface PruningReadModelOptions { workspaceDir: string; /** Override days threshold for 'watch' risk level (default: 30) */ watchThresholdDays?: number; /** Override days threshold for 'review' risk level (default: 90) */ reviewThresholdDays?: number; /** Override L1 hard cap for health summary (default: 12) */ l1Cap?: number; } export declare class PruningReadModel { private readonly workspaceDir; private readonly watchThresholdDays; private readonly reviewThresholdDays; private readonly l1Cap; constructor(opts: PruningReadModelOptions); /** * Build per-principle signals for the current workspace ledger. * * Reads: * - .state/principle_training_state.json (ledger) * - .pd/state.db principle_candidates (candidate table) * * Returns one signal per ledger principle entry. */ getPrincipleSignals(): PrinciplePruningSignal[]; /** * Build aggregate pruning health summary. * Reuses getPrincipleSignals() to avoid duplicate DB queries. */ getHealthSummary(): PruningHealthSummary; getOrphanDerivedCandidates(): OrphanDetectionResult; } export interface RemovedOrphanReference { principleId: string; removedIds: string[]; } export declare function removeOrphanReferencesFromLedger(stateDir: string, orphanIdsByPrinciple: Map>): RemovedOrphanReference[]; //# sourceMappingURL=pruning-read-model.d.ts.map