/** * Shared rule-evaluation loop + per-rule observability. * * Both build engines (the single-program `runGraph` and the sharded * `runShardedGraph`) evaluate the rule set over the unified catalog. They * historically carried two byte-identical inline loops — a divergence trap: * instrumentation or a fix applied to one silently missed the other (and the * sharded loop is the one large monorepos actually take). This module is the * single evaluation seam both engines call. * * **Observability (the regression class this closes).** A single O(N²) rule * once dominated the entire "rules" stage while the only signal was the * aggregate stage duration — the pathological rule was invisible. This loop * times every rule and emits a structured `graph.rule.evaluated` event per * rule, plus a louder `graph.rule.slow` WARN when one rule both takes real * wall-time AND owns the overwhelming majority of the stage. A future * algorithmic regression in any rule surfaces immediately instead of hiding * inside the stage total. * * **Order-preserving.** Rules run sequentially in registration order and * signals are appended in that order — byte-for-byte identical to the prior * inline loops. Signal array order is observable downstream (fingerprint * de-dup, SARIF ordering), so this loop must stay sequential and in-order; * it is NOT a parallelism seam. */ import { type Signal } from '@opensip-cli/core'; import type { Catalog, FeatureTable, GraphConfig, Indexes, Rule, RuleHints } from '../types.js'; /** The frozen pipeline data a rule's `evaluate` consumes. */ export interface RuleEvaluationInput { readonly catalog: Catalog; readonly indexes: Indexes; readonly config: GraphConfig; readonly hints?: RuleHints; readonly features?: FeatureTable; } /** Resolve an explicit rule override or snapshot the current scoped registry. */ export declare function resolveRuleSet(explicitRules?: readonly Rule[]): readonly Rule[]; /** * Evaluate `ruleSet` over the unified catalog, accumulating signals in * registration order. Emits per-rule timing telemetry; returns the collected * signals. The sole rule-evaluation path for both build engines. */ export declare function evaluateRules(ruleSet: readonly Rule[], data: RuleEvaluationInput): Signal[]; //# sourceMappingURL=evaluate-rules.d.ts.map