/** * Constitution Loader and Evaluator * * Loads constitution files and evaluates pattern approval * based on risk tolerance and conditions. * * @module autofix/constitution */ import { type Constitution, type Severity } from "./constitution.schema.js"; import type { FixPattern } from "../certification/autofix.js"; /** * Default constitution file locations (checked in order) */ export declare const CONSTITUTION_PATHS: string[]; /** * Load constitution from project directory */ export declare function loadConstitution(projectPath: string, constitutionPath?: string): Promise; /** * Result of pattern approval check */ export interface ApprovalResult { /** Whether the pattern is approved for auto-application */ approved: boolean; /** Reason for the decision */ reason?: string; /** Required reviewer if not auto-approved */ requiredReviewer?: string; } /** * Context for evaluating pattern approval */ export interface ApprovalContext { /** File path being fixed */ filePath: string; /** Severity of the finding */ severity: Severity; /** Number of lines changed (optional) */ linesChanged?: number; } /** * Check if a pattern is approved for auto-application */ export declare function isPatternApproved(constitution: Constitution, pattern: FixPattern, context: ApprovalContext): ApprovalResult; /** * Result of path check */ export interface PathCheckResult { /** Whether the path is allowed for autofix */ allowed: boolean; /** Reason for the decision */ reason?: string; /** Whether additional review is required */ requiresReview: boolean; } /** * Check if file path is allowed for autofix */ export declare function isPathAllowed(constitution: Constitution, filePath: string): PathCheckResult; /** * Get effective safeToAutoApply status for patterns based on constitution */ export declare function getEffectivePatterns(constitution: Constitution, patterns: FixPattern[]): FixPattern[]; /** * Validate a constitution file */ export declare function validateConstitution(content: unknown): { valid: boolean; errors?: string[]; }; /** * Generate a default constitution file content */ export declare function generateDefaultConstitution(): string; export { ConstitutionSchema, DEFAULT_CONSTITUTION } from "./constitution.schema.js"; export type { Constitution, RiskTolerance, Severity, PatternApproval, PRRules, DirectoryRules, SafetyConstraints, } from "./constitution.schema.js"; //# sourceMappingURL=constitution.d.ts.map