/**
 * Attribution core domain types — canonical shapes for the per-document
 * attribution ensemble (Doc 04).
 *
 * Phase 1 lands the type carriers; Phase 4 lands the compute step. The
 * Zod schemas in `packages/eval/src/adapters/attribution/` assert
 * `satisfies z.ZodType<...>` against these types.
 *
 * Doc identity is referenced by `documentId` (D0052), not by `slug` —
 * `slug` is retained as a human-readable annotation only. The
 * resolvable-set check is carried as a separate
 * `hallucinationCheckedAgainst: string[]` field (Pitfall #11).
 *
 * @see docs/decisions/D0049-shared-confidence-contract.md
 * @see docs/decisions/D0052-judgment-ref-granularity.md
 * @see docs/design-docs/actionability-ladder/04-per-document-attribution-ensemble.md
 */
import type { Confidence } from "./confidence.js";
/**
 * Per-document attribution score for one judgment. The `signals` sub-record
 * carries each ensemble member's contribution; the top-level `score` is
 * the post-weighting composite.
 *
 * `documentId` is the canonical D0052 reference; `slug` is a
 * human-readable annotation only and must not be relied on for identity.
 */
export interface DocAttribution {
    /** Canonical D0052 document ref (id, not slug). */
    documentId: string;
    /** Optional human-readable annotation. Never the identity. */
    slug?: string;
    /** Composite attribution score in [0, 1]. */
    score: number;
    /** Per-ensemble-member contributions before weighting. */
    signals: {
        citation?: number;
        canonical?: number;
        retrieved?: number;
    };
    /** Shared D0049 confidence triple. */
    confidence: Confidence;
}
/**
 * Per-judgment attribution carrier. Emitted by Phase 4's
 * `ComputeAttributionStep`; persisted at
 * `runs/{runId}/attribution/{entryKey}.json`.
 *
 * `hallucinationCheckedAgainst` is the resolvable-set used at compute
 * time — required (not optional) so consumers can audit citation
 * grounding without re-deriving the set. Per Pitfall #11 the canonical
 * task field is `contextDocs`; do not invent `expectedDocs` /
 * `usedDocs` synonyms.
 */
export interface JudgmentAttribution {
    /** D0052 granular ref to the underlying grader judgment. */
    judgmentRef: string;
    taskId: string;
    modelId: string;
    dimension: string;
    attributions: DocAttribution[];
    /** Resolvable-set used at compute time (Pitfall #11). */
    hallucinationCheckedAgainst: string[];
}
/**
 * Run-scoped attribution metadata. Persisted alongside the per-entry
 * attribution objects so consumers can interpret signal-weighting and
 * embedding choices without re-loading the calibration set.
 *
 * `embeddingModel` is REQUIRED (Pitfall #6) — silently downgrading to a
 * default has caused regressions in adjacent codebases.
 */
export interface AttributionMeta {
    ensembleVersion: string;
    /** Embedding model identifier — REQUIRED (Pitfall #6). */
    embeddingModel: string;
    calibrationSetVersion?: string;
    weights: {
        citation: number;
        canonical: number;
        retrieved: number;
    };
}
