Technical product brief · Digital Democracy / Digi-LAW

Make public rules inspectable before AI touches the answer.

Digi-LAW is building machine-readable legal and public-decision infrastructure: deterministic rule evaluation, traceable evidence, and human review for public processes.

Core: implemented & testedEvidence pipeline: stabilizingUpdated August 2026

Digital Democracy is developing an open, machine-readable foundation for legal and public decisions. Instead of hiding the decision logic inside an AI prompt, it represents requirements, exceptions, and conclusions as versioned JSON/YAML rulegraphs, evaluates structured facts deterministically, and shows the reasoning trace and missing evidence.

The legal result does not come from an LLM

The core evaluator works with explicit rules—including ALL, ANY, XOR, and exception logic—and returns TRUE, FALSE, or UNKNOWN. Every result can include an ordered trace of the rule path and the evidence still needed to make a determination.

01Public ruleRequirements, exceptions, and legal definitions become structured rulemaps.
02Versioned rulegraphJSON/YAML models can be validated, compared, and connected to provisions.
03Structured factsFacts and evidence are treated separately from the rule that evaluates them.
04Deterministic resultThe engine returns true, false, or unknown—not a plausible-sounding guess.
05Explainable reviewUsers see the reasoning path, missing evidence, provenance, and reviewer decisions.

The product principle: AI may eventually help extract or suggest information, but it must remain an assistance layer around rules, evidence, and accountable human review.

What is being engineered now

Rulegraph engine

The core legal-evaluation engine, versioned legal models, provenance, and reasoning traces are implemented and tested with examples including BGB §823 and building-permit rulemaps.

Analysis workspace

A Next.js/React/ReactFlow workspace visualizes rules, facts, missing evidence, and evaluation paths, with Facts, Analysis, and Evaluation views.

Document and evidence pipeline

PDF extraction preserves page-level text spans and records failures explicitly. A deterministic candidate layer can group potential meaningful information without prematurely declaring it true.

Locked case exports and review controls

Cases can be finalized as locked exports so the reviewed record is preserved against silent modification. Pseudonymisation, ownership boundaries, evidence hypotheses, and append-only reviewer decisions support the wider auditable workflow.

A different open-source direction

The intent is not to publish private case material or operational secrets. The more defensible path is to extract the reusable machinery: rulegraph-core, schemas, sample rulemaps, and the documented evaluation trace.

That creates an inspectable public layer for how rules are represented and evaluated, while documents, authentication, reversible identity mappings, case data, and encryption keys remain protected.

Current development boundaries

OCR, batch analysis, no-code rule authoring, broader report generation beyond the existing locked case exports, and self-hosted open-source models are future work. The document, evidence, and pseudonymisation pipeline is under active stabilization.

Technology and delivery

Digi-LAW is primarily a TypeScript/Node.js monorepo with a Next.js/React web interface and a Fastify backend. It is built around structured legal models, PostgreSQL persistence, containerized delivery, and a traceable deployment path from Git commit to immutable production image.

Rules & evaluationTypeScript · JSON/YAML rulemaps · deterministic traces
ApplicationNext.js · React · ReactFlow · Fastify
Data & documentsPostgreSQL · pdfjs-dist · pdf-parse · PDF/DOCX output
DeliveryDocker · Caddy · MinIO · Mailgun · GitHub Actions/GHCR · Hetzner

Deployment failure changed the security model

The original server deployment failed shortly after provisioning when the host was compromised and the hosting account was blocked. Recovery involved investigating the likely failure path, rebuilding the deployment, configuring a firewall, tightening server and access controls, and treating release verification as a security task rather than a final upload.

Signup and transactional email through Mailgun, secrets handling, access boundaries, auditability, change traceability, backups, and incident response are now part of the delivery model. The work draws on control patterns associated with SOC 1- and SOC 2-oriented operations.

Related research: Why legal decision engines should return TRUE, FALSE, or UNKNOWN →

Explore Digital Democracy

Transparent process records for grants, laws, and permits.

Visit Digital Democracy ↗