import { type EvolveReceiptBundle, type LineageTelemetry, type PlateauReport, type MutationStat } from './evolve-proof.js'; import { type HarvestPattern } from './harness-corpus-harvester.js'; import { type RetrievalConfig, type RankedItem } from './harness-flywheel.js'; export declare const FLYWHEEL_DIR: string[]; export declare const FROZEN_CORPUS = "harvested-selfsup-frozen-v1"; export interface AnchorTask { id: string; q: string; labels: string[]; } export interface GenerationDeps { getPatterns: () => HarvestPattern[] | Promise; search: (q: string, cfg: RetrievalConfig) => Promise | RankedItem[]; anchorTasks: AnchorTask[]; humanEvalHash?: string; sample?: number; now: number; applyFn?: (cfg: Record, hash: string, generation: number) => void; } export interface GenerationResult { ran: boolean; reason: string; generation: number; promoted?: boolean; delta?: number; significant?: boolean; championConfig?: Record; servedChampion?: string | null; anchorRegressed?: boolean; } /** Promotions only — the champion chain (generation-N.json), sorted by generation. */ export declare function loadPromotions(root: string): EvolveReceiptBundle[]; /** Every attempt (promoted + rejected) — for telemetry + mutation-effectiveness. */ export declare function loadAttempts(root: string): EvolveReceiptBundle[]; /** The current operating champion (last promotion's config), or defaults. */ export declare function currentChampion(root: string): { config: Record; hash: string | null; generation: number; }; export interface ServedState { championHash: string | null; config: Record | null; servedAt: number | null; fromGeneration: number | null; } export declare function servedChampion(root: string): ServedState; /** * Shadow→serve gate: apply the latest promoted champion to the ACTIVE policy iff * it is newer than what is currently served. Called at tick START, so a champion * promoted last tick is served this tick (a 1-generation shadow delay) — never * auto-served the instant it is promoted. */ export declare function serveCurrentChampionIfPending(root: string, now: number, applyFn?: GenerationDeps['applyFn']): string | null; export interface AxisStat { axis: string; promotions: number; meanDelta: number; } /** * Which policy AXES have historically paid off — attribute each promotion's * held-out Δ to the axes that changed in it. Turns the lineage into a * knowledge base the optimizer can act on (not just audit). */ export declare function axisEffectiveness(promotions: EvolveReceiptBundle[]): AxisStat[]; /** * Candidate set biased by measured axis payoff (meta-learning). Every axis keeps * a ±1 exploration floor (never abandon a dimension), but axes with a positive * historical Δ get EXPANDED range (±2, ±3) and PAIRWISE joint moves with other * productive axes — so compute concentrates on the dimensions that have actually * produced gains, instead of a uniform grid. Deterministic; bounded. */ export declare function biasedGrid(c: RetrievalConfig, ranking: AxisStat[]): RetrievalConfig[]; /** * Run ONE generation against `root`, compounding on the persisted champion. * Serves the prior champion first (shadow delay), then evaluates a new candidate. */ export declare function runFlywheelGeneration(root: string, deps: GenerationDeps): Promise; export interface DriftCheck { checked: boolean; rolledBack: boolean; reason: string; servedScore?: number; predecessorScore?: number; } /** * A real deployment-safety check on real (not fabricated) data: the store keeps * changing as ruflo is used, so a champion benchmarked at promotion time can * DRIFT. Each tick, re-score the currently-SERVED champion against its * predecessor on a FRESH harvest of the current store; if it now regresses * (self-retrieval OR the human anchor), automatically ROLL BACK the active policy * to the predecessor. This is the honest analogue of a live-traffic canary — * genuine ongoing measurement + genuine rollback — without fabricating traffic. * $0; never throws. */ export declare function checkServedChampionDrift(root: string, deps: GenerationDeps): Promise; export interface FlywheelStatus { generations: number; attempts: number; lineage: LineageTelemetry; plateau: PlateauReport; mutation: MutationStat[]; axisEffectiveness: AxisStat[]; cumulativeBenchmarkDelta: number; cumulativeHumanRelevanceDelta: number; humanEvalHash: string | null; served: ServedState; champion: { config: Record; hash: string | null; }; /** * ADR-381 §3 — visibility into the sequential alpha stream so budget * exhaustion reads as a plateau signal, not a mystery: the next test's * index, its allocated alpha and e-value threshold, the minimum all-win * informative pairs needed to clear it, and the family-wise budget left. */ sequential: { nextTestIndex: number; alphaAllocatedNext: number; thresholdNext: number; minInformativePairsNext: number; remainingAlphaBudget: number; alphaTotal: number; }; } /** Reconstruct the persisted lineage + telemetry for a status endpoint / CLI. */ export declare function flywheelStatus(root: string): FlywheelStatus; //# sourceMappingURL=harness-flywheel-generations.d.ts.map