The engine’s founding principle is zero built-in domain knowledge (RFC-007): all legal and domain knowledge comes from law YAML files and parameters. The engine provides pure operations (arithmetic, comparison, date math) and a resolution framework. It does not know about Easter, King’s Day, public holidays, tax rates, or government structure.
The engine does need certain knowledge to function that no specific law declares: the regulatory layer hierarchy (constitutional doctrine), territorial scoping dimensions (gemeente_code, provincie_code), type coercion rules (eurocent rounding), and delegation validation rules. This is the meta-knowledge about how to process law, distinct from the law itself. It belongs in configuration, separate from both the corpus where real law lives and the engine binary.
The engine reads its domain knowledge from an Engine Policy file at startup: a YAML configuration file, separate from the corpus, that defines the meta-rules for law execution.
The Engine Policy follows the same layered pattern as the laws it executes:
Override semantics are section-level replacement, not deep merge. If an organization provides regulatory_layers, it replaces the entire hierarchy. If it provides type_coercions, it replaces all coercion rules. Sections not present in the override inherit from the national default.
The extends field references the base policy. The engine loads the base first, then applies overrides.
The active Engine Policy (after overlay resolution) is recorded in the Execution Receipt (RFC-013). A reviewer can see which hierarchy, coercion rules, and scope dimensions were active for any given decision.
The policy hash is a content hash of the resolved (post-overlay) policy. Combined with the engine version and regulation hashes already in the receipt, this completes the reproducibility chain.
Pure operations stay in the engine. The line is:
Date arithmetic (RFC-007) stays in the engine. The clamping rule (Jan 31 + 1 month = Feb 28) is standard calendar math confirmed by the Hoge Raad (HR 1 September 2017, ECLI:NL:HR:2017:2225). Age calculation stays. Day-of-week numbering stays (ISO 8601). These are the same in any jurisdiction.
The engine binary contains no Dutch legal knowledge. Everything comes from law YAML or policy YAML.
The policy is in the Execution Receipt, so an auditor can see which hierarchy and scoping rules were active for any decision. Policy changes are tracked in version control like any other configuration.
Organizations can customize without forking. A water board can add waterschap_code as a scope dimension. A test harness might use a simplified hierarchy, and a non-Dutch deployment would replace the policy entirely.
The engine must validate the policy at startup. Malformed policies (circular delegation rules, unknown coercion types) must fail fast.
Adding new policy sections requires schema versioning, same as the regulation schema.
Section-level replacement is coarse. An organization that wants to add one scope dimension must repeat all existing dimensions. Fine-grained merge would create ambiguity about the effective policy, so we accept the repetition.
Policy lookups (layer rank, scope matching) must be fast. The current hardcoded match statements are O(1). Policy-driven lookups should use pre-built HashMaps at startup, not YAML traversal at runtime.
Alternative 1: Keep domain knowledge in Rust, document it thoroughly
Alternative 2: Express domain knowledge as law YAML in the corpus
Alternative 3: Rust configuration file (TOML/JSON) without overlay
Alternative 4: Deep merge for overrides
type_coercion entry, does it append or replace? Section-level replacement is explicit and predictable.Phase 1: Extract and externalize
engine-policy/v1/schema.json for policy validationengine-policy/default.yaml with current hardcoded valuespriority.rs:layer_rank() with policy-driven lookupresolver.rs:matches_scope() hardcoded gemeente_code with policy-driven scope dimensionsservice.rs eurocent rounding with policy-driven type coercionservice.rs delegation type validation with policy-driven rulesPhase 2: Organization overlay
extends mechanism for policy overlayLawExecutionService configuration--policy <path> (defaults to built-in national policy)Phase 3: Policy in CI
An exploration by Bureau Architectuur of the Dutch Ministry of the Interior into the possibilities of transparent, executable legislation.
Bureau Architectuur
Ministry of the Interior and Kingdom Relations