8ac69254d4
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.