/** * @fileoverview Causal Integrity Invariant (I1) * * I1: Graph is acyclic; topological sort is possible. * * Per SPEC Section 8.2: * INVARIANT: For all nodes n in graph G: * - The transitive closure of dependsOn contains no cycles * - topologicalSort(G) terminates successfully */ import type { IntentGraph, IntentNodeId } from "../core/types/intent-graph.js"; /** * Result of cycle detection. */ export type CycleCheckResult = { readonly hasCycle: false; } | { readonly hasCycle: true; readonly cycle: readonly IntentNodeId[]; }; /** * Check for cycles in the Intent Graph using DFS. * * This implements the I1 (Causal Integrity) invariant check. * * @param graph - The Intent Graph to check * @returns Result indicating whether a cycle exists and the cycle path if found */ export declare function checkCausalIntegrity(graph: IntentGraph): CycleCheckResult; /** * Check if graph has any cycles. * * Convenience wrapper that returns a boolean. */ export declare function hasCycle(graph: IntentGraph): boolean; //# sourceMappingURL=causal-integrity.d.ts.map