import type { ClassificationLabel } from "./ledger.js"; /** * v0.5 ยง6.2 โ€” 4-label classifier with priority `codebase-fact > domain > * workflow > role`. Real Anthropic API integration is deferred; the * `ClassifierCaller` interface lets tests inject a mock and lets a future * sprint plug in `@anthropic-ai/sdk` without touching call sites. * * Priority resolution: when the caller returns multiple labels with * comparable confidence the most *concrete* wins. This is the inverse of * how an LLM would rank by salience โ€” codebase facts are concrete enough * that they should stay in the repo even if the file *also* reads like * domain knowledge. * * Ambiguity: when max-confidence label scores < 0.7, mark `ambiguous: true` * so the report routes the file to human review. */ export declare const AMBIGUITY_THRESHOLD = 0.7; export declare const DEFAULT_BATCH_SIZE = 8; export interface ClassifierInput { path: string; body: string; } export interface RawScore { label: ClassificationLabel; confidence: number; } /** A caller returns one or more candidate labels per file, ordered freely. */ export interface ClassifierCaller { classify(batch: ClassifierInput[]): Promise; /** Diagnostic โ€” incremented by each batch invocation. Tests assert == 0 for cached runs. */ call_count?: number; } export interface Classification { path: string; label: ClassificationLabel; confidence: number; ambiguous: boolean; raw: RawScore[]; } export interface ClassifyOpts { caller: ClassifierCaller; batch_size?: number; /** Override for tests of the ambiguity gate. */ ambiguity_threshold?: number; } export declare function classifyBatch(skills: ClassifierInput[], opts: ClassifyOpts): Promise; /** * Priority-resolve a list of raw scores. The caller may return multiple * candidates; we pick by `confidence`, tie-break by priority weight (codebase- * fact wins ties over domain, etc.). */ export declare function pickWinner(scores: RawScore[]): RawScore; export declare function createHeuristicCaller(): ClassifierCaller;