Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
Remove obsolete files: deleted unused test-debug.ts, .semgrep rules, documentation images, and various markdown files related to skill generation and audit reports.
diegosouzapw277f530f0e77
diff --git a/.semgrep/rules/cli-no-sqlite.yaml b/.semgrep/rules/cli-no-sqlite.yamldeleted file mode 100644index 5057d888c3..0000000000--- a/.semgrep/rules/cli-no-sqlite.yaml+++ /dev/null@@ -1,31 +0,0 @@-rules:- - id: cli-no-sqlite-direct- patterns:- - pattern: new Database(...)- paths:- include:- - "/bin/**"- exclude:- - "/bin/cli/sqlite.mjs"- message: >- Direct SQLite access in bin/ is banned. Use src/lib/db/* helpers or- withRuntime() from bin/cli/runtime.mjs. See CLAUDE.md hard rule #5 and- bin/cli/CONVENTIONS.md.- languages: [js]- severity: ERROR-- - id: cli-no-raw-sql- patterns:- - pattern: $DB.prepare("INSERT INTO ...")- - pattern: $DB.prepare("DELETE FROM ...")- - pattern: $DB.prepare("UPDATE $TABLE SET ...")- paths:- include:- - "/bin/**"- exclude:- - "/bin/cli/sqlite.mjs"- message: >- Raw SQL in bin/ is banned. Use src/lib/db/* helpers. See CLAUDE.md- hard rule #5 and bin/cli/CONVENTIONS.md.- languages: [js]- severity: ERRORdiff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-generator-output.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-generator-output.mddeleted file mode 100644index f5df11b544..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-generator-output.md+++ /dev/null@@ -1,133 +0,0 @@-# Task 15 — Skill Generator Output--Timestamp: 2026-05-28T00:00:00.000Z-------## Dry-run summary--- Generated: 42 SKILL.md files-- Unchanged: 0 (initial dry-run baseline)-- Orphans detected: 18 (old omniroute-* directories)-- Custom blocks found: 0 (dry-run; no existing custom blocks at time of initial pass)-------## Apply summary--- Generated: 42 SKILL.md files written (22 API + 20 CLI)-- Unchanged: 0 (all freshly generated on first apply)-- Pruned: 18 orphan directories moved to `_orchestration/15-pruned-archive/`-------## Generated skill IDs--### API Skills (22)--1. `omni-auth`-2. `omni-providers`-3. `omni-models`-4. `omni-combos-routing`-5. `omni-api-keys`-6. `omni-usage-logs`-7. `omni-budget`-8. `omni-settings`-9. `omni-proxies`-10. `omni-cache`-11. `omni-compression`-12. `omni-context-rtk`-13. `omni-resilience`-14. `omni-cli-tools`-15. `omni-tunnels`-16. `omni-sync-cloud`-17. `omni-db-backups`-18. `omni-webhooks`-19. `omni-mcp`-20. `omni-agents-a2a`-21. `omni-version-manager`-22. `omni-inference`--### CLI Skills (20)--1. `cli-serve`-2. `cli-health`-3. `cli-providers`-4. `cli-keys`-5. `cli-models`-6. `cli-chat`-7. `cli-routing`-8. `cli-resilience`-9. `cli-compression`-10. `cli-contexts`-11. `cli-cost-usage`-12. `cli-mcp`-13. `cli-a2a`-14. `cli-tunnel`-15. `cli-backup-sync`-16. `cli-policy-audit`-17. `cli-batches`-18. `cli-eval`-19. `cli-plugins-skills`-20. `cli-setup`-------## Pruned orphan IDs (18)--These directories were present in `skills/` but have no matching entry in-`CURATED_SKILLS`. They were moved to `_orchestration/15-pruned-archive/` for-reference and will not be served by the catalog.--1. `omniroute`-2. `omniroute-a2a`-3. `omniroute-chat`-4. `omniroute-cli`-5. `omniroute-cli-admin`-6. `omniroute-cli-cloud`-7. `omniroute-cli-eval`-8. `omniroute-cli-providers`-9. `omniroute-compression`-10. `omniroute-embeddings`-11. `omniroute-image`-12. `omniroute-mcp`-13. `omniroute-monitoring`-14. `omniroute-routing`-15. `omniroute-stt`-16. `omniroute-tts`-17. `omniroute-web-fetch`-18. `omniroute-web-search`--Archive location: `_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/`-------## Idempotency confirmation--A second apply run with the same 42-entry `CURATED_SKILLS` produced:--- Generated: 0 (all files already up-to-date)-- Unchanged: 42-- Pruned: 0--The generator correctly detects that all output files are current and skips-regeneration, confirming idempotent behaviour.-------## Custom blocks preserved (10)--The following skills contained `<!-- skill:custom-start --> ... <!-- skill:custom-end -->`-blocks with manually authored content. The generator re-injected these blocks-unchanged after regenerating the surrounding scaffold:--1. `omni-auth`-2. `omni-resilience`-3. `omni-mcp`-4. `omni-combos-routing`-5. `omni-compression`-6. `omni-agents-a2a`-7. `omni-inference`-8. `cli-serve`-9. `cli-providers`-10. `cli-eval`diff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-a2a/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-a2a/SKILL.mddeleted file mode 100644index 2783c6261f..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-a2a/SKILL.md+++ /dev/null@@ -1,71 +0,0 @@-----name: omniroute-a2a-description: OmniRoute exposes an A2A (Agent-to-Agent) JSON-RPC 2.0 server with 5 skills (smart-routing, quota-management, provider-discovery, cost-analysis, health-report). Use when the user wants OmniRoute to act as an agent peer in an A2A network or multi-agent pipeline.------# OmniRoute — A2A Protocol--Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md) for setup.--OmniRoute publishes an Agent Card at `/.well-known/agent.json` and accepts-JSON-RPC 2.0 calls at `/a2a`.--## Discovery--```bash-curl $OMNIROUTE_URL/.well-known/agent.json-```--Returns Agent Card with skills, endpoints, auth scheme.--## Available skills--| Skill | Purpose |-| -------------------- | ----------------------------------------------------------------------------------- |-| `smart-routing` | Given a prompt, recommends best provider/model combo |-| `quota-management` | Reports quota balance for given provider/account |-| `provider-discovery` | Lists providers matching capability filters (vision, JSON mode, tools, max-context) |-| `cost-analysis` | Estimates cost for a given request shape |-| `health-report` | Returns system health (circuit states, latencies, errors) |--## Call example (JSON-RPC 2.0)--```bash-curl -X POST $OMNIROUTE_URL/a2a \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "jsonrpc": "2.0",- "method": "tasks/send",- "params": {- "skillId": "smart-routing",- "input": { "prompt_length": 4000, "tools": true, "vision": false }- },- "id": 1- }'-```--## Response shape--```json-{- "jsonrpc": "2.0",- "result": {- "taskId": "...",- "status": "completed",- "output": { "recommended_combo": "...", "reasoning": "..." }- },- "id": 1-}-```--## Errors--- `-32600` → invalid request (bad JSON-RPC envelope)-- `-32601` → method not found (check `method` field)-- `-32602` → invalid params (check `skillId` against Agent Card)-- `401` → missing/invalid `OMNIROUTE_KEY`--## Reference--Full docs: https://github.com/diegosouzapw/OmniRoute/blob/main/docs/frameworks/A2A-SERVER.mddiff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-chat/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-chat/SKILL.mddeleted file mode 100644index 7f97c73cd0..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-chat/SKILL.md+++ /dev/null@@ -1,68 +0,0 @@-----name: omniroute-chat-description: Chat / code generation via OmniRoute using OpenAI /v1/chat/completions or Anthropic /v1/messages format with SSE streaming, auto-fallback combos, RTK token saver, and 207+ providers. Use when the user wants to ask an LLM, generate code, summarize text, or run prompts through OmniRoute.------# OmniRoute — Chat--Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md) for setup.--## Endpoints--- `POST $OMNIROUTE_URL/v1/chat/completions` — OpenAI format-- `POST $OMNIROUTE_URL/v1/messages` — Anthropic Messages format-- `POST $OMNIROUTE_URL/v1/responses` — OpenAI Responses API--## Discover--```bash-curl $OMNIROUTE_URL/v1/models | jq '.data[].id'-```--Combos (e.g. `auto`, `cost-optimized`, `subscription`) auto-fallback through multiple providers.--## OpenAI format example--```bash-curl -X POST $OMNIROUTE_URL/v1/chat/completions \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "model": "claude-opus-4-7",- "messages": [{"role": "user", "content": "Refactor this function"}],- "stream": true- }'-```--## Anthropic format example--```bash-curl -X POST $OMNIROUTE_URL/v1/messages \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "anthropic-version: 2023-06-01" \- -H "Content-Type: application/json" \- -d '{- "model": "claude-opus-4-7",- "max_tokens": 4096,- "messages": [{"role": "user", "content": "Hi"}]- }'-```--## Tool use--Supports OpenAI `tools` array and Anthropic `tools` block. Tool results-auto-compressed via RTK (47 filters: git-diff, grep, test-jest, terraform-plan,-docker-logs, etc.) — 20-40% token savings. Disable per-request with-`X-Omniroute-Rtk: off` header.--## Reasoning / thinking--Anthropic extended thinking and OpenAI Responses reasoning blocks are forwarded-verbatim. Cached automatically via reasoning cache.--## Errors--- `401` → invalid API key-- `400 invalid_model` → model not in registry; check `/v1/models`-- `503 circuit_open` → provider circuit breaker tripped; retry later or use combo-- `429 rate_limited` → honor `Retry-After`; consider using a combo for auto-fallbackdiff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli-admin/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli-admin/SKILL.mddeleted file mode 100644index 082817cf4d..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli-admin/SKILL.md+++ /dev/null@@ -1,145 +0,0 @@-----name: omniroute-cli-admin-description: Manage the OmniRoute server lifecycle via CLI — start/stop/restart, non-interactive setup, diagnostics (omniroute doctor), backup/restore, autostart, and tunnel management. Use when the user wants to operate the OmniRoute server, automate provisioning, or troubleshoot the runtime.------# OmniRoute — CLI Admin--Requires the `omniroute` CLI. See [CLI entry-point skill](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli/SKILL.md) for install + global flags.--## Server lifecycle--```bash-omniroute # Start server (default port 20128)-omniroute serve # Explicit alias-omniroute --port 3000 # Override port-omniroute --no-open # Don't auto-open browser-omniroute --mcp # Start as MCP server (stdio transport)--omniroute stop # Stop the running server-omniroute restart # Restart the server--omniroute dashboard # Open dashboard in browser-omniroute open # Alias for dashboard-omniroute status # Runtime status (uptime, requests, providers)-```--## Setup & provisioning--### Interactive wizard--```bash-omniroute setup # Step-by-step interactive setup-```--### Non-interactive (CI / Docker)--```bash-omniroute setup --non-interactive \- --password 'admin-password' \- --add-provider \- --provider openai \- --api-key 'sk-...' \- --test-provider-```--Environment variables for non-interactive setup:--| Variable | Purpose |-| ----------------------------- | -------------------------------------------- |-| `OMNIROUTE_SETUP_PASSWORD` | Admin password (≥8 chars) |-| `OMNIROUTE_PROVIDER` | Provider id (e.g. `openai`, `anthropic`) |-| `OMNIROUTE_PROVIDER_NAME` | Display name for the connection |-| `OMNIROUTE_PROVIDER_BASE_URL` | Optional OpenAI-compatible base URL override |-| `OMNIROUTE_API_KEY` | Provider API key |-| `OMNIROUTE_DEFAULT_MODEL` | Optional default model |-| `DATA_DIR` | Override OmniRoute data directory |--## Diagnostics--```bash-omniroute doctor # Full health check-omniroute doctor --json # Machine-readable JSON-omniroute doctor --no-liveness # Skip HTTP health probe-omniroute doctor --host 0.0.0.0 # Override liveness host-omniroute doctor --liveness-url <url> # Full URL override-```--Checks performed: Config, Database, Storage/encryption, Port, Node runtime, Native binary (better-sqlite3), Memory, Server liveness.--Exit code is non-zero if any check fails — useful in CI:--```bash-omniroute doctor --json | jq '.checks[] | select(.status=="fail")'-```--## Backup & restore--```bash-omniroute backup # Snapshot config + SQLite DB to ~/.omniroute/backups/-omniroute restore # Restore from a previous snapshot (interactive picker)-```--## Autostart (system tray / startup)--```bash-omniroute autostart enable # Register OmniRoute as a system startup item-omniroute autostart disable # Remove startup registration-omniroute autostart status # Show current autostart state-```--On Linux: creates a **systemd user service** (`~/.config/systemd/user/omniroute.service`) and enables **linger** so the service can start after reboot without a graphical login; on desktop sessions it also adds an XDG autostart entry with `--tray`. On macOS: LaunchAgent plist. On Windows: registry startup entry.--## Tunnels (public URL)--Expose a local OmniRoute instance via a secure tunnel:--```bash-omniroute tunnel list # List active tunnels-omniroute tunnel create cloudflare # Start a Cloudflare Tunnel (free)-omniroute tunnel create tailscale # Start a Tailscale funnel-omniroute tunnel create ngrok # Start an ngrok tunnel-omniroute tunnel stop <id> # Stop a running tunnel-```--The tunnel URL is printed and can be used as `OMNIROUTE_BASE_URL` from remote machines.--## Config & environment--```bash-omniroute config show # Display current effective configuration-omniroute env show # List all OmniRoute environment variables-omniroute env get <KEY> # Get a single env var value-omniroute env set <KEY> <value> # Set an env var (temporary — until restart)-```--## Recovery--```bash-omniroute reset-password # Reset the admin password interactively-omniroute reset-encrypted-columns # Dry-run: show encrypted credential columns-omniroute reset-encrypted-columns --force # Null out encrypted credentials in SQLite-```--Use `reset-encrypted-columns --force` only if `STORAGE_ENCRYPTION_KEY` was lost and you need to re-enter all provider API keys.--## Logs--```bash-omniroute logs # Stream live request logs-omniroute logs --json # JSON log entries-omniroute logs --search <term> # Filter by term-omniroute logs --follow # Tail mode (keep streaming)-```--## Update--```bash-omniroute update # Check for a newer version and prompt to update-```--## Errors--- `doctor` shows `STORAGE_ENCRYPTION_KEY missing` → set the key in `.env` or run `reset-encrypted-columns --force` to wipe and re-enter credentials-- `doctor` reports native binary fail → `npm rebuild better-sqlite3` in the OmniRoute app directory-- `tunnel create cloudflare` hangs → ensure `cloudflared` is installed: `brew install cloudflare/cloudflare/cloudflared`diff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli-cloud/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli-cloud/SKILL.mddeleted file mode 100644index 75e83ef4a6..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli-cloud/SKILL.md+++ /dev/null@@ -1,120 +0,0 @@-----name: omniroute-cli-cloud-description: Control OmniRoute cloud agents (OpenAI Codex, Devin, Jules) from the CLI — create tasks, track status, approve plans, send messages, and manage sources. Use when the user wants to automate cloud coding agent workflows via the terminal.------# OmniRoute — CLI Cloud Agents--Requires the `omniroute` CLI. See [CLI entry-point skill](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli/SKILL.md) for install + global flags.--## Supported agents--| Agent | ID | Auth required |-| -------------- | ------- | -------------- |-| OpenAI Codex | `codex` | OpenAI API key |-| Devin | `devin` | Devin API key |-| Jules (Google) | `jules` | Google OAuth |--## Authenticate an agent--```bash-omniroute cloud codex auth # Set / refresh Codex API key-omniroute cloud devin auth # Set / refresh Devin API key-omniroute cloud jules auth # OAuth login for Jules (opens browser)-```--## List all agents--```bash-omniroute cloud agents # Show all configured cloud agents + status-omniroute cloud agents --json-```--## Create a task--```bash-omniroute cloud codex task create \- --title "Add OAuth to the auth module" \- --prompt "Implement Google OAuth 2.0 login in src/auth/oauth.ts"--omniroute cloud codex task create \- --title "Fix test failures" \- --prompt-file ./task-description.md # Read prompt from a file-```--Same syntax for `devin` and `jules`:--```bash-omniroute cloud devin task create --title "..." --prompt "..."-omniroute cloud jules task create --title "..." --prompt "..."-```--## List tasks--```bash-omniroute cloud codex task list # All Codex tasks (table)-omniroute cloud codex task list --json # JSON output-```--## Get task details--```bash-omniroute cloud codex task get <taskId> # Full task record-omniroute cloud codex task status <taskId> # Status + progress only-```--Task status values: `running`, `completed`, `failed`, `cancelled`.--## Approve a plan--Devin and Jules may pause for plan approval before writing code:--```bash-omniroute cloud devin task approve <taskId> # Approve the proposed plan-omniroute cloud jules task approve <taskId>-```--## Send a message to a running task--```bash-omniroute cloud codex task message <taskId> "Focus on the backend only, skip the UI"-```--## List task sources (files touched)--```bash-omniroute cloud codex task sources <taskId> # Files changed / created by the task-```--## Cancel a task--```bash-omniroute cloud codex task cancel <taskId>-omniroute cloud devin task cancel <taskId>-```--## Typical workflow--```bash-# 1. Authenticate-omniroute cloud codex auth--# 2. Create a task-TASK_ID=$(omniroute cloud codex task create \- --title "Refactor auth module" \- --prompt "Extract JWT logic to src/auth/jwt.ts" \- --output json | jq -r '.id')--# 3. Poll status-omniroute cloud codex task status $TASK_ID--# 4. View touched files when complete-omniroute cloud codex task sources $TASK_ID-```--## Errors--- `auth required` → run `omniroute cloud <agent> auth` before any task commands-- `task create` fails with 402 → agent billing limit reached; check your Codex/Devin/Jules account-- `task approve` fails with 404 → task does not have a pending plan; check status first-- `jules auth` browser flow fails → ensure Google account has Jules access; try `omniroute cloud jules auth` againdiff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli-eval/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli-eval/SKILL.mddeleted file mode 100644index 244097d4b7..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli-eval/SKILL.md+++ /dev/null@@ -1,113 +0,0 @@-----name: omniroute-cli-eval-description: Run and manage OmniRoute eval suites from the CLI — create suites, run benchmarks, watch live results, view scorecards, and compare model performance. Use when the user wants to benchmark models, validate quality regressions, or automate LLM evals in CI.------# OmniRoute — CLI Evals--Requires the `omniroute` CLI. See [CLI entry-point skill](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli/SKILL.md) for install + global flags.--## What are evals?--Evals are automated test suites that score LLM outputs against expected answers or rubrics. OmniRoute stores suites and run results in its local database.--## Eval suites--```bash-omniroute eval suites list # List all eval suites-omniroute eval suites list --json # JSON output--omniroute eval suites get <suiteId> # Full suite definition-```--### Create a suite--```bash-omniroute eval suites create \- --name "code-quality" \- --rubric "exact-match" \- --samples-file ./samples.jsonl # JSONL: {input, expected_output}-```--Rubric options: `exact-match`, `contains`, `llm-judge`, `regex`.--`--samples-file` format (one JSON object per line):--```jsonl-{"input": "What is 2+2?", "expected_output": "4"}-{"input": "Translate 'hello' to Spanish", "expected_output": "hola"}-```--## Run an eval--```bash-omniroute eval suites run <suiteId> \- --model claude-sonnet-4-6 # Run suite against a specific model--omniroute eval suites run <suiteId> \- --model gpt-4o \- --watch # Live TUI progress (EvalWatch)-```--The run is asynchronous. Use `--watch` for a live terminal dashboard or poll manually:--```bash-RUN_ID=$(omniroute eval suites run <suiteId> --model claude-sonnet-4-6 --output json | jq -r '.id')-omniroute eval get $RUN_ID-```--## Manage runs--```bash-omniroute eval list # List all eval runs-omniroute eval list --json--omniroute eval get <runId> # Run details (status, model, score)-omniroute eval results <runId> # Per-sample results-omniroute eval scorecard <runId> # Full scorecard with pass/fail per sample-omniroute eval cancel <runId> # Cancel a running eval-```--## Scorecard output--```bash-omniroute eval scorecard <runId> --output json-```--Response fields per sample:--```json-{- "id": "sample-1",- "score": 0.95,- "passed": true,- "input": "What is 2+2?",- "output": "4",- "expected": "4"-}-```--## Comparing models--Run the same suite against multiple models and compare:--```bash-for MODEL in claude-sonnet-4-6 gpt-4o gemini-2.0-flash; do- omniroute eval suites run $SUITE_ID --model $MODEL --output json | jq '{model: .model, score: .score}'-done-```--## CI integration--```bash-# Run and fail CI if score drops below threshold-SCORE=$(omniroute eval suites run $SUITE_ID --model claude-sonnet-4-6 --output json | jq -r '.score')-python3 -c "import sys; score=float('$SCORE'); sys.exit(0 if score >= 0.90 else 1)"-```--## Errors--- `suites create` fails with `invalid rubric` → use one of: `exact-match`, `contains`, `llm-judge`, `regex`-- `suites run` returns `model not found` → verify model ID with `omniroute models --search <name>`-- `eval get` shows `status: failed` → check `omniroute logs --search eval` for error details-- `scorecard` returns empty results → the run may still be `running`; poll `omniroute eval get <runId>` until `status` is `completed`diff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli-providers/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli-providers/SKILL.mddeleted file mode 100644index 1d8e53a5b9..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli-providers/SKILL.md+++ /dev/null@@ -1,145 +0,0 @@-----name: omniroute-cli-providers-description: Manage OmniRoute provider connections, API keys, and routing combos via CLI — add/list/test/remove providers, rotate keys, run OAuth flows, list models, and create/switch combos. Use when the user wants to configure providers, manage credentials, or set up routing from the terminal.------# OmniRoute — CLI Providers & Keys--Requires the `omniroute` CLI. See [CLI entry-point skill](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli/SKILL.md) for install + global flags.--## Provider catalog (available providers)--```bash-omniroute providers available # Full OmniRoute provider catalog-omniroute providers available --search openai # Filter by id, name, alias-omniroute providers available --category api-key # Filter by category-omniroute providers available --json # Machine-readable JSON-```--Categories: `api-key`, `oauth`, `free`, `local`, `combo`.--## Configured provider connections--```bash-omniroute providers list # Connections in your DB-omniroute providers list --json-```--## Testing connections--```bash-omniroute providers test <id|name> # Test one configured connection-omniroute providers test-all # Test every active connection (TUI progress)-omniroute providers validate # Local-only structural validation (no HTTP)-```--`test-all` opens an interactive TUI that shows live pass/fail per connection. Use `--json` to get a machine-readable result:--```bash-omniroute providers test-all --json-```--## API key management (OmniRoute keys)--These manage the OmniRoute API keys issued under **API Manager** — not provider credentials.--```bash-omniroute keys list # List all OmniRoute API keys-omniroute keys add <provider> [apiKey] # Add an API key for a provider-omniroute keys remove <provider> # Remove an API key-omniroute keys regenerate <id> # Regenerate (rotate) a key-omniroute keys revoke <id> # Revoke a key (disables it)-omniroute keys reveal <id> # Show the full key value-omniroute keys usage <id> # Show usage stats for a key--omniroute keys rotate <id> # Rotate + revoke old key atomically-omniroute keys expiration list # List key expiration times-```--### Key policies--```bash-omniroute keys policy show <id> # Show rate-limit / permission policy-omniroute keys policy set <id> \- --rate-limit 100 \- --rate-window minute \- --permissions chat,models # Set policy on a key-```--## Models--```bash-omniroute models # List all models (all providers)-omniroute models openai # Filter by provider-omniroute models --search gpt # Search by name-omniroute models --json # JSON output-```--## OAuth providers--```bash-omniroute oauth list # List OAuth-configured providers-omniroute oauth login <provider> # Start browser-based OAuth flow-omniroute oauth logout <provider> # Revoke OAuth token-omniroute oauth status <provider> # Show token state + expiry-omniroute oauth refresh <provider> # Force token refresh-```--For OAuth providers (Gemini, Windsurf, Antigravity, etc.) the `login` command opens the OmniRoute dashboard OAuth flow in your browser.--## Provider nodes (multi-account routing)--Provider nodes let you attach multiple API keys / accounts to one logical provider for round-robin or failover.--```bash-omniroute nodes list <provider> # List nodes for a provider-omniroute nodes add <provider> --api-key <key> # Add a node-omniroute nodes remove <provider> <nodeId> # Remove a node-omniroute nodes test <provider> <nodeId> # Test one node-```--## Routing combos (CLI)--Create and manage routing combos from the terminal:--```bash-omniroute combo list # List all combos-omniroute combo create <name> \- --strategy priority \- --targets anthropic/claude-opus-4-7,openai/gpt-4o # Create combo-omniroute combo switch <name> # Activate a combo as default-omniroute combo delete <name> # Delete a combo-omniroute combo suggest --task "code review" # Ask OmniRoute to recommend a combo-```--For the full REST API for combos see [omniroute-routing skill](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-routing/SKILL.md).--## Quota & usage--```bash-omniroute quota # Provider quota usage + reset times-omniroute usage # Request + token usage summary-omniroute cost # Cost breakdown (by provider/model)-```--## Compression (CLI)--```bash-omniroute compression status # Current compression mode + savings stats-omniroute compression set --mode rtk # Enable RTK compression-omniroute compression set --mode stacked # Enable stacked (RTK + Caveman)-omniroute compression set --mode off # Disable compression-omniroute compression preview --mode rtk --text "..." # Preview savings for sample text-```--## Health--```bash-omniroute health # Detailed health: circuit breakers, cache, memory-```--## Errors--- `providers test <id>` fails with 401 → API key stored for that provider is wrong; use `keys remove` + `keys add` to reset it-- `oauth login` opens but doesn't complete → the OAuth token endpoint may be firewalled; use API key auth instead-- `combo create` fails with `strategy unknown` → use one of: `priority`, `weighted`, `round-robin`, `fill-first`, `least-used`, `cost-optimized`, `auto`, `random`, `strict-random`, `p2c`, `reset-aware`, `lkgp`, `context-optimized`, `context-relay`diff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli/SKILL.mddeleted file mode 100644index 5229916395..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-cli/SKILL.md+++ /dev/null@@ -1,104 +0,0 @@-----name: omniroute-cli-description: Entry point for the OmniRoute CLI (omniroute binary) — install, global flags, output formats, environment variables, and index of CLI capability skills. Use when the user wants to control OmniRoute from the terminal, automate workflows, or integrate with CI/CD.------# OmniRoute — CLI (Entry Point)--The `omniroute` binary ships with the OmniRoute server. It is both the server launcher and a full management CLI with 250+ commands across 39 groups.--## Install--```bash-npm install -g omniroute # npm registry-# or: use the binary bundled with the desktop app-```--Requires Node.js ≥20.20.2, ≥22.22.2, or ≥24.--Verify:--```bash-omniroute --version # prints installed version-omniroute --help # full command tree-```--## Connection--Every CLI command that talks to the server reads two values:--| Source | Variable / Flag |-| -------- | ------------------------------------ |-| Base URL | `OMNIROUTE_BASE_URL` or `--base-url` |-| API key | `OMNIROUTE_API_KEY` or `--api-key` |--Default base URL: `http://localhost:20128`--```bash-export OMNIROUTE_BASE_URL="http://localhost:20128"-export OMNIROUTE_API_KEY="sk-..." # from Dashboard → API Manager-```--For a remote server:--```bash-export OMNIROUTE_BASE_URL="https://your-server.com"-```--## Global flags--| Flag | Description |-| ------------------- | -------------------------------------------------------- |-| `--base-url <url>` | Override server URL for this invocation |-| `--api-key <key>` | Override API key for this invocation |-| `--output <format>` | Output format: `table` (default), `json`, `jsonl`, `csv` |-| `--json` | Shorthand for `--output json` |-| `--non-interactive` | Disable prompts — for CI / shell scripts |-| `--no-open` | Don't auto-open the browser on start |-| `--port <n>` | Override default port 20128 |-| `--help`, `-h` | Show help for the current command |-| `--version`, `-v` | Print the installed version |--## Output formats--All listing commands support `--output`:--```bash-omniroute combo list # human-readable table-omniroute combo list --output json # JSON array-omniroute combo list --output jsonl # one JSON object per line-omniroute combo list --output csv # CSV with header row-```--## Quick start: one-shot server + provider setup--```bash-# 1. Start server-omniroute--# 2. (First run) interactive setup wizard-omniroute setup--# 3. Verify everything is healthy-omniroute doctor-```--## CLI capability skills--| Capability | Skill |-| ------------------------------------ | ----------------------------------------------------------------------------------------------------- |-| Server admin + backup | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli-admin/SKILL.md |-| Provider & key management | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli-providers/SKILL.md |-| Cloud agents (Codex / Devin / Jules) | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli-cloud/SKILL.md |-| Evals & benchmarking | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli-eval/SKILL.md |--## API skills (REST)--For direct HTTP usage instead of the CLI, see the [OmniRoute entry-point skill](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md).--## Errors--- `Connection refused` → server not running; run `omniroute` or `omniroute serve`-- `401 Unauthorized` → wrong or missing API key-- `command not found: omniroute` → not in PATH; check `npm root -g` or re-install-- `doctor` reports SQLite incompatible → `npm rebuild better-sqlite3` in the app directorydiff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-compression/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-compression/SKILL.mddeleted file mode 100644index fd670ead69..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-compression/SKILL.md+++ /dev/null@@ -1,131 +0,0 @@-----name: omniroute-compression-description: Configure OmniRoute token compression to save 60–90% of context tokens. Covers RTK (command/tool output), Caveman (prose), stacked mode (both), and the MCP accessibility-tree filter (browser snapshots). Use when the user wants to reduce costs, fit long sessions into context windows, or speed up AI responses.------# OmniRoute — Compression--Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md) for setup.--## Overview--OmniRoute compresses token payloads before forwarding to providers. No code changes required — set it once, it applies to all requests transparently.--| Engine | Best for | Typical savings |-| ------------------------- | ------------------------------------ | --------------- |-| RTK | Terminal / build / test / git output | 60–90% |-| Caveman | Human prose, chat history | 46% input |-| Stacked (`rtk → caveman`) | Mixed coding sessions | 78–95% |-| MCP accessibility filter | Browser/accessibility tool results | 60–80% |--## Get current settings--```bash-curl $OMNIROUTE_URL/api/settings/compression \- -H "Authorization: Bearer $OMNIROUTE_KEY"-```--## Enable RTK (best for coding agents)--```bash-curl -X PUT $OMNIROUTE_URL/api/settings/compression \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{ "mode": "rtk", "enabled": true }'-```--## Enable stacked mode (maximum savings)--```bash-curl -X PUT $OMNIROUTE_URL/api/settings/compression \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "mode": "stacked",- "enabled": true,- "stackedPipeline": ["rtk", "caveman"]- }'-```--## Enable Caveman (prose / chat)--```bash-curl -X PUT $OMNIROUTE_URL/api/settings/compression \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{ "mode": "standard", "enabled": true }'-```--Caveman intensities: `lite` (safe), `standard` (balanced), `aggressive` (long sessions), `ultra` (context recovery).--## Preview compression before enabling--```bash-curl -X POST $OMNIROUTE_URL/api/compression/preview \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "mode": "rtk",- "text": "$ npm test\n> jest\n\nPASS src/a.test.ts (2.1s)\nPASS src/b.test.ts (1.8s)\n..."- }'-```--Response includes `compressed`, `original_length`, `compressed_length`, `savings_pct`.--## MCP accessibility-tree filter (browser agent use)--When OmniRoute is used with browser/Playwright MCP tools, it automatically compresses verbose accessibility-tree tool results. Enabled by default; configure thresholds:--```bash-curl -X PUT $OMNIROUTE_URL/api/settings/compression \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "mcpAccessibility": {- "enabled": true,- "collapseThreshold": 30,- "maxTextChars": 50000- }- }'-```--`collapseThreshold`: collapse sibling lines when ≥ N repeats (default 30).-`maxTextChars`: hard truncate after N chars with navigation hint (default 50000).--## Language packs (Caveman)--Caveman supports language-aware rules for pt-BR, es, de, fr, ja:--```bash-curl -X PUT $OMNIROUTE_URL/api/settings/compression \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "mode": "standard",- "cavemanConfig": {- "language": "pt-BR",- "autoDetectLanguage": true- }- }'-```--## Via MCP--```-omniroute_compression_status → current settings + savings analytics-omniroute_compression_configure → update mode/threshold/language-omniroute_set_compression_engine → switch engine at runtime-```--## Disable compression--```bash-curl -X PUT $OMNIROUTE_URL/api/settings/compression \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -d '{ "enabled": false }'-```--## Errors--- `400 invalid mode` → use `off`, `lite`, `standard`, `aggressive`, `ultra`, `rtk`, or `stacked`-- `400 invalid stackedPipeline` → array must contain valid engine ids (`rtk`, `caveman`)diff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-embeddings/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-embeddings/SKILL.mddeleted file mode 100644index f02998092e..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-embeddings/SKILL.md+++ /dev/null@@ -1,45 +0,0 @@-----name: omniroute-embeddings-description: Embeddings via OmniRoute using OpenAI /v1/embeddings format with auto-fallback across text-embedding-3-large, Voyage, Cohere, Gemini embeddings, Jina. Use when the user needs vector embeddings for RAG, similarity search, or clustering.------# OmniRoute — Embeddings--Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md) for setup.--## Endpoint--- `POST $OMNIROUTE_URL/v1/embeddings`--## Discover--```bash-curl $OMNIROUTE_URL/v1/models/embedding | jq '.data[]'-```--Each entry: `{ id, owned_by, dimensions, max_input_tokens }`.--## Example--```bash-curl -X POST $OMNIROUTE_URL/v1/embeddings \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "model": "text-embedding-3-large",- "input": ["first text", "second text"],- "encoding_format": "float"- }'-```--Response: `{ data:[{ embedding:[...], index }], usage:{ prompt_tokens, total_tokens } }`--## Batch input--`input` accepts a string or array of strings (up to provider batch limit, typically 2048 items).--## Errors--- `400 input_too_long` → input exceeds `max_input_tokens` for this model-- `400 invalid_encoding_format` → use `float` or `base64`-- `503` → provider unavailable; try another model in `/v1/models/embedding`diff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-image/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-image/SKILL.mddeleted file mode 100644index 9ccd40a170..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-image/SKILL.md+++ /dev/null@@ -1,45 +0,0 @@-----name: omniroute-image-description: Image generation via OmniRoute using OpenAI /v1/images/generations format with auto-fallback across DALL-E, Stable Diffusion, Flux, Imagen providers. Use when the user wants to generate, edit, or vary images.------# OmniRoute — Image Generation--Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md) for setup.--## Endpoints--- `POST $OMNIROUTE_URL/v1/images/generations` — Text-to-image-- `POST $OMNIROUTE_URL/v1/images/edits` — Image edit (mask)-- `POST $OMNIROUTE_URL/v1/images/variations` — Variations--## Discover--```bash-curl $OMNIROUTE_URL/v1/models/image | jq '.data[]'-```--Returns `{ id, owned_by, sizes:[...], capabilities:[...] }` per model.--## Generate example--```bash-curl -X POST $OMNIROUTE_URL/v1/images/generations \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "model": "dall-e-3",- "prompt": "a red bicycle on a wet street, photoreal",- "n": 1,- "size": "1024x1024",- "response_format": "b64_json"- }'-```--Response: `{ created, data: [{ url? or b64_json, revised_prompt }] }`--## Errors--- `400 invalid_size` → not supported by this model; check `/v1/models/image`-- `400 content_policy_violation` → blocked by provider safety-- `503` → provider unavailable; try another model in `/v1/models/image`diff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-mcp/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-mcp/SKILL.mddeleted file mode 100644index 594896d1b1..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-mcp/SKILL.md+++ /dev/null@@ -1,71 +0,0 @@-----name: omniroute-mcp-description: OmniRoute exposes a built-in MCP (Model Context Protocol) server with 37 tools (chat, embeddings, memory CRUD, skills, providers, routing, audit) over SSE/stdio/HTTP transports. Use when the user wants to add OmniRoute as an MCP server in Claude Desktop, Cursor, Cline, or any MCP-compatible client.------# OmniRoute — MCP Server--Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md) for setup.--## Transports--- **stdio** — local IPC, for Claude Desktop / VS Code extensions-- **SSE** — `GET $OMNIROUTE_URL/api/mcp/sse`-- **Streamable HTTP** — `POST $OMNIROUTE_URL/api/mcp/stream`--## Claude Desktop config--Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:--```json-{- "mcpServers": {- "omniroute": {- "command": "npx",- "args": ["-y", "omniroute", "--mcp"],- "env": { "OMNIROUTE_KEY": "sk-..." }- }- }-}-```--## Cursor / VS Code config--```json-{- "mcp": {- "servers": {- "omniroute": {- "url": "http://localhost:20128/api/mcp/sse",- "headers": { "Authorization": "Bearer sk-..." }- }- }- }-}-```--## Available tools (37 total)--| Scope | Tools |-| --------- | -------------------------------------------------------------------------------------------------- |-| health | `omniroute_get_health` |-| combos | `omniroute_list_combos`, `omniroute_get_combo_metrics`, `omniroute_switch_combo` |-| routing | `omniroute_simulate_route`, `omniroute_best_combo_for_task`, `omniroute_explain_route` |-| providers | `omniroute_get_provider_metrics`, `omniroute_check_quota`, `omniroute_route_request` |-| budget | `omniroute_set_budget_guard`, `omniroute_set_routing_strategy`, `omniroute_set_resilience_profile` |-| testing | `omniroute_test_combo` |-| memory | `memory_add`, `memory_search`, `memory_delete` |-| skills | `skill_invoke`, `skill_list`, `skill_describe`, `skill_register` |-| cache | `omniroute_cache_stats`, `omniroute_cache_flush` |-| admin | `omniroute_db_health_check`, `omniroute_sync_pricing`, `omniroute_get_session_snapshot` |--Full list: `GET $OMNIROUTE_URL/api/mcp/tools`--## Scopes--Tools are grouped into 13 scopes (chat-only, memory-readonly, full-admin, etc.).-Pass scope name as `--scope` arg or via `X-Omniroute-Scope` header.--## Reference--Full docs: https://github.com/diegosouzapw/OmniRoute/blob/main/docs/frameworks/MCP-SERVER.mddiff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-monitoring/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-monitoring/SKILL.mddeleted file mode 100644index f2f0b23c08..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-monitoring/SKILL.md+++ /dev/null@@ -1,114 +0,0 @@-----name: omniroute-monitoring-description: Monitor OmniRoute system health, provider circuit breakers, per-provider latency (p50/p95/p99), quota usage, and set budget guards. Use when the user wants to check if the system is healthy, debug slow providers, manage spend limits, or set up oncall-style monitoring.------# OmniRoute — Monitoring & Health--Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md) for setup.--## System health--```bash-curl $OMNIROUTE_URL/api/health \- -H "Authorization: Bearer $OMNIROUTE_KEY"-```--Returns: uptime, memory, active connections, circuit breaker states, rate limit status, cache stats.--Unauthenticated quick check:--```bash-curl $OMNIROUTE_URL/api/health-# → {"ok":true}-```--## Provider circuit breakers--Circuit breakers prevent traffic from hitting failing providers.--States: `CLOSED` (normal), `OPEN` (blocked), `HALF_OPEN` (probe mode — auto-recovers).--```bash-curl $OMNIROUTE_URL/api/monitoring/health \- -H "Authorization: Bearer $OMNIROUTE_KEY"-```--Response includes `circuitBreakers` array with per-provider state and `resetAt` timestamp.--## Per-provider metrics (p50/p95/p99)--```bash-curl $OMNIROUTE_URL/api/providers/metrics \- -H "Authorization: Bearer $OMNIROUTE_KEY"-```--Response shape per provider:--```json-{- "provider": "anthropic",- "requests": 1247,- "successRate": 0.994,- "latency": { "p50": 820, "p95": 2100, "p99": 3800 },- "circuitState": "CLOSED",- "tokensUsed": 2847000-}-```--## Via MCP (if OmniRoute is your MCP server)--```-omniroute_get_health → full system health snapshot-omniroute_get_provider_metrics → p50/p95/p99 + circuit state per provider-omniroute_get_session_snapshot → cost, tokens, errors for current session-omniroute_check_quota → quota balance + percent remaining + reset time-omniroute_db_health_check → diagnose + auto-repair database drift-```--## Quota check--```bash-curl $OMNIROUTE_URL/api/quota \- -H "Authorization: Bearer $OMNIROUTE_KEY"-```--Returns used/total tokens and requests per provider/account, with `resetAt` timestamps.--## Budget guard (spend limit)--Set a session spending limit that degrades or blocks requests when hit:--```bash-curl -X POST $OMNIROUTE_URL/api/budget/guard \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "limitUsd": 5.00,- "action": "degrade",- "degradeTo": "openai/gpt-4o-mini"- }'-```--`action` options:--- `degrade` — switch to a cheaper model when limit is hit-- `block` — return 429 when limit is hit-- `alert` — continue but add `X-Budget-Warning` header--## MCP audit log--OmniRoute logs every MCP tool call to `mcp_audit` table. Query via API:--```bash-curl "$OMNIROUTE_URL/api/mcp/status" \- -H "Authorization: Bearer $OMNIROUTE_KEY"-```--Returns: server status, heartbeat, recent audit activity summary.--## Errors--- `503` on health endpoint → OmniRoute is starting up; retry in 5s-- Circuit breaker `OPEN` → provider is temporarily blocked; check `resetAt` to know when it auto-recovers-- `429 budget_exceeded` → budget guard limit reached; raise limit or wait for resetdiff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-routing/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-routing/SKILL.mddeleted file mode 100644index d0a90de766..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-routing/SKILL.md+++ /dev/null@@ -1,129 +0,0 @@-----name: omniroute-routing-description: Create and configure OmniRoute routing combos, choose from 14 strategies (priority, weighted, auto, round-robin, cost-optimized, etc.), activate Auto-combo 9-factor scoring, and set up fallback chains. Use when the user wants to configure multi-provider routing, load balancing, or cost-optimized model selection.------# OmniRoute — Routing & Combos--Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md) for setup.--## What is a combo?--A combo is a named group of providers/models with a routing strategy. All requests through a combo are automatically distributed, failed-over, and load-balanced — the caller uses a single model ID like `my-combo`.--## List existing combos--```bash-curl $OMNIROUTE_URL/api/combos \- -H "Authorization: Bearer $OMNIROUTE_KEY"-```--Response includes `id`, `name`, `strategy`, `enabled`, and per-target stats.--## Create a combo--```bash-curl -X POST $OMNIROUTE_URL/api/combos \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "name": "my-combo",- "strategy": "priority",- "targets": [- { "provider": "anthropic", "model": "claude-opus-4-7", "weight": 1 },- { "provider": "openai", "model": "gpt-4o", "weight": 1 }- ]- }'-```--## 14 routing strategies--| Strategy | Description |-| ------------------- | -------------------------------------------------- |-| `priority` | Always use target[0]; fall back on error |-| `weighted` | Distribute by weight percentage |-| `round-robin` | Rotate targets in order |-| `fill-first` | Fill quota of target[0] before spilling |-| `least-used` | Route to target with fewest active requests |-| `cost-optimized` | Pick cheapest target for the token estimate |-| `auto` | 9-factor scoring: cost + latency + quota + circuit |-| `random` | Uniform random selection |-| `strict-random` | Random without repeating until all used |-| `p2c` | Power-of-2-choices: sample 2, pick better |-| `reset-aware` | Prefer targets near quota reset time |-| `lkgp` | Last-known-good-provider sticky routing |-| `context-optimized` | Pick best model for context length |-| `context-relay` | Chain models for very long contexts |--## Auto-combo (recommended for production)--Auto-combo scores each candidate on 9 factors every request:--```bash-curl -X POST $OMNIROUTE_URL/api/combos \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "name": "prod-auto",- "strategy": "auto",- "targets": [- { "provider": "anthropic", "model": "claude-sonnet-4-6" },- { "provider": "openai", "model": "gpt-4o-mini" },- { "provider": "google", "model": "gemini-2.0-flash" }- ]- }'-```--Then call it with:--```bash-curl -X POST $OMNIROUTE_URL/v1/chat/completions \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{ "model": "prod-auto", "messages": [{ "role": "user", "content": "Hello" }] }'-```--## Activate / deactivate a combo--```bash-# Activate-curl -X PUT $OMNIROUTE_URL/api/combos/{id}/toggle \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -d '{ "enabled": true }'-```--## Get combo metrics--```bash-curl $OMNIROUTE_URL/api/combos/{id}/metrics \- -H "Authorization: Bearer $OMNIROUTE_KEY"-```--Returns p50/p95/p99 latency, success rate, cost, and per-target breakdown.--## Simulate routing (dry run)--```bash-curl -X POST $OMNIROUTE_URL/api/routing/simulate \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{ "comboId": "{id}", "messages": [{ "role": "user", "content": "test" }] }'-```--Returns which provider would be selected and why — no actual API call is made.--## Via MCP (if OmniRoute is your MCP server)--```-omniroute_list_combos → list all combos-omniroute_switch_combo → enable/disable a combo-omniroute_set_routing_strategy → change strategy at runtime-omniroute_simulate_route → dry-run routing decision-omniroute_best_combo_for_task → get recommendation by task type-```--## Errors--- `404 combo not found` → check `id` from `/api/combos`-- `400 invalid strategy` → use one of the 14 strategies above-- `409 name conflict` → combo name already existsdiff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-stt/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-stt/SKILL.mddeleted file mode 100644index 4008b69ffb..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-stt/SKILL.md+++ /dev/null@@ -1,42 +0,0 @@-----name: omniroute-stt-description: Speech-to-text via OmniRoute using OpenAI /v1/audio/transcriptions format with auto-fallback across Whisper, AssemblyAI, Deepgram, Azure STT. Use when the user wants transcription of audio files or real-time speech recognition.------# OmniRoute — Speech-to-Text--Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md) for setup.--## Endpoints--- `POST $OMNIROUTE_URL/v1/audio/transcriptions` — multipart upload, returns text-- `POST $OMNIROUTE_URL/v1/audio/translations` — transcribe + translate to English--## Discover--```bash-curl $OMNIROUTE_URL/v1/models/stt | jq '.data[]'-```--## Example--```bash-curl -X POST $OMNIROUTE_URL/v1/audio/transcriptions \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -F "[email protected]" \- -F "model=whisper-1" \- -F "response_format=verbose_json"-```--Response: `{ text, language, duration, segments?:[{ start, end, text }] }`--## Supported formats--Audio: `mp3`, `mp4`, `mpeg`, `mpga`, `m4a`, `wav`, `webm`.-Response formats: `json`, `text`, `srt`, `verbose_json`, `vtt`.--## Errors--- `400 invalid_file_format` → unsupported audio format-- `400 file_too_large` → exceeds provider limit (usually 25MB)-- `503` → provider unavailable; try another model in `/v1/models/stt`diff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-tts/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-tts/SKILL.mddeleted file mode 100644index f236615ca5..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-tts/SKILL.md+++ /dev/null@@ -1,45 +0,0 @@-----name: omniroute-tts-description: Text-to-speech via OmniRoute using OpenAI /v1/audio/speech format with auto-fallback across OpenAI TTS, ElevenLabs, Azure Neural, Google Cloud TTS. Use when the user wants spoken audio output from text.------# OmniRoute — Text-to-Speech--Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md) for setup.--## Endpoint--- `POST $OMNIROUTE_URL/v1/audio/speech` — returns binary audio (mp3/opus/wav/flac)--## Discover--```bash-curl $OMNIROUTE_URL/v1/models/tts | jq '.data[]'-```--Each entry includes `voices:[...]` for the available voice names per provider.--## Example--```bash-curl -X POST $OMNIROUTE_URL/v1/audio/speech \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "model": "tts-1",- "input": "Hello from OmniRoute.",- "voice": "alloy",- "response_format": "mp3"- }' --output speech.mp3-```--## Voices--Voice names vary by provider. Check `/v1/models/tts` — each entry has `voices:[...]`.-Common OpenAI voices: `alloy`, `echo`, `fable`, `onyx`, `nova`, `shimmer`.--## Errors--- `400 invalid_voice` → voice not supported by this model-- `400 input_too_long` → input exceeds model character limit-- `503` → provider unavailable; try another model in `/v1/models/tts`diff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-web-fetch/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-web-fetch/SKILL.mddeleted file mode 100644index 9c009e1954..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-web-fetch/SKILL.md+++ /dev/null@@ -1,47 +0,0 @@-----name: omniroute-web-fetch-description: Fetch a URL and convert to clean markdown via OmniRoute proxying Jina Reader, Firecrawl, raw HTML strip. Use when the user wants to ingest a webpage as markdown for context in an LLM conversation.------# OmniRoute — Web Fetch--Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md) for setup.--## Endpoint--- `POST $OMNIROUTE_URL/v1/web/fetch`--## Discover--```bash-curl $OMNIROUTE_URL/v1/models/web | jq '.data[] | select(.kind == "webFetch")'-```--## Example--```bash-curl -X POST $OMNIROUTE_URL/v1/web/fetch \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "model": "jina/reader",- "url": "https://anthropic.com",- "format": "markdown"- }'-```--Response: `{ url, title, markdown, links?:[...], images?:[...] }`--## Parameters--| Field | Type | Description |-| -------- | ------ | ----------------------------------------------------------------------- |-| `model` | string | Provider from `/v1/models/web` (e.g. `jina/reader`, `firecrawl/scrape`) |-| `url` | string | URL to fetch |-| `format` | string | `markdown` (default), `html`, `text` |--## Errors--- `400 invalid_url` → URL must be http/https-- `403 blocked` → provider blocked by target site; try a different model-- `503` → provider unavailable; try another model in `/v1/models/web`diff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-web-search/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-web-search/SKILL.mddeleted file mode 100644index ca169b2305..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute-web-search/SKILL.md+++ /dev/null@@ -1,49 +0,0 @@-----name: omniroute-web-search-description: Web search via OmniRoute proxying Tavily, Brave Search, SerpAPI, Exa with auto-fallback. Use when the user wants live web search results, current news, or facts that may be beyond the LLM training cutoff.------# OmniRoute — Web Search--Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute/SKILL.md) for setup.--## Endpoint--- `POST $OMNIROUTE_URL/v1/web/search` — unified search format--## Discover--```bash-curl $OMNIROUTE_URL/v1/models/web | jq '.data[] | select(.kind == "webSearch")'-```--## Example--```bash-curl -X POST $OMNIROUTE_URL/v1/web/search \- -H "Authorization: Bearer $OMNIROUTE_KEY" \- -H "Content-Type: application/json" \- -d '{- "model": "tavily/search",- "query": "OmniRoute github latest release",- "max_results": 5,- "include_answer": true- }'-```--Response: `{ answer?, results:[{ url, title, content, score }] }`--## Parameters--| Field | Type | Description |-| ---------------- | ------- | ------------------------------------ |-| `model` | string | Provider model from `/v1/models/web` |-| `query` | string | Search query |-| `max_results` | number | Max results (default: 5) |-| `include_answer` | boolean | Include AI-synthesized answer |-| `search_depth` | string | `basic` or `advanced` (Tavily) |--## Errors--- `400 query_too_long` → shorten the search query-- `503` → provider unavailable; try another model in `/v1/models/web`diff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute/SKILL.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute/SKILL.mddeleted file mode 100644index 6291d47a53..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/15-pruned-archive/omniroute/SKILL.md+++ /dev/null@@ -1,76 +0,0 @@-----name: omniroute-description: Entry point for OmniRoute — local/remote AI gateway with OpenAI-compatible REST for chat, image, TTS, STT, embeddings, web search, web fetch, MCP, A2A. Use when the user mentions OmniRoute, OMNIROUTE_URL, or wants AI without writing provider boilerplate. This skill covers setup + indexes capability skills; fetch the relevant capability SKILL.md from the URLs below when needed.------# OmniRoute--Local/remote AI gateway exposing OpenAI-compatible REST. One key, 207+ providers,-auto-fallback, RTK token saver, MCP server, A2A agents.--## Setup--```bash-export OMNIROUTE_URL="http://localhost:20128" # or VPS / tunnel URL-export OMNIROUTE_KEY="sk-..." # from Dashboard → API Keys-```--All requests: `${OMNIROUTE_URL}/v1/...` with `Authorization: Bearer ${OMNIROUTE_KEY}`.--Verify: `curl $OMNIROUTE_URL/api/health` → `{"ok":true}`--## Discover models--```bash-curl $OMNIROUTE_URL/v1/models # chat/LLM (default)-curl $OMNIROUTE_URL/v1/models/image # image-gen-curl $OMNIROUTE_URL/v1/models/tts # text-to-speech-curl $OMNIROUTE_URL/v1/models/embedding # embeddings-curl $OMNIROUTE_URL/v1/models/web # web search + fetch-curl $OMNIROUTE_URL/v1/models/stt # speech-to-text-```--Use `data[].id` as `model` field in requests. Combos appear with `owned_by:"combo"`.--## Capability skills--| Capability | Raw URL |-| --------------------- | --------------------------------------------------------------------------------------------------- |-| Chat / code-gen | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-chat/SKILL.md |-| Image generation | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-image/SKILL.md |-| Text-to-speech | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-tts/SKILL.md |-| Speech-to-text | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-stt/SKILL.md |-| Embeddings | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-embeddings/SKILL.md |-| Web search | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-web-search/SKILL.md |-| Web fetch | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-web-fetch/SKILL.md |-| MCP server (37 tools) | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-mcp/SKILL.md |-| A2A protocol | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-a2a/SKILL.md |-| Routing & combos | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-routing/SKILL.md |-| Token compression | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-compression/SKILL.md |-| Monitoring & health | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-monitoring/SKILL.md |--## CLI skills (omniroute binary)--| Capability | Raw URL |-| ---------------------- | ----------------------------------------------------------------------------------------------------- |-| CLI entry point | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli/SKILL.md |-| CLI admin & lifecycle | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli-admin/SKILL.md |-| CLI providers & keys | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli-providers/SKILL.md |-| CLI cloud agents | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli-cloud/SKILL.md |-| CLI evals & benchmarks | https://raw.githubusercontent.com/diegosouzapw/OmniRoute/main/skills/omniroute-cli-eval/SKILL.md |--## Errors--- `401` → set/refresh `OMNIROUTE_KEY` (Dashboard → API Keys)-- `400 Invalid model format` → check `model` exists in `/v1/models/<kind>`-- `503 Provider circuit open` → upstream provider down; retry after `Retry-After` seconds-- `429` → rate limited; honor `Retry-After`--## Differentiators vs OpenAI direct--- **Auto-fallback** combos (14 strategies): never stop coding even if a provider rate-limits-- **RTK token saver**: tool_result compressed via 47 specialized filters (git-diff, test-jest, terraform-plan, docker-logs…) — 20-40% token reduction-- **Caveman mode**: optional terse system prompt injection (LITE/FULL/ULTRA) — 15-25% completion reduction-- **MCP + A2A** servers built-in (this is the only AI router that exposes both protocols)-- **Memory** with FTS5 + Qdrant for persistent agent context-- **Guardrails** for PII masking, prompt injection detection, vision policiesdiff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/audit-report-B.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/audit-report-B.mddeleted file mode 100644index 3f2a7904dc..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/audit-report-B.md+++ /dev/null@@ -1,410 +0,0 @@-# Audit Report — Group B (Plans 16 + 22)--**Frente F10 — Audit final, perf, a11y, coverage, docs e E2E**-**Date**: 2026-05-28-**Branch**: `refactor/pages-v3-B-monitoring-quota-share`-**F10 audit branch**: `chore/group-b-audit-docs-F10`-**Auditor**: F10 executor (Claude Sonnet 4.6)-------## Sumário--9 frentes entregues (F1-F9), integradas sequencialmente na branch pai.-F10 realizou auditoria Hard Rules, validação completa, criação de docs, E2E specs, e correções incidentais.--| Metric | Value |-|--------|-------|-| Total commits (F1-F10 vs base release/v3.8.6) | 64 |-| Files modified/created | 155 files changed |-| Insertions / Deletions | +12,704 / -2,522 |-| Unit test files (total in tests/unit/) | 761 |-| New integration tests (Group B) | 7 files |-| New UI (vitest) tests | 9 files |-| New E2E specs (Group B) | 4 files (11 test cases) |-| Coverage gate (40/40/40/40) | **PASS** — St:62.35% / Br:69.45% / Fn:59.84% / Ln:62.35% |-| Lint | 0 errors (2989 pre-existing warnings) |-| TypeScript core | clean |-| TypeScript noimplicit | clean |-| Circular dependencies | 0 new cycles |-------## Hard Rules 1–17 Audit--| Rule | Description | Status | Evidence |-|------|-------------|--------|---------|-| **#1** | No secrets / credentials in code | **PASS** | grep for common secret patterns returned 0 hits in new files |-| **#2** | No logic in localDb.ts | **PASS** | `src/lib/localDb.ts` contains only re-exports from `./db/*`; verified via `grep -E "^(function\|const\|class)" src/lib/localDb.ts` |-| **#3** | No eval / new Function / implied eval | **PASS** | One `eval` found in `src/lib/quota/redisQuotaStore.ts:39` is a TypeScript interface method declaration for the `ioredis` Redis client's EVAL Lua command — it is a TYPE declaration, NOT a code invocation. No `eval()` calls. |-| **#4** | No direct commits to main | **PASS** | All commits are on branch `refactor/pages-v3-B-monitoring-quota-share` / sub-branches |-| **#5** | No raw SQL outside src/lib/db/ | **PASS** | `grep -rn "db.prepare\|db.exec" src/app/api/quota/ src/app/api/settings/quota-store/ src/lib/quota/` → 0 hits |-| **#6** | No silently swallowing errors in SSE streams | **PASS** | Quota paths are not SSE; enforce/consume fail-open patterns use `pino.warn` (not silence) |-| **#7** | Zod validation on all inputs | **PASS** | All 13 REST endpoints use Zod schemas (`PoolCreateSchema`, `PoolUpdateSchema`, `PlanUpsertSchema`, `QuotaStoreSettingsSchema`, `QuotaPreviewQuerySchema`, `AuditLogQuerySchema`) |-| **#8** | Tests required when changing production code | **PASS** | Each production module has corresponding tests; 7 integration + 9 vitest UI + 30+ unit test files added for Group B modules |-| **#9** | Coverage gate ≥40/40/40/40 (relaxed per C5) | **PASS** | Measured: St:62.35% / Br:69.45% / Fn:59.84% / Ln:62.35% |-| **#10** | No --no-verify | **PASS** | `git log release/v3.8.6..HEAD --format=%B | grep -iE "no.verify"` → 0 hits |-| **#11** | No public creds as literals (resolvePublicCred) | **PASS** | No new OAuth client IDs or Firebase keys added in Group B scope |-| **#12** | No raw err.stack/err.message in HTTP responses | **PASS** | `grep -rnE "JSON.stringify\([^)]*err.(stack\|message)" src/app/api/quota/ src/app/api/settings/quota-store/ src/app/api/compliance/audit-log/` → 0 hits. All error paths use `buildErrorBody()` (32 usages in quota routes verified) |-| **#13** | No shell string interpolation with external paths | **PASS** | No new `exec()` / `spawn()` calls in Group B scope |-| **#14** | No CodeQL/Secret alerts dismissed without justification | **PASS** | N/A — no new alerts expected for Group B (no new shell exec, no new OAuth secrets) |-| **#15** | Spawn-process routes must be LOCAL_ONLY | **PASS** | `/api/quota/**` and `/api/settings/quota-store` explicitly NOT LOCAL_ONLY (B18) — they do not spawn processes. Decision B18 documented. |-| **#16** | No Co-Authored-By in commits | **PASS** | `git log release/v3.8.6..HEAD --grep="Co-Authored-By"` → 0 hits |-| **#17** | /api/services/ routes must be LOCAL_ONLY | **PASS** | No new `/api/services/` routes added in Group B |--### Hard Rule #3 — eval — Detail--File: `src/lib/quota/redisQuotaStore.ts:39`-```ts-interface RedisLike {- eval(script: string, numkeys: number, ...args: unknown[]): Promise<unknown>;-}-```-This is a TypeScript **interface method declaration** for the `ioredis` Redis client's-`EVAL` Lua scripting command. It is not an `eval()` call. ESLint's `no-eval` rule does-not trigger on interface method names. **Verdict: FALSE POSITIVE — no violation.**-------## Validation Pipeline Results--### Lint-```-npm run lint → 0 errors (2989 pre-existing warnings)-```-- **Audit-discovered fix**: `src/lib/quota/planResolver.ts` had a stale `eslint-disable-line @typescript-eslint/no-unused-vars` comment (the rule no longer triggered). Fixed by renaming param to `_runtimeSignals` — clean pattern, no disable comment needed. Committed as part of F10.--### TypeScript-```-npm run typecheck:core → exit 0 (clean)-npm run typecheck:noimplicit:core → exit 0 (clean)-```--### Circular Dependencies-```-npm run check:cycles → [cycles] OK - no cycles detected across 211 files-```--### Unit Tests (critical modules)-```-40 tests pass: quota-fair-share + quota-enforce + audit-high-level-actions + quota-plan-resolver + quota-burn-rate-```--### Integration Tests (Group B)-```-27 tests pass: quota-pools-crud + quota-plans-crud + audit-log-level-filter-28 tests pass: quota-pools-usage + quota-preview + quota-store-settings + quota-routes-error-sanitization-Total: 55 integration tests — 0 failures-```--### Vitest (UI)-```-31 tests pass across 6 files:-- quota-share-page, pool-card, allocation-table, burn-rate-chart,- use-local-storage-pool-migration, provider-plan-config-```--### Coverage Gate (40/40/40/40)-```-Statements : 62.35% (120989/194020) → PASS-Branches : 69.45% (13715/19748) → PASS-Functions : 59.84% (3895/6508) → PASS-Lines : 62.35% (120989/194020) → PASS--Note: Coverage was measured on the full test suite (6889 tests, 30 pre-existing-failures from unrelated tests, not from Group B modules).-```--### E2E-```-Status: LISTED (11 test cases in 4 files)-Environment: Requires app server running (playwright webServer config)-Cannot execute in agentless env without display / server.-Marked as SKIP-ENVIRONMENT — spec files created and validated for syntax.-Reason: No display or local server available in audit execution environment.-```-------## Acceptance Criteria §9 — Line-by-Line--### §9.1 Plano 16 — Monitoring Reorg + Costs Section--| Criterion | Status | Evidence |-|-----------|--------|---------|-| Monitoring has 3 subgroups (Logs/Audit/System) + Activity at top | ✅ | `sidebar-monitoring-reorg.test.ts` passes; `sidebarVisibility.ts` has LOGS_GROUP, AUDIT_GROUP, SYSTEM_GROUP |-| Activity is friendly timeline by day with icons + human phrases | ✅ | `ActivityFeed.tsx`, `ActivityItem.tsx`, `DayHeader.tsx` created; `audit-timeline.test.ts` passes |-| Audit Log keeps table + severity + export + new actor filter | ✅ | `ComplianceTab.tsx` + actor filter via `compliance-tab-actor-filter.test.tsx` |-| Activity and Audit are no longer the same screen | ✅ | `/dashboard/activity` = timeline; `/dashboard/audit` = compliance table |-| `AuditLogTab.tsx` duplicate removed | ✅ | File deleted in F4 commit `ec3aa40aa` |-| New "Costs" section with Overview + Pricing + Budget + Quota Sharing | ✅ | `sidebar-costs-section.test.ts` passes (5 items including quota-plans added by F9) |-| Costs overview removed from Analytics | ✅ | Test `sidebar-costs-section.test.ts` validates absence from analytics |-| Pricing/Budget/Quota out of Monitoring | ✅ | `sidebar-monitoring-reorg.test.ts` validates no COSTS_PARAMS_GROUP in monitoring |-| Redirect 308 `/logs/activity` → `/activity` | ✅ | `permanentRedirect()` in `logs/activity/page.tsx`; `activity-page-redirect.test.ts` |-| CompressionLogTab uses namespace `logs` | ✅ | `compression-log-namespace.test.tsx` passes |-| `/dashboard/usage` links audited | ✅ | F5 audit report at `F5-usage-audit-report.md` |-| i18n PT-BR + EN + fallback | ✅ | `pt-BR.json` + `en.json` updated; fallback via next-intl |--### §9.2 Plano 22 — Quota Sharing Engine--| Criterion | Status | Evidence |-|-----------|--------|---------|-| Pools persisted in DB via `/api/quota/pools` | ✅ | `quota-pools-crud.test.ts` passes (27 tests) |-| Real consumption per API key per dimension shown | ✅ | `AllocationTable.tsx` reads `/api/quota/pools/[id]/usage`; `allocation-table.test.tsx` |-| Multi-dimensional: %, requests, tokens, $ | ✅ | `QuotaUnitSchema` covers all 4; `quota-dimensions.test.ts` |-| Plan can combine dimensions | ✅ | `planRegistry.ts` Codex plan has 2 dimensions; `quota-plan-registry.test.ts` |-| Plan config per provider (known + manual override) | ✅ | `/dashboard/costs/quota-share/plans`; `provider-plan-config.test.tsx` |-| Allocation by weight + optional absolute cap | ✅ | `PoolAllocationSchema` with `weight`, `capValue`, `capUnit`; `quota-schemas.test.ts` |-| Enforcement in pipeline: hard/soft/burst | ✅ | `enforce.ts` + `chatCore.ts` hook + `combo.ts` penalty; `quota-enforce.test.ts` |-| Fair-share with borrowing; global ceiling; 5h ≠ weekly | ✅ | `fairShare.ts`; `quota-fair-share.test.ts` (10 scenarios including cap-absolute) |-| Sliding window counter (5h/hourly/daily/weekly/monthly) | ✅ | `sqliteQuotaStore.ts` with 2-bucket SWC; `quota-sqlite-store.test.ts` |-| QuotaStore: SQLite default + Redis optional | ✅ | `storeFactory.ts` with driver selection; `quota-store-factory.test.ts` |-| Stacked bar + deficit/surplus + burn rate | ✅ | `DimensionBar.tsx`, `AllocationTable.tsx`, `BurnRateChart.tsx`; vitest tests |-| Global saturation signals from fetchers/headers | ✅ | `saturationSignals.ts`; `quota-saturation-signals.test.ts` |-| No spurious blocking when window has headroom | ✅ | `fairShare.ts` generous mode; scenario tested in `quota-fair-share.test.ts` |-| i18n + no new `any` + coverage ≥40/40/40/40 | ✅ | Coverage gate PASS; noimplicit typecheck PASS |--### §9.3 Edge Cases--| Criterion | Status | Evidence |-|-----------|--------|---------|-| Activity polling/refresh without losing position | ✅ | `ActivityFeedClient.tsx` stateful scroll; `audit-activity-icons.test.ts` |-| Saturation signals respects 30s TTL | ✅ | `saturationSignals.ts` + `quota-saturation-signals.test.ts` TTL test |-| `enforceQuotaShare` fail-open | ✅ | `enforce.ts` try/catch + pino.warn; `quota-enforce.test.ts` fail-open scenario |-| `recordConsumption` fail-open | ✅ | `spendRecorder.ts`; `quota-spend-recorder.test.ts` |-| Cap absolute always blocks | ✅ | `fairShare.ts` cap-absolute check; scenario in `quota-fair-share.test.ts` |-| Multi-dimension: any fails = block | ✅ | `enforce.ts` loops all dimensions; tested |-| LS→DB migration is idempotent | ✅ | `useLocalStoragePoolMigration.ts` + `use-local-storage-pool-migration.test.tsx` |-| Unknown provider → manual plan | ✅ | `planResolver.ts` → empty plan; `quota-plan-resolver.test.ts` |-| CapAbsolute ≤ 0 → 400 Zod | ✅ | `PoolAllocationSchema` capValue z.number().positive(); `quota-schemas.test.ts` |-| Redis without URL → 400 | ✅ | `quota-store-settings.test.ts` validates this path |-| BurnRate no history → null | ✅ | `burnRate.ts` requires ≥2 samples; `quota-burn-rate.test.ts` |--### §9.4 Security + Observability--| Criterion | Status | Evidence |-|-----------|--------|---------|-| `requireManagementAuth` on ALL /api/quota/** + /api/settings/quota-store | ✅ | Verified by grep: 10+ `requireManagementAuth` calls in quota routes |-| `buildErrorBody` / `sanitizeErrorMessage` in all error responses | ✅ | 32 usages of `buildErrorBody` in quota routes; 0 raw err.stack hits |-| `logAuditEvent` on each mutation (pool/plan/setting) | ✅ | 9 `logAuditEvent` calls verified in quota routes |-| redisUrl masked in GET | ✅ | `settings/quota-store/route.ts` masks URL in GET response; tested |-| No logs with tokens/keys raw | ✅ | grep for raw credential patterns returned 0 hits in new files |-| pino logger used (not console.log) | ✅ | `grep -rn "console.log" src/lib/quota/` → 0 hits |--### §9.5 UI/API/DB/SSE Integrations--| Criterion | Status | Evidence |-|-----------|--------|---------|-| Sidebar has `costs-quota-plans` inside `costs` | ✅ | `sidebar-costs-quota-plans.test.ts` + `sidebar-costs-section.test.ts` (5 items) |-| `/dashboard/costs/quota-share/plans` functional | ✅ | `ProviderPlanConfigClient.tsx` + `provider-plan-config.test.tsx` |-| `/dashboard/activity` renders with filters + timeline | ✅ | `ActivityFeedClient.tsx` + vitest UI tests + E2E spec created |-| ComplianceTab has new actor filter | ✅ | `compliance-tab-actor-filter.test.tsx` |--### §9.6 i18n + Telemetry--| Criterion | Status | Evidence |-|-----------|--------|---------|-| PT-BR complete for activity, quotaShare, quotaPlans | ✅ | Commits from F3, F4, F5, F9 confirm i18n additions |-| EN complete | ✅ | Same commits |-| 39 other locales fall back without error | ✅ | next-intl fallback; no locale-specific code added |-| quota.* audit events appear in /dashboard/audit | ✅ | `logAuditEvent` calls with quota.* actions in routes; HIGH_LEVEL_ACTIONS includes all 5 |-| quota.* events appear in Activity feed | ✅ | `HIGH_LEVEL_ACTIONS` includes all 5 quota.* actions; allowlist verified |-------## §10 Definition of Done — 18 Items--| # | Item | Status | Notes |-|---|------|--------|-------|-| 1 | Lint: 0 errors | ✅ | ESLint 0 errors |-| 2 | Typecheck: core + noimplicit clean | ✅ | Both exit 0 |-| 3 | Cycles: 0 new | ✅ | check-cycles OK across 211 files |-| 4 | Unit tests: all green | ✅ | Critical modules all pass; 30 pre-existing failures in unrelated tests (confirmed pre-existing) |-| 5 | Vitest: all green | ✅ | 31 tests pass in 6 quota-share UI test files |-| 6 | Coverage gate: ≥40/40/40/40 | ✅ | St:62%, Br:69%, Fn:59%, Ln:62% |-| 7 | Combined check (lint+test) | ✅ | lint=0 errors; unit critical pass |-| 8 | E2E: 4 specs (11 tests) | ⚠️ SKIP-ENV | Specs created and listed; cannot execute without display/server in audit env |-| 9 | Protocol E2E: no regression | ⚠️ NOT RUN | No display/server; not regressed by Group B (MCP/A2A untouched) |-| 10 | Build: success + Recharts lazy | ⚠️ NOT RUN | Build requires full Next.js build (~5 min); Recharts lazy loading verified via code inspection (`dynamic()` confirmed) |-| 11 | Hard Rules audit: 0 violations | ✅ | See Hard Rules table above |-| 12 | §9 acceptance criteria line-by-line | ✅ | All items checked above |-| 13 | Docs: QUOTA_SHARE.md + MONITORING_SECTIONS.md + REPOSITORY_MAP + openapi.yaml | ✅ | All 4 created/updated by F10 |-| 14 | No Co-Authored-By | ✅ | git log grep = 0 |-| 15 | No --no-verify | ✅ | git log grep = 0 |-| 16 | PRs: 1 per frente or consolidated | ⏳ PENDING | To be created by owner after validation |-| 17 | Branch base: release/v3.8.6 | ✅ | Confirmed at B0 |-| 18 | LS→DB migration tested manually | ⚠️ NOT DONE | Requires running app + browser session with localStorage data; documented as post-merge task |--**Summary: 13/18 fully verified ✅, 3 require running environment (8, 9, 10), 1 pending owner action (16), 1 documented as post-merge (18).**-------## Audit-Discovered Fixes--### Fix 1: Stale eslint-disable in planResolver.ts--**File**: `src/lib/quota/planResolver.ts:43`-**Issue**: `eslint-disable-line @typescript-eslint/no-unused-vars` on `runtimeSignals?` parameter-was a stale directive (lint rule no longer triggered, causing an "unused directive" warning).-**Fix**: Renamed parameter to `_runtimeSignals` (underscore prefix = intentionally unused convention).-**Commit**: Part of F10 fix commit `fix(quota): audit-discovered stale eslint-disable in planResolver`.-**Lines changed**: 2.--### Fix 2: sidebar-costs-section.test.ts expected 4 items but F9 added 5--**File**: `tests/unit/sidebar-costs-section.test.ts`-**Issue**: Test from F3 expected the Costs section to have 4 items. F9 correctly added-`costs-quota-plans` as a 5th item (per B5/B19). The test became stale after F9 merged.-**Fix**: Updated test to expect 5 items with the correct order including `costs-quota-plans`.-**Commit**: Part of F10 fix commit.-**Lines changed**: 10.-------## Documented Deviations--| ID | Deviation | Impact | Resolution |-|----|-----------|--------|------------|-| **C5** | Coverage gate relaxed 75/75/75/70 → 40/40/40/40 (branch only) | Deferred technical debt | Restore after Group B merges; alvo ≥90% for critical modules maintained per B24 |-| **F7 combo TODO** | `QUOTA_SOFT_DEPRIORITIZE_FACTOR` applied in `combo.ts` `auto` strategy but not all scoring paths | Soft penalty may not apply in all combo strategies | Documented as post-merge task; factor is applied in the main auto scoring path |-| **E2E skip-env** | E2E specs created but not executed (no display/server) | 4 specs untested in CI gate | To be run via `npm run test:e2e -- --grep "group-b"` after merge |-| **Migration manual test** | `useLocalStoragePoolMigration` not tested end-to-end in running browser | Hook is unit-tested (idempotency); manual E2E not done | Post-merge task: open dashboard with LS data, verify toast + DB state |-| **Build not run** | `npm run build` (Next.js standalone) not executed in audit env | Recharts lazy loading not verified via chunk output | Verified via source code inspection: `BurnRateChart.tsx` uses `dynamic(() => import("recharts"), { ssr: false })` for all Recharts components |-| **30 pre-existing unit test failures** | `tests/unit/*.test.ts` has 30 failures in non-Group-B tests when run with `--test-force-exit` | Not introduced by Group B | Confirmed pre-existing: all failures are in files unrelated to the quota/audit/activity/sidebar changes |-------## Metrics Final--| Metric | Value |-|--------|-------|-| Commits on branch (F1-F10 vs release/v3.8.6) | 64 |-| Files changed | 155 |-| Insertions | +12,704 |-| Deletions | -2,522 |-| New integration test files | 7 |-| New UI (vitest) test files | 9 |-| New E2E spec files | 4 (11 test cases) |-| New lib modules (quota + audit) | 16 files in src/lib/quota/ + 3 in src/lib/audit/ |-| New DB modules | 3 (quotaPools, quotaConsumption, providerPlans) |-| New DB migrations | 3 (073, 074, 075) |-| New API routes | 13 endpoints across /api/quota/** and /api/settings/quota-store |-| New docs | 2 new files + 2 updated (REPOSITORY_MAP, openapi.yaml) |-| Coverage (statements/branches/functions/lines) | 62.35% / 69.45% / 59.84% / 62.35% |-| Lint errors | 0 |-------## Pendências para post-merge--1. **Restaurar gate de cobertura**: reverter `package.json::test:coverage` e `CLAUDE.md` de 40/40/40/40 para 75/75/75/70.-2. **Wire-up quota soft penalty completo**: verificar se `QUOTA_SOFT_DEPRIORITIZE_FACTOR` é aplicado em todos os estratégias de combo (não só `auto`).-3. **Execução dos E2E specs**: `npm run test:e2e -- --grep "group-b"` após subir o servidor local.-4. **Teste manual da migração LS→DB**: abrir `/dashboard/costs/quota-share` com dados em localStorage, verificar toast de migração e estado do DB.-5. **Build de produção**: `npm run build` para verificar chunk lazy do Recharts.-6. **Migration renumbering se Grupo A mergear antes**: conforme B2, renumerar 073/074/075 para 076/077/078 via `git mv`.-7. **Coverage catch-up**: adicionar testes nos módulos críticos para atingir ≥90% local (atualmente fairShare ~85%, sqliteQuotaStore ~88%, enforce ~80%).-------## Gap closure (post-PR #2859 code review)--**Date**: 2026-05-28-**Trigger**: Code review minucioso do orquestrador identificou 6 gaps reais.-**5 frentes G1-G5 implementadas e mergeadas em pai.**--### Gap status após fechamento--| # | Gap | Status | Frente | Commit hashes (merges) |-|---|-----|--------|--------|------------------------|-| 1 | i18n 39 locales sem chaves novas | ✅ FIXED | G1 | `841e54695` |-| 2 | Soft policy `void` (não desprioriza) | ✅ FIXED | G2 | `2a0b318b7` |-| 3 | Activity feed praticamente vazia | ✅ FIXED | G3 | `3f3e64a80` |-| 4 | Stacked bar de fatias por key ausente | ✅ FIXED | G4 | `33c79a8c3` |-| 5 | KPIs incompletos | ✅ FIXED | G5 | `bd1ef1a68` |-| 6 | Coverage gate 40 vs critério 75 | ⏳ POST-MERGE | — | N/A (decisão B24/C5 do owner) |--### Mudanças aplicadas--#### G1 — i18n EN fallback (request.ts)-- Adicionada função `deepMergeFallback` em `src/i18n/request.ts`.-- Carrega `en.json` como fallback para qualquer chave faltante em locale-específico.-- 17 testes em `tests/unit/i18n-fallback.test.ts`.-- 39 locales agora exibem texto EN onde a tradução nativa não cobre as chaves novas (em vez de chaves cruas).--#### G2 — Soft policy wiring (chatCore → combo)-- `void quotaSoftDeprioritize` removido de `chatCore.ts`.-- Nova função exportada `setCandidateQuotaSoftPenalty(executionKey, stepId, penalty)` em `combo.ts`.-- Map module-level `_activeExecutionCandidates` com register/unregister via try/finally em `handleComboChat`.-- 5 testes em `tests/unit/combo-quota-soft-penalty.test.ts`.-- Soft policy agora desprioriza efetivamente no combo scoring (`score *= QUOTA_SOFT_DEPRIORITIZE_FACTOR`).--#### G3 — Allowlist refactor para naming REAL-- `HIGH_LEVEL_ACTIONS` agora reflete actions REALMENTE emitidas pelo repo (26 actions).-- Inclui: `provider.credentials.*` (9), `auth.login.*` (6), `auth.logout.success`, `sync.token.*` (2), `settings.update*` (2), `service.reveal_api_key`, `quota.*` (5).-- `ACTIVITY_ICONS` realinhada 1:1.-- i18n pt-BR + en com novas chaves de eventVerb.-- Test novo `audit-allowlist-real-actions.test.ts` valida 1:1 coverage e presença das 26 actions.-- Activity feed agora exibirá eventos REAIS do repo (provider/auth/settings/quota).--#### G4 — StackedAllocationBar component + PoolCard bug fix-- Novo componente `StackedAllocationBar.tsx` (~115 LOC) com fatias horizontais por allocation, paleta 8 cores, labels com weight + (usedSuffix se usage).-- Renderizado em `PoolCard.tsx` entre `DimensionBar` grid e `AllocationTable`.-- Bug linha 68 corrigido: `text-[16px] shrink-0 {statusCls}` (literal) → `${statusCls}` (template).-- `<span>` duplicado das linhas 71-73 removido.-- 8 testes em `tests/unit/ui/stacked-allocation-bar.test.tsx`.--#### G5 — KPIs canônicos + usePoolsUsageAggregate-- Novo hook `usePoolsUsageAggregate(pools)` em `hooks/usePoolsUsageAggregate.ts` (polling 15s, `Promise.all`, fail-soft, divisão por zero protegida).-- `QuotaSharePageClient.tsx` agora renderiza 4 KPI cards canônicos: **Pools ativos · Keys alocadas · Util média · Em empréstimo agora**.-- `kpiProvidersWithQuota` e StatCard `"Pools"` duplicado removidos.-- 9 testes em `tests/unit/ui/use-pools-usage-aggregate.test.tsx` + assertions atualizadas em `quota-share-page.test.tsx`.--### Validação re-rodada (pós gap closure)--| Comando | Resultado |-|---------|-----------|-| `npm run lint` | exit 0 — 0 errors, 2989 pre-existing warnings |-| `npm run typecheck:core` | exit 0 — clean |-| `npm run typecheck:noimplicit:core` | exit 0 — clean |-| `npm run check:cycles` | OK — 0 cycles across 211 files |-| `npm run test:coverage` (gate 40/40/40/40) | PASS — St:79.84% / Br:73.68% / Fn:82% / Ln:79.84% |-| Tests gap-specific (57 unit + 26 vitest UI) | 57/57 pass (node:test) + 26/26 pass (vitest) |-| `git log --grep="Co-Authored-By"` | 0 |-| `git log --grep="--no-verify"` | 0 |--### Métricas finais (Group B + gap closure)--| Metric | Pre-gap-closure | Post-gap-closure |-|--------|----------------|------------------|-| Commits | 64 | 94 |-| Files changed | 155 | 172 |-| Insertions / Deletions | +12,704 / -2,522 | +15,745 / -2,529 |-| Tests added (unit + UI) | 86 | ~112+ |--### Definition of Done §10 — re-avaliado--| # | Item | Status atualizado |-|---|------|-------------------|-| 1 | Lint: 0 errors | ✅ (re-rodado pós gap closure) |-| 2 | Typecheck: core + noimplicit clean | ✅ (re-rodado) |-| 3 | Cycles: 0 new | ✅ (re-rodado) |-| 4 | Unit tests: all green | ✅ (57 gap-specific + base suite) |-| 5 | Vitest: all green | ✅ (26 UI tests — pool-card, stacked-bar, use-pools-usage-aggregate, quota-share-page) |-| 6 | Coverage gate: ≥40/40/40/40 | ✅ St:79.84% / Br:73.68% / Fn:82% / Ln:79.84% |-| 7 | Combined check (lint+test) | ✅ |-| 8 | E2E specs | ⚠️ SKIP-ENV |-| 9 | Protocol E2E | ⚠️ SKIP-ENV |-| 10 | Build prod | ⚠️ NOT RUN |-| 11 | Hard Rules audit | ✅ (re-verificado: Co-Authored-By=0, no-verify=0) |-| 12 | §9 critérios | ✅ atualizados pelos gaps |-| 13 | Docs | ✅ (atualizado: audit-report-B.md com seção Gap closure) |-| 14 | No Co-Authored-By | ✅ (re-verificado) |-| 15 | No --no-verify | ✅ |-| 16 | PR | ✅ PR #2859 atualizado com novo HEAD após push |-| 17 | Branch base | ✅ |-| 18 | LS→DB migration manual | ⚠️ POST-MERGE |--### Aceite final--Após Gap closure: **6/6 gaps funcionais resolvidos em código** (gap #6 é doc-only). Group B agora atende ~95-100% dos critérios §8 dos planos 16 e 22 (sem contar SKIP-ENV). Coverage subiu de 62.35%/69.45%/59.84% (F10) para **79.84%/73.68%/82%** (pós G1-G5).diff --git a/_tasks/features-v3.8.6/refactorpages/_orchestration/audit-report-group-C.md b/_tasks/features-v3.8.6/refactorpages/_orchestration/audit-report-group-C.mddeleted file mode 100644index ffded0adc1..0000000000--- a/_tasks/features-v3.8.6/refactorpages/_orchestration/audit-report-group-C.md+++ /dev/null@@ -1,403 +0,0 @@-# Audit Report — Group C (Playground Studio + Search Tools Studio)--**Auditor:** F10 subagent (Sonnet max effort)-**Date:** 2026-05-28-**Branch:** `chore/playground-search-audit-F10`-**Base:** `release/v3.8.6`-**Merges applied:** F1 → F2 → F3 → F4 → F5 → F6 → F7 → F8 → F9 (all clean, no conflicts)-------## A. Hard Rule Audit--### A1 — No Secrets (#1)--**Command:**-```-grep -rE "(['\"])(sk-|sk_|Bearer\s+[A-Za-z0-9_-]{20,})" src/lib/playground/ src/app/api/playground/ src/app/api/search/ ...-```-**Result:** ✅ ZERO HITS — no hardcoded secrets found in new code.-`$OMNIROUTE_API_KEY` placeholder used correctly throughout (D11 enforced).--### A2 — localDb.ts re-export only (#2)--**Command:**-```-git diff release/v3.8.6 src/lib/localDb.ts | grep '^+' | grep -v '^+++' | grep -E '\b(function|const|class|let|var)\b'-```-**Result:** ✅ ZERO HITS — only re-export block added:-```ts-export {- listPlaygroundPresets, getPlaygroundPreset, createPlaygroundPreset,- updatePlaygroundPreset, deletePlaygroundPreset,-} from "./db/playgroundPresets";-export type { PlaygroundPresetListItem } from "./db/playgroundPresets";-```-Hard Rule #2 respected.--### A3 — No eval / new Function (#3)--**Command:**-```-grep -rE "\beval\(|new Function\(|setTimeout\(['\"]|setInterval\(['\"]" src/lib/playground/ ...-```-**Result:** ✅ ZERO HITS — no eval, no new Function, no implied eval in any Group C code.--### A4 — No raw SQL outside src/lib/db/ (#5)--**Command:**-```-grep -rE "db\.prepare\(|db\.exec\(" src/lib/playground/ src/app/api/playground/ ... | grep -v "src/lib/db/"-```-**Result:** ✅ ZERO HITS — all DB access goes through `src/lib/db/playgroundPresets.ts`.--### A5 — Zod validation in POST/PUT routes (#7)--Routes found:-- `POST /api/playground/improve-prompt` → validates via `ImprovePromptRequestSchema.safeParse()` ✅-- `POST /api/playground/presets` → validates via `PlaygroundPresetCreateSchema.safeParse()` ✅-- `PUT /api/playground/presets/[id]` → validates via `PlaygroundPresetUpdateSchema.safeParse()` ✅-- `POST /api/playground/simulate-route` → pre-existing route (Release v3.8.3), not Group C ✅--**Result:** ✅ All new POST/PUT routes validated by Zod schemas.--### A6 — Coverage gate ≥ 40/40/40/40 (D23 / §17.8)--**Command:** `npm run test:coverage`-**Result:**-```-Statements : 79.1% ( 197115/249173 )-Branches : 74.41% ( 31541/42387 )-Functions : 80.49% ( 6674/8291 )-Lines : 79.1% ( 197115/249173 )-# tests 7012 | pass 7003 | fail 1 | skipped 8-```-**Gate (40/40/40/40):** ✅ PASSED — all thresholds comfortably exceeded (79.1/74.4/80.5/79.1).-The 1 failing test is pre-existing (present in `release/v3.8.6` before Group C), not introduced by this group.--### A7 — No --no-verify in commits (#10)--**Command:**-```-git log release/v3.8.6..HEAD --format="%B" | grep -iE "no-verify|--no-verify"-```-**Result:** ✅ ZERO HITS--### A8 — No raw err.stack/err.message in response bodies (#12)--**Command:**-```-grep -rE 'errorResponse\([^)]*err\.(stack|message)|err\.(stack|message)\)' src/app/api/playground/ src/app/api/search/-```-**Result:** ✅ ZERO HITS — all error paths route through `buildErrorBody()` / `sanitizeErrorMessage()`:-- `improve-prompt/route.ts`: uses `buildErrorBody` + `sanitizeErrorMessage` ✅-- `presets/route.ts`: uses `buildErrorBody` + `sanitizeErrorMessage` ✅-- `presets/[id]/route.ts`: uses `buildErrorBody` + `sanitizeErrorMessage` ✅-- `search/providers/route.ts`: uses `buildErrorBody` ✅--### A9 — routeGuard.ts zero changes (D6) and sidebarVisibility.ts zero changes (D5)--**Commands:**-```-git diff release/v3.8.6 src/server/authz/routeGuard.ts | head-git diff release/v3.8.6 src/shared/constants/sidebarVisibility.ts | head-```-**Result:** ✅ BOTH EMPTY — zero changes to routeGuard.ts and sidebarVisibility.ts (D5+D6 enforced).--### A10 — No Co-Authored-By in Group C commits (#16)--**Command:**-```-git log release/v3.8.6..HEAD --format="%B" | grep -i "Co-Authored-By"-```-**Result:** ✅ ZERO HITS in Group C commit range. (Broader `--all` flag would include upstream PRs from contributors; scoped to Group C range: clean.)-------## B. Sidebar / RouteGuard (D5 + D6)--```-git diff release/v3.8.6 src/shared/constants/sidebarVisibility.ts → EMPTY ✅-git diff release/v3.8.6 src/server/authz/routeGuard.ts → EMPTY ✅-```-Both protected files unchanged.-------## C. Performance Checks--### C1 — Monaco Editor Lazy-Loaded (ApiTab)--Found in `PlaygroundStudio.tsx`:-```ts-const ApiTab = dynamic(() => import("./components/tabs/ApiTab"), { ssr: false });-```-And inside `ApiTab.tsx`:-```ts-const Editor = dynamic(() => import("@/shared/components/MonacoEditor"), { ssr: false });-```-✅ Monaco is double-lazy-loaded: PlaygroundStudio lazy-imports ApiTab, which lazy-imports MonacoEditor.-No SSR risk; Monaco will appear in separate chunk in build.--### C2 — AbortController in CompareTab (D10/D19)--```-CompareTab.tsx line 103: const controllersRef = useRef<Map<string, AbortController>>(new Map());-CompareTab.tsx line 142: controllersRef.current.get(id)?.abort(); // per-column cancel-CompareTab.tsx line 149: controllersRef.current.get(id)?.abort(); // unmount-CompareTab.tsx line 154: ctrl.abort(); // "Cancel all"-CompareTab.tsx line 169: const controller = new AbortController(); // new per stream-```-✅ Abort all on cancel AND on unmount. D10+D19 enforced.--### C3 — Scrape cap 256KB (D21)--```-ScrapeResult.tsx line 7: const CONTENT_CAP_BYTES = 256 * 1024;-ScrapeResult.tsx line 33: const isTruncated = contentSize > CONTENT_CAP_BYTES;-ScrapeResult.tsx line 35: ? result.content.slice(0, CONTENT_CAP_BYTES)-```-✅ Cap applied, truncated state shows "(truncated, view raw)" option.-------## D. Accessibility--**Aria-labels/roles count:**-```-grep -rn "aria-label\|role=\"" src/app/(dashboard)/dashboard/playground/components/ src/app/(dashboard)/dashboard/search-tools/components/ | wc -l-```-**Result:** 44 occurrences of `aria-label` or `role=` across new components. Examples:-- `aria-label="Cancel all streams"` / `aria-label="Run all columns"` in CompareTab-- `role="tablist"` in SearchToolsTopBar and StudioTopBar-- `aria-selected`, `aria-controls`, `id` on tab buttons-- `aria-label="Close export modal"` in ExportCodeModal--✅ Meaningful a11y coverage. Keyboard nav via role=tablist pattern implemented.-------## E. Cycles--**Command:** `npm run check:cycles`-**Result:**-```-[cycles] OK - no cycles detected across 209 files-```-✅ Zero new cycles introduced.-------## F. Build--**Command:** `npm run build` (via node_modules symlink from main repo)-**Result:** Background task running at time of report generation. Build outcome to be confirmed.-Note: Monaco lazy-loading architecture confirmed by code inspection (double-dynamic import: PlaygroundStudio → ApiTab → MonacoEditor).-------## G. Cross-group A paranoia (src/mitm/)--**Command:**-```-git diff release/v3.8.6 --name-only | grep -E '^src/mitm/'-```-**Result:** ✅ ZERO HITS — no src/mitm/ files touched by Group C.-------## H. Checklist de Conformidade §9--### §9.1 Plano 17 — Playground Studio--| Critério | Status | Notas |-|---------|--------|-------|-| Studio com 4 abas (Chat / Compare / API / Build) + config pane | ✅ | PlaygroundStudio.tsx + tabs/ |-| Aba API preserva Monaco editor 100% (D14) | ✅ | ApiTab.tsx preserva 846 LOC do editor |-| Params no UI (sliders) | ✅ | ParamSliders.tsx |-| System prompt editável no painel | ✅ | StudioConfigPane.tsx |-| Token/cost counter | ✅ | TokenCostCounter.tsx + label "(estimated)" D13 |-| Export code curl/Python/TS | ✅ | codeExport.ts + ExportCodeModal.tsx |-| Markdown rendering | ✅ | MarkdownMessage.tsx (react-markdown) |-| Compare: N modelos paralelos até 4 (D10) | ✅ | CompareTab.tsx MAX_COLUMNS=4 |-| Métricas TTFT/TPS/tokens/custo por coluna | ✅ | useStreamMetrics.ts + ProviderMetrics.tsx |-| Build tab: tools[] + JSON mode | ✅ | BuildTab.tsx + ToolsBuilder.tsx + StructuredOutputEditor.tsx |-| Presets: salvar/carregar persistidos | ✅ | playgroundPresets.ts DB + presets routes + PresetPicker.tsx |-| Prompt Improver via LLM | ✅ | promptImprover.ts + improve-prompt route + ImprovePromptButton.tsx |-| i18n 41 locales | ❌ | **BLOCKER** — zero i18n keys adicionadas para features novas (F9 não implementou) |-| Sem any novos | ✅ | typecheck:noimplicit:core passou |-| Sem regressão playground atual | ✅ | ApiTab preserva código original |--### §9.2 Plano 18 — Search Tools Studio--| Critério | Status | Notas |-|---------|--------|-------|-| Studio com 3 abas (Search / Scrape / Compare) | ✅ | SearchToolsClient.tsx refatorado |-| Card explicativo (SearchConceptCard) | ✅ | SearchConceptCard.tsx |-| Catálogo de providers com metadata+status | ✅ | ProviderCatalog.tsx + /api/search/providers estendido |-| Empty states com CTA | ✅ | SearchTab.tsx inclui empty state |-| Aba Search preserva funcionalidade atual | ✅ | SearchTab.tsx usa SearchForm+ResultsPanel+RerankPanel |-| Aba Scrape consome /v1/web/fetch | ✅ | ScrapeTab.tsx + useScrapeFetch.ts |-| Aba Compare N providers lado a lado | ✅ | CompareTab.tsx MAX_PROVIDERS=4 (D22) |-| Export code (curl/Python/TS) | ⚠️ **FIXED** | MockExportCodeModal substituído pelo ExportCodeModal real nesta auditoria |-| Métricas (latência/custo) | ✅ | SearchToolsTopBar exibe latencyMs/costUsd |-| i18n 41 locales | ❌ | **GAP** — zero i18n keys adicionadas |-| Sem any novos | ✅ | typecheck clean |-| String "Size" hardcoded em ProviderComparison | ⚠️ | Marcada com `data-i18n="search.size"` + TODO mas não extraída para i18n key real |--### §9.3 Edge Cases--| Critério | Status |-|---------|--------|-| Compare cancel global aborta todos os streams | ✅ |-| Compare cap 4 colunas — desabilita ao bater limite | ✅ |-| Scrape result > 256KB → truncated + raw | ✅ |-| Export code nunca embute API key real | ✅ (testado) |-| Improve prompt modal avisa "consome quota" | ✅ |-| Preset migration aditiva (sem API keys) | ✅ |-| Tools UI rejeita schema inválido | ✅ |-| Structured Output: schema inválido → erro client-side | ✅ |-| Search empty state quando 0 providers | ✅ |-| Provider catalog status reflete realtime | ✅ |--### §9.4 Segurança + observabilidade--| Critério | Status |-|---------|--------|-| buildErrorBody em todos error responses | ✅ |-| Hard Rule #1: zero hard-coded secrets | ✅ |-| Hard Rule #2: localDb re-export only | ✅ |-| Hard Rule #5: zero raw SQL fora de db/ | ✅ |-| Hard Rule #7: Zod em cada body | ✅ |-| Hard Rule #8: tests em cada arquivo | ✅ |-| Hard Rule #9: coverage ≥ 40/40/40/40 | ✅ (79.1/74.4/80.5/79.1) |-| Hard Rule #10: sem --no-verify | ✅ |-| Hard Rule #12: errors sanitizados | ✅ |-| Hard Rule #16: sem Co-Authored-By | ✅ |--### §9.5 Integrações UI/API/DB/SSE--| Critério | Status |-|---------|--------|-| ChatTab → /v1/chat/completions (SSE) | ✅ |-| CompareTab → N × /v1/chat/completions | ✅ |-| BuildTab → request com tools[] + response_format | ✅ |-| PresetPicker → /api/playground/presets/* | ✅ |-| ImprovePromptButton → /api/playground/improve-prompt | ✅ |-| ScrapeTab → /v1/web/fetch | ✅ |-| CompareTab (search) → /v1/search N× | ✅ |-| ProviderCatalog → /api/search/providers (estendido) | ✅ |--### §9.6 i18n + telemetria--| Critério | Status | Notas |-|---------|--------|-------|-| PT-BR completo (~40+25 chaves novas) | ❌ | **BLOCKER** — F9 não implementou i18n keys |-| EN completo | ❌ | **BLOCKER** — F9 não implementou i18n keys |-| 39 outros locales fallback EN | ❌ | Não verificável sem keys |-| Zero strings hardcoded em UI nova | ❌ | Múltiplos textos hardcoded ("Chat", "Compare", "API", "Build", "Search", "Scrape", etc.) |-------## I. Gaps Encontrados--### Gap 1 — BLOCKER: F9 não implementou i18n keys--**Impacto:** Critério de aceite §9.1 e §9.2 "i18n 41 locales" não atendido.-**Artefatos faltando:**-- `src/i18n/messages/en.json` — zero chaves `playground.*` novas (os ~40 esperados: tabs, params, tools, export, presets, métricas)-- `src/i18n/messages/pt-BR.json` — idem (~25 chaves `search.*` novas)-- 39 outros locales sem fallback confirmado-**Strings hardcoded detectadas** (amostra): "Chat", "Compare", "API", "Build" em `StudioTopBar.tsx`; "Search", "Scrape", "Compare" em `SearchToolsTopBar.tsx`; "Search", "Scrape", "Compare" em `SearchConceptCard.tsx`; "Chat completions", "Search" etc em `StudioConfigPane.tsx`.-**Recomendação:** Despachar F9 corretivo para adicionar chaves i18n e substituir strings hardcoded.--### Gap 2 — BLOCKER: F9 não criou E2E specs--**Impacto:** DoD §10.8 "E2E: 3 specs novos passando" não atendido.-**Artefatos faltando:**-- `tests/e2e/playground-studio.spec.ts`-- `tests/e2e/search-tools-studio.spec.ts`-- `tests/e2e/playground-compare.spec.ts`-**Recomendação:** Despachar F9 corretivo para criar os 3 E2E specs.--### Gap 3 — BLOCKER: F9 não criou docs--**Impacto:** DoD §10.13 não atendido.-**Artefatos faltando:**-- `docs/frameworks/PLAYGROUND_STUDIO.md`-- `docs/frameworks/SEARCH_TOOLS_STUDIO.md`-- Atualizações em `docs/architecture/REPOSITORY_MAP.md`-- Novas rotas em `docs/reference/openapi.yaml` (`/api/playground/improve-prompt`, `/api/playground/presets`, `/api/playground/presets/{id}`)-**Recomendação:** Despachar F9 corretivo para criar docs e atualizar OpenAPI.--### Gap 4 — CORRIGIDO: ExportCodeModal não conectado em Search Tools (F8)--**Impacto:** Critério §9.2 "Export code (curl/Python/TS) for search and fetch" falhou — F8 usava `MockExportCodeModal`.-**Correção aplicada nesta auditoria:**-- `src/app/(dashboard)/dashboard/search-tools/components/SearchToolsTopBar.tsx` — substituído `MockExportCodeModal` pelo real `ExportCodeModal` de F7, importando via `@/app/(dashboard)/dashboard/playground/components/ExportCodeModal`.-- `src/app/(dashboard)/dashboard/search-tools/SearchToolsClient.tsx` — `exportState` tipado como `PlaygroundState` (importado de `@/lib/playground/codeExport`).-- TypeScript typecheck confirma fix válido.--### Gap 5 — MENOR: String "Size" em ProviderComparison.tsx não extraída para i18n--**Impacto:** Plano 18 §6 pede i18n key `search.size`. Atual estado: marcada com `data-i18n="search.size"` mas ainda renderiza literal "Size" (depende do Gap 1 ser resolvido antes).-**Recomendação:** Resolver junto com Gap 1 (i18n keys).-------## J. Checklist de Comandos Finais--| Comando | Resultado |-|---------|-----------|-| `npm run lint` | ✅ 0 errors (2987 pre-existing warnings) |-| `npm run typecheck:core` | ✅ Clean |-| `npm run typecheck:noimplicit:core` | ✅ Clean (confirmado em background) |-| `npm run check:cycles` | ✅ No cycles (209 files scanned) |-| `npm run test:coverage` | ✅ 79.1/74.4/80.5/79.1 — gate 40/40/40/40 PASSED |-| `npm run build` | Running in background (Monaco lazy confirmed by code inspection) |-| `git diff src/shared/constants/sidebarVisibility.ts` | ✅ Empty (D5) |-| `git diff src/server/authz/routeGuard.ts` | ✅ Empty (D6) |-| `git diff --name-only \| grep src/mitm/` | ✅ Zero hits (D cross-group paranoia) |-------## K. Micro-Fixes Aplicados Nesta Auditoria--| Fix | Arquivo | Descrição |-|-----|---------|-----------|-| `fix(search-tools): wire ExportCodeModal real from F7` | `SearchToolsTopBar.tsx` | Substituiu MockExportCodeModal pelo componente real |-| `fix(search-tools): type exportState as PlaygroundState` | `SearchToolsClient.tsx` | Tipagem correta para export state |-------## Status Final--### ❌ BLOCKERS (3 gaps pendentes — requerem F9 corretivo)--1. **i18n keys não implementadas** — UI nova tem strings hardcoded; pt-BR/en.json sem chaves `playground.*` e `search.*` novas (§9.1, §9.2, §9.6).-2. **E2E specs ausentes** — 3 specs Playwright não criados (DoD §10.8).-3. **Docs não criados** — PLAYGROUND_STUDIO.md, SEARCH_TOOLS_STUDIO.md, REPOSITORY_MAP.md updates, openapi.yaml updates faltando (DoD §10.13).--### Corrigido nesta auditoria:--- ExportCodeModal conectado em Search Tools (era MockExportCodeModal).--### Pronto para merge APÓS resolver blockers:--- Hard Rules 1–17: ✅ Todas respeitadas-- Coverage gate 40/40/40/40: ✅ (79.1/74.4/80.5)-- Cycles: ✅ Zero-- Lint: ✅ 0 errors-- TypeScript: ✅ Clean-- D5 (sidebarVisibility): ✅ Zero mudanças-- D6 (routeGuard): ✅ Zero mudanças-- D11 (API key placeholder): ✅-- D12 (TTFT/TPS "(estimated)" label): ✅-- D13 (custo "(estimated)"): ✅-- D14 (ApiTab Monaco preservado): ✅-- D21 (scrape 256KB cap): ✅-- D10/D22 (Compare 4-column cap): ✅-- Cross-group A (src/mitm/ zero changes): ✅-- Co-Authored-By zero: ✅--**Conclusão: ❌ NOT READY TO MERGE — aguarda F9 corretivo para i18n + E2E + Docs.**diff --git a/docs-overview.png b/docs-overview.pngdeleted file mode 100644index 8782d4c4de..0000000000Binary files a/docs-overview.png and /dev/null differdiff --git a/test-debug.ts b/test-debug.tsdeleted file mode 100644index bd6a3bb953..0000000000--- a/test-debug.ts+++ /dev/null@@ -1,21 +0,0 @@-import { validateProviderApiKey } from "./src/lib/providers/validation.ts";--globalThis.fetch = async () =>- new Response(JSON.stringify({ error: "Unauthorized" }), {- status: 401,- headers: { "content-type": "application/json" },- });--validateProviderApiKey({- provider: "bailian-coding-plan",- apiKey: "invalid-key",- providerSpecificData: {- baseUrl: "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic/v1",- },-})- .then((res) => {- console.log("Result:", res);- })- .catch((err) => {- console.error("Error:", err);- });