# fedotdev/stvor-orchestrator architecture

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

- Interactive diagram: https://gitdiagram.com/fedotdev/stvor-orchestrator
- Repository: https://github.com/fedotdev/stvor-orchestrator

## Overview

Jev Router classifies a task into a deterministic, safety-aware RoutingPlan; it does not execute that plan. The OpenCode tool invokes the Python CLI, which sends typed questions to TypeSafe System One, applies local policy and emits an auditable artifact. Policy-derived text signals supplement the model answers. The repository also includes an offline/live routing evaluator. Acceptance and execution modules are present, but the supplied excerpts do not establish their runtime wiring; the artifact explicitly describes execution as unconfigured.

Main entry points: [`agent_router/cli.py`](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/cli.py) (Router CLI), [`routing_eval/score.py`](https://github.com/fedotdev/stvor-orchestrator/blob/main/routing_eval/score.py) (Routing evaluator), [`agent_router/client.py`](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/client.py) (HTTP client), [`agent_router/artifact.py`](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/artifact.py) (Routing artifact)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Integration"]
  node_opencode["OpenCode plugin<br/>[jev-router.js]"]
  node_cli["Router CLI<br/>[cli.py]"]
  node_systemone{{"System One API"}}
  node_client["HTTP client<br/>[client.py]"]
end

subgraph group_routing["Routing"]
  node_questions["Typed questions<br/>[questions.py]"]
  node_policy["Routing policy<br/>[policy.py]"]
  node_signals["Text signals<br/>[signals.py]"]
  node_config["Router config<br/>[config.py]"]
end

subgraph group_audit["Audit"]
  node_redact["Secret scrubbing<br/>[redact.py]"]
  node_artifact["Routing artifact<br/>[artifact.py]"]
  node_artifact_store[("Artifact files")]
  node_acceptance["Acceptance checks<br/>[acceptance.py]"]
  node_execution["Execution support<br/>[execution.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_scorer["Routing evaluator<br/>[score.py]"]
end

node_user(("Agent user"))

node_user -->|"requests routing"| node_opencode
node_opencode -->|"invokes CLI"| node_cli
node_cli -->|"requests evaluation"| node_client
node_cli -->|"sends questions"| node_questions
node_client -->|"sends request"| node_systemone
node_cli -->|"derives plan"| node_policy
node_policy -->|"computes hints"| node_signals
node_cli -->|"uses settings"| node_config
node_client -->|"reads settings"| node_config
node_cli -->|"builds artifact"| node_artifact
node_artifact -->|"scrubs content"| node_redact
node_artifact -->|"writes JSON"| node_artifact_store
node_scorer -->|"evaluates live cases"| node_client
node_scorer -->|"uses question set"| node_questions
node_scorer -->|"derives routes"| node_policy
node_scorer -->|"uses settings"| node_config
node_scorer -->|"scrubs tasks"| node_redact

click node_opencode "https://github.com/fedotdev/stvor-orchestrator/blob/main/plugins/jev-router.js"
click node_cli "https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/cli.py"
click node_client "https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/client.py"
click node_questions "https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/questions.py"
click node_policy "https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/policy.py"
click node_signals "https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/signals.py"
click node_config "https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/config.py"
click node_redact "https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/redact.py"
click node_artifact "https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/artifact.py"
click node_acceptance "https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/acceptance.py"
click node_execution "https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/execution.py"
click node_scorer "https://github.com/fedotdev/stvor-orchestrator/blob/main/routing_eval/score.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_opencode,node_cli,node_systemone,node_client,node_user toneBlue
class node_questions,node_policy,node_signals,node_config toneAmber
class node_redact,node_artifact,node_artifact_store,node_acceptance,node_execution toneMint
class node_scorer toneRose
```

## Components

### Integration

- [OpenCode plugin](https://github.com/fedotdev/stvor-orchestrator/blob/main/plugins/jev-router.js): `plugins/jev-router.js`
- [Router CLI](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/cli.py): `agent_router/cli.py`
- **System One API**
- [HTTP client](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/client.py): `agent_router/client.py`

### Routing

- [Typed questions](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/questions.py): `agent_router/questions.py`
- [Routing policy](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/policy.py): `agent_router/policy.py`
- [Text signals](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/signals.py): `agent_router/signals.py`
- [Router config](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/config.py): `agent_router/config.py`

### Audit

- [Secret scrubbing](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/redact.py): `agent_router/redact.py`
- [Routing artifact](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/artifact.py): `agent_router/artifact.py`
- **Artifact files**
- [Acceptance checks](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/acceptance.py): `agent_router/acceptance.py`
- [Execution support](https://github.com/fedotdev/stvor-orchestrator/blob/main/agent_router/execution.py): `agent_router/execution.py`

### Evaluation

- [Routing evaluator](https://github.com/fedotdev/stvor-orchestrator/blob/main/routing_eval/score.py): `routing_eval/score.py`

### Other components

- **Agent user**

## Connections

- Agent user → OpenCode plugin: requests routing (evidence: `plugins/jev-router.js`)
- OpenCode plugin → Router CLI: invokes CLI (evidence: `plugins/jev-router.js`)
- Router CLI → HTTP client: requests evaluation (evidence: `agent_router/cli.py`)
- Router CLI → Typed questions: sends questions (evidence: `agent_router/cli.py`)
- HTTP client → System One API: sends request (evidence: `agent_router/client.py`)
- Router CLI → Routing policy: derives plan (evidence: `agent_router/cli.py`)
- Routing policy → Text signals: computes hints (evidence: `agent_router/policy.py`)
- Router CLI → Router config: uses settings (evidence: `agent_router/cli.py`)
- HTTP client → Router config: reads settings (evidence: `agent_router/client.py`)
- Router CLI → Routing artifact: builds artifact (evidence: `agent_router/cli.py`)
- Routing artifact → Secret scrubbing: scrubs content (evidence: `agent_router/artifact.py`)
- Routing artifact → Artifact files: writes JSON (evidence: `agent_router/artifact.py`)
- Routing evaluator → HTTP client: evaluates live cases (evidence: `routing_eval/score.py`)
- Routing evaluator → Typed questions: uses question set (evidence: `routing_eval/score.py`)
- Routing evaluator → Routing policy: derives routes (evidence: `routing_eval/score.py`)
- Routing evaluator → Router config: uses settings (evidence: `routing_eval/score.py`)
- Routing evaluator → Secret scrubbing: scrubs tasks (evidence: `routing_eval/score.py`)
