import { type HarvestPattern } from './harness-corpus-harvester.js'; import { type FlywheelEvaluationReceipt } from './flywheel-receipt.js'; export interface RetrievalConfig { alpha: number; subjectWeight: number; mmrLambda: number; bodyWeight: number; typePenaltyFactor: number; } export declare const DEFAULT_CONFIG: RetrievalConfig; export interface RankedItem { id: string; name: string; } export interface AnchorTask { id: string; input: { id: string; q: string; }; expected: string[]; } export interface FlywheelDeps { getPatterns: () => HarvestPattern[] | Promise; search: (query: string, config: RetrievalConfig, signal?: AbortSignal) => Promise | RankedItem[]; anchorTasks: AnchorTask[]; activeParams?: () => Partial | null; sample?: number; now?: number; lineageId?: string; evaluationRunId?: string; safetyEnvelopeRef?: string; /** Hash of the project-specific human-labelled objective. */ anchorRef?: string; requestedProposer?: 'auto' | 'local' | 'darwin'; effectiveProposer?: 'local' | 'darwin'; proposerSubstitution?: string; receiptPrivateKeyPem?: string; receiptPublicKeyPem?: string; bootstrapIterations?: number; /** Candidate policies supplied by an external proposer archive (ADR-322B). */ candidatePolicies?: RetrievalConfig[]; /** ADR-324: hard local cap for concurrent candidate/task evaluation. */ maxConcurrency?: number; evaluationTimeoutMs?: number; } export interface FlywheelResult { ran: boolean; reason: string; accepted?: boolean; applied?: boolean; baselineScore?: number; candidateScore?: number; delta?: number; anchorRegressed?: boolean; championRef?: string; corpusVersion?: string; candidateConfig?: RetrievalConfig; receiptId?: string; receipt?: FlywheelEvaluationReceipt; promotable?: boolean; legacyDeprecation?: boolean; /** * ADR-381 ยง4 soft pre-flight: whether this evaluation's promotion holdout * can clear the sequential-evidence threshold at the ledger's next test * index even on a perfect all-win sweep. viable:false does NOT block the * evaluation (learn value stands; the gate refuses size-inviable receipts * without alpha spend) โ€” it tells the operator promotion is out of reach. */ sequentialPreflight?: { viable: boolean; heldSize: number; minPairsRequired: number; nextTestIndex: number; }; } export declare function retrievalPolicyNeighbors(base: RetrievalConfig): RetrievalConfig[]; /** * Run one flywheel tick against `projectRoot`. Best-effort; never throws. * Returns a rich result AND (as a side effect) appends to the improvement ledger * and โ€” on accept โ€” applies the champion locally + chains it. */ export declare function evaluateFlywheelCandidate(projectRoot: string, deps: FlywheelDeps): Promise; /** * Compatibility wrapper. New callers get evaluation-only semantics. The legacy * implicit apply path exists for one release behind an explicit opt-in flag. */ export declare function runFlywheelTick(projectRoot: string, deps: FlywheelDeps): Promise; //# sourceMappingURL=harness-flywheel.d.ts.map