/** * Config gate for the Nx infrastructure validators. * * Every other rule in the system (eslint rules, code-rules, ai-hook rules, validate-ts-in-src) can be * turned off or time-boxed from webpieces.config.json. The five infrastructure executors * (validate-architecture-unchanged, validate-no-architecture-cycles, validate-packagejson, * validate-versions-locked, validate-eslint-sync) hardcoded their behavior instead, which made them * the only checks a consuming repo could not adopt gradually. This gate gives them the same * semantics, from the same source of truth (`loadAndValidate` → webpieces.config.json). * * Semantics: * - rule entry ABSENT (or no webpieces.config.json at all) → RUN. Fail-safe: an older config, or a * repo that has not adopted the keys yet, behaves exactly as it did before this gate existed. * - `"mode": "OFF"` → skip with a reason. * - the time-box / branch escape hatches (turnOffRuleUntilEpoch / turnOffRuleWhileOnBranch) → honored * when the caller passes `honorEpoch: true`. All five executors now pass true: a schedule ("do not * enforce until / off ") is coherent for any of them, baseline or not (see the * comment block above ValidateArchitectureUnchangedConfig in rules-config/src/rule-configs.ts). The * param is retained so a future caller can still opt a rule out of time-boxing. */ export declare class RuleGate { /** * @param workspaceRoot the Nx `context.root` — where webpieces.config.json is looked up from. * @param ruleName the webpieces.config.json key, identical to the Nx target name. * @param honorEpoch true to honor the time-box/branch escape hatches (all five executors pass true). * @returns a human-readable reason when the executor must SKIP, or null when it must RUN. */ skipReason(workspaceRoot: string, ruleName: string, honorEpoch: boolean): string | null; /** * Convenience wrapper: prints the standard skip line and reports whether the caller should stop. * Keeps the four-line preamble identical across all five executors. */ isDisabled(workspaceRoot: string, ruleName: string, honorEpoch: boolean): boolean; }