/** * Calibration store for slice work-estimation. * * v1 (current): pure heuristic based on LoC + test count + complexity. * confidence: 'low' until >= 5 historical slice records exist. * formula: minutesP50 = 0.25 * locSum + 0.5 * testCount + 0.1 * complexitySum * minutesP90 = minutesP50 * 1.6 * * v1.1 (next): read `.peaks/_runtime//qa/cycle-time.json` history; if * sample size >= 5 for a complexity bucket, switch to percentile-based * estimate with confidence 'high'. * * v1 rationale: peaks-loop itself has fewer than 5 completed refactor slices * (per the design doc R3), so v1 cannot be calibrated yet. v1 ships the * heuristic AND records every estimate to `.peaks/_runtime//sc/ * slice-calibration/.json` so the next slice can use the prior data. * * LoC is intentionally kept as a primary input (not replaced). The user * feedback that motivated the algorithm explicitly cited LoC as a useful * signal -- the issue was the absence of a DAG on top, not the absence * of LoC. The "complexity" field in nodes is unused for v1 because * codegraph v0.7.10 does not emit it; v2 can re-enable once * `.codegraph/codegraph.db` is read directly. */ import type { WorkEstimate } from './slice-decompose-types.js'; /** * Compute a work-estimate envelope. * * @param complexitySum Sum of `complexity` of touched graph nodes. Pass 0 * when codegraph v0.7.10 (the field is not emitted). * @param testCount Number of test files this slice adds/modifies. * @param locSum Sum of LoC across the slice's primary files. * @param sampleSize Number of historical slice records the calibrator * could draw from. Drives confidence: * >= 5 -> 'high' (percentile lookup would be used in v1.1) * >= 1 -> 'medium' (some signal) * == 0 -> 'low' (heuristic only) */ export declare function calibrate(complexitySum: number, testCount: number, locSum: number, sampleSize: number): WorkEstimate;