# manassharma2006/stratum-open architecture

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

- Interactive diagram: https://gitdiagram.com/manassharma2006/stratum-open
- Repository: https://github.com/manassharma2006/stratum-open

## Overview

Stratum Open reviews pull requests for maintainers: it reads a PR diff, applies repository policy and automated checks, asks a configured model to review in-scope changes, then ranks findings and publishes review feedback and triage on the hosting platform. The README also describes dependency, workflow, agent-instruction, Python-name and weakened-test checks, plus an optional incremental/early-check workflow. The graph emphasizes the documented runner-to-engine flow and sampled module references; GitLab and several feature-specific check implementations are represented at subsystem level where their runtime wiring was not excerpted.

Main entry points: [`stratum_open/runner.py`](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/runner.py) (Review runner), [`stratum_open/checks/__init__.py`](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/checks/__init__.py) (Automated checks), [`stratum_open/review.py`](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/review.py) (Model review), [`stratum_open/findings.py`](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/findings.py) (Findings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_githubaction["GitHub Action<br/>[action.py]"]
  node_cli["CLI<br/>[cli.py]"]
  node_app["App interface<br/>[app.py]"]
  node_runner["Review runner<br/>[runner.py]"]
end

subgraph group_analysis["Review analysis"]
  node_policy["Policy<br/>[policy.py]"]
  node_diff["Diff handling<br/>[diff.py]"]
  node_checks["Automated checks<br/>[__init__.py]"]
  node_dependencychecks["Dependency checks<br/>[dependencies.py]"]
  node_pythonnamechecks["Python name checks<br/>[unknown_names.py]"]
  node_modelreview["Model review<br/>[review.py]"]
  node_modelclient["Model client<br/>[model.py]"]
  node_findings["Findings<br/>[findings.py]"]
end

subgraph group_triage["Triage and state"]
  node_triage["PR triage<br/>[triage.py]"]
  node_queue["Review queue<br/>[triage_queue.py]"]
  node_storage[("Review storage<br/>[storage.py]")]
  node_trackrecord[("Track record<br/>[track_record.py]")]
end

subgraph group_hosting["Platform integration"]
  node_githubpublish["GitHub publishing<br/>[publish.py]"]
  node_githubapi["GitHub API<br/>[api.py]"]
  node_gitlabci["GitLab CI<br/>[ci.py]"]
  node_gitlabapi["GitLab API<br/>[api.py]"]
end

node_maintainer(("Maintainer"))
node_pullrequest["Pull request"]
node_github{{"GitHub"}}
node_gitlab{{"GitLab"}}
node_modelserver{{"Model server"}}

node_maintainer -->|"configures"| node_githubaction
node_pullrequest -->|"triggers review"| node_runner
node_githubaction -->|"invokes"| node_runner
node_cli -.->|"invokes"| node_runner
node_app -.->|"invokes"| node_runner
node_runner -->|"loads rules"| node_policy
node_runner -->|"prepares changes"| node_diff
node_runner -->|"runs analysis"| node_checks
node_checks -->|"dispatches"| node_dependencychecks
node_checks -.->|"dispatches"| node_pythonnamechecks
node_runner -->|"requests review"| node_modelreview
node_modelreview -->|"prompts"| node_modelclient
node_modelclient -->|"sends requests"| node_modelserver
node_runner -->|"ranks results"| node_findings
node_checks -->|"creates findings"| node_findings
node_modelreview -->|"creates findings"| node_findings
node_runner -->|"assigns priority"| node_triage
node_triage -->|"uses history"| node_trackrecord
node_runner -->|"persists state"| node_storage
node_runner -->|"publishes review"| node_githubpublish
node_githubpublish -->|"posts feedback"| node_githubapi
node_githubapi -->|"reads and writes"| node_github
node_github -->|"supplies changes"| node_pullrequest
node_gitlabci -.->|"uses client"| node_gitlabapi
node_gitlab -.->|"runs pipeline"| node_gitlabci

click node_githubaction "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/action.py"
click node_cli "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/cli.py"
click node_app "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/app.py"
click node_runner "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/runner.py"
click node_policy "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/policy.py"
click node_diff "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/diff.py"
click node_checks "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/checks/__init__.py"
click node_dependencychecks "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/checks/dependencies.py"
click node_pythonnamechecks "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/repo/unknown_names.py"
click node_modelreview "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/review.py"
click node_modelclient "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/model.py"
click node_findings "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/findings.py"
click node_triage "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/triage.py"
click node_queue "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/triage_queue.py"
click node_storage "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/storage.py"
click node_trackrecord "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/track_record.py"
click node_githubpublish "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/github/publish.py"
click node_githubapi "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/github/api.py"
click node_gitlabci "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/gitlab/ci.py"
click node_gitlabapi "https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/gitlab/api.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_githubaction,node_cli,node_app,node_runner toneBlue
class node_policy,node_diff,node_checks,node_dependencychecks,node_pythonnamechecks,node_modelreview,node_modelclient,node_findings toneAmber
class node_triage,node_queue,node_storage,node_trackrecord,node_pullrequest,node_modelserver toneMint
class node_githubpublish,node_githubapi,node_gitlabci,node_gitlabapi toneRose
class node_maintainer,node_github,node_gitlab toneIndigo
```

## Components

### Entry points

- [GitHub Action](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/action.py): `stratum_open/action.py`
- [CLI](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/cli.py): `stratum_open/cli.py`
- [App interface](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/app.py): `stratum_open/app.py`
- [Review runner](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/runner.py): `stratum_open/runner.py`

### Review analysis

- [Policy](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/policy.py): `stratum_open/policy.py`
- [Diff handling](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/diff.py): `stratum_open/diff.py`
- [Automated checks](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/checks/__init__.py): `stratum_open/checks/__init__.py`
- [Dependency checks](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/checks/dependencies.py): `stratum_open/checks/dependencies.py`
- [Python name checks](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/repo/unknown_names.py): `stratum_open/repo/unknown_names.py`
- [Model review](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/review.py): `stratum_open/review.py`
- [Model client](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/model.py): `stratum_open/model.py`
- [Findings](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/findings.py): `stratum_open/findings.py`

### Triage and state

- [PR triage](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/triage.py): `stratum_open/triage.py`
- [Review queue](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/triage_queue.py): `stratum_open/triage_queue.py`
- [Review storage](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/storage.py): `stratum_open/storage.py`
- [Track record](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/track_record.py): `stratum_open/track_record.py`

### Platform integration

- [GitHub publishing](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/github/publish.py): `stratum_open/github/publish.py`
- [GitHub API](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/github/api.py): `stratum_open/github/api.py`
- [GitLab CI](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/gitlab/ci.py): `stratum_open/gitlab/ci.py`
- [GitLab API](https://github.com/manassharma2006/stratum-open/blob/main/stratum_open/gitlab/api.py): `stratum_open/gitlab/api.py`

### Other components

- **Maintainer**
- **Pull request**
- **GitHub**
- **GitLab**
- **Model server**

## Connections

- Maintainer → GitHub Action: configures
- Pull request → Review runner: triggers review
- GitHub Action → Review runner: invokes
- CLI → Review runner: invokes
- App interface → Review runner: invokes (evidence: `stratum_open/app.py`)
- Review runner → Policy: loads rules (evidence: `stratum_open/runner.py`)
- Review runner → Diff handling: prepares changes (evidence: `stratum_open/runner.py`)
- Review runner → Automated checks: runs analysis (evidence: `stratum_open/runner.py`)
- Automated checks → Dependency checks: dispatches (evidence: `stratum_open/checks/__init__.py`)
- Automated checks → Python name checks: dispatches
- Review runner → Model review: requests review (evidence: `stratum_open/runner.py`)
- Model review → Model client: prompts (evidence: `stratum_open/review.py`)
- Model client → Model server: sends requests (evidence: `stratum_open/model.py`)
- Review runner → Findings: ranks results (evidence: `stratum_open/runner.py`)
- Automated checks → Findings: creates findings (evidence: `stratum_open/checks/__init__.py`)
- Model review → Findings: creates findings (evidence: `stratum_open/review.py`)
- Review runner → PR triage: assigns priority (evidence: `stratum_open/runner.py`)
- PR triage → Track record: uses history (evidence: `stratum_open/triage.py`)
- Review runner → Review storage: persists state (evidence: `stratum_open/runner.py`)
- Review runner → GitHub publishing: publishes review (evidence: `stratum_open/runner.py`)
- GitHub publishing → GitHub API: posts feedback (evidence: `stratum_open/github/publish.py`)
- GitHub API → GitHub: reads and writes (evidence: `stratum_open/github/api.py`)
- GitHub → Pull request: supplies changes
- GitLab CI → GitLab API: uses client (evidence: `stratum_open/gitlab/ci.py`)
- GitLab → GitLab CI: runs pipeline
