/** * Policy Violation Detection * * Detects various types of architectural policy violations by comparing * merged scanner output against the policy file. */ import { Policy } from "../../shared/types/policy.js"; import { MergedScanResult } from "../merge/types.js"; /** * Types of policy violations that can be detected */ export type ViolationType = "forbidden_caller" | "missing_allowed_caller" | "feature_flag" | "permission" | "kill_pattern"; /** * A single policy violation */ export interface Violation { /** File where the violation occurred */ file: string; /** Module that owns the violating file */ module: string; /** Type of violation */ type: ViolationType; /** Human-readable message describing the violation */ message: string; /** Additional context and details */ details: string; /** Module involved in the violation (e.g., the module being called) */ target_module?: string; /** Import statement or pattern that caused the violation */ import_from?: string; } /** * Detect all policy violations in the merged scanner output * * @param merged - Merged scanner output from lexmap merge * @param policy - Policy definitions from lexmap.policy.json * @returns Array of detected violations */ export declare function detectViolations(merged: MergedScanResult, policy: Policy): Violation[];