/** * @fileoverview Intent Statefulness Invariant (I4) * * I4: Every node has resolution.status. * * Per SPEC Section 8.2: * INVARIANT: For all nodes n in graph G: * - n.resolution.status ∈ {"Resolved", "Ambiguous", "Abstract"} * - n.resolution.ambiguityScore ∈ [0, 1] * * Also enforces Resolution Consistency Rules (SPEC Section 8.3): * - R1: status = "Resolved" → missing MUST be empty or undefined * - R2: missing is non-empty → status MUST be "Ambiguous" or "Abstract" * - R3: ambiguityScore = 0 → status SHOULD be "Resolved" (warning) */ import type { IntentGraph, IntentNodeId } from "../core/types/intent-graph.js"; /** * Result of statefulness check. */ export type StatefulnessCheckResult = { readonly valid: true; } | { readonly valid: false; readonly error: "INVALID_STATUS" | "INVALID_SCORE" | "R1_VIOLATION" | "MISSING_WITHOUT_STATUS"; readonly nodeId: IntentNodeId; readonly details?: string; }; /** * Warning from statefulness check. */ export type StatefulnessWarning = { readonly code: "ZERO_SCORE_NOT_RESOLVED"; readonly nodeId: IntentNodeId; readonly message: string; }; /** * Check the I4 (Intent Statefulness) invariant. * * Verifies that every node has valid resolution.status and ambiguityScore. * * @param graph - The Intent Graph to check * @returns Result with validity and optional error details */ export declare function checkStatefulness(graph: IntentGraph): { result: StatefulnessCheckResult; warnings: readonly StatefulnessWarning[]; }; /** * Check if all nodes have valid statefulness. * * Convenience wrapper that returns a boolean. */ export declare function isStatefulnessValid(graph: IntentGraph): boolean; //# sourceMappingURL=statefulness.d.ts.map