Page typeInfrastructure RunnabilityRunnable locally OutcomeWARN

Your ADRs become constraints the rest of the system can enforce.

The compiler treats docs/adr/*.md as source: it reads the frontmatter, checks the directives, resolves precedence, emits project_memory.json, and hands the result to the normal enforcement pipeline. This walkthrough uses Mneme's own ADR-005—no model or external service required.

ADR compiler

The ADR stops being a document and starts doing work.

This walkthrough follows compilation through to a real WARN. The flagship demo shows the corrected pass.

Source decision

ADR-005 · Brand versus package namespace. The Python namespace is mneme. MnemeHQ is a forbidden dependency token on code-bearing surfaces.

adr import + mneme check · compiled constraint trace
  1. 01 Decision

    A Markdown ADR carries accepted status, foundational priority, code scope, and constraint directives.

    docs/adr/ADR-005.md · FORBID_DEPENDENCY: MnemeHQ
  2. 02 Guidance

    The compiler validates the directive, resolves precedence, and emits the active constraint.

    emit .mneme/project_memory.json · active set: 4 ADRsDemonstrated
  3. 03 Violation

    The enforcement input uses the brand token as if it were the Python package namespace.

    from MnemeHQ.memory_store import MemoryStore
  4. 04 Deny / warn

    The compiled rule fires through the normal checker and names its source ADR.

    WARN [ADR-005] · trigger: mnemehq
    WARN
  5. 05 Correction

    The compiler walkthrough stops after proving the emitted rule can fire.

    Not included in this walkthrough
    N/A
  6. 06 Allow

    A corrected import and passing rerun are demonstrated in the governed Python flagship instead.

    See governed-python-agent
    N/A
Runnable locally · compiler output is deterministic

Run it yourself

Compile Mneme's own ADRs

The repository walkthrough previews the import, writes a fresh memory file, and checks a namespace violation.

git clone https://github.com/MnemeHQ/mneme
cd mneme
pip install -e .
python examples/demo-adr-import.py

Unknown directives and unresolved equal-precedence conflicts fail closed instead of being silently omitted.

What happened

ADRs remain the source.

Teams keep Markdown rationale and add structured metadata only where enforcement needs it.

Precedence is compiled.

Supersession, priority, scope, and date are resolved before any hook or CI gate consumes the corpus.

The output is operational.

The same emitted decision record drives agent guidance, enforcement checks, and the architectural-drift proof.

Common questions

Does the compiler replace Markdown ADRs?

No. ADR files remain the source. The compiler emits a structured downstream artifact for enforcement.

What happens when two ADRs conflict?

If precedence cannot be resolved deterministically, compilation stops. A human must supersede one decision, change priority, narrow scope, or otherwise remove the ambiguity.

Why are correction and allow absent?

This page proves the compiler and one emitted WARN. The full corrected-import PASS is shown in the governed Python agent demo.

Compile the decisions you already maintain.

Keep the ADRs human-readable and make their active constraints executable.

pipx install "mneme-hq>=0.5.1"
Python 3.11+ · MIT licensed