/**
 * pipeline/compute-attribution.ts
 *
 * Pure three-signal attribution ensemble helper (v0).
 *
 * Computes per-document attribution scores for a single grader judgment
 * using three signals:
 *   - citation:   the grader's explicit doc citation with a role weight
 *   - canonical:  whether the doc appears in the task's declared context.docs
 *   - retrieved:  whether the doc slug was visited by the agent (agentic mode)
 *
 * No AppContext, no filesystem I/O — this is a pure function importable
 * by calibration scripts and orchestration steps alike.
 *
 * Weights (v0): citation=0.55, canonical=0.30, retrieved=0.15.
 * Embedding model: "none" (v0 — no embedding calls yet).
 *
 * @see docs/decisions/D0049-shared-confidence-contract.md
 * @see docs/decisions/D0050-per-entry-attribution-layout.md
 * @see docs/decisions/D0052-judgment-ref-granularity.md
 * @see docs/design-docs/actionability-ladder/04-per-document-attribution-ensemble.md
 */
import type { Confidence, DocumentRef, GraderJudgment, JudgmentAttribution } from "../_vendor/ailf-core/index.d.ts";
/**
 * Widened structural type for ensemble weights. Calibration / grid-search
 * callers pass dynamic `number`-valued tuples — they cannot satisfy the
 * literal type produced by `typeof V0_WEIGHTS as const`.
 */
export interface EnsembleWeights {
    citation: number;
    canonical: number;
    retrieved: number;
}
/** v0 ensemble weights. Callers may pass custom weights for calibration. */
export declare const V0_WEIGHTS: EnsembleWeights;
/**
 * Compute the per-document attribution for a single grader judgment.
 *
 * The function is side-effect free except for the `reliability` accumulator —
 * the caller owns the `GraderReliability`-shaped mutable object and should
 * persist it after iterating over all judgments in a run.
 *
 * Hallucination short-circuit: when a candidate doc has a citation AND
 * `doc.slug` is absent from `judgment.hallucinationCheckedAgainst`,
 * the doc's attribution short-circuits to `score: 0`,
 * `confidence.level: "low"`, `signalsPresent: 0`, and
 * `reliability.hallucinationCount` is incremented. The function does NOT
 * throw — the pipeline continues and the count is persisted by the caller.
 *
 * @param judgment       - The grader judgment being attributed.
 * @param candidates     - DocumentRefs to compute attribution for. Callers
 *                         control the set (contextDocs ∪ cited docs ∪
 *                         retrieved docs).
 * @param contextDocIds  - Set of documentIds declared in task.context.docs
 *                         (the canonical signal source).
 * @param retrievedSlugs - Set of doc slugs visited by the agent, or
 *                         `undefined` when running in baseline mode (the
 *                         retrieved signal is then dropped from the ensemble).
 * @param reliability    - Mutable accumulator; `hallucinationCount` is
 *                         incremented for each hallucinated citation.
 * @param weights        - Ensemble weights; defaults to V0_WEIGHTS.
 */
export declare function computeJudgmentAttribution(judgment: GraderJudgment, candidates: DocumentRef[], contextDocIds: ReadonlySet<string>, retrievedSlugs: ReadonlySet<string> | undefined, reliability: {
    hallucinationCount: number;
}, weights?: EnsembleWeights): JudgmentAttribution;
/**
 * Derive a `Confidence` triple from the array of present signal values
 * using standard-deviation-based agreement scoring.
 *
 * When `present.length <= 1`, the result is always `"low"` — a single
 * signal cannot speak to agreement.
 *
 * The `0.5` normalization constant is the maximum standard deviation for
 * a 2-or-3-point series whose values are in [0, 1] (achieved by
 * [0, 1] or [0, 0, 1] patterns). Dividing the actual stdev by 0.5
 * normalises agreement to [0, 1].
 *
 * Buckets: agreement > 0.7 → "high", > 0.4 → "medium", else → "low".
 */
export declare function deriveEnsembleConfidence(present: readonly number[]): Confidence;
