import { WebpiecesRulesConfig, MatchRuleConfig } from '@webpieces/rules-config'; import type { Rule } from './types'; /** The two gated-command strings guards print, resolved from `commands.guardHints`. Data-only. */ export declare class GuardHintCommands { readonly upsertPr: string; readonly mergeComplete: string; constructor(upsertPr: string, mergeComplete: string); } export declare function loadRules(config: WebpiecesRulesConfig, workspaceRoot: string, guardHints: GuardHintCommands): readonly Rule[]; /** * The KEYLESS bash guards: rules that have NO webpieces.config.json entry, and are therefore * deliberately kept out of `builtInConfigKeys`/`BUILT_IN_RULE_MAP` — so the config-sync check (fault Y, * "every built-in rule needs an entry, or every Bash call is blocked") can never see them. That * containment is the whole point: whole-repo-build-guard shipped inside the config-driven set once and * took every upgrading consumer's shell down with it. * * Each rule here decides for ITSELF whether it acts, and the two do it differently on purpose: * * - `whole-repo-build-guard` is EXPERIMENTAL and inert unless the optional machine-local * `~/.webpieces/config.json` opts IN with `experimental.whole-repo-build-guard: true`. Every * experimental flag defaults OFF, and it takes no file and no key to be in that default state — * which is the difference between this and the required-key release that blocked every upgrading * consumer's shell. * - `commit-message-substitution-guard` acts unconditionally. Nobody legitimately wants a backtick * expanded inside a commit message, and its cure (`git commit -F `) is available for every * input and can never itself match the guard — so there is nothing for a switch to rescue. * - `build-output-pipe-guard` acts unconditionally, on the same test. Piping `wp-build` / * `wp-review-upsert-pr` / `wp-finish-upsert-pr` withholds their heartbeat until they exit and gets * the build killed by the 600s watchdog; the cure is the SAME command with less typing, available * for every input, and it cannot itself match the guard. * * `affectedBuildCommand` is the project's gate command, passed through so a refusal quotes what THIS * repo's gate actually runs. */ export declare function loadKeylessBashRules(affectedBuildCommand: string): Rule[]; export declare function loadMatchRules(matchRules: readonly MatchRuleConfig[]): Rule[]; export declare function globMatches(pattern: string, filePath: string): boolean;