/** * @fileoverview Result Pattern Consistency Check * * Enforces consistent use of Result vs throw based on error type: * - Result for expected failures (validation, not found, business rules) * - throw for unexpected failures (system errors, security issues) * * @see CLAUDE.md Error Handling Policy */ import { type CheckViolation } from '@opensip-cli/fitness'; /** * Recipe-config shape for result-pattern-consistency. Project-specific boundary * directories (where throwing is the intended pattern) belong in a recipe's * `checks.config['result-pattern-consistency']` block, not in the check's * built-in defaults — hardcoding one codebase's layout into a generic check * either leaks that layout or misclassifies another codebase's files. */ export interface ResultPatternConsistencyConfig extends Record { /** * Additional path patterns where `throw` is allowed (treated as an * infrastructure/edge boundary). Each entry compiles to a RegExp via * `new RegExp(entry)` and is matched against the file path. */ additionalThrowAllowedPaths?: readonly string[]; } /** * Paths where throwing is expected (infrastructure boundaries per DEC-015). * These are entry points that bridge external systems, CLI, or pipeline layers * where callers can't meaningfully recover — throw is the correct pattern. */ export declare const THROW_ALLOWED_PATHS: RegExp[]; /** Analyze a file for Result/throw consistency issues. */ export declare function analyzeFileForResultPatternConsistency(content: string, filePath: string): CheckViolation[]; /** * Check: quality/result-pattern-consistency * * Ensures consistent use of Result for expected failures and throw for unexpected failures. */ export declare const resultPatternConsistency: import("@opensip-cli/fitness").Check; //# sourceMappingURL=result-pattern-consistency.d.ts.map