How the engine selects the law version in force on a date, how hooks, overrides and procedures follow that version, how it reports references to expired laws, and how dates are compared and subtracted.
A calculation always happens as of a date. The rules and amounts in force on 15 June 2024 are not the ones in force on 15 June 2025, and a faithful answer uses the version that applied on the day in question. Two mechanisms make this work: version selection by date, and date operations inside the rules.
A law version declares valid_from, and optionally valid_to: the first and last calendar days on which it is in force, both inclusive. The engine selects the version where valid_from <= reference_date <= valid_to, where the reference date is the calculation date supplied by the caller.
valid_to lets a law expire without a successor. A version with valid_to: 2024-12-31 resolves on its last day:
and the day after, it is gone. Selection does not fall through to an older version once the in-force one has ended: an expired law is expired, and its predecessor does not take over. A reference to a law that has ended fails with the concrete dates:
The same applies across a cross-law reference: a law that reads an ended law reports which law ended and when, and does not compute on rules that are no longer valid. The selection outcome is one of in force, not yet in force, or ended on a date (SelectionReason in packages/engine/src/resolver.rs), and both valid_from and valid_to are recorded in the Execution Receipt so the choice is reproducible. The scenarios above come from bdd/conformance/valid_to.feature.
A rulework also declares things that act on other ruleworks: a hook that fires on a decision, an override of another article’s output, a filling of another article’s open term (implements), a procedure with stages. These follow the same calendar as the articles. On a calculation date the engine applies what the version in force on that date declares, in every rulework the calculation passes through. A decision of 2025 under the Awb sees the Awb as it read in 2025.
The engine indexes these declarations for every loaded version and checks the version in force when it uses one (index_declarations_of_every_version in packages/engine/src/resolver.rs). So a declaration that a later version drops still applies on the dates before it, and one that a later version adds does not apply to them:
The scenarios are in bdd/conformance/override_versions.feature.
The corpus holds the Awb from 1 January 2026 on, in one version. The act has applied since 1 January 1994, and the Basiswettenbestand has its text from 1 April 2002, but the corpus has no version from before 2026 yet. A calculation dated before 1 January 2026 therefore finds no Awb in force: its hooks are skipped, and a decision whose procedure the Awb defines is refused, as below.
A hook, override or filling that the version in force does not declare does not exist on that date. Its article may have lapsed, been renumbered or not been inserted yet. The article may also exist but not declare it in that version. The engine does not tell these cases apart and records nothing. A renumbered hook, override or filling applies under the number its own version gives it. When the rulework of a hook, an override or a filling has no version in force on the date at all, whether the declaration applies is not established. The engine then skips it and records why on the Execution Receipt.
A procedure is stricter. When a loaded rulework defines the procedure of a decision, but no rulework that defines it has a version in force on the date, the engine refuses to take the decision: whether the hearing or the objection period applies is then not established. A version in force that defines no default procedure for the legal character is an ordinary answer, and the decision is taken in one go. An article that names a procedure that no version in force defines is refused.
Deadlines and durations need arithmetic on dates. Two routes cover it.
Comparison operators dispatch on operand type. GREATER_THAN, LESS_THAN, LESS_THAN_OR_EQUAL and the rest compare numbers when both operands are numeric, and compare chronologically when both are ISO 8601 dates. So $indieningsdatum <= $peildatum works directly, with no detour through AGE. EQUALS gains a date fallback for the mixed case (a date string against the {iso, year, month, day} object form of referencedate).
DATE_DIFF measures the span between two dates with an explicit unit:
It is signed: positive when to is on or after from, negative otherwise. For a request filed on 2025-01-01 against a peildatum of 2025-07-01, the span is 181 days; flip the two dates and it is -181. Months and years count whole calendar units, reusing the same arithmetic as AGE (BW art. 1:2), so end-of-month and leap-year cases stay consistent: 31 January to 28 February is one whole month, because January has no 31st counterpart in February.
Dates must be in canonical YYYY-MM-DD form, zero-padded. 2025-1-1 is rejected; the engine does not guess. These scenarios come from bdd/conformance/date_operations.feature, and the related operations AGE, DATE_ADD and DATE are specified in the Schema Reference.
Two more operations, added by RFC-032, work on a single date.
DATE_PART reads one calendar component out of a date and returns it as a number:
It is the inverse of DATE, so in ranges over exactly the components DATE takes. The weekday is not one of them and stays DAY_OF_WEEK. The unit is singular here where DATE_DIFF’s is plural, because this reads a component instead of counting units; in: months is an error that names the words it accepts. A month number is only meaningful within one year, so comparing two of them across a year boundary is almost always wrong.
START_OF cuts a date back to 1 January of its year, or to the first day of its month:
Truncation is a named operation and never an implicit property of a date, for the same reason RFC-024 made rounding explicit: the cut belongs in the law where the law prescribes it.
Together they write “de eerste dag van de kalendermaand volgende op”, the figure that runs through the whole of social security law:
Truncate first, add afterwards. In that order the result is exact for every input date, including the first of the month and including 31 January, because the truncated date is day 1 and the end-of-month clamping of DATE_ADD never comes into play. Where the law asks whether something happened after the first of the month, test the day number: a change on the first counts in that month itself.
An exploration into transparent, executable legislation, and one of the three projects in the starting selection of the Nederlandse Digitale Dienst.
GitHub repository
How it works
Demo walkthrough
Stay informed
Roadmap (Dutch)
Documentation
Research
Basiswerk recht (Dutch)
Nederlandse Digitale Dienst
Ministry of Economic Affairs and Climate Policy