/**
 * pipeline/reverse-mapping.ts
 *
 * Builds a reverse index from document slugs to feature areas.
 *
 * The canonical_docs in each task YAML define which docs are relevant to
 * each task. This module inverts that mapping: given a document slug,
 * return which feature areas (and specific tasks) would be affected if
 * that document changed.
 *
 * This is the foundation for event-driven evaluation triggers — when a
 * content webhook fires for a document, we look up affected areas and
 * dispatch a scoped evaluation.
 *
 * @see docs/design-docs/report-store/visibility-workflows.md — Event-Driven Triggers
 */
import { type ResolvedMappings } from "./resolve-mappings.js";
/** A feature area + task affected by a document change */
export interface AffectedTarget {
    /** Feature area name (filename stem, e.g., "groq") */
    area: string;
    /** Task ID within the area (e.g., "groq-blog-queries") */
    taskId: string;
}
/** Summary of impact for a set of changed slugs */
export interface ImpactSummary {
    /** Unique affected area names (for --area flag) */
    areas: string[];
    /** All affected targets with area + task detail */
    targets: AffectedTarget[];
    /** Unique affected task IDs (for --task flag) */
    taskIds: string[];
    /** Slugs that don't match any canonical docs (untracked) */
    unmatchedSlugs: string[];
}
/** The reverse mapping: document slug → affected areas/tasks */
export type ReverseMapping = Map<string, AffectedTarget[]>;
/**
 * Get all unique canonical doc slugs across all tasks.
 * Useful for checking if a webhook payload matches any tracked document.
 */
export declare function allTrackedSlugs(reverseMapping: ReverseMapping): string[];
/**
 * Given a set of changed document slugs, determine which areas and tasks
 * are affected and should be re-evaluated.
 *
 * @param slugs - Document slugs that changed
 * @param reverseMapping - Pre-built reverse mapping (or will build from rootDir)
 * @returns Impact summary with deduplicated areas and tasks
 */
export declare function assessImpact(slugs: string[], reverseMapping: ReverseMapping): ImpactSummary;
/**
 * Build a reverse mapping from document slugs to feature areas.
 *
 * Reads all task YAML files and inverts the canonical_docs mappings.
 * A single slug may map to multiple areas/tasks (e.g., "groq-introduction"
 * is referenced by multiple GROQ tasks).
 *
 * @param rootDir - Path to the eval package root (packages/eval)
 * @returns Map from slug → array of affected targets
 */
export declare function buildReverseMapping(rootDir: string): ReverseMapping;
/**
 * Build a reverse mapping from already-resolved mappings.
 * Useful for testing without filesystem access.
 */
export declare function buildReverseMappingFromResolved(mappings: ResolvedMappings): ReverseMapping;
