/**
 * @sanity/ailf-core — Artifact-persistence degradation detector
 * (`W-detect-wholesale-artifact-loss`).
 *
 * Pure, I/O-free check that runs at report-assembly time. It reads a run's
 * `ArtifactManifest` and decides whether the run suffered *wholesale* artifact
 * loss: a remote artifact backend (GCS / API Gateway) was configured, yet zero
 * (or below a configured threshold) of the produced artifact sections actually
 * persisted there — every section fell back to `store: "local"`.
 *
 * ## Why a manifest-only check is insufficient
 *
 * Artifact uploads are non-blocking by design (P5): each failure warns and the
 * fanout falls through to the local writer, downgrading the ref to
 * `store: "local"`. When *all* uploads fail (e.g. the Node 22.23.0 /
 * node-fetch@2 OAuth-token regression that failed 95/95 uploads of
 * `run_20260625T084753Z_0fk47ex2`), every manifest section is `store: "local"`
 * — but a legitimate local-only run (no remote credentials) produces an
 * *identical* manifest. The `store` labels alone cannot tell the two apart, so
 * the caller must supply `remoteConfigured` (derived from the actual writer
 * wiring). This detector only fires when remote was configured.
 *
 * ## Relationship to the existing degraded guard
 *
 * The enrichment guard (`detectReportDegradation`) fires on missing inline
 * `summary.testResults`. This one is orthogonal: in the motivating incident
 * the inline `testResults` were present (8 entries) — what was missing was the
 * *GCS persistence* of `testOutputs` / `rawResults`. Both feed the same D0059
 * `ReportDegradation` mechanism via a distinct `reason`.
 *
 * @see docs/decisions/D0059-report-validity-axis-and-trustworthiness-gate.md
 * @see docs/decisions/D0032-run-anchored-artifact-store.md
 */
import type { ArtifactManifest, ReportDegradation } from "../types/index.js";
/**
 * Default persisted-fraction threshold: flag only when the fraction of produced
 * sections that reached the remote store is `<= 0` — i.e. literally zero
 * persisted (wholesale loss). Partial loss (some sections local, some remote)
 * is left to the writer's per-entry "local fallback" warning rather than
 * stamping the whole report degraded, which keeps false positives at zero for
 * the common case of a single transient blip on one section.
 */
export declare const DEFAULT_WHOLESALE_LOSS_THRESHOLD = 0;
export interface ArtifactPersistenceDetectorOptions {
    /**
     * Whether a remote artifact backend was wired for this run. Derived by the
     * caller from the actual writer chain (a `FanoutArtifactWriter` carrying a
     * GCS / API-Gateway delegate). When `false` (local-only or `--no-artifacts`),
     * an all-`local` manifest is expected and never flagged.
     */
    remoteConfigured: boolean;
    /**
     * Persisted-fraction at or below which the run is flagged degraded. Defaults
     * to {@link DEFAULT_WHOLESALE_LOSS_THRESHOLD} (0 — wholesale loss only). A
     * stricter policy can pass e.g. `0.5` to flag when more than half of the
     * produced sections failed to persist.
     */
    threshold?: number;
}
/**
 * Inspect a run manifest for wholesale artifact-persistence failure.
 *
 * Returns a `ReportArtifactPersistenceDegradation` marker when a remote backend
 * was configured but the fraction of produced sections that reached it is at or
 * below `threshold`; otherwise `undefined` (a healthy or legitimately
 * local-only run). Pure: same input → same output.
 *
 * The denominator is the set of sections actually present in the manifest (the
 * ones this run produced); the numerator counts those whose canonical
 * `store` is `"gcs"`. A run that produced no artifact sections is never flagged
 * (nothing was lost).
 */
export declare function detectArtifactPersistenceDegradation(manifest: ArtifactManifest | undefined, options: ArtifactPersistenceDetectorOptions): ReportDegradation | undefined;
