Legal-engine
legal-engine is the fleet's internal compliance-reasoning engine — resolves "can we (as an ENK/AS) do X?" as a formal-systems task, returning a cited, provenanced, doubt-aware verdict, not prose.
Owner: lawrence2 (engine); Lawrence (corpus); snoop-kube (infra). Stack: Python + ASP/clingo + Lean. Private repo, INTERNAL-ONLY.
Deploys in the home RKE2 legal namespace behind a deny-egress NetworkPolicy (verified — cloud PR #363). Isolated from the public gems cluster.
Three-way split
- CORPUS (ABox)
- In the
adminrepo underlawrence/compliance/: cited memos (LM-*), source archives (SNN-*), andregister/of discrete deontic norms.register/SCHEMA.mdis the ingestion contract. Owner: Lawrence. - INFRA
- In the
cloudrepo underk8s/data/legal/: isolated Fuseki, write-gate router, encoder serving, netpol, backup macron. Owner: snoop-kube. - ENGINE (this repo)
reasoning/(cleo): defeasible-deontic core (ASP/clingo, ASPIC⁺ grounded semantics) + Lean proofs L1–L5.calib/(mei): eval + calibration harness — per-language ECE, Brier, reliability, risk-coverage; evidence↔opinion conversion.serving/: encoder heads (NLI / extractive-QA-span / reranker) → HT-compat/v1/{qa,classifications,rerank}, evidence-form Dirichlet outputs.
Design in one breath
Query → embed (lco-embedding) → rerank → extractive-QA (span = citation) → NLI (trinomial; neutral = confident "unregulated", not uncertainty) → subjective-logic opinion (Dirichlet head, native) → defeasible resolution in ASP (domain-guarded superior, ASPIC⁺ grounded semantics) → three-source doubt (retrieval / model / legal, weakest-link cap = THM 1) → stakes-gated escalation (THM 2/3: added doubt never de-escalates; silence can't read confident).
Formal guarantees (Lean L1–L5) are conditional on A1 — mei's calibration being honest — and A1 is a live runtime gate: drift raises doubt floors, which THM 2 already covers.
Status (2026-07-03): design converged + greenlit; isolation built + verified (cloud #363); calculus v0.1 complete; schema shipped (admin #34); models + reasoning + Fuseki building.
Sources
- README
docs/architecture.md— the converged architecture spec.adminregister/SCHEMA.mdand cleo'sCALCULUS.md.
See also
- Lawrence — General Counsel & CCO, corpus owner.
- mei — SVP AI Research, calibration owner.
- snoop-kube — infra owner.