Files
Imhotep/packages/imhotep-core
John Dvorak 8ac69254d4 feat: fact planning derived from predicate specs with fulfillment tracking
predicate-specs.ts:
  - Add FactCategory enum (geometry, topology, styles, fragments,
    domAncestry, clipping, scroll, visibility, transforms, text)
  - Add FactPlan interface with predicateFacts provenance map and
    per-category fulfillment tracking (fulfilled/failed/approximated/skipped)
  - Add requiredFactToCategory() — centralized mapping from required-fact
    strings to FactCategory values, replacing scattered inline checks
  - Add planRequiredFacts() — builds a complete FactPlan from collected
    predicate facts + AST structural analysis (CssLengthMetrics, domAncestry)
  - Add createEmptyFactPlan() factory

extraction.ts:
  - computeRequiredFacts returns FactPlan (was inline record), uses
    planRequiredFacts from spec infrastructure
  - extractWorld/extractWorldFastGeometry/extractWorldCdp accept FactPlan
    instead of inline requiredFacts record
  - After successful extraction, populate FactPlan.fulfillment with
    per-category 'fulfilled' status, providing a structured audit trail
    of which facts were requested and obtained

Adding a new predicate with new required facts now requires only a
spec entry — the fact planner, extraction engine, and fulfillment
tracker all derive behavior from the spec table automatically.

658 tests pass.
2026-05-22 15:02:20 -07:00
..

imhotep-core

Foundation types and contracts for Imhotep. Defines the AST/IR, geometry world schema, diagnostic taxonomy, pipeline contracts, FOL AST/IR representations, domain/value types, scene target descriptors, property contract/results types, and geometry snapshot caching.

Key Exports

Module Description
types Core type definitions (positions, IDs, results, proofs)
ast Unist-style AST node definitions
ir Semantic IR and execution IR
world Geometry world schema tables
contracts Extractor, solver, compiler, reporter interfaces
diagnostics Diagnostic categories, error codes, traces, shrinking
logic-ast FOL AST types (quantifiers, connectives, predicates)
logic-ir Lowered FOL IR for logic engine
canonical Canonical world adapter for solver
geometry-cache Disk-based extraction caching