# az967252-creator/ml-model-architect architecture

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

- Interactive diagram: https://gitdiagram.com/az967252-creator/ml-model-architect
- Repository: https://github.com/az967252-creator/ml-model-architect

## Overview

ML Model Architect is a reference-driven governance framework for AI-assisted ML engineering. Its documented workflow moves from requirements and literature-grounded model selection through a cryptographically locked plan, sandboxed construction, static and policy checks, empirical evaluation, and production handoff. The CLI dispatches several governance operations; the repository also provides reference utilities and decision-review tools. Some product capabilities are documented in the README but their implementation wiring was not sampled, so those links are shown only where explicitly documented.

Main entry points: [`src/ml_model_architect/cli.py`](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/cli.py) (Project CLI), [`src/ml_model_architect/scanner.py`](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/scanner.py) (AST Security Scanner), [`mcp_server/local_knowledge.py`](https://github.com/az967252-creator/ml-model-architect/blob/main/mcp_server/local_knowledge.py) (MCP Research Server), [`sandbox`](https://github.com/az967252-creator/ml-model-architect/tree/main/sandbox) (Execution Sandbox)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Governed ML Workflow"]
  node_cli["Project CLI<br/>[cli.py]"]
  node_requirements["Requirements and Goals<br/>[cli.py]"]
  node_technique["Technique Selection<br/>[model_selection.py]"]
  node_sandbox["Execution Sandbox"]
  node_evaluation["Empirical Evaluation<br/>[model_selection.py]"]
  node_handoff["Production Handoff<br/>[policy.py]"]
  node_dashboard["Dashboard<br/>[app.py]"]
end

subgraph group_controls["Integrity and Validation"]
  node_plan["Plan Locking<br/>[locker.py]"]
  node_scanner["AST Security Scanner<br/>[scanner.py]"]
  node_policy["Execution Policy<br/>[policy.py]"]
  node_enforcer["Constitution Enforcer<br/>[enforcer.py]"]
end

subgraph group_research["Research and References"]
  node_mcp["MCP Research Server<br/>[local_knowledge.py]"]
  node_sota["SOTA Discovery<br/>[sota.py]"]
  node_doi["DOI Verification<br/>[doi.py]"]
  node_pdf["PDF Conversion<br/>[pdf_to_markdown.py]"]
end

subgraph group_advisory["Decision Support"]
  node_premortem["Pre-Mortem Review<br/>[pre_mortem.py]"]
  node_redteam["Red-Team Review<br/>[red_team.py]"]
  node_diagram["Decision Diagram<br/>[diagram.py]"]
  node_summary["Executive Summary"]
end

node_engineer(("ML Engineer"))
node_agent(("Constitutional Agent"))

node_engineer -->|"sets constraints"| node_agent
node_agent -->|"elicits goals"| node_requirements
node_agent -->|"queries literature"| node_mcp
node_mcp -->|"returns references"| node_agent
node_agent -->|"proposes models"| node_technique
node_agent -->|"locks plan"| node_plan
node_agent -->|"emits pipeline"| node_sandbox
node_agent -->|"requests scan"| node_scanner
node_scanner -->|"returns verdict"| node_agent
node_agent -->|"executes validation"| node_sandbox
node_agent -->|"checks assertions"| node_policy
node_agent -->|"presents results"| node_evaluation
node_agent -->|"presents deployment"| node_handoff
node_engineer -->|"runs commands"| node_cli
node_cli -->|"dispatches locking"| node_plan
node_cli -->|"dispatches checks"| node_policy
node_cli -->|"dispatches scans"| node_scanner
node_cli -->|"dispatches enforcement"| node_enforcer
node_cli -->|"dispatches verification"| node_doi
node_agent -.->|"discovers research"| node_sota
node_engineer -.->|"converts references"| node_pdf
node_engineer -.->|"reviews decisions"| node_premortem
node_engineer -.->|"reviews decisions"| node_redteam
node_engineer -.->|"visualizes decisions"| node_diagram
node_engineer -.->|"summarizes results"| node_summary
node_engineer -.->|"opens dashboard"| node_dashboard

click node_cli "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/cli.py"
click node_requirements "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/cli.py"
click node_technique "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/model_selection.py"
click node_plan "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/locker.py"
click node_sandbox "https://github.com/az967252-creator/ml-model-architect/tree/main/sandbox"
click node_scanner "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/scanner.py"
click node_policy "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/policy.py"
click node_enforcer "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/enforcer.py"
click node_evaluation "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/model_selection.py"
click node_handoff "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/policy.py"
click node_mcp "https://github.com/az967252-creator/ml-model-architect/blob/main/mcp_server/local_knowledge.py"
click node_sota "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/sota.py"
click node_doi "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/doi.py"
click node_pdf "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/tools/pdf_to_markdown.py"
click node_premortem "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/tools/pre_mortem.py"
click node_redteam "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/tools/red_team.py"
click node_diagram "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/tools/diagram.py"
click node_summary "https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/tools/executive_summary.py"
click node_dashboard "https://github.com/az967252-creator/ml-model-architect/blob/main/app.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_cli,node_requirements,node_technique,node_sandbox,node_evaluation,node_handoff,node_dashboard toneBlue
class node_plan,node_scanner,node_policy,node_enforcer toneAmber
class node_mcp,node_sota,node_doi,node_pdf toneMint
class node_premortem,node_redteam,node_diagram,node_summary toneRose
class node_engineer,node_agent toneIndigo
```

## Components

### Governed ML Workflow

- [Project CLI](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/cli.py): `src/ml_model_architect/cli.py`
- [Requirements and Goals](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/cli.py): `src/ml_model_architect/cli.py`
- [Technique Selection](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/model_selection.py): `src/ml_model_architect/model_selection.py`
- [Execution Sandbox](https://github.com/az967252-creator/ml-model-architect/tree/main/sandbox): `sandbox`
- [Empirical Evaluation](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/model_selection.py): `src/ml_model_architect/model_selection.py`
- [Production Handoff](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/policy.py): `src/ml_model_architect/policy.py`
- [Dashboard](https://github.com/az967252-creator/ml-model-architect/blob/main/app.py): `app.py`

### Integrity and Validation

- [Plan Locking](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/locker.py): `src/ml_model_architect/locker.py`
- [AST Security Scanner](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/scanner.py): `src/ml_model_architect/scanner.py`
- [Execution Policy](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/policy.py): `src/ml_model_architect/policy.py`
- [Constitution Enforcer](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/enforcer.py): `src/ml_model_architect/enforcer.py`

### Research and References

- [MCP Research Server](https://github.com/az967252-creator/ml-model-architect/blob/main/mcp_server/local_knowledge.py): `mcp_server/local_knowledge.py`
- [SOTA Discovery](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/sota.py): `src/ml_model_architect/sota.py`
- [DOI Verification](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/doi.py): `src/ml_model_architect/doi.py`
- [PDF Conversion](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/tools/pdf_to_markdown.py): `src/ml_model_architect/tools/pdf_to_markdown.py`

### Decision Support

- [Pre-Mortem Review](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/tools/pre_mortem.py): `src/ml_model_architect/tools/pre_mortem.py`
- [Red-Team Review](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/tools/red_team.py): `src/ml_model_architect/tools/red_team.py`
- [Decision Diagram](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/tools/diagram.py): `src/ml_model_architect/tools/diagram.py`
- [Executive Summary](https://github.com/az967252-creator/ml-model-architect/blob/main/src/ml_model_architect/tools/executive_summary.py): `src/ml_model_architect/tools/executive_summary.py`

### Other components

- **ML Engineer**
- **Constitutional Agent**

## Connections

- ML Engineer → Constitutional Agent: sets constraints (evidence: `README.md`)
- Constitutional Agent → Requirements and Goals: elicits goals (evidence: `README.md`)
- Constitutional Agent → MCP Research Server: queries literature (evidence: `README.md`)
- MCP Research Server → Constitutional Agent: returns references (evidence: `README.md`)
- Constitutional Agent → Technique Selection: proposes models (evidence: `README.md`)
- Constitutional Agent → Plan Locking: locks plan (evidence: `README.md`)
- Constitutional Agent → Execution Sandbox: emits pipeline (evidence: `README.md`)
- Constitutional Agent → AST Security Scanner: requests scan (evidence: `README.md`)
- AST Security Scanner → Constitutional Agent: returns verdict (evidence: `README.md`)
- Constitutional Agent → Execution Sandbox: executes validation (evidence: `README.md`)
- Constitutional Agent → Execution Policy: checks assertions (evidence: `README.md`)
- Constitutional Agent → Empirical Evaluation: presents results (evidence: `README.md`)
- Constitutional Agent → Production Handoff: presents deployment (evidence: `README.md`)
- ML Engineer → Project CLI: runs commands (evidence: `README.md`)
- Project CLI → Plan Locking: dispatches locking (evidence: `src/ml_model_architect/cli.py`)
- Project CLI → Execution Policy: dispatches checks (evidence: `src/ml_model_architect/cli.py`)
- Project CLI → AST Security Scanner: dispatches scans (evidence: `src/ml_model_architect/cli.py`)
- Project CLI → Constitution Enforcer: dispatches enforcement (evidence: `src/ml_model_architect/cli.py`)
- Project CLI → DOI Verification: dispatches verification (evidence: `src/ml_model_architect/cli.py`)
- Constitutional Agent → SOTA Discovery: discovers research
- ML Engineer → PDF Conversion: converts references
- ML Engineer → Pre-Mortem Review: reviews decisions
- ML Engineer → Red-Team Review: reviews decisions
- ML Engineer → Decision Diagram: visualizes decisions
- ML Engineer → Executive Summary: summarizes results
- ML Engineer → Dashboard: opens dashboard
