import { QualityIntelligence } from "@oscharko-dev/keiko-contracts";
/** Thresholds for atom coverage classification. */
export declare const COVERAGE_THRESHOLD_COVERED: 0.7;
export declare const COVERAGE_THRESHOLD_WEAKLY_COVERED: 0.3;
/**
 * Classification of a single evidence atom: whether its confidence places it in a
 * covered, weakly-covered, or uncovered state. "uncovered" means zero or insufficient
 * structural evidence that a candidate tests this requirement atom.
 */
export type CoverageStatus = "covered" | "weakly-covered" | "uncovered";
export interface AtomCoverageStatus {
    readonly atomId: QualityIntelligence.QualityIntelligenceEvidenceAtomId;
    readonly status: CoverageStatus;
    readonly confidence: number;
    readonly coveringCandidateIds: readonly QualityIntelligence.QualityIntelligenceTestCaseId[];
}
/**
 * Classify a single atom given its coverage-map mapping (undefined when the atom has
 * no mapping entry — i.e. no candidate cited it at all).
 */
export declare function classifyAtomCoverage(atom: QualityIntelligence.QualityIntelligenceEvidenceAtom, mapping: QualityIntelligence.QualityIntelligenceCoverageMapping | undefined): AtomCoverageStatus;
/**
 * Classify every atom in `atoms` against the supplied coverage map. Atoms with no
 * mapping are classified as "uncovered". The result is sorted by atomId ascending.
 */
export declare function buildAtomCoverageStatuses(atoms: readonly QualityIntelligence.QualityIntelligenceEvidenceAtom[], coverageMap: QualityIntelligence.QualityIntelligenceCoverageMap): readonly AtomCoverageStatus[];
/**
 * Returns the percentage of atoms classified as "covered" out of all atoms. Returns
 * 0 when the array is empty (deterministic, no division by zero).
 */
export declare function runCoveragePercentage(statuses: readonly AtomCoverageStatus[]): number;
export interface BuildCoverageMapInput {
    readonly runId: QualityIntelligence.QualityIntelligenceRunId;
    readonly atoms: readonly QualityIntelligence.QualityIntelligenceEvidenceAtom[];
    readonly candidates: readonly QualityIntelligence.QualityIntelligenceTestCaseCandidate[];
}
/**
 * A citing test counts as a *focused* cover of an atom when it derives from at most this many
 * atoms — i.e. the test is reasonably specific to the requirement rather than a sprawling
 * integration test that incidentally touches it. An atom whose only covering tests are all
 * broader than this is classified "weakly-covered" (covered only incidentally).
 *
 * Conservative for regulated use: a dedicated test (focus 1) always yields "covered"; coverage
 * is NEVER diluted by the total run size (see the regression test for the historical bug where
 * `citedCount / candidates.length` reported a perfectly-covered run as 0%).
 */
export declare const FOCUS_COVERED_MAX: 3;
/**
 * Deterministic, run-size-INDEPENDENT structural confidence in [0, 1] that an atom is covered.
 *
 * Inputs are atom-local: `citerCount` is the number of candidates that DIRECTLY derive from the
 * atom, and `bestFocus` is the smallest `derivedFromAtomIds` length among those citers (1 = a test
 * dedicated to this atom alone). Confidence is monotonic non-decreasing in `citerCount` so more
 * tracing tests never lowers confidence.
 *
 *   - no citers              -> 0           (uncovered)
 *   - >=1 focused citer      -> [0.7, 1.0]  (covered; threshold COVERAGE_THRESHOLD_COVERED)
 *   - only broad citers      -> [0.3, 0.7)  (weakly-covered; incidental coverage only)
 */
export declare const coverageConfidence: (citerCount: number, bestFocus: number) => number;
/**
 * Build a coverage map for the supplied run. The returned map is validated
 * against `assertCoverageMapInvariant` before being returned — callers can
 * trust every confidence value lies in [0, 1] and every mapping cites at
 * least one candidate.
 *
 * Atoms whose structural score is 0 (no candidate cites them and no step
 * mentions them) are omitted from the returned mappings — including a zero-
 * confidence mapping would violate the contract invariant (every mapping
 * must cite at least one candidate).
 */
export declare const buildCoverageMap: (input: BuildCoverageMapInput) => QualityIntelligence.QualityIntelligenceCoverageMap;
//# sourceMappingURL=coverageRelevance.d.ts.map