/**
 * report-cache-state.ts — the single derivation of whether an eval report's
 * displayed cost / tokens / timestamp were inherited from a remote-cache
 * source run, shared by every output surface (Slack, PR-comment markdown,
 * CLI, dashboard) so the classification and source-run attribution are
 * identical everywhere.
 *
 * ## Why this exists
 *
 * When the pipeline serves a run from the remote cache (the eval fingerprint
 * matches a prior published report), the new report inherits the source run's
 * `summary.overall.cost`, `summary.scores`, and `summary.timestamp`, while
 * `durationMs` stays the new run's own short wall-clock. Every renderer shows
 * these side by side, so a $48 / 1M-token figure appears next to a 28-second
 * runtime with no marker that the cost is borrowed. This helper produces the
 * marker.
 *
 * ## The signal (no new persisted field — D0040)
 *
 * The cache-hit branch in `RunEvalStep` copies the source report's artifact
 * manifest forward and stamps `sourceRunId` on every ref via
 * `remapToCacheHitRefs`. So an artifact whose `sourceRunId` is set and differs
 * from the report's own `provenance.runId` was served from another run.
 *
 * ## Why only the cost-bearing artifacts count
 *
 * The classification reads only the artifacts that represent the eval
 * execution whose cost is being displayed: `rawResults` (provider inference +
 * its per-call cost/tokens), `renderedPrompts`, `graderPrompts`,
 * `graderJudgments` (grader cost), and `traces` (agentic execution).
 *
 * `testOutputs` is deliberately EXCLUDED. It is restored from a prior run
 * independently of cost — real fresh-cost reports carry a foreign
 * `testOutputs.sourceRunId` while their `rawResults` ran fresh (observed on
 * production reports `019f03ae` and `019f07d8`: foreign `testOutputs`, fresh
 * everything else, genuine sub-$0.50 spend). Counting `testOutputs` would
 * mislabel those fresh runs as cached. Bulk bookkeeping artifacts
 * (`pipelineContext`, `scoreSummary`, `runManifest`, …) are excluded because
 * the new run always produces them fresh, and post-hoc artifacts
 * (`diagnosis`) are excluded because `remapToCacheHitRefs` never stamps them.
 *
 * @see docs/decisions/D0040-artifact-ref-source-run-id.md
 * @see packages/eval/src/pipeline/cache-hit-restore.ts (remapToCacheHitRefs)
 */
/**
 * Eval-execution artifacts whose `sourceRunId` reflects whether the displayed
 * cost was inherited. `satisfies readonly ArtifactType[]` ties the list to the
 * registry so renaming or removing an artifact type is a compile error here.
 */
declare const COST_BEARING_ARTIFACTS: readonly ["rawResults", "renderedPrompts", "graderPrompts", "graderJudgments", "traces"];
type CostBearingArtifact = (typeof COST_BEARING_ARTIFACTS)[number];
/**
 * Minimal manifest shape the derivation reads: per cost-bearing artifact type,
 * an optional ref carrying an optional `sourceRunId`. Both the domain
 * `ArtifactManifest` (`Partial<Record<ArtifactType, ArtifactRef>>`) and the
 * Studio projection shape (`summary.artifactManifest`, which uses
 * `sourceRunId?: string` and omits some keys) are structurally assignable to
 * this — so every surface passes its own manifest with no mapping or cast.
 */
export type CacheBearingManifest = Partial<Record<CostBearingArtifact, {
    readonly sourceRunId?: string;
} | undefined>>;
/**
 * Whether a report's displayed cost/tokens were served from a remote-cache
 * source run, and from which run(s).
 *
 * - `fresh` — every cost-bearing artifact was produced by this run.
 * - `partially-cached` — some cost-bearing artifacts were inherited, some are
 *   fresh (e.g. baseline cached, agentic re-run). The displayed run-level cost
 *   mixes inherited and fresh spend.
 * - `fully-cached` — every present cost-bearing artifact was inherited; none of
 *   the displayed cost was spent by this run.
 *
 * `sourceRunIds` lists the distinct source run id(s) the inherited artifacts
 * point at (a fully-cached report can pull baseline and agentic artifacts from
 * two different source runs), sorted for stable rendering.
 */
export type ReportCacheState = {
    readonly kind: "fresh";
} | {
    readonly kind: "partially-cached";
    readonly sourceRunIds: readonly string[];
} | {
    readonly kind: "fully-cached";
    readonly sourceRunIds: readonly string[];
};
/** Input to the shared cache-state derivation. */
export interface CacheStateInput {
    /** The report's own run id (`provenance.runId`). */
    readonly currentRunId: string;
    /** The report's artifact manifest, in any structurally-compatible shape. */
    readonly artifactManifest?: CacheBearingManifest;
}
/**
 * Derive cache state from a run id and an artifact manifest. The single source
 * of truth for the classification — every surface consumes this (directly, or
 * via {@link reportCacheState} for domain `Report` callers).
 */
export declare function classifyCacheState(input: CacheStateInput): ReportCacheState;
/**
 * {@link classifyCacheState} over a domain `Report` (or any value carrying
 * `provenance.runId` and an optional `artifactManifest`). This is the entry
 * point for the Slack and markdown renderers, which operate on the domain
 * `Report`.
 */
export declare function reportCacheState(report: {
    readonly provenance: {
        readonly runId: string;
    };
    readonly artifactManifest?: CacheBearingManifest;
}): ReportCacheState;
/**
 * Surface-agnostic phrasing of a non-fresh cache state, so every renderer
 * (Slack, PR-comment markdown, CLI, dashboard tooltip) uses identical wording
 * and source-run attribution (W-surface-cache-provenance AC #3). Each surface
 * wraps these strings in its own emphasis/markup (emoji, bold, table cell);
 * the words themselves come from here.
 */
export interface CacheProvenanceNote {
    readonly kind: "partially-cached" | "fully-cached";
    /** Short label: "Fully cached" / "Partially cached". */
    readonly label: string;
    /** Distinct source run id(s), sorted. */
    readonly sourceRunIds: readonly string[];
    /** "source run X" or "source runs X, Y" — the attribution clause. */
    readonly sourceAttribution: string;
    /** One-line explanation including the source-run attribution. */
    readonly summary: string;
}
/**
 * Returns a {@link CacheProvenanceNote} for a cache-served report, or `null`
 * for a fresh report (no indicator needed).
 */
export declare function describeCacheState(state: ReportCacheState): CacheProvenanceNote | null;
export {};
