# selectess/lair_management architecture

> Architecture diagram of the GitHub repository selectess/lair_management, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/selectess/lair_management
- Repository: https://github.com/selectess/lair_management

## Overview

LAIRM is a constitutional and legislative framework for governing autonomous agents, accompanied by reference implementations and practical tools. A user can invoke the developer CLI to search the corpus or run compliance and audit operations; agents can use the SDK, while workflow tooling supports compliance, audit, and human-approval steps. The corpus, reference compendium, and implementations are distinct product stages, not a software build pipeline. README capabilities include 19 axioms, technical ARAM concepts, and operational deployment vectors; their detailed implementations are not fully represented in the sampled sources.

Main entry points: [`LAIRM/05-TOOLS/audit_engine/lairm_audit_engine.py`](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/audit_engine/lairm_audit_engine.py) (Audit Engine), [`LAIRM/05-TOOLS/mcp_server/lairm_mcp_server.py`](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/mcp_server/lairm_mcp_server.py) (MCP Server), [`LAIRM/05-TOOLS/developer-tools/lairm_cli.py`](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/developer-tools/lairm_cli.py) (Developer CLI), [`LAIRM/05-TOOLS/compliance_checker/lairm_compliance_checker.py`](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/compliance_checker/lairm_compliance_checker.py) (Compliance Checker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_corpus["Normative Corpus"]
  node_axioms["19 Axioms"]
end

subgraph group_reference["Reference Material"]
  node_compendium["28 Chapters"]
end

subgraph group_implementations["Technical Implementations"]
  node_python_core["Python Core<br/>[lairm_core.py]"]
  node_python_compliance["Python Compliance"]
  node_python_audit["Python Audit<br/>[audit_engine.py]"]
  node_reference_workflow["Workflow Example"]
end

subgraph group_tools["Agent Governance Tools"]
  node_agent_sdk["Agent SDK<br/>[lairm_agent_sdk.py]"]
  node_tool_compliance["Compliance Checker"]
  node_extended_axioms["Axioms VI–XIX<br/>[axioms_vi_xix.py]"]
  node_tool_audit["Audit Engine"]
  node_crypto["Audit Cryptography<br/>[crypto_security.py]"]
  node_distributed_storage["Distributed Storage"]
  node_workflow_engine["Workflow Engine"]
  node_mcp_server["MCP Server"]
  node_cli["Developer CLI<br/>[lairm_cli.py]"]
end

node_human(("Human User"))

node_human -.->|"runs commands"| node_cli
node_cli -->|"searches articles"| node_mcp_server
node_cli -->|"checks compliance"| node_tool_compliance
node_cli -->|"creates audit records"| node_tool_audit
node_mcp_server -->|"checks compliance"| node_tool_compliance
node_mcp_server -->|"creates audit records"| node_tool_audit
node_mcp_server -->|"uses agent SDK"| node_agent_sdk
node_workflow_engine -->|"checks compliance"| node_tool_compliance
node_workflow_engine -->|"creates audit records"| node_tool_audit
node_reference_workflow -->|"uses framework"| node_python_core
node_reference_workflow -->|"records audit"| node_python_audit
node_tool_audit -.-> node_crypto
node_tool_audit -.-> node_distributed_storage

click node_axioms "https://github.com/selectess/lair_management/tree/main/LAIRM/02-COMPENDIUM-LEGISLATIVE"
click node_compendium "https://github.com/selectess/lair_management/tree/main/LAIRM/01-COMPENDIUM-REFERENCE"
click node_python_core "https://github.com/selectess/lair_management/blob/main/LAIRM/03-TECHNICAL-ANNEXES/implementations/python/lairm_core.py"
click node_python_compliance "https://github.com/selectess/lair_management/blob/main/LAIRM/03-TECHNICAL-ANNEXES/implementations/python/compliance_engine.py"
click node_python_audit "https://github.com/selectess/lair_management/blob/main/LAIRM/03-TECHNICAL-ANNEXES/implementations/python/audit_engine.py"
click node_reference_workflow "https://github.com/selectess/lair_management/blob/main/LAIRM/03-TECHNICAL-ANNEXES/implementations/reference/workflow_example.py"
click node_agent_sdk "https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/agent_framework/lairm_agent_sdk.py"
click node_tool_compliance "https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/compliance_checker/lairm_compliance_checker.py"
click node_extended_axioms "https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/compliance_checker/axioms_vi_xix.py"
click node_tool_audit "https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/audit_engine/lairm_audit_engine.py"
click node_crypto "https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/audit_engine/crypto_security.py"
click node_distributed_storage "https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/audit_engine/distributed_storage.py"
click node_workflow_engine "https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/workflow-engine/lairm_workflow_engine.py"
click node_mcp_server "https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/mcp_server/lairm_mcp_server.py"
click node_cli "https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/developer-tools/lairm_cli.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_axioms,node_human toneBlue
class node_compendium toneAmber
class node_python_core,node_python_compliance,node_python_audit,node_reference_workflow toneMint
class node_agent_sdk,node_tool_compliance,node_extended_axioms,node_tool_audit,node_crypto,node_distributed_storage,node_workflow_engine,node_mcp_server,node_cli toneRose
```

## Components

### Normative Corpus

- [19 Axioms](https://github.com/selectess/lair_management/tree/main/LAIRM/02-COMPENDIUM-LEGISLATIVE): `LAIRM/02-COMPENDIUM-LEGISLATIVE`

### Reference Material

- [28 Chapters](https://github.com/selectess/lair_management/tree/main/LAIRM/01-COMPENDIUM-REFERENCE): `LAIRM/01-COMPENDIUM-REFERENCE`

### Technical Implementations

- [Python Core](https://github.com/selectess/lair_management/blob/main/LAIRM/03-TECHNICAL-ANNEXES/implementations/python/lairm_core.py): `LAIRM/03-TECHNICAL-ANNEXES/implementations/python/lairm_core.py`
- [Python Compliance](https://github.com/selectess/lair_management/blob/main/LAIRM/03-TECHNICAL-ANNEXES/implementations/python/compliance_engine.py): `LAIRM/03-TECHNICAL-ANNEXES/implementations/python/compliance_engine.py`
- [Python Audit](https://github.com/selectess/lair_management/blob/main/LAIRM/03-TECHNICAL-ANNEXES/implementations/python/audit_engine.py): `LAIRM/03-TECHNICAL-ANNEXES/implementations/python/audit_engine.py`
- [Workflow Example](https://github.com/selectess/lair_management/blob/main/LAIRM/03-TECHNICAL-ANNEXES/implementations/reference/workflow_example.py): `LAIRM/03-TECHNICAL-ANNEXES/implementations/reference/workflow_example.py`

### Agent Governance Tools

- [Agent SDK](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/agent_framework/lairm_agent_sdk.py): `LAIRM/05-TOOLS/agent_framework/lairm_agent_sdk.py`
- [Compliance Checker](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/compliance_checker/lairm_compliance_checker.py): `LAIRM/05-TOOLS/compliance_checker/lairm_compliance_checker.py`
- [Axioms VI–XIX](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/compliance_checker/axioms_vi_xix.py): `LAIRM/05-TOOLS/compliance_checker/axioms_vi_xix.py`
- [Audit Engine](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/audit_engine/lairm_audit_engine.py): `LAIRM/05-TOOLS/audit_engine/lairm_audit_engine.py`
- [Audit Cryptography](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/audit_engine/crypto_security.py): `LAIRM/05-TOOLS/audit_engine/crypto_security.py`
- [Distributed Storage](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/audit_engine/distributed_storage.py): `LAIRM/05-TOOLS/audit_engine/distributed_storage.py`
- [Workflow Engine](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/workflow-engine/lairm_workflow_engine.py): `LAIRM/05-TOOLS/workflow-engine/lairm_workflow_engine.py`
- [MCP Server](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/mcp_server/lairm_mcp_server.py): `LAIRM/05-TOOLS/mcp_server/lairm_mcp_server.py`
- [Developer CLI](https://github.com/selectess/lair_management/blob/main/LAIRM/05-TOOLS/developer-tools/lairm_cli.py): `LAIRM/05-TOOLS/developer-tools/lairm_cli.py`

### Other components

- **Human User**

## Connections

- Human User → Developer CLI: runs commands
- Developer CLI → MCP Server: searches articles (evidence: `LAIRM/05-TOOLS/developer-tools/lairm_cli.py`)
- Developer CLI → Compliance Checker: checks compliance (evidence: `LAIRM/05-TOOLS/developer-tools/lairm_cli.py`)
- Developer CLI → Audit Engine: creates audit records (evidence: `LAIRM/05-TOOLS/developer-tools/lairm_cli.py`)
- MCP Server → Compliance Checker: checks compliance (evidence: `LAIRM/05-TOOLS/mcp_server/lairm_mcp_server.py`)
- MCP Server → Audit Engine: creates audit records (evidence: `LAIRM/05-TOOLS/mcp_server/lairm_mcp_server.py`)
- MCP Server → Agent SDK: uses agent SDK (evidence: `LAIRM/05-TOOLS/mcp_server/lairm_mcp_server.py`)
- Workflow Engine → Compliance Checker: checks compliance (evidence: `LAIRM/05-TOOLS/workflow-engine/lairm_workflow_engine.py`)
- Workflow Engine → Audit Engine: creates audit records (evidence: `LAIRM/05-TOOLS/workflow-engine/lairm_workflow_engine.py`)
- Workflow Example → Python Core: uses framework (evidence: `LAIRM/03-TECHNICAL-ANNEXES/implementations/reference/workflow_example.py`)
- Workflow Example → Python Audit: records audit (evidence: `LAIRM/03-TECHNICAL-ANNEXES/implementations/reference/workflow_example.py`)
- Audit Engine → Audit Cryptography
- Audit Engine → Distributed Storage
