import type { Config, CustomRule } from '@/types'; import type { LoadedRulebookInfo, LoadedRulesPolicy, RulebookLockEntry, RulesConfig, RulesPolicyOptions } from './types'; interface ScopePolicy { rules: CustomRule[]; rulebooks: LoadedRulebookInfo[]; entries: RulebookLockEntry[]; knownRuleIds: Set; errors: string[]; canValidateOverrides: boolean; } export declare function loadRulesPolicy(options?: RulesPolicyOptions): LoadedRulesPolicy; export declare function getRulesConfigSourceDisplayMap(configPath: string): Map; export declare function getRulesConfigRuntimeErrorsForConfig(configPath: string, lockPath: string, options: RulesPolicyOptions): string[]; /** @internal - exported for test coverage */ export declare function getUnknownOverrideErrorsForConfig(configPath: string, lockPath: string, options: RulesPolicyOptions): string[]; export declare function loadScopePolicy(config: RulesConfig, lockPath: string, configDir: string, options: RulesPolicyOptions, source: 'user' | 'project'): ScopePolicy; /** * Convert a loaded rules policy into a runtime Config. * * Fail-open default (fork change): when policy errors are present the safety * net runs with no custom rules so commands are ALLOWED through. This prevents * a broken/legacy rulebook from bricking the shell. * * Set CC_SAFETY_NET_STRICT=1 to restore the upstream fail-closed behavior * (block every command except repair until the rulebook is fixed). */ export declare function rulesPolicyToConfig(policy: LoadedRulesPolicy): Config; export declare function getRulebookMigratedFrom(configDir: string, source: string): string | null; export {};