mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-20 22:02:19 +03:00
Fase 2 da auditoria código×docs 2026-08-31: ~90 divergências corrigidas em README/llm.txt(+42 espelhos)/SVGs/AGENTS.md/25+ docs; correções semânticas (breaker 8/12/2 + DEGRADED, webhooks sem eventos fantasma, ROUTE_GUARD_TIERS completo, API_REFERENCE sem fantasmas, reasoning 200); gate check:docs-counts endurecido (versão em prosa, patterns anti-evasão, superfície +llm.txt/mcp-server/omni-mcp/tier-flow) +5 testes; fonte do gerador de agent-skills corrigida (107/32 → 110/33) e mesma família varrida do Copilot prompt, 39 locales, skills/README, CONTRIBUTING e 2 guias.
25 lines
1.2 KiB
Plaintext
25 lines
1.2 KiB
Plaintext
%% Request pipeline for /v1/chat/completions
|
|
%% Reflects: src/app/api/v1/chat/completions/route.ts → open-sse/handlers/chatCore.ts
|
|
%% v3.8.0
|
|
flowchart LR
|
|
Client["Client<br/>(IDE/CLI/SDK)"] --> Route["Next.js Route<br/>/v1/chat/completions"]
|
|
Route --> CORS["CORS preflight"]
|
|
CORS --> Validate["Zod validation<br/>(request body)"]
|
|
Validate --> Authz["AuthZ pipeline<br/>(extractApiKey +<br/>isValidApiKey)"]
|
|
Authz --> Policy["API key policy<br/>(allowlist + scopes)"]
|
|
Policy --> Guard["Prompt-injection<br/>guardrail"]
|
|
Guard --> ChatCore["handleChatCore"]
|
|
ChatCore --> Cache{"Cache hit?"}
|
|
Cache -->|yes| Return["Return cached"]
|
|
Cache -->|no| Rate["Rate limit<br/>(per-key, per-IP)"]
|
|
Rate --> Combo{"Combo<br/>target?"}
|
|
Combo -->|combo| Resolve["resolveComboTargets<br/>(19 strategies)"]
|
|
Resolve --> Single["handleSingleModel<br/>(per target)"]
|
|
Combo -->|single| Single
|
|
Single --> Translate["translateRequest<br/>(OpenAI↔Claude↔Gemini)"]
|
|
Translate --> Exec["getExecutor<br/>(104 executor modules)"]
|
|
Exec --> Upstream["Upstream Provider<br/>(352 catalog entries)"]
|
|
Upstream --> Stream["SSE / JSON"]
|
|
Stream --> Transformer["responsesTransformer<br/>(Responses↔Chat)"]
|
|
Transformer --> Client
|