• Rust 65.3%
  • JavaScript 16.4%
  • Vue 13.8%
  • Gherkin 2.2%
  • Python 0.7%
  • Other 1.5%
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tim de Jager 922ad1b306
fix(pipeline): reap zombie git children and add resource-exhaustion breaker (#763)
* fix(pipeline): reap zombie git children and add resource-exhaustion breaker

The harvest worker runs as PID 1 with no init, so git's reparented
grandchildren (merge-base, git-remote-https, the askpass helper)
accumulate as zombies against the container's low pids limit until
fork() fails with EAGAIN ("cannot fork() ... Resource temporarily
unavailable"). The single-threaded worker then fast-failed every queued
job for ~21h without recovering, because nothing restarted the degraded
process.

- Run tini as PID 1 in the harvester- and enrich-worker images so
  reparented child processes are reaped instead of leaking. The enrich
  worker kills the LLM CLI on timeout, which orphans its children, so it
  needs reaping too.
- Add a resource-exhaustion circuit breaker to both worker loops:
  classify fork()/EAGAIN/OOM errors as environmental, and after
  WORKER_MAX_CONSECUTIVE_RESOURCE_FAILURES (default 5) consecutive such
  failures exit the process so the orchestrator restarts the worker with
  a clean process table — the only thing that clears the condition.
  Failed jobs still go through the normal failure/requeue path so law
  status is reset and nothing is left dangling.

* fix(pipeline): feed breaker outcome when harvest fail_job errors

Address ralph review finding: the harvest failure path used `?` on
fail_job, so an error while recording the failure dropped the computed
resource-exhaustion outcome and the breaker never saw it. Match on
fail_job instead and return the outcome on error, matching how the
enrich paths already handle it.

* docs(pipeline): clarify non-resource fail_job path in harvest breaker comment

Note that a non-resource fail_job error returns Processed (not Err) on
purpose, and why that can't tight-loop. Comment-only.
2026-06-06 21:07:47 +02:00
.claude chore: nldd design-system plugin inschakelen voor de repo (#741) 2026-06-03 19:47:05 +00:00
.github feat(dev): local SSO login against a Keycloak realm (#737) 2026-06-03 12:16:40 +02:00
conformance/v0.5.0 docs: rfc-014 engine conformance test suite (#434) 2026-04-03 17:37:57 +00:00
corpus docs: koppel RFC-kruisverwijzingen en herstel inconsistenties (#722) 2026-05-29 20:25:22 +00:00
dev feat(dev): local dev stack with hot reload (#274) 2026-03-18 16:40:42 +01:00
docs feat(frontend): read-only Traject-info sheet from the traject dropdown (#760) 2026-06-05 15:56:33 +02:00
features feat(ci): validate-annotations in just check + ambiguïteit-use-case (RFC-018 Fase 6) (#651) 2026-05-19 09:47:15 +02:00
frontend fix(editor): stop scenario dependency-scan request storm + un-gate result buttons (#762) 2026-06-06 18:22:04 +02:00
frontend-lawmaking fix(frontend): use design-system fonts instead of hardcoded OS fonts (#761) 2026-06-06 17:15:44 +02:00
packages fix(pipeline): reap zombie git children and add resource-exhaustion breaker (#763) 2026-06-06 21:07:47 +02:00
schema feat(engine): add TextQuoteSelector note resolver, schema and WASM (#634) 2026-05-18 14:38:15 +02:00
script feat(engine): add TextQuoteSelector note resolver, schema and WASM (#634) 2026-05-18 14:38:15 +02: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 feat(editor): notities inchecken via PR (federated schrijfpad) (#652) 2026-05-19 21:27:24 +02:00
.env.example feat(admin): migrate to @nldd/design-system and refresh jobs UI 2026-05-12 23:41:35 +02:00
.env.sso-local.example chore(dev): rename local SSO env to .env.sso-local; drop dev/keycloak ignore (#738) 2026-06-03 13:32:26 +02:00
.gitignore chore(dev): rename local SSO env to .env.sso-local; drop dev/keycloak ignore (#738) 2026-06-03 13:32:26 +02:00
.pre-commit-config.yaml ci: add conventional commit message linting to pre-commit (#435) 2026-04-03 16:45:24 +02:00
.yamllint chore: remove beads issue tracker (#131) 2026-02-18 20:44:44 +01:00
CLAUDE.md docs(claude): UI moet met MinBZK design-system componenten gebouwd worden (#733) 2026-06-02 15:40:09 +02:00
corpus-registry.yaml feat(editor-api): fetch only favorite laws from GitHub sources (#335) 2026-03-24 17:59:33 +01: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(admin): migrate to @nldd/design-system and refresh jobs UI 2026-05-12 23:41:35 +02:00
Justfile chore(dev): rename local SSO env to .env.sso-local; drop dev/keycloak ignore (#738) 2026-06-03 13:32:26 +02:00
LICENSE Add license 2025-11-10 14:14:42 +01:00
README.md docs: volledige correctiepass over documentatie (rendering, links, code-conformiteit, taal) (#723) 2026-05-30 10:12:14 +02:00
REVIEW.md chore: repo rename regelrecht-mvp → regelrecht (#339) 2026-03-26 11:12:44 +01:00
rust-toolchain.toml feat(engine): implement execution provenance (RFC-013) (#433) 2026-04-03 16:46:49 +00:00

regelrecht

CI License: EUPL-1.2 Rust 2021 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
  • 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/harvester/ Downloads Dutch legislation from BWB
packages/pipeline/ PostgreSQL job queue for law processing
packages/admin/ Admin dashboard API (Axum)
packages/editor-api/ Backend API for the law editor
packages/corpus/ Git integration for the regulation corpus
packages/shared/ Shared domain types across crates
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)
docs/ Astro site: landing page + documentation

Data and testing

Directory Description
corpus/regulation/ Dutch regulations in machine-readable YAML
schema/ Versioned JSON schema for the law format (current: v0.5.2)
features/ Gherkin BDD scenarios for law execution
packages/grafana/ Grafana monitoring dashboards

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

PR preview environments are deployed automatically and cleaned up when the PR is closed.

Getting started

Prerequisites: Rust (stable) and just.

just check    # run all quality checks (format, lint, build, validate, tests)
just test     # unit tests only
just bdd      # BDD tests only

See the docs site for full development instructions.

License

EUPL-1.2