diff --git a/packages/imhotep-dsl/src/lower-to-canonical.ts b/packages/imhotep-dsl/src/lower-to-canonical.ts index 81e4d81..ac280e7 100644 --- a/packages/imhotep-dsl/src/lower-to-canonical.ts +++ b/packages/imhotep-dsl/src/lower-to-canonical.ts @@ -616,6 +616,8 @@ export function clauseEquivalent(a: CanonicalClauseDescriptor, b: CanonicalClaus a.flags === b.flags && a.quantifier === b.quantifier && a.envGuard === b.envGuard && + a.compoundOperator === b.compoundOperator && + a.compoundGroupId === b.compoundGroupId && frameEquivalent(a.frame, b.frame) && stateEquivalent(a.state, b.state) && toleranceEquivalent(a.tolerance, b.tolerance) && diff --git a/packages/imhotep-playwright/src/fol-compiler.ts b/packages/imhotep-playwright/src/fol-compiler.ts index 913f92e..ed0ffc3 100644 --- a/packages/imhotep-playwright/src/fol-compiler.ts +++ b/packages/imhotep-playwright/src/fol-compiler.ts @@ -36,12 +36,15 @@ import { FluentQuantifier as FQ, FluentRelation as FR } from 'imhotep-dsl' * - If the node has a `type` property, it's in grammar.ts shape and needs conversion. */ function adaptGrammarFormulaToLogicAst(node: any): FormulaNode { - // Already in logic-ast.ts shape — pass through if (node && typeof node === 'object' && 'kind' in node) { - return node as FormulaNode + const kind = node.kind + if (kind === 'forall' || kind === 'exists' || kind === 'and' || kind === 'or' || + kind === 'not' || kind === 'implies' || kind === 'predicate') { + return node as FormulaNode + } + throw new TypeError(`Unknown formula kind: ${kind}`) } - // Not an object or null — cannot adapt if (!node || typeof node !== 'object') { throw new TypeError('Cannot adapt non-object formula node') } diff --git a/packages/imhotep-solver/src/predicates.ts b/packages/imhotep-solver/src/predicates.ts index d816f6c..6a8e306 100644 --- a/packages/imhotep-solver/src/predicates.ts +++ b/packages/imhotep-solver/src/predicates.ts @@ -134,7 +134,7 @@ export class PredicateRegistry { } } -// Global default instance for backward compatibility. +/** @deprecated Use explicit PredicateRegistry injection via LogicEngineOptions.predicateRegistry. */ export const globalPredicateRegistry = new PredicateRegistry(); export function registerPredicate(evaluator: PredicateEvaluator): void { diff --git a/packages/imhotep-solver/src/registry.ts b/packages/imhotep-solver/src/registry.ts index b52c196..dc0adc2 100644 --- a/packages/imhotep-solver/src/registry.ts +++ b/packages/imhotep-solver/src/registry.ts @@ -267,7 +267,7 @@ export class ClauseRegistry { } } -// Global default instance for backward compatibility. +/** @deprecated Use explicit ClauseRegistry injection via EvaluationOptions.registry. */ export const globalClauseRegistry = new ClauseRegistry(); /** Register a clause family so the engine can route evaluation. */