# soumaditya777/potionlabs-dispatch-gate architecture

> Architecture diagram of the GitHub repository soumaditya777/potionlabs-dispatch-gate, 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/soumaditya777/potionlabs-dispatch-gate
- Repository: https://github.com/soumaditya777/potionlabs-dispatch-gate

## Overview

Dispatch Gate Brief Compiler turns factory interviews and register data into a traceable, schema-validated requirements brief. The main workflow loads plant configuration and inputs, extracts interview claims (optionally via an LLM), verifies claims and combines them with deterministic register analysis, then validates and writes the result. The graph includes the principal input, analysis, and assembly stages. Some subsystem links rely on the SOURCE INDEX and README; unsampled implementation details are not inferred.

Main entry points: [`src/gatepass/cli.py`](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/cli.py) (Command-line entry), [`src/gatepass/brief.py`](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/brief.py) (Verification and assembly), [`src/gatepass/dataset.py`](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/dataset.py) (Register loader), [`src/gatepass/config.py`](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/config.py) (Plant configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and configuration"]
  node_config["Plant configuration<br/>[config.py]"]
  node_register_data["Gate register<br/>[register.json]"]
  node_interview_data["Interview transcript<br/>[interviews.json]"]
  node_schema_data["Output schema<br/>[output_schema.json]"]
end

subgraph group_analysis["Evidence analysis"]
  node_dataset["Register loader<br/>[dataset.py]"]
  node_register_analysis["Register analysis<br/>[register.py]"]
  node_interviews["Interview grounding<br/>[interviews.py]"]
  node_llm["Claim extraction<br/>[llm.py]"]
end

subgraph group_assembly["Brief compilation"]
  node_cli["Command-line entry<br/>[cli.py]"]
  node_brief["Verification and assembly<br/>[brief.py]"]
end

subgraph group_delivery["Validated output"]
  node_schema_validator["Schema validation<br/>[schema.py]"]
  node_result["Compiled brief<br/>[result.json]"]
end

node_operator(("Operator"))
node_providers{{"Model providers"}}

node_operator -->|"runs"| node_cli
node_cli -->|"loads"| node_config
node_cli -->|"loads register"| node_dataset
node_register_data -->|"provides rows"| node_dataset
node_dataset -->|"reads mapping"| node_config
node_cli -->|"loads transcript"| node_interviews
node_interview_data -->|"provides utterances"| node_interviews
node_cli -->|"loads schema"| node_schema_validator
node_schema_data -->|"defines rules"| node_schema_validator
node_cli -->|"builds brief"| node_brief
node_brief -->|"extracts claims"| node_llm
node_llm -.->|"requests completion"| node_providers
node_brief -->|"analyses register"| node_register_analysis
node_register_analysis -->|"analyses movements"| node_dataset
node_register_analysis -->|"uses thresholds"| node_config
node_brief -->|"verifies citations"| node_interviews
node_brief -->|"assembles plan"| node_config
node_brief -->|"validates result"| node_schema_validator
node_cli -->|"writes result"| node_result

click node_config "https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/config.py"
click node_register_data "https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/data/register.json"
click node_interview_data "https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/data/interviews.json"
click node_schema_data "https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/data/output_schema.json"
click node_dataset "https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/dataset.py"
click node_register_analysis "https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/register.py"
click node_interviews "https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/interviews.py"
click node_llm "https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/llm.py"
click node_cli "https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/cli.py"
click node_brief "https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/brief.py"
click node_schema_validator "https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/schema.py"
click node_result "https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/output/result.json"

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_config,node_register_data,node_interview_data,node_schema_data toneBlue
class node_dataset,node_register_analysis,node_interviews,node_llm toneAmber
class node_cli,node_brief toneMint
class node_schema_validator,node_result toneRose
class node_operator,node_providers toneIndigo
```

## Components

### Inputs and configuration

- [Plant configuration](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/config.py): `src/gatepass/config.py`
- [Gate register](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/data/register.json): `data/register.json`
- [Interview transcript](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/data/interviews.json): `data/interviews.json`
- [Output schema](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/data/output_schema.json): `data/output_schema.json`

### Evidence analysis

- [Register loader](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/dataset.py): `src/gatepass/dataset.py`
- [Register analysis](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/register.py): `src/gatepass/register.py`
- [Interview grounding](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/interviews.py): `src/gatepass/interviews.py`
- [Claim extraction](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/llm.py): `src/gatepass/llm.py`

### Brief compilation

- [Command-line entry](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/cli.py): `src/gatepass/cli.py`
- [Verification and assembly](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/brief.py): `src/gatepass/brief.py`

### Validated output

- [Schema validation](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/src/gatepass/schema.py): `src/gatepass/schema.py`
- [Compiled brief](https://github.com/soumaditya777/potionlabs-dispatch-gate/blob/master/output/result.json): `output/result.json`

### Other components

- **Operator**
- **Model providers**

## Connections

- Operator → Command-line entry: runs (evidence: `README.md`)
- Command-line entry → Plant configuration: loads (evidence: `src/gatepass/cli.py`)
- Command-line entry → Register loader: loads register (evidence: `src/gatepass/cli.py`)
- Gate register → Register loader: provides rows (evidence: `README.md`)
- Register loader → Plant configuration: reads mapping (evidence: `src/gatepass/dataset.py`)
- Command-line entry → Interview grounding: loads transcript (evidence: `src/gatepass/cli.py`)
- Interview transcript → Interview grounding: provides utterances (evidence: `README.md`)
- Command-line entry → Schema validation: loads schema (evidence: `src/gatepass/cli.py`)
- Output schema → Schema validation: defines rules (evidence: `README.md`)
- Command-line entry → Verification and assembly: builds brief (evidence: `src/gatepass/cli.py`)
- Verification and assembly → Claim extraction: extracts claims (evidence: `src/gatepass/brief.py`)
- Claim extraction → Model providers: requests completion (evidence: `README.md`)
- Verification and assembly → Register analysis: analyses register (evidence: `src/gatepass/brief.py`)
- Register analysis → Register loader: analyses movements (evidence: `src/gatepass/register.py`)
- Register analysis → Plant configuration: uses thresholds (evidence: `src/gatepass/register.py`)
- Verification and assembly → Interview grounding: verifies citations (evidence: `src/gatepass/brief.py`)
- Verification and assembly → Plant configuration: assembles plan (evidence: `src/gatepass/brief.py`)
- Verification and assembly → Schema validation: validates result (evidence: `src/gatepass/brief.py`)
- Command-line entry → Compiled brief: writes result (evidence: `src/gatepass/cli.py`)
