# omarnizam/smd-backend-factory architecture

> Architecture diagram of the GitHub repository omarnizam/smd-backend-factory, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/omarnizam/smd-backend-factory
- Repository: https://github.com/omarnizam/smd-backend-factory

## Overview

SyncMind is a multi-tenant agentic automation platform, but the README says its service skeletons are not yet implemented; the repository currently contains the software factory and infrastructure. The documented change workflow runs from a job specification through tests, build and gates, reviews, human approval, staging, and a production canary. The graph preserves the documented platform services as planned subsystems. Source excerpts show the factory MCP server calling its state store and contract-check tools using shared helpers; links for other factory stages and platform services are documented rather than verified in source.

Main entry points: [`factory/gates.sh`](https://github.com/omarnizam/smd-backend-factory/blob/main/factory/gates.sh) (Factory gates), [`services/ai-orchestrator`](https://github.com/omarnizam/smd-backend-factory/tree/main/services/ai-orchestrator) (AI orchestrator), [`factory/tools/contractlib.py`](https://github.com/omarnizam/smd-backend-factory/blob/main/factory/tools/contractlib.py) (Contract helpers), [`backend-factory/prompt`](https://github.com/omarnizam/smd-backend-factory/tree/main/backend-factory/prompt) (Job specification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_factory["Software factory"]
  node_job["Job specification"]
  node_tests["Test-first build<br/>[agents]"]
  node_gates["Factory gates<br/>[gates.sh]"]
  node_reviews["Five reviews<br/>[agents]"]
  node_approval["GitHub approval"]
  node_release["Staging and canary<br/>[deploy.sh]"]
  node_factory_helpers["Gate helpers<br/>[factory_lib.py]"]
  node_factory_mcp["Factory MCP<br/>[server.py]"]
  node_state_store[("Factory state<br/>[store.py]")]
end

subgraph group_contracts["Contract checks"]
  node_contract_diff["MCP contract diff"]
  node_openapi_sunset["OpenAPI sunset<br/>[openapi_sunset.py]"]
  node_event_compat["Event compatibility"]
  node_contract_helpers["Contract helpers<br/>[contractlib.py]"]
end

subgraph group_platform["Platform services"]
  node_core_api["Core API"]
  node_orchestrator["AI orchestrator"]
  node_ingestion["Ingestion"]
  node_mcp_gateway["MCP gateway"]
end

subgraph group_infrastructure["Infrastructure"]
  node_infra["Cloud infrastructure"]
end

node_engineer(("Engineer"))

node_engineer -->|"specifies work"| node_job
node_job -->|"starts test-first"| node_tests
node_tests -->|"builds and gates"| node_gates
node_gates -->|"passes to review"| node_reviews
node_reviews -->|"requests approval"| node_approval
node_approval -->|"authorizes rollout"| node_release
node_gates -.->|"uses helpers"| node_factory_helpers
node_engineer -->|"queries factory"| node_factory_mcp
node_factory_mcp -->|"reads and answers"| node_state_store
node_contract_diff -->|"uses helpers"| node_contract_helpers
node_openapi_sunset -->|"uses helpers"| node_contract_helpers
node_event_compat -->|"uses helpers"| node_contract_helpers
node_core_api -.->|"publishes run events"| node_orchestrator
node_orchestrator -.->|"calls gRPC"| node_ingestion
node_orchestrator -.->|"calls MCP servers"| node_mcp_gateway

click node_job "https://github.com/omarnizam/smd-backend-factory/tree/main/backend-factory/prompt"
click node_tests "https://github.com/omarnizam/smd-backend-factory/tree/main/.claude/agents"
click node_gates "https://github.com/omarnizam/smd-backend-factory/blob/main/factory/gates.sh"
click node_reviews "https://github.com/omarnizam/smd-backend-factory/tree/main/.claude/agents"
click node_release "https://github.com/omarnizam/smd-backend-factory/blob/main/factory/deploy.sh"
click node_factory_helpers "https://github.com/omarnizam/smd-backend-factory/blob/main/factory/lib/factory_lib.py"
click node_factory_mcp "https://github.com/omarnizam/smd-backend-factory/blob/main/factory/mcp/server.py"
click node_state_store "https://github.com/omarnizam/smd-backend-factory/blob/main/factory/mcp/store.py"
click node_contract_diff "https://github.com/omarnizam/smd-backend-factory/blob/main/factory/tools/mcp_contract_diff.py"
click node_openapi_sunset "https://github.com/omarnizam/smd-backend-factory/blob/main/factory/tools/openapi_sunset.py"
click node_event_compat "https://github.com/omarnizam/smd-backend-factory/blob/main/factory/tools/jsonschema_compat.py"
click node_contract_helpers "https://github.com/omarnizam/smd-backend-factory/blob/main/factory/tools/contractlib.py"
click node_core_api "https://github.com/omarnizam/smd-backend-factory/tree/main/services/core-api"
click node_orchestrator "https://github.com/omarnizam/smd-backend-factory/tree/main/services/ai-orchestrator"
click node_ingestion "https://github.com/omarnizam/smd-backend-factory/tree/main/services/ingestion"
click node_mcp_gateway "https://github.com/omarnizam/smd-backend-factory/tree/main/services/mcp-gateway"
click node_infra "https://github.com/omarnizam/smd-backend-factory/tree/main/infra/terraform"

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_job,node_tests,node_gates,node_reviews,node_approval,node_release,node_factory_helpers,node_factory_mcp,node_state_store toneBlue
class node_contract_diff,node_openapi_sunset,node_event_compat,node_contract_helpers toneAmber
class node_core_api,node_orchestrator,node_ingestion,node_mcp_gateway toneMint
class node_infra toneRose
class node_engineer toneIndigo
```

## Components

### Software factory

- [Job specification](https://github.com/omarnizam/smd-backend-factory/tree/main/backend-factory/prompt): `backend-factory/prompt`
- [Test-first build](https://github.com/omarnizam/smd-backend-factory/tree/main/.claude/agents): `.claude/agents`
- [Factory gates](https://github.com/omarnizam/smd-backend-factory/blob/main/factory/gates.sh): `factory/gates.sh`
- [Five reviews](https://github.com/omarnizam/smd-backend-factory/tree/main/.claude/agents): `.claude/agents`
- **GitHub approval**
- [Staging and canary](https://github.com/omarnizam/smd-backend-factory/blob/main/factory/deploy.sh): `factory/deploy.sh`
- [Gate helpers](https://github.com/omarnizam/smd-backend-factory/blob/main/factory/lib/factory_lib.py): `factory/lib/factory_lib.py`
- [Factory MCP](https://github.com/omarnizam/smd-backend-factory/blob/main/factory/mcp/server.py): `factory/mcp/server.py`
- [Factory state](https://github.com/omarnizam/smd-backend-factory/blob/main/factory/mcp/store.py): `factory/mcp/store.py`

### Contract checks

- [MCP contract diff](https://github.com/omarnizam/smd-backend-factory/blob/main/factory/tools/mcp_contract_diff.py): `factory/tools/mcp_contract_diff.py`
- [OpenAPI sunset](https://github.com/omarnizam/smd-backend-factory/blob/main/factory/tools/openapi_sunset.py): `factory/tools/openapi_sunset.py`
- [Event compatibility](https://github.com/omarnizam/smd-backend-factory/blob/main/factory/tools/jsonschema_compat.py): `factory/tools/jsonschema_compat.py`
- [Contract helpers](https://github.com/omarnizam/smd-backend-factory/blob/main/factory/tools/contractlib.py): `factory/tools/contractlib.py`

### Platform services

- [Core API](https://github.com/omarnizam/smd-backend-factory/tree/main/services/core-api): `services/core-api`
- [AI orchestrator](https://github.com/omarnizam/smd-backend-factory/tree/main/services/ai-orchestrator): `services/ai-orchestrator`
- [Ingestion](https://github.com/omarnizam/smd-backend-factory/tree/main/services/ingestion): `services/ingestion`
- [MCP gateway](https://github.com/omarnizam/smd-backend-factory/tree/main/services/mcp-gateway): `services/mcp-gateway`

### Infrastructure

- [Cloud infrastructure](https://github.com/omarnizam/smd-backend-factory/tree/main/infra/terraform): `infra/terraform`

### Other components

- **Engineer**

## Connections

- Engineer → Job specification: specifies work (evidence: `README.md`)
- Job specification → Test-first build: starts test-first (evidence: `README.md`)
- Test-first build → Factory gates: builds and gates (evidence: `README.md`)
- Factory gates → Five reviews: passes to review (evidence: `README.md`)
- Five reviews → GitHub approval: requests approval (evidence: `README.md`)
- GitHub approval → Staging and canary: authorizes rollout (evidence: `README.md`)
- Factory gates → Gate helpers: uses helpers (evidence: `factory/lib/factory_lib.py`)
- Engineer → Factory MCP: queries factory (evidence: `factory/mcp/server.py`)
- Factory MCP → Factory state: reads and answers (evidence: `factory/mcp/server.py`)
- MCP contract diff → Contract helpers: uses helpers (evidence: `factory/tools/mcp_contract_diff.py`)
- OpenAPI sunset → Contract helpers: uses helpers (evidence: `factory/tools/openapi_sunset.py`)
- Event compatibility → Contract helpers: uses helpers (evidence: `factory/tools/jsonschema_compat.py`)
- Core API → AI orchestrator: publishes run events (evidence: `README.md`)
- AI orchestrator → Ingestion: calls gRPC (evidence: `README.md`)
- AI orchestrator → MCP gateway: calls MCP servers (evidence: `README.md`)
