- Rust 49.6%
- TypeScript 14.3%
- Vue 12.7%
- JavaScript 11.5%
- Gherkin 5.9%
- Other 6%
* feat(engine): hooks, overrides en procedures uit de versie die op de peildatum geldt De indexen van hooks, overrides en procedures omvatten elke geladen versie van een regelwerk. Bij gebruik toetst de engine of de versie die op de peildatum geldt de declaratie heeft: een hook of override die een latere versie laat vallen geldt nog op de data daarvoor, en een die een latere versie toevoegt niet. Een hernummerde hook of override geldt onder het nummer van zijn eigen versie. find_procedure en find_procedure_reported krijgen een reference_date. ProcedureMiss verliest DefaultDangling en krijgt NotInForce; procedure_of maakt daar een ResolutionError van. DeclarationsFromOtherVersion en het veld declaration_version_notes op het resultaat en de receipt vervallen. overrides_on_date filtert alleen een hernummering uit de notities van overrides die niet gelden; een tweede artikel van dezelfde wet dat dezelfde output overschrijft blijft als notitie staan. Uit #2051. Werkpakket: referentie-casus-i * fix(engine): een hook of override zonder artikel in de geldende versie bestaat op die datum niet Ontbreekt het artikel van een hook of override in de versie die op de peildatum geldt, dan bestaat de declaratie op die datum niet: vervallen, hernummerd of nog niet ingevoegd maakt geen verschil. De engine laat haar stil vallen, zonder DeclarationNotInForce. Alleen als het regelwerk op de datum helemaal geen versie heeft, blijft de melding staan. still_declared geeft false voor een ontbrekend artikel; fireable_hooks en overrides_on_date slaan het stil over. De filter in overrides_on_date die hernummeringen probeerde te herkennen vervalt, net als article_missing_from_version. De implements-index (offered_candidate) blijft ongewijzigd: die komt op main nog uit de nieuwste versie, en daar kan een ontbrekend artikel een hernummering zijn die de index mist. Tests op fictieve fixtures: een hernummerde, een vervallen en een hook zonder geldende versie, en hetzelfde voor overrides. Werkpakket: referentie-casus-i * fix(engine): reviewpunten op de versie-indexen - De fout bij een benoemde procedure zegt dat geen wet die op de datum geldt haar definieert, in plaats van geen geladen wet. - Commentaar bij hooks_firing_on en DeclarationKind volgt het gedrag. - De test op een procedurewet zonder geldende versie toetst de reden. - Fictieve teksten zeggen alleen "in afwijking" waar de versie de override declareert. - temporal-and-dates.md onderscheidt een standaardprocedure van een benoemde. - Test: een hook met twee filters wordt één keer gemeld als zijn wet op de datum geen versie heeft. Werkpakket: referentie-casus-i * test(engine): een ander artikel met hetzelfde nummer is niet het gefaseerde (mutant) De test op een hernummerde hook bij een gefaseerde aanvraag laadt nu ook een wet zonder geldende versie met een hook op de aanvraag. In de fase BESLUIT wachten de hooks van de aanvraag zelf, maar die van het register, een ander artikel 1 dat ook een AANVRAAG vestigt, worden geprobeerd: de melding staat er dus ook. Dat doodt de mutant op `staged` in fireable_hooks. Werkpakket: referentie-casus-i * test(engine): een hook die een latere versie toevoegt vuurt pas vanaf die versie Spiegeltest naast die voor een hook die een latere versie laat vallen. Een fictieve hook-wet zonder hook in de versie van 2021 en met een hook op BESCHIKKING in die van 2026: op 2025-06-01 vuurt hij niet en staat er geen melding in `declarations_not_in_force`, op 2026-06-01 vuurt hij wel. Werkpakket: referentie-casus-i |
||
|---|---|---|
| .claude | ||
| .github | ||
| bdd | ||
| conformance | ||
| corpus | ||
| corpus-poc | ||
| deploy/nginx | ||
| dev | ||
| docs | ||
| frontend | ||
| frontend-demo | ||
| frontend-lawmaking | ||
| frontend-poc-napp | ||
| frontend-poc-nieuwkomersbekostiging | ||
| frontend-poc-portal | ||
| frontend-poc-regels-op-een-plek | ||
| frontend-poc-terugbetaalregimes | ||
| frontend-poc-wetsgeschiedenis | ||
| LICENSES | ||
| packages | ||
| pocs | ||
| schema | ||
| script | ||
| tests/fixtures/federation | ||
| .dockerignore | ||
| .env.example | ||
| .env.poc.example | ||
| .env.sso-local.example | ||
| .gitignore | ||
| .npmrc | ||
| .pre-commit-config.yaml | ||
| .yamllint | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| CONTRIBUTING.md | ||
| corpus-registry.yaml | ||
| deny.toml | ||
| docker-compose.dev.yml | ||
| Justfile | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| publiccode.yml | ||
| README.md | ||
| REUSE.toml | ||
| REVIEW.md | ||
| rust-toolchain.toml | ||
regelrecht
Machine-readable Dutch law execution. regelrecht takes legal texts, encodes them as structured YAML, and runs them as deterministic decision logic.
What does it do
- The engine takes a regulation and a set of inputs, evaluates the decision logic, and returns a result with a full explanation trail
- Laws are tested against real-world scenarios using BDD (Gherkin) tests, many derived from legislative explanatory memoranda. The vocabulary those scenarios speak lives in
bdd/grammar.yamland every engine's step bindings are generated from it - A harvester downloads and tracks Dutch legislation from the official BWB repository
- Regulations can be edited through a web UI with live execution preview
Components
Rust packages
| Package | Description |
|---|---|
| packages/engine/ | Law execution engine (also compiles to WASM) |
| packages/law-model/ | The Rust representation of the law format, conforming to schema/ |
| packages/harvester/ | Downloads Dutch legislation from BWB |
| packages/pipeline/ | PostgreSQL job queue for law processing |
| packages/admin/ | Harvester-admin API; its dashboard UI lives in the editor |
| packages/editor-api/ | Backend API for the law editor |
| packages/corpus/ | Git integration for the regulation corpus |
| packages/auth/ | Shared OIDC/SSO authentication |
| packages/github/ | Shared GitHub REST client |
| packages/shared/ | Shared domain types across crates |
| packages/arch-extract/ | Derives the architecture model from the code (just arch-explore) |
| packages/tui/ | Terminal dashboard (Ratatui) |
Frontends and sites
| Directory | Description |
|---|---|
| frontend/ | Law editor UI (Vue 3 + Vite) |
| frontend-lawmaking/ | Law-making process visualization (Vue 3 + Vite) |
| packages/frontend-shared/ | Shared frontend primitives (auth, colour scheme, API fetch) |
| docs/ | Astro site: landing page + documentation |
Data and testing
| Directory | Description |
|---|---|
| corpus/regulation/ | A working set of real ruleworks |
| schema/ | Versioned JSON schema for the law format (schema/latest points at the current version) |
| bdd/ | The Gherkin vocabulary (grammar.yaml) and the engine-conformance suite, with its fictional test_* ruleworks in bdd/conformance/fixtures/ |
corpus/regulation/**/scenarios/ |
Law-validation scenarios, next to the law they test |
| packages/grafana/ | Grafana monitoring dashboards (provisioning, not a crate) |
The full corpus lives elsewhere
corpus/regulation/ in this repo holds a couple of dozen laws: the ones the
BDD scenarios run against. The fictional test_* ruleworks of the
conformance suite sit elsewhere, in bdd/conformance/fixtures/. The harvested
body of Dutch legislation is far too large to carry here and lives in its own
repository:
MinBZK/regelrecht-corpus — currently some 22,000 YAML files under regulation/nl.
Which branch you want depends on what you are after:
| Branch | What is on it |
|---|---|
development |
The working branch, and what corpus-registry.yaml points this repo at. Harvested laws land here first |
main |
Only moves when development is merged into it, so it lags |
enrich/* |
Output of the enrichment runs, one branch per enricher (enrich/claude, enrich/opencode) |
Short-lived prN and editor/* branches belong to preview deployments and
editor sessions; they are not meant to be read directly.
Deployed services
| Service | URL |
|---|---|
| Editor | https://editor.regelrecht.rijks.app |
| Landing page | https://regelrecht.rijks.app |
| Documentation | https://docs.regelrecht.rijks.app |
| Law-making | https://lawmaking.regelrecht.rijks.app |
| Harvester admin | https://harvester-admin.regelrecht.rijks.app |
| Grafana | https://grafana.regelrecht.rijks.app |
The pipeline API and the harvester and enrich workers deploy alongside these but have no web UI of their own.
A PR gets a preview environment once it carries the deploy:preview label; taking the label off, or closing the PR, cleans it up again.
Getting started
Prerequisites: Rust (rustup installs the version pinned in
rust-toolchain.toml) and just. The dev stacks
below also need Docker and Node.js, and on x86_64 Linux mold.
just check # everything CI runs (format, lint, build, validate, tests)
just test # every Rust test in the workspace
just test-no-docker # the same, minus the container-backed suites
just bdd # the BDD suites: law scenarios and engine conformance
just test and just check start PostgreSQL containers for the crates that
need one, so they want a Docker daemon. Without one, just test-no-docker
covers everything else. just bdd runs separately: it executes against the real
corpus and is deliberately not part of just test.
Faster builds (recommended)
Run just dev-setup once. It does three things:
- Points every worktree at one shared target dir — a new worktree reuses the already-built dependency graph instead of cold-building ~600 crates.
- Puts that target on fast local storage when the repo lives on a slow mount.
A Rust build writes tens of thousands of small files; on a 9p/NFS/SMB mount
(e.g. a WSL2 or Docker-Desktop dev container where the repo is a Windows
drive) that I/O dominates build time — often more than everything else
combined.
dev-setupdetects this and relocates the target to~/.cache/regelrecht/(local disk). This is usually the single biggest win. - Installs mold +
sccache. mold (wired intopackages/.cargo/config.toml) speeds up linking and is a hard requirement for the dev recipes;sccacheis installed but left off locally.
sccache is disabled locally because it requires CARGO_INCREMENTAL=0 and so
disables incremental compilation, which slows every rebuild after an edit.
Enable it only for cold or flag-varying builds:
export RUSTC_WRAPPER=sccache CARGO_INCREMENTAL=0
CI uses both mold and sccache (see .github/workflows/ci.yml).
Running a dev stack
just dev # editor (7300) + lawmaking (7500), editor-api on 8000, admin API on 8001
just dev editor # just the editor (editor-api + editor UI + DB)
just dev admin # just the admin API + DB
just dev lawmaking # just the lawmaking UI (no backend)
just dev-down # stop it
just dev starts only what the chosen app needs: no Grafana, Prometheus or
workers. The editor runs with real SSO against the central Keycloak, so it
needs .env.sso-local (copy .env.sso-local.example).
Vite ports default to 7300/7500 (overridable via EDITOR_PORT /
LAWMAKING_PORT). When a native backend can't reach Postgres
on localhost (e.g. a WSL2/Docker-Desktop dev container, where Postgres is
published on the Docker host), point it at host.docker.internal: for the
admin API set DB_HOST=host.docker.internal in .env; for the
editor that host comes from DATABASE_URL in .env.sso-local (the
.env.sso-local.example already uses host.docker.internal).
See the docs site for full development instructions.