7f40224f0f
ast.ts: Add optional compoundOperator and compoundParts fields to RelationAssertion, allowing compound fluent assertions to carry their .and / .or structure through the AST layer. fluent.ts: toAst() now emits compoundOperator/compoundParts when isCompound, closing the gap where compound state was silently dropped in canonical extraction, preset building, and validation. lower-to-canonical.ts: Handle RelationAssertion with compound metadata by lowering each part as a separate grouped clause (same groupId, same compoundOperator), matching DSL parser compound behavior. validator.ts: Validate options on each compound part, closing the false-positive validation gap where only the final relation was checked. 3 lossy code paths (extractCanonicalFromAssertion, presets.toPresetResult, validateRelation) now preserve compound structure. Primary FOL evaluation path was already correct (fol-compiler reads compoundParts directly). 658 tests pass.
imhotep-dsl
Domain-specific language for Imhotep assertions. Provides a fluent assertion API, a dense string-based DSL parser, FOL compilation/validation, canonical lowering, and property-run builders.
Key Exports
| Export | Description |
|---|---|
expect(subject) |
Fluent assertion builder |
spec(src) |
Dense DSL parser (parseSpec alias) |
compile(source) |
Compile DSL to assertion nodes |
compileDenseFOLToFormula(src) |
Compile dense FOL to solver-ready AST |
validateAssertion(node) |
Pre-flight validation without extraction |
lowerToCanonical(nodes) |
Canonical lowering for IR equivalence |
component, enumerate |
Property-run fluent builders |
forAll, exists, predicate, domain |
FOL fluent builders |