ENESCA
PROJECT 017 · Frontier research venture

Civic Compiler

Can society test a rule before living inside it?
Law · Institutional simulation · Verifiable AIAN IDEA BY LLUÍS PALLARÈS · AJL INNOVATION LAB
MOVE TO EXPLORETHE IDEA IN ONE LINEprecedent
01 / PREMISE

The beginning

Civic Compiler begins from an uncomfortable fact: law is one of civilisation's most consequential technologies, yet we usually discover how a new rule behaves only after millions of people and institutions are already living inside it. A statute is written as text, interpreted through precedent, modified by guidance, activated by facts, constrained by rights and transformed by enforcement. I imagine a normative digital twin capable of representing that living system through time. Before a regulation, contract architecture or public programme becomes operational, its authors could compile it into rights, obligations, permissions, exceptions, powers, remedies and unresolved ambiguities; simulate how those elements interact with real institutions and heterogeneous lives; and expose contradictions, unequal burdens and paths to abuse while change is still possible. The ambition is not to turn justice into software. It is to give legal imagination an instrument as serious as the systems it designs.

Legal intelligence is fragmented between documents, jurisdictions, institutions and time. Search retrieves passages but rarely reconstructs which version applied on a particular date, how authorities conflict, whether an exception defeats a general rule or how enforcement changes the law in practice. Large language models can summarise and draft with extraordinary fluency, yet they may fabricate authority, erase minority interpretations and make an uncertain chain of reasoning sound inevitable. Traditional rules engines are precise but brittle: they struggle with open-textured concepts, defeasible rules, proportionality and contested facts. Impact assessments rely on coarse categories and static assumptions, while contracts are reviewed one at a time even when obligations propagate through entire supply networks. The deeper failure is that legal text, operational systems and lived consequences have no shared computational representation. We publish rules, encode fragments into software, and then lose the visible line connecting democratic authority to machine execution.

02 / THE PRODUCT

What it could become

Civic Compiler would be a secure legal-systems studio with five connected layers. The first is a temporal authority graph that ingests legislation, judgments, administrative guidance, contracts and machine-readable standards while preserving source, jurisdiction, hierarchy, validity and amendment history. The second is a normative compiler that translates selected provisions into candidate obligations, permissions, prohibitions, rights, exceptions, evidentiary requirements and remedies—never silently, always as a reviewable interpretation. The third is a population and institutional simulator: synthetic cases and bounded agents explore how a rule behaves across different facts, capabilities, incentives, administrative capacity and adversarial strategies without pretending to predict individual people. The fourth is a verification layer that searches for conflicts, unreachable rights, loopholes, circular duties, discriminatory proxies, missing appeals and divergence between policy intent and executable logic. The fifth produces a signed decision object: a human-readable explanation plus machine-checkable provenance, assumptions, model versions, dissenting interpretations and an explicit path to challenge the result. Users do not receive one answer; they receive a legal possibility space and the smallest real-world experiment capable of resolving its most consequential uncertainty.

For whom

  • Legislatures and ministries drafting consequential rules
  • Regulators translating mandates into operational supervision
  • Courts, ombuds institutions and public-interest legal organisations
  • Companies managing obligations across contracts and jurisdictions
  • Civil-society groups testing distributional and fundamental-rights effects
  • Researchers studying computational law, institutions and democratic accountability

Core capabilities

  • Versioned authority graphs across legislation, precedent, guidance and contracts
  • Neuro-symbolic extraction of rights, duties, exceptions, powers and remedies
  • Temporal and jurisdiction-specific legal reasoning with explicit defeasibility
  • Counterfactual simulation of institutions, enforcement and heterogeneous cases
  • Formal conflict, coverage, loophole and appeal-path analysis
  • Proof-carrying outputs with citations, interpretation paths and dissent
  • Privacy-preserving eligibility and compliance proofs
  • Machine-readable policy APIs that remain traceable to legitimate authority
THE VALUE

The project becomes meaningful only when a new technical possibility is translated into a clear human advantage, an experience people can understand, and a system capable of earning trust over time.

03 / FOUNDATIONS

Intelligence and mathematics

ARTIFICIAL INTELLIGENCE

The intelligence would be deliberately plural. Foundation models parse language, compare provisions, recover candidate issues and generate alternative interpretations. Retrieval is authority-aware rather than similarity-only: it respects jurisdiction, court hierarchy, temporal validity, citation treatment and the distinction between binding and persuasive material. A legal knowledge graph links provisions, definitions, actors, facts, procedures and remedies. Symbolic and defeasible reasoners test whether conclusions follow under an explicit interpretation; theorem provers and model checkers search for contradiction, incompleteness and impossible procedure. Adversarial agents search for strategic compliance, regulatory arbitrage and ways a powerful actor could satisfy the letter while defeating the purpose. A constitutional critic tests fundamental-rights impacts and procedural safeguards. No generative model is permitted to certify legality. The system must separate quotation, extracted rule, inferred interpretation, simulated consequence and normative choice. Every conclusion is proof-carrying: it returns with the authority it used, the dates and jurisdiction for which it may hold, the facts it assumed, the rules that defeated other rules, calibrated uncertainty, counterarguments and the identity of the human who authorised action.

MATHEMATICAL IDEA

The core object is a temporal, multilayer normative graph. Nodes represent authorities, legal concepts, actors, facts, procedures, rights, obligations and remedies; typed edges express citation, amendment, priority, exception, delegation, satisfaction, violation and appeal. Deontic and defeasible logics represent what must, may or must not happen without pretending that every rule is absolute. Temporal logic determines which norm exists and applies at each moment. Argumentation frameworks preserve competing interpretations instead of averaging them into one embedding. Category-theoretic mappings could describe how one legal ontology composes with another across jurisdictions; graph rewriting can model amendment and institutional action; model checking can identify states in which a right exists in text but no executable path can reach its remedy. Causal inference and agent-based simulation estimate how enforcement, incentives and administrative friction mediate effects. Distributionally robust optimisation tests policies against populations and behaviours not captured by historical data. Mechanism design asks whether institutions make truthful and fair participation possible. Differential privacy, secure multiparty computation and zero-knowledge proofs could let a person prove eligibility or compliance without exposing the underlying sensitive facts. The system never collapses legality, effectiveness, fairness and legitimacy into one score: it exposes a Pareto surface on which those values remain visibly political.

04 / VENTURE LOGIC

How it might live

I would build Civic Compiler first as infrastructure for regulatory design and complex obligation networks, not as consumer legal advice and never as an automated adjudicator. A narrow entry product could compile one bounded regulatory regime into a versioned obligation graph, connect it to operational controls and generate inspectable evidence packs for both organisations and supervisors. A second product could let public institutions stress-test draft rules through synthetic cases, procedural model checking and civil-society challenge before enactment. Secure enterprise workspaces, jurisdiction modules and verified policy components could fund an open standard for signed legal decision objects. The long-term opportunity is a public-interest protocol layer between authoritative law and the software that increasingly implements it. Its defensibility would come from temporal legal data, validated compilers, institutional integrations, evaluation suites, governance and trust—not from enclosing public law in a proprietary model.

For me, a venture is more than an interesting technology. It needs a narrow first user, a repeated problem, a distribution path, a credible advantage and a reason to improve as more people use it. I would test those conditions before deciding whether this idea should become a company, a product, an open technology or an ongoing research programme.

05 / DESIGN PRINCIPLES

Rules for making it real

  1. 01

    Law remains authoritative text interpreted by legitimate institutions; the model is never the sovereign.

  2. 02

    Every computed conclusion must carry provenance, time, jurisdiction, assumptions and a route to contest it.

  3. 03

    Preserve dissenting interpretations when authority or evidence cannot resolve them.

  4. 04

    A right is not operational unless a person can discover, exercise and enforce it.

  5. 05

    Never optimise administrative efficiency by making due process disappear.

  6. 06

    Simulated populations are stress tests, not substitutes for affected people.

  7. 07

    Keep legal validity, policy effectiveness, fairness and legitimacy as separate questions.

  8. 08

    Public rules require public auditability, even when sensitive facts remain private.

  9. 09

    No autonomous decisions concerning liberty, status, benefits, migration, policing or punishment.

  10. 10

    The system must make refusal possible when a rule cannot be compiled without hiding a political choice.

06 / ROADMAP

From question to company

  1. 01
    Frame

    Choose one bounded, document-rich regulatory domain with identifiable obligations, exceptions and remedies.

  2. 02
    Prototype

    Build a temporal authority graph from official sources using Akoma Ntoso-compatible structure and LegalRuleML concepts.

  3. 03
    Prove

    Have lawyers construct a gold set of competing interpretations, edge cases and dated legal questions.

  4. 04
    Build

    Prototype the normative compiler and require every output to reconstruct its complete authority path.

  5. 05
    Advance

    Add model checking for contradiction, unreachable remedies, missing appeals and version conflicts.

  6. 06
    Advance

    Run red-team workshops with regulators, regulated organisations and civil-society challengers.

  7. 07
    Advance

    Simulate a proposed amendment and prospectively compare predicted failure modes with a bounded real implementation.

  8. 08
    Advance

    Create signed decision objects and an independent audit protocol for machine-executed policy.

  9. 09
    Advance

    Test privacy-preserving proofs for one narrow eligibility or reporting obligation.

  10. 10
    Advance

    Expand only through jurisdiction-specific modules governed by local legal institutions and affected communities.

07 / HONEST QUESTIONS

What could go wrong

Serious imagination includes the possibility that an idea should change radically—or should not exist. These are the tensions the project would need to resolve:

  • A fluent interpretation gaining authority merely because it is computable.
  • Historical case law encoding structural injustice that simulation then normalises.
  • The ontology excluding forms of harm or identity it was not designed to represent.
  • Governments using simulation to legitimise decisions already made.
  • Private vendors gaining infrastructural control over public legal meaning.
  • Legal teams treating model coverage as proof that no obligation exists outside it.
  • Adversarial actors using the simulator to discover loopholes faster than institutions can respond.
  • Machine-readable rules becoming rigid while the human law remains contextual and contested.
  • Privacy-preserving proofs creating new coercive demands to prove personal facts.
  • Automated execution outrunning appeal, correction and democratic oversight.
  • Cross-jurisdiction translation erasing differences in doctrine, language and constitutional culture.
  • The project making justice more efficient for institutions but less reachable for people.
EVIDENCE / BOUNDARIES

Built on inspectable standards, not automated authority

This is an early research idea, not legal advice and not a proposal for automated adjudication. Any real deployment would require jurisdiction-specific legal validation, public accountability, independent evaluation and meaningful participation by the people whose rights it could affect.

08 / NEXT EXPERIMENT

I want to make the smallest thing that can change my mind.

The next step is not a complete platform. It is a deliberately small experiment designed to test the project’s most fragile assumption with real people, real constraints and evidence strong enough to guide my following decision.