/**
 * Normalise runner — walks the rule manifest, applies each applicable
 * rule's detect/transform pipeline, and returns the transformed spec
 * + an audit trail of what fired.
 *
 * Phase 1a of the 2026-05-13-NORMALISE-PHASE proposal.
 *
 * Contract:
 *   - INPUT: a parsed NormaliseSpec + a NormaliseContext
 *   - OUTPUT: the transformed AST + per-rule result list
 *   - INVARIANT: identity on empty ruleset (no rules → spec returned unchanged)
 *   - INVARIANT: deterministic — same input + same ruleset → same output
 *   - INVARIANT: rules apply in `ordering` ascending; later rules see
 *     the transformed state from earlier rules
 *
 * The runner does NOT deep-clone the spec between rules. Rules MAY
 * mutate in-place (and downstream rules MUST handle the mutated state
 * gracefully). The runner returns the same reference passed in unless
 * a rule explicitly returns a new object.
 */
import { type NormaliseRule, type NormaliseContext, type NormaliseRuleResult, type NormaliseSpec } from './normalise-rules.js';
export interface NormaliseRunResult {
    spec: NormaliseSpec;
    results: NormaliseRuleResult[];
    /**
     * Aggregate stats — total matches across all rules, total rules
     * that fired (matchCount > 0), total rules skipped.
     */
    stats: {
        totalRulesConsidered: number;
        rulesFired: number;
        rulesSkipped: number;
        totalMatches: number;
    };
}
export interface NormaliseRunOptions {
    /**
     * Override the canonical RULES manifest with a custom rule list.
     * Used by tests to inject synthetic rules without polluting the
     * real manifest. Defaults to the live RULES array.
     */
    rules?: NormaliseRule[];
}
/**
 * Run the normalise pipeline on a parsed spec.
 *
 * Each applicable rule:
 *   1. Has detect() called once
 *   2. If detect returned ≥1 match, transform() is called per match
 *   3. The rule's result is recorded in the returned audit trail
 *
 * Rules that return no matches are recorded as `matchCount: 0`, NOT
 * as skipped — they ran successfully, just had nothing to do. Skipped
 * means the rule was excluded before detect ran (disabled in ctx,
 * `appliesWhen` returned false, etc.).
 */
export declare function runNormalise(spec: NormaliseSpec, ctx: NormaliseContext, options?: NormaliseRunOptions): NormaliseRunResult;
//# sourceMappingURL=runner.d.ts.map