/**
 * ValidationRuleRegistry: dynamic dispatch for pack-contributed validation rules.
 *
 * Replaces the hardcoded `isCICDWorkflow() ? getCICDValidationRules() : []`
 * pattern. Each registered rule set has a detect predicate and a lazy rule loader.
 * The validate API calls `getApplicableRules(ast)` and merges results.
 */
/**
 * Registry for dynamically contributed validation rule sets.
 * Core rule sets (like CI/CD) register themselves at startup.
 * Pack-contributed rule sets are loaded from manifests.
 */
export class ValidationRuleRegistry {
    ruleSets = [];
    /** Register a validation rule set. */
    register(ruleSet) {
        this.ruleSets.push(ruleSet);
    }
    /**
     * Get all validation rules applicable to the given workflow AST.
     * Runs each registered detect predicate and collects rules from matching sets.
     */
    getApplicableRules(ast) {
        const rules = [];
        for (const ruleSet of this.ruleSets) {
            if (ruleSet.detect(ast)) {
                rules.push(...ruleSet.getRules());
            }
        }
        return rules;
    }
    /** Get the number of registered rule sets. */
    get size() {
        return this.ruleSets.length;
    }
}
//# sourceMappingURL=rule-registry.js.map