Feature: Fact Extractors
Purpose
A rule is only as good as its facts. The extractors read project artifacts and emit the registry’s fact types, so the check workflow can run the compiled rule sets against real files. The engine stays generic; the extractor is the frontier.
Requirements
EXTRACTOR-R001—scripts/site-facts.mjsmust emit, per file, the file facts and anentitieslist whose first entry is thefilefact.EXTRACTOR-R002— The task extractor must readprompts/tasks/*.mdand emittask,task_section,task_op_line,task_file_row,task_verify,task_feature, andtask_acceptancefacts.EXTRACTOR-R003— The feature extractor must readprompts/features/*.mdand emitfeature,feature_section,requirement, andfeature_dependencyfacts.EXTRACTOR-R004— The test extractor must readtests/*.shand emit atestfact with its declared tier and whether the tier is one the workflow defines.EXTRACTOR-R005— Every emitted type must be registered indataflow.in/object-model.json; an unregistered type is a defect.EXTRACTOR-R006— The extractors must be read-only and deterministic: the same tree yields the same facts.
Behavior
make studiobuilds the facts intodataflow.out/studio/browser/files.json.- The studio’s check panel runs the selected rule set against the selected file’s
entities. tests/26-browser-demo.test.mjsasserts the task and feature extraction and that the conforming files produce no finding.
Dependencies
04-browser-demo.md— the check panel consumes the facts.03-rules-engine.md— the engine evaluates them.