# mgi25/simulation-factory architecture

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

- Interactive diagram: https://gitdiagram.com/mgi25/simulation-factory
- Repository: https://github.com/mgi25/simulation-factory

## Overview

This repository combines a company-operations platform with simulation and media-production code. The clearest sampled end-to-end workflow is its engineering job lifecycle: a request becomes a validated work order and plan, is prepared for a developer session, then its receipt is ingested and reviewed into a recorded outcome. The graph focuses on that workflow and its supporting runtime and experience layers. Edges reflect the orchestrator’s documented responsibilities; unsampled subsystem wiring is omitted.

Main entry points: [`company/engineering/orchestrator.py`](https://github.com/mgi25/simulation-factory/blob/main/company/engineering/orchestrator.py) (Job orchestrator), [`company/engineering/review.py`](https://github.com/mgi25/simulation-factory/blob/main/company/engineering/review.py) (Review and verify), [`company/runtime/session_adapter.py`](https://github.com/mgi25/simulation-factory/blob/main/company/runtime/session_adapter.py) (Session adapter), [`company/experience/repository.py`](https://github.com/mgi25/simulation-factory/blob/main/company/experience/repository.py) (Experience repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_job["Engineering lifecycle"]
  node_orchestrator["Job orchestrator<br/>[orchestrator.py]"]
  node_intake["Request intake<br/>[intake.py]"]
  node_work_order["Work order<br/>[work_order.py]"]
  node_planning["Plan creation<br/>[plan.py]"]
  node_job_records[("Job records<br/>[store.py]")]
  node_review["Review and verify<br/>[review.py]"]
  node_outcome["Job outcome<br/>[result.py]"]
end

subgraph group_runtime["Execution runtime"]
  node_context["Context assembly"]
  node_packets["Session packet<br/>[packets.py]"]
  node_runtime_tasks["Task validation<br/>[tasks.py]"]
  node_session_adapter["Session adapter<br/>[session_adapter.py]"]
  node_receipt["Attempt receipt<br/>[receipts.py]"]
end

subgraph group_experience["Experience memory"]
  node_experience_repo[("Experience repository<br/>[repository.py]")]
  node_experience_store[("Experience store<br/>[store.py]")]
end

node_requester(("Requester"))
node_runner(("External runner"))

node_requester -->|"submits request"| node_orchestrator
node_orchestrator -->|"opens job"| node_intake
node_orchestrator -->|"creates order"| node_work_order
node_orchestrator -->|"creates plan"| node_planning
node_orchestrator -->|"persists stages"| node_job_records
node_orchestrator -->|"assembles context"| node_context
node_orchestrator -->|"prepares packet"| node_packets
node_orchestrator -->|"hands off session"| node_runner
node_runner -->|"validates task"| node_runtime_tasks
node_runner -->|"submits attempt"| node_session_adapter
node_session_adapter -->|"records receipt"| node_receipt
node_orchestrator -->|"reviews attempt"| node_review
node_review -->|"records result"| node_outcome
node_runner -.->|"revalidates suggestions"| node_experience_repo
node_experience_repo -->|"uses memory"| node_experience_store

click node_orchestrator "https://github.com/mgi25/simulation-factory/blob/main/company/engineering/orchestrator.py"
click node_intake "https://github.com/mgi25/simulation-factory/blob/main/company/engineering/intake.py"
click node_work_order "https://github.com/mgi25/simulation-factory/blob/main/company/engineering/work_order.py"
click node_planning "https://github.com/mgi25/simulation-factory/blob/main/company/engineering/plan.py"
click node_job_records "https://github.com/mgi25/simulation-factory/blob/main/company/engineering/store.py"
click node_context "https://github.com/mgi25/simulation-factory/blob/main/company/runtime/context_assembly.py"
click node_packets "https://github.com/mgi25/simulation-factory/blob/main/company/runtime/packets.py"
click node_runtime_tasks "https://github.com/mgi25/simulation-factory/blob/main/company/runtime/tasks.py"
click node_session_adapter "https://github.com/mgi25/simulation-factory/blob/main/company/runtime/session_adapter.py"
click node_receipt "https://github.com/mgi25/simulation-factory/blob/main/company/runtime/receipts.py"
click node_review "https://github.com/mgi25/simulation-factory/blob/main/company/engineering/review.py"
click node_outcome "https://github.com/mgi25/simulation-factory/blob/main/company/engineering/result.py"
click node_experience_repo "https://github.com/mgi25/simulation-factory/blob/main/company/experience/repository.py"
click node_experience_store "https://github.com/mgi25/simulation-factory/blob/main/company/experience/store.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_orchestrator,node_intake,node_work_order,node_planning,node_job_records,node_review,node_outcome toneBlue
class node_context,node_packets,node_runtime_tasks,node_session_adapter,node_receipt toneAmber
class node_experience_repo,node_experience_store,node_requester toneMint
class node_runner toneIndigo
```

## Components

### Engineering lifecycle

- [Job orchestrator](https://github.com/mgi25/simulation-factory/blob/main/company/engineering/orchestrator.py): `company/engineering/orchestrator.py`
- [Request intake](https://github.com/mgi25/simulation-factory/blob/main/company/engineering/intake.py): `company/engineering/intake.py`
- [Work order](https://github.com/mgi25/simulation-factory/blob/main/company/engineering/work_order.py): `company/engineering/work_order.py`
- [Plan creation](https://github.com/mgi25/simulation-factory/blob/main/company/engineering/plan.py): `company/engineering/plan.py`
- [Job records](https://github.com/mgi25/simulation-factory/blob/main/company/engineering/store.py): `company/engineering/store.py`
- [Review and verify](https://github.com/mgi25/simulation-factory/blob/main/company/engineering/review.py): `company/engineering/review.py`
- [Job outcome](https://github.com/mgi25/simulation-factory/blob/main/company/engineering/result.py): `company/engineering/result.py`

### Execution runtime

- [Context assembly](https://github.com/mgi25/simulation-factory/blob/main/company/runtime/context_assembly.py): `company/runtime/context_assembly.py`
- [Session packet](https://github.com/mgi25/simulation-factory/blob/main/company/runtime/packets.py): `company/runtime/packets.py`
- [Task validation](https://github.com/mgi25/simulation-factory/blob/main/company/runtime/tasks.py): `company/runtime/tasks.py`
- [Session adapter](https://github.com/mgi25/simulation-factory/blob/main/company/runtime/session_adapter.py): `company/runtime/session_adapter.py`
- [Attempt receipt](https://github.com/mgi25/simulation-factory/blob/main/company/runtime/receipts.py): `company/runtime/receipts.py`

### Experience memory

- [Experience repository](https://github.com/mgi25/simulation-factory/blob/main/company/experience/repository.py): `company/experience/repository.py`
- [Experience store](https://github.com/mgi25/simulation-factory/blob/main/company/experience/store.py): `company/experience/store.py`

### Other components

- **Requester**
- **External runner**

## Connections

- Requester → Job orchestrator: submits request
- Job orchestrator → Request intake: opens job
- Job orchestrator → Work order: creates order
- Job orchestrator → Plan creation: creates plan
- Job orchestrator → Job records: persists stages
- Job orchestrator → Context assembly: assembles context
- Job orchestrator → Session packet: prepares packet
- Job orchestrator → External runner: hands off session
- External runner → Task validation: validates task
- External runner → Session adapter: submits attempt
- Session adapter → Attempt receipt: records receipt
- Job orchestrator → Review and verify: reviews attempt
- Review and verify → Job outcome: records result
- External runner → Experience repository: revalidates suggestions
- Experience repository → Experience store: uses memory
