Context
PR feat/milieurecht introduces corpus/context/ — a directory for domain knowledge that is not law but needed to execute law. Currently it contains:
nl/calendar/ — Dutch public holiday dates per year (2020-2035)
nl/hooks/ — Hook registers for cross-cutting laws (ATW, AWB)
The BDD test harness reads these files directly. The engine does not load them yet.
What needs to happen
The engine should load corpus/context/ at startup alongside corpus/regulation/, making context data available during law execution. This enables:
-
Automatic calendar injection: When the Termijnenwet hook fires, the engine can automatically look up holiday dates from the calendar files instead of requiring the caller to pass all 9 dates as parameters.
-
Hook register validation: The engine can validate that hooks declared in law YAML files match the hook register, catching configuration errors early.
-
Context-aware execution: Future context data (institutional structure, scope dimensions) can be loaded the same way.
Design considerations
- Context files have different schemas than regulation files — need a separate
ContextData struct, not ArticleBasedLaw
- Add
context_base_path() alongside regulation_base_path() (already added in BDD test common)
- Calendar data is keyed by year — engine needs to resolve the correct year from the execution date
- Hook registers are informational — engine may validate against them but they don't drive execution (the hooks in the law YAML do)
References
- RFC-015: Engine Policy (describes the three-way split: regulation / context / engine-policy)
corpus/context/README.md for full explanation
Context
PR feat/milieurecht introduces
corpus/context/— a directory for domain knowledge that is not law but needed to execute law. Currently it contains:nl/calendar/— Dutch public holiday dates per year (2020-2035)nl/hooks/— Hook registers for cross-cutting laws (ATW, AWB)The BDD test harness reads these files directly. The engine does not load them yet.
What needs to happen
The engine should load
corpus/context/at startup alongsidecorpus/regulation/, making context data available during law execution. This enables:Automatic calendar injection: When the Termijnenwet hook fires, the engine can automatically look up holiday dates from the calendar files instead of requiring the caller to pass all 9 dates as parameters.
Hook register validation: The engine can validate that hooks declared in law YAML files match the hook register, catching configuration errors early.
Context-aware execution: Future context data (institutional structure, scope dimensions) can be loaded the same way.
Design considerations
ContextDatastruct, notArticleBasedLawcontext_base_path()alongsideregulation_base_path()(already added in BDD test common)References
corpus/context/README.mdfor full explanation