Code for the RegelRecht Fieldlab 2026 application
  • Rust 49.2%
  • TypeScript 15.2%
  • Vue 12.6%
  • JavaScript 10.6%
  • Gherkin 5.6%
  • Other 6.7%
Find a file
2026-11-26 16:54:58 +00:00
.claude build(deps): ontwerpsysteem @nldd/design-system naar 0.29.0 2026-11-24 13:52:56 +01:00
.forgejo ci: plugin controleert gegenereerde CRD's, wizarduitvoer en env-variabelen van de chart (#35) 2026-11-25 08:46:16 +00:00
.github refactor: wetsproces heet voortaan RegelHet 2026-11-24 10:51:18 +01:00
bdd test: testfuncties heten naar het construct en lezen het live corpus niet meer voor casuswaarden (#2058) 2026-11-20 08:10:15 +00:00
charts chore(dev): regelhet-image eb77cdff in de chart [skip ci] 2026-11-26 16:54:58 +00:00
conformance feat(engine): een invulling van een haakbegrip kan het herkomstartikel noemen, en een invulling zonder herkomst telt weer (#2028) 2026-11-19 09:37:15 +00:00
corpus feat: individuele inkomenstoeslag Groningen als eigen casus van het wetsprocessysteem (#15) 2026-11-23 18:00:44 +00:00
corpus-poc feat: wetsgeschiedenis als poc, Kamerstukken afspelen en een wet ophalen (#1747) 2026-11-19 17:20:40 +00:00
deploy/nginx chore(dev): eigen uitrol van wetsproces weg ten gunste van de helm-chart 2026-11-23 12:05:55 +01:00
dev refactor(dev): fold dev-frontend into just dev, drop the backend-only stack (#1667) 2026-10-02 11:19:09 +00:00
docs feat(frontend): "Waarop het besluit rust" ingeklapt in een sheet, "Op grond van" blijft zichtbaar (#63) 2026-11-26 16:48:13 +00:00
frontend build(deps): ontwerpsysteem @nldd/design-system naar 0.29.0 2026-11-24 13:52:56 +01:00
frontend-demo build(deps): ontwerpsysteem @nldd/design-system naar 0.29.0 2026-11-24 13:52:56 +01:00
frontend-lawmaking build(deps): ontwerpsysteem @nldd/design-system naar 0.29.0 2026-11-24 13:52:56 +01:00
frontend-poc-napp build(deps): ontwerpsysteem @nldd/design-system naar 0.29.0 2026-11-24 13:52:56 +01:00
frontend-poc-nieuwkomersbekostiging build(deps): ontwerpsysteem @nldd/design-system naar 0.29.0 2026-11-24 13:52:56 +01:00
frontend-poc-portal build(deps): ontwerpsysteem @nldd/design-system naar 0.29.0 2026-11-24 13:52:56 +01:00
frontend-poc-regels-op-een-plek build(deps): ontwerpsysteem @nldd/design-system naar 0.29.0 2026-11-24 13:52:56 +01:00
frontend-poc-terugbetaalregimes build(deps): ontwerpsysteem @nldd/design-system naar 0.29.0 2026-11-24 13:52:56 +01:00
frontend-poc-wetsgeschiedenis build(deps): ontwerpsysteem @nldd/design-system naar 0.29.0 2026-11-24 13:52:56 +01:00
frontend-regelhet feat(frontend): "Waarop het besluit rust" ingeklapt in een sheet, "Op grond van" blijft zichtbaar (#63) 2026-11-26 16:48:13 +00:00
LICENSES feat(docs): jurix-paper over uitleg aan burgers als research-paper (#1736) 2026-10-16 15:18:27 +00:00
packages test: een casus zonder eigen inlog houdt dezelfde formulieren (#65) 2026-11-26 16:48:09 +00:00
pocs feat: de leervraag van de poc gaat over regelrecht, niet over het dso (#2047) 2026-11-19 20:45:48 +00:00
schema feat(engine): een invulling van een haakbegrip kan het herkomstartikel noemen, en een invulling zonder herkomst telt weer (#2028) 2026-11-19 09:37:15 +00:00
script feat(frontend): burgerapp in de browser die via FSC voor Burgers met elk RegelHet praat en lokaal voorspelt (#42) 2026-11-24 21:28:21 +00:00
tests/fixtures/federation feat(schema): v0.5.0 operation set with engine, corpus migration, and WOO (#312) 2026-03-30 21:59:09 +02:00
.dockerignore refactor(lawmaking): de app in TypeScript, opgezet zoals create-vue (#1757) 2026-10-21 08:04:10 +00:00
.env.example feat: verrijken kan ook met VLAM, via de ZAD-dienst vlam (#1879) 2026-11-03 08:30:50 +00:00
.env.poc.example refactor: de poc-app heet chronolexografie (#1742) 2026-10-19 09:39:34 +00:00
.env.sso-local.example fix(editor): allow Safari for local SSO dev (#782) 2026-06-10 14:26:11 +02:00
.gitignore feat: poc regels op een plek, met de gegevens uit een afgeschermde bron (#2023) 2026-11-19 14:16:45 +00:00
.npmrc refactor(frontend): extract shared auth/color-scheme/fetch package (#860) 2026-06-26 14:04:30 +02:00
.pre-commit-config.yaml ci: plugin controleert gegenereerde CRD's, wizarduitvoer en env-variabelen van de chart (#35) 2026-11-25 08:46:16 +00:00
.yamllint feat: Fundament-plugin v0.2 biedt wetsprocessen aan per project, met een wizard in de console (#11) 2026-11-23 15:13:21 +00:00
AGENTS.md chore(dev): eigen uitrol van wetsproces weg ten gunste van de helm-chart 2026-11-23 12:05:55 +01:00
CLAUDE.md chore(dev): instructies voor agents staan in AGENTS.md (#1541) 2026-09-23 12:03:48 +00:00
CONTRIBUTING.md feat(docs): werkpakketten krijgen een slug, en elke pull request noemt er een (#1485) 2026-09-17 15:07:43 +02:00
corpus-registry.yaml feat(editor): corpus juris zonder account, en zoeken dat de bronnen langsgaat (#1786) 2026-11-09 08:42:07 +00:00
deny.toml feat(editor): notities inchecken via PR (federated schrijfpad) (#652) 2026-05-19 21:27:24 +02:00
docker-compose.dev.yml feat: verrijken kan ook met VLAM, via de ZAD-dienst vlam (#1879) 2026-11-03 08:30:50 +00:00
Justfile feat: regelrecht-regelhet check zegt zonder server of een casus start (#27) 2026-11-25 08:45:52 +00:00
LICENSE Add license 2025-11-10 14:14:42 +01:00
package-lock.json feat(frontend): burgerapp in de browser die via FSC voor Burgers met elk RegelHet praat en lokaal voorspelt (#42) 2026-11-24 21:28:21 +00:00
package.json refactor: wetsproces heet voortaan RegelHet 2026-11-24 10:51:18 +01:00
publiccode.yml feat(demo): de demo en de rondleiding in het Frans (#1842) 2026-10-28 17:45:34 +00:00
README.md build: alle crates naar rust edition 2024 (#1928) 2026-11-10 12:07:22 +00:00
REUSE.toml feat(frontend): burgerapp in de browser die via FSC voor Burgers met elk RegelHet praat en lokaal voorspelt (#42) 2026-11-24 21:28:21 +00:00
REVIEW.md test: guard tegen tests die nergens in CI draaien (#1884) 2026-11-03 15:40:34 +00:00
rust-toolchain.toml chore(ci): consolidate pipeline Dockerfiles, align Rust base images, matrix twin CI jobs (#793) 2026-06-15 10:59:32 +02:00

regelrecht

CI License: EUPL-1.2 Rust 2024 Mutation Testing Docs

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.yaml and 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 ruleworks, some of them synthetic (test_*)
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
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 tests and BDD scenarios run against, plus synthetic test_* laws for the conformance suite. 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.

Run just dev-setup once. It does three things:

  1. Points every worktree at one shared target dir — a new worktree reuses the already-built dependency graph instead of cold-building ~600 crates.
  2. 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-setup detects this and relocates the target to ~/.cache/regelrecht/ (local disk). This is usually the single biggest win.
  3. Installs mold + sccache. mold (wired into packages/.cargo/config.toml) speeds up linking and is a hard requirement for the dev recipes; sccache is 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.

License

EUPL-1.2