docs: link Mermaid diagrams from 8 architecture/framework docs

Wire the new docs/diagrams/exported/*.svg into the documents that
already describe each flow, with the .mmd source linked alongside so
edits stay auditable:

- CLAUDE.md                       resilience-3layers
- docs/ARCHITECTURE.md            request-pipeline + resilience-3layers
- docs/AUTO-COMBO.md              auto-combo-9factor
- docs/RESILIENCE_GUIDE.md        resilience-3layers
- docs/I18N.md                    i18n-flow
- docs/MCP-SERVER.md              mcp-tools-37
- docs/CLOUD_AGENT.md             cloud-agent-flow
- docs/AUTHZ_GUIDE.md             authz-pipeline
- docs/CODEBASE_DOCUMENTATION.md  request-pipeline + db-schema-overview

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
diegosouzapw
2026-05-13 13:54:26 -03:00
parent 519fdf41b8
commit ee97583e02
9 changed files with 51 additions and 1 deletions

View File

@@ -79,7 +79,10 @@ API routes follow a consistent pattern: `Route → CORS preflight → Zod body v
## Resilience Runtime State
OmniRoute has three related but distinct temporary-failure mechanisms. Keep their
scope separate when debugging routing behavior.
scope separate when debugging routing behavior. See the
[3-layer resilience diagram](./docs/diagrams/exported/resilience-3layers.svg)
(source: [docs/diagrams/resilience-3layers.mmd](./docs/diagrams/resilience-3layers.mmd))
for an at-a-glance map.
### Provider Circuit Breaker

View File

@@ -78,6 +78,21 @@ Primary runtime model:
- Next.js app routes under `src/app/api/*` implement both dashboard APIs and compatibility APIs
- A shared SSE/routing core in `src/sse/*` + `open-sse/*` handles provider execution, translation, streaming, fallback, and usage
## Reference Diagrams
Canonical, version-controlled Mermaid sources for the v3.8.0 platform live in
[`docs/diagrams/`](./diagrams/README.md). Two are reproduced below for orientation;
the rest are linked from their domain-specific guides.
![Request pipeline (/v1/chat/completions)](./diagrams/exported/request-pipeline.svg)
> Source: [diagrams/request-pipeline.mmd](./diagrams/request-pipeline.mmd)
![3-layer resilience model](./diagrams/exported/resilience-3layers.svg)
> Source: [diagrams/resilience-3layers.mmd](./diagrams/resilience-3layers.mmd) — also linked from
> [RESILIENCE_GUIDE.md](./RESILIENCE_GUIDE.md) and the `CLAUDE.md` resilience reference.
## Scope and Boundaries
### In Scope

View File

@@ -5,6 +5,10 @@
OmniRoute has a route-aware authorization pipeline that gates every API request. Classification is **deterministic** and **fail-closed** — anything that cannot be classified ends up as `MANAGEMENT` and demands a session or management-grade token. This page explains the model for engineers maintaining routes or designing new endpoints.
![AuthZ pipeline (3 route classes + policy evaluation)](./diagrams/exported/authz-pipeline.svg)
> Source: [diagrams/authz-pipeline.mmd](./diagrams/authz-pipeline.mmd)
## Two Auth Modes
### 1. API Key (Bearer)

View File

@@ -77,6 +77,10 @@ Auto-scoring selects best provider/model per request
The Auto-Combo Engine dynamically selects the best provider/model for each request using a **9-factor scoring function** (defined in `open-sse/services/autoCombo/scoring.ts``DEFAULT_WEIGHTS`). All weights sum to **1.0**.
![Auto-Combo 9-factor scoring](./diagrams/exported/auto-combo-9factor.svg)
> Source: [diagrams/auto-combo-9factor.mmd](./diagrams/auto-combo-9factor.mmd)
| Factor | Default Weight | Description |
| :----------------- | :------------- | :---------------------------------------------------------------------- |
| `health` | 0.22 | Health score from circuit breaker (CLOSED=1.0, HALF_OPEN=0.5, OPEN=0.0) |

View File

@@ -12,6 +12,10 @@ A Cloud Agent task is **not** a regular chat completion. It is a durable, multi-
unit of work that may take minutes to hours, can produce a Pull Request as its
artifact, and supports follow-up messages and (in some providers) plan approval gates.
![Cloud Agent task lifecycle](./diagrams/exported/cloud-agent-flow.svg)
> Source: [diagrams/cloud-agent-flow.mmd](./diagrams/cloud-agent-flow.mmd)
## Supported Agents
| Provider ID | Class | Source | Upstream Base URL | Plan Approval |

View File

@@ -286,6 +286,10 @@ Top-level files in `src/lib/`:
Singleton SQLite database (`getDbInstance()` in `core.ts`, WAL journaling).
**Never write raw SQL in routes or handlers** — go through these modules.
![Database schema overview (selected core tables)](./diagrams/exported/db-schema-overview.svg)
> Source: [diagrams/db-schema-overview.mmd](./diagrams/db-schema-overview.mmd)
Domain modules (each owns one or more tables): `apiKeys.ts`, `backup.ts`,
`batches.ts`, `cleanup.ts`, `cliToolState.ts`, `combos.ts`,
`commandCodeAuth.ts`, `compression.ts`, `compressionAnalytics.ts`,
@@ -638,6 +642,10 @@ Common commands:
## 9. Request Pipeline (Summary)
![Request pipeline (/v1/chat/completions)](./diagrams/exported/request-pipeline.svg)
> Source: [diagrams/request-pipeline.mmd](./diagrams/request-pipeline.mmd)
```
Client request
→ /v1/chat/completions (route.ts)

View File

@@ -17,6 +17,10 @@ OmniRoute supports **30 languages** with full dashboard UI translation, translat
## Architecture
![Incremental hash-based i18n pipeline](./diagrams/exported/i18n-flow.svg)
> Source: [diagrams/i18n-flow.mmd](./diagrams/i18n-flow.mmd)
### Source of Truth
- **UI strings**: `src/i18n/messages/en.json` (English source, ~2800 keys)

View File

@@ -4,6 +4,10 @@
>
> Source of truth: `open-sse/mcp-server/schemas/tools.ts` (30 tools) + `open-sse/mcp-server/tools/memoryTools.ts` (3 tools) + `open-sse/mcp-server/tools/skillTools.ts` (4 tools). Tool registration and scope wiring lives in `open-sse/mcp-server/server.ts`.
![MCP tool inventory (37 tools by category)](./diagrams/exported/mcp-tools-37.svg)
> Source: [diagrams/mcp-tools-37.mmd](./diagrams/mcp-tools-37.mmd)
## Installation
OmniRoute MCP is built-in. Start it with:

View File

@@ -2,6 +2,10 @@
OmniRoute has three distinct but related resilience mechanisms. Each has a different scope and purpose. Keep them separate when debugging routing behavior.
![3-layer resilience model](./diagrams/exported/resilience-3layers.svg)
> Source: [diagrams/resilience-3layers.mmd](./diagrams/resilience-3layers.mmd)
## 1. Provider Circuit Breaker
**Scope:** entire provider (e.g., `glm`, `openai`, `anthropic`).