/** * @fileoverview Feature Checking (SPEC Section 14) * * Check IR validity against Lexicon. * Errors are values, not exceptions (per Constitution). */ import type { IntentIR, Term, Role, EventClass, ValueType } from "../schema/index.js"; import type { Lexicon } from "./interface.js"; export type CheckError = { readonly code: "UNKNOWN_LEMMA"; readonly lemma: string; } | { readonly code: "CLASS_MISMATCH"; readonly expected: EventClass; readonly actual: EventClass; } | { readonly code: "MISSING_ROLE"; readonly role: Role; } | { readonly code: "INVALID_TERM_KIND"; readonly role: Role; readonly expected: readonly Term["kind"][]; readonly actual: Term["kind"]; } | { readonly code: "INVALID_ENTITY_TYPE"; readonly role: Role; readonly entityType: string; readonly allowed: readonly string[]; } | { readonly code: "INVALID_VALUE_TYPE"; readonly role: Role; readonly valueType: ValueType; readonly allowed: readonly ValueType[]; } | { readonly code: "UNKNOWN_ENTITY_TYPE"; readonly entityType: string; }; export type CheckResult = { readonly valid: true; readonly requiresConfirm?: boolean; } | { readonly valid: false; readonly error: CheckError; readonly suggest: "ERROR" | "CLARIFY"; }; /** * Check IR validity against Lexicon. * * Per SPEC Section 14.3: * 1. Lemma must exist in Lexicon * 2. Event class must match Lexicon entry * 3. All required roles must be present * 4. Term kinds must match selectional restrictions * 5. Entity types must be valid * 6. Policy hints trigger confirmations * * @example * const result = checkFeatures(ir, lexicon); * if (!result.valid) { * console.error(result.error); * } */ export declare function checkFeatures(ir: IntentIR, lexicon: Lexicon): CheckResult; //# sourceMappingURL=check.d.ts.map