/**
 * pipeline/retrieval-metrics.ts
 *
 * Computes retrieval precision and recall by comparing the doc slugs an agent
 * visited against the canonical doc set defined in task definitions.
 *
 * The canonical (expected) set is keyed on the cross-version **document key**
 * (D0084) — `baseDocumentId(ref.id)` for id refs, the editorial slug/path for
 * slug/path refs — with the slug as the display label. The agent's *visited*
 * docs stay on a slug/URL axis (the agent browses the live site), so the two
 * axes are deliberately asymmetric (design §4 / W-doctype-retrieval-attribution
 * AC#3). This module is dormant — `report.retrievalMetrics` is never produced
 * and there is no production call site — but is kept document-type-agnostic so a
 * future revival counts non-article `_id`/`path` pins by construction.
 *
 * This is a pure computation module — no file I/O beyond reading task files.
 */
import type { GeneralizedDocRef } from "../_vendor/ailf-core/index.d.ts";
import type { RetrievalMetrics, TaskRetrievalMetrics } from "./types.js";
export interface AgenticBehaviorData {
    /** Feature area (from detectFeatureArea) */
    area: string;
    /** Test description (used to match tasks) */
    description: string;
    /** Doc slugs the agent actually visited */
    docSlugsVisited: string[];
    /** Task ID (extracted from description if possible) */
    taskId?: string;
}
/**
 * Compute retrieval metrics from agentic behavior data.
 *
 * @param rootDir  Package root (to find tasks/*.yaml)
 * @param behaviors  Agentic behavior data per task
 * @returns RetrievalMetrics or null if no canonical docs or behavior data
 */
export declare function computeRetrievalMetrics(rootDir: string, behaviors: AgenticBehaviorData[]): null | RetrievalMetrics;
/**
 * Compute retrieval metrics for a single task.
 */
export declare function computeTaskMetrics(taskId: string, area: string, retrieved: string[], canonical: Set<string>): TaskRetrievalMetrics;
/**
 * The cross-version **document keys** (D0084) a task's canonical doc refs
 * resolve to — the canonical (expected) set behind the recall/precision/F1
 * denominators.
 *
 * Every ref is routed through the shared `resolveDocRefToDocumentKey`
 * (`@sanity/ailf-core`), the single ref→document-identity resolver, so the
 * slug-only assumption that previously dropped `_id`/`path`-only pins cannot
 * silently regrow:
 *
 * - An **id ref** contributes `baseDocumentId(ref.id)` directly — type-agnostic,
 *   so a task pinning a non-article doc only by `_id` now counts toward the
 *   canonical set, where the old `d.slug`-only read dropped it. This is the
 *   denominator-growth the fixture test exercises.
 * - A **slug ref** / **path ref** (last segment) contributes its editorial
 *   handle. This dormant loader has no run manifest, hence the empty
 *   {@link NO_MANIFEST_BRIDGE}: the editorial slug is the best available key and
 *   doubles as the display label and the axis the agent's visited slugs/URLs are
 *   compared on (AC#3). A revival with a real manifest would bridge slug→`_id`
 *   exactly as `compute-attribution-step.ts` does.
 * - A **perspective ref** contributes nothing (one-to-many fetch-time
 *   expansion; no single key from the ref alone), matching the live path.
 *
 * The axis asymmetry is deliberate: a non-article `_id` key grows the recall
 * denominator but is never "hit" by a slug-visiting agent — correct, since the
 * doc is expected yet has no slug for the agent to retrieve it by.
 *
 * Exported for unit testing (the dormant `loadCanonicalDocs` reads from disk).
 */
export declare function canonicalDocKeysForRefs(docs: readonly GeneralizedDocRef[]): Set<string>;
/**
 * Load canonical docs from *.task.ts files in tasks/literacy/.
 * Returns a map of taskId → { docKeys: Set<string>, area: string }, where each
 * key is the document key (D0084) the ref resolves to (slug for slug/path refs).
 */
export declare function loadCanonicalDocs(rootDir: string): Map<string, {
    area: string;
    docKeys: Set<string>;
}>;
