export type RuleSeverity = 'must' | 'should' | 'never'; export type RuleScope = 'all' | 'code' | 'commits' | 'tests'; export interface ConstitutionRule { id: string; severity: RuleSeverity; scope: RuleScope; title: string; text: string; keywords: string[]; source: 'file' | 'proposed' | 'approved'; } export interface Violation { rule: ConstitutionRule; confidence: number; evidence: string; } export interface ValidateResult { violations: Violation[]; passed: ConstitutionRule[]; } interface InjectOpts { scope?: RuleScope; maxRules?: number; } export declare class Constitution { private rules; private approved; private projectRoot; private watcher; private initialized; private embeddings; private vectorCache; constructor(projectRoot?: string); init(): Promise; /** Prepend the most relevant constitution rules to a prompt as a preamble. */ injectInto(prompt: string, opts?: InjectOpts): string; /** * Score `text` against every rule. Uses both keyword matching (fast, precise) * and semantic similarity (slower, fuzzy). Reports a confidence in [0,1]. */ validate(text: string): Promise; /** Build a candidate rule from an observed pattern. Template-only, no LLM. */ proposeRule(observation: string): ConstitutionRule; /** Persist a user-approved rule to constitution-approved.json. */ approve(rule: ConstitutionRule): Promise; listRules(): ConstitutionRule[]; dispose(): void; private allRules; private loadFromDisk; private startWatcher; private cachedEmbed; private extractEvidence; private logViolation; } export declare function parseConstitutionMarkdown(md: string): ConstitutionRule[]; export declare function getConstitution(projectRoot?: string): Constitution; export declare function resetConstitutionForTests(): void; export {}; //# sourceMappingURL=constitution.d.ts.map