# ai-orchestrator - Doramagic AI Context Pack

> Positioning: a pre-install experience and judgment asset. It helps the host AI get off to a good start, but it does not mean the project has already been installed, run, or validated.

## Sufficiency Principle

- **Sufficiency over compression**: The AI Context Pack should be sufficient for the host AI to understand the project's value, capability boundaries, entrypoints, risks, and evidence sources before starting work; it may be layered, but it does not aim for the shortest possible summary.
- **Compression policy**: Compress only noise and duplication, never context that affects judgment or the quality of the work.

## How the Host AI Should Use This

You are reading the AI Context Pack that Doramagic compiled for ai-orchestrator. Treat it as pre-work context: help the user understand who it fits, what it can do, how to start, what must be verified after install, and where the risks are. Do not claim that you have already installed, run, or executed the target project.

## Claim Consumption Rules

- **Fact source**: Repo Evidence + Claim/Evidence Graph; the Human Wiki only supplies salience, terminology, and narrative structure.
- **Minimum status for a fact**: `supported`
- `supported`: May be used as a project fact, but the answer must cite the claim_id and evidence path.
- `weak`: Usable only as a low-confidence lead; the user must be asked to keep verifying.
- `inferred`: Usable only for risk notes or open questions; must not be packaged as a project fact.
- `unverified`: Must not be used as fact; state clearly that evidence is insufficient.
- `contradicted`: Must show the conflicting sources and must not force a single version on the user's behalf.

## Who It Fits Best

- **Developers already using host AIs such as Claude/Codex/Cursor/Gemini**: The README or plugin config mentions multiple host AIs. Evidence: `README.md` Claim: `clm_0002` supported 0.86

## What It Can Do

- **Command-Line Startup or Install Flow** (Verify after install): The project documentation contains runnable commands; real use requires running them in a local or host environment. Evidence: `README.md` Claim: `clm_0001` supported 0.86

## How to Start

- `pip install -r requirements.txt` Evidence: `README.md` Claim: `clm_0003` supported 0.86
- `pip install -e .` Evidence: `README.md` Claim: `clm_0004` supported 0.86

## Continue-or-Stop Decision Card

- **Current recommendation**: Trial role matching first
- **Why**: This project is more of a role library; the core risk is picking the wrong role or treating role copy as execution capability. Trial role matching with Prompt Preview first, then decide whether to sandbox-import it.

### 30-Second Read

- **What to do now**: Trial role matching first
- **Minimum safe next step**: Trial role matching with Prompt Preview first; import in isolation only once satisfied
- **Do not trust yet**: Role quality and task fit cannot be trusted directly.
- **Continuing will touch**: Role selection bias, Command execution, Local environment or project files

### What You Can Trust Now

- **Target-audience signal: Developers already using host AIs such as Claude/Codex/Cursor/Gemini** (supported): Backed by a supported claim or project evidence, but that still is not the same as real install results. Evidence: `README.md` Claim: `clm_0002` supported 0.86
- **Capability exists: Command-Line Startup or Install Flow** (supported): You can trust that the project contains signals of this capability; whether it fits your specific task still needs trial or after-install verification. Evidence: `README.md` Claim: `clm_0001` supported 0.86
- **There are Quick Start / install-command signals** (supported): You can trust that the docs mention a startup or install entrypoint; do not run it directly in your primary environment because of that. Evidence: `README.md` Claim: `clm_0003` supported 0.86

### What You Cannot Trust Yet

- **Role quality and task fit cannot be trusted directly.** (unverified): A role library proves there are many roles; it does not prove each one fits your specific task or that a role produces high-quality results.
- **Do not treat role copy as real execution capability.** (unverified): Before install you can only judge whether the role description and task profile match; you cannot prove it can complete the task inside the host AI.
- **Real output quality cannot be trusted before install.** (unverified): Prompt Preview can only show how it guides you; it cannot prove result quality in the real project.
- **Host AI version compatibility cannot be trusted before install.** (unverified): Host loading rules and version differences across Claude, Cursor, Codex, Gemini, and others must be verified in a real environment.
- **That it will not pollute your existing host AI's behavior cannot be trusted directly.** (inferred): Skill, plugin, and AGENTS/CLAUDE/GEMINI instructions may change the host AI's default behavior.
- **Safe rollback cannot be assumed by default.** (unverified): Unless the project clearly provides uninstall and recovery instructions, verify in an isolated environment first.
- **After a real install, is it compatible with the user's current host AI version?** (unverified): Compatibility can only be verified in the actual host environment.
- **Does the project's output quality meet the user's specific task?** (unverified): The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.

### What Continuing Will Touch

- **Role selection bias**: The user's judgment about which expert role should handle the task. Why: Picking the wrong role makes the AI answer from the wrong expert perspective, wasting time or misleading decisions.
- **Command execution**: Package managers, network downloads, the local plugin directory, project config, or the user's home directory. Why: Running the very first command can already change your environment; decide whether it is worth running first. Evidence: `README.md`
- **Local environment or project files**: Install results, plugin caches, project config, or local dependency directories. Why: The write scope and rollback path cannot be proven before install and need isolated verification. Evidence: `README.md`
- **Host AI context**: The AI Context Pack, Prompt Preview, Skill routing, risk rules, and project facts. Why: Importing context affects the host AI's later judgment, so avoid packaging unverified items as facts.

### Minimum Safe Next Steps

- **Run Prompt Preview first**: Use an interactive trial to verify the task profile and role match first; do not import the whole role library up front. (applies when: Applies to any project, especially when output quality is unknown.)
- **Trial-install only in an isolated directory or a test account**: Avoid letting install commands pollute your primary host AI, real projects, or home directory. (applies when: When there are signals of command execution, plugin config, or local writes.)
- **After install, verify just one minimal task**: Verify loading, compatibility, output quality, and rollback first, then decide whether to use it deeply. (applies when: When moving from a trial into a real workflow.)

### Exit Plan

- **Preserve the pre-install state**: Record the original host config and project state so you can later judge whether it is recoverable.
- **Keep a record of the original role selection**: If output goes off-topic, you can return to the task-profiling stage and reselect a role instead of pushing on with the wrong one.
- **Record the install commands and written paths**: Without clear uninstall instructions, you at least need to know which directories or configs to clean up manually.
- **If there is no rollback path, do not enter your primary environment**: No rollback is a blocker before continuing; do not proceed on trust or luck.

## What Can Only Be Previewed

- Explain who the project fits and what it can do
- Demonstrate a typical conversation flow based on project docs
- Help the user decide whether it is worth installing or researching further

## What Must Be Verified After Install

- Actually installing the Skill, plugin, or CLI
- Running scripts, modifying local files, or accessing external services
- Verifying real output quality, performance, and compatibility

## Boundary & Risk Decision Card

- **Mistaking the pre-install preview for a real run**: The user may overestimate how much configuration, permission, and compatibility verification the project has already done. Mitigation: Clearly separate prompt_preview_can_do from runtime_required. Claim: `clm_0005` inferred 0.45
- **Command execution will modify the local environment**: Install commands may write to the user's home directory, the host plugin directory, or project configuration. Mitigation: Run in an isolated environment or a test account first. Evidence: `README.md` Claim: `clm_0006` supported 0.86
- **To confirm**: After a real install, is it compatible with the user's current host AI version?. Why: Compatibility can only be verified in the actual host environment.
- **To confirm**: Does the project's output quality meet the user's specific task?. Why: The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.
- **To confirm**: Do the install commands require network access, permissions, or global writes?. Why: This affects install risk in both enterprise and personal environments.

## Pre-Work Working Context

### Loading Order

- First read how_to_use.host_ai_instruction to establish the boundaries of this pre-install judgment asset.
- Read claim_graph_summary to confirm facts come from the Claim/Evidence Graph, not the Human Wiki narrative.
- Then read intended_users, capabilities, and quick_start_candidates to judge whether the user is a match.
- When you need to carry out a concrete task, check role_skill_index first, then evidence_index.
- For real install, file modification, network access, performance, or compatibility questions, turn to risk_card and boundaries.runtime_required.

### Task Routes

- **Command-Line Startup or Install Flow**: State that this is an after-install capability first, then give a pre-install checklist. Boundary: Must be verified after a real install or run. Evidence: `README.md` Claim: `clm_0001` supported 0.86

### Context Scale

- Total files: 80
- Important-file coverage: 40/80
- Evidence index entries: 73
- Role / Skill entries: 23

### Handling Insufficient Evidence

- **missing_evidence**: State that evidence is insufficient and ask the user for the target file, a README section, or after-install verification records; do not fill in facts.
- **out_of_scope_request**: State that the task is beyond the current AI Context Pack's evidence scope and suggest the user check the Human Manual or verify after a real install.
- **runtime_request**: Provide a pre-install checklist and command sources, but do not run commands for the user or claim they have been run.
- **source_conflict**: Show the conflicting sources side by side, mark them as unverified, and do not force a single version.

## Prompt Recipes

### Fit assessment

- Goal: Judge whether this project fits the user's current task.
- Expected output: A fit conclusion, key reasons, evidence citations, what can be previewed before install, what must be verified after install, and a next-step recommendation.

```text
Based on the AI Context Pack for ai-orchestrator, ask me 3 necessary questions first, then judge whether it fits my task. The answer must cover: who it fits, what it can do, what it cannot do, whether it is worth installing, and where the evidence comes from. Every project fact must cite evidence_refs, source_paths, or a claim_id.
```

### Pre-install experience

- Goal: Let the user feel the core workflow before installing, while avoiding packaging the preview as real capability or a marketing promise.
- Expected output: An experience script with boundary labels, an after-install verification checklist, and a cautious recommendation; with no real-run promises or strong marketing language.

```text
Treat ai-orchestrator as a pre-install experience asset, not an already-installed tool or a real runtime environment.

Output exactly four parts:
1. Ask me 3 necessary questions first.
2. Give an "experience script": use the three labels [Previewable before install], [Must verify after install], and [Insufficient evidence] to show how it might guide the workflow.
3. Give an after-install verification checklist: list which capabilities can only be confirmed after a real install, real host loading, and a real project run.
4. Give a cautious recommendation: only "worth researching/trialing further", "add information before deciding", or "not recommended to continue"; do not endorse the project.

Hard boundaries:
- Do not claim you have installed, run, executed tests, modified files, or produced real results.
- Do not write promise-like phrasing such as "auto-adapts", "guarantees passing", "perfect fit", or "strongly recommend installing".
- If you describe how it works after install, you must use a conditional such as "if installed successfully and the host loads the Skill correctly, it might...".
- The experience script may only be written as "example lines / hypothetical flow": use "might ask / might suggest / might show", not "has written, has generated, has passed, is running, is generating".
- Prompt Preview does not hand out install commands; if the user is ready to trial, only prompt them to read Quick Start and the Risk Card first and to verify in an isolated environment.
- Every project fact must come from a supported claim, evidence_refs, or source_paths; inferred/unverified items can only be risks or open questions.

```

### Role / Skill selection

- Goal: Pick the best-matching asset from the project's roles or Skills.
- Expected output: A list of candidate roles or Skills, each with an applicable scenario, evidence paths, risk boundary, and whether after-install verification is needed.

```text
Read role_skill_index and recommend 3-5 of the most relevant roles or Skills for my target task. For each recommendation, state the applicable scenario, likely output, risk boundary, and evidence_refs.
```

### Risk pre-check

- Goal: Identify environment, permission, rule-conflict, and quality risks before installing or adopting.
- Expected output: A checklist of environment, permission, dependency, license, host-conflict, quality risk, and unknown items.

```text
Based on risk_card, boundaries, and quick_start_candidates, give me a pre-install risk pre-check list. Do not run commands for me; only explain what I should check, why, and what impact a failure would have.
```

### Host AI kickoff instruction

- Goal: Turn the project context into a host AI instruction for the start of a conversation.
- Expected output: A pre-work instruction with clear boundaries and clear evidence citations, suitable to copy to a host AI.

```text
Based on the AI Context Pack for ai-orchestrator, generate a pre-work instruction I can paste to my host AI. This instruction must obey not_runtime=true and must not claim the project has been installed, run, or produced real results.
```

## Role / Skill Index

- Indexed 23 role / Skill / project-doc entries.

- **docs/decisions/** (project_doc): Registro de decisiones técnicas de ai-orchestrator : qué se decidió, qué se propuso y no se cerró, y qué evidencia respalda cada cosa. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/README.md`
- **analyses/** (project_doc): Análisis técnicos independientes ANL-NNN-slug.md que informan una decisión futura sin fijarla por sí mismos: benchmarks, auditorías de una superficie del código, comparativas de prior art que no están atadas a un RFC específico. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/analyses/README.md`
- **Evidencia de RFC-006** (project_doc): RFC-006 ../../rfcs/RFC-006-provider-safe-routing.md afirma resultados medidos localmente: pytest tests/test egress.py → 15 passed, pytest tests/ → 126 passed / 1 failed pre-existente, PoC de cero bytes a DeepSeek en un proyecto restricted . Ese patch egress-gate.patch , +512/−28 fue efímero: se aplicó, se probó y se descartó sin publicar rama ni guardar el patch ni el script repro.py en este repo. No hay artefactos… Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/evidence/RFC-006/README.md`
- **Evidencia de RFC-007** (project_doc): Esta carpeta guarda la evidencia de ejecutar docs/decisions/rfcs/RFC-007-ai-control-plane.md Parte II los 13 commits de Fase 0 + Fase 1 contra código real. Distinto de ../RFC-006/README.md , que documenta el diseño original y su patch efímero histórico, nunca publicado — I1-I14 se diseñaron en RFC-006, pero se implementan y verifican acá , junto con I15 invariante nueva, exclusiva de RFC-007 . Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/evidence/RFC-007/README.md`
- **Catalogo de precios de modelos** (project_doc): Fuente canonica y versionada de precios por modelo, referenciada en la ADR-002 ../decisions/adrs/ADR-002-model-pricing-catalog.md . Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/pricing/README.md`
- **Por qué** (project_doc): Memoria, trazabilidad y control de costos para desarrollo asistido por agentes IA Rutea tareas entre Claude, OpenAI, DeepSeek y Gemini según el contexto del proyecto, con dashboard en vivo, tracking de costo y memoria RAG. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `README.md`
- **Administracion de llaves IA, catalogo de modelos y ruteo** (project_doc): Administracion de llaves IA, catalogo de modelos y ruteo Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/ai-provider-keys-model-catalog-review.md`
- **Obtención de API Keys** (project_doc): El orquestador necesita hasta cuatro API keys, una por proveedor. Solo son obligatorias las de los proveedores que vayas a usar. El mínimo funcional es tener DeepSeek para el router + al menos un proveedor destino . Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/api-keys.md`
- **Esquema de context.yaml** (project_doc): Cada proyecto registrado tiene su propio .orchestrator/context.yaml , versionado junto al código. Este archivo es la fuente de verdad que el router consulta para decidir qué proveedor usar en cada tarea. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/context-schema.md`
- **ADR-001: Chunking RAG de 1500 caracteres** (project_doc): ADR-001: Chunking RAG de 1500 caracteres Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/adrs/ADR-001-rag-chunking.md`
- **ADR-002: Catálogo versionado de modelos y precios** (project_doc): ADR-002: Catálogo versionado de modelos y precios Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/adrs/ADR-002-model-pricing-catalog.md`
- **RFC: Egress Gate para ai-orchestrator** (project_doc): RFC: Egress Gate para ai-orchestrator Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/archive/RFC-001-egress-gate.md`
- **RFC-002: Egress Gate para ai-orchestrator** (project_doc): RFC-002: Egress Gate para ai-orchestrator Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/archive/RFC-002-egress-gate.md`
- **RFC-003: Egress Gate + Provider-Safe Routing para ai-orchestrator** (project_doc): RFC-003: Egress Gate + Provider-Safe Routing para ai-orchestrator Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/archive/RFC-003-provider-safe-routing.md`
- **RFC-004: Egress Gate + Provider-Safe Routing** (project_doc): RFC-004: Egress Gate + Provider-Safe Routing Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/archive/RFC-004-egress-gate.md`
- **RFC-005: Project-Scoped Governed Decision Provenance** (project_doc): RFC-005: Project-Scoped Governed Decision Provenance Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/archive/RFC-005-governed-decision-provenance.md`
- **RFC-007 — Local AI Control Plane para desarrollo asistido por IA** (project_doc): RFC-007 — Local AI Control Plane para desarrollo asistido por IA Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/archive/RFC-007-ai-control-plane-v0.3.md`
- **RFC-006: Provider-Safe Routing para ai-orchestrator** (project_doc): RFC-006: Provider-Safe Routing para ai-orchestrator Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/rfcs/RFC-006-provider-safe-routing.md`
- **RFC-007 — Local AI Control Plane: Plan de Implementación Definitivo** (project_doc): RFC-007 — Local AI Control Plane: Plan de Implementación Definitivo Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/rfcs/RFC-007-ai-control-plane.md`
- **RFC-008 — Acceso MCP gobernado y superficie remota del Local AI Control Plane** (project_doc): RFC-008 — Acceso MCP gobernado y superficie remota del Local AI Control Plane Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/rfcs/RFC-008-governed-mcp-access.md`
- **Mapa de implementación de ADR-002** (project_doc): Este mapa aterriza ADR-002 catálogo versionado de modelos y precios en cambios concretos dentro de ai-orchestrator . La regla de orden es mantener primero compatibilidad con el calculo actual de costos y despues abrir nuevas superficies: API local, CLI, discovery y router. Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/support/ADR-002/implementation-map.md`
- **ADR-NNN: título de la decisión** (project_doc): Estado: propuesta aceptada rechazada superseded deprecated Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/templates/ADR-TEMPLATE.md`
- **RFC-NNN — Título corto** (project_doc): Estado: Draft Draft para validación final Draft para ejecución Codex Aceptado Superseded Versión: 0.1 Fecha: AAAA-MM-DD Repo de referencia: owner/repo@branch = verificado AAAA-MM-DD Relación con la serie: ¿a qué RFC sucede o complementa? ¿Qué queda fuera de alcance porque lo cubre otro documento? Activation hint: Reference this when the user needs to understand the project's structure, install path, or boundaries. Evidence: `docs/decisions/templates/RFC-TEMPLATE.md`

## Evidence Index

- Indexed 73 evidence entries.

- **docs/decisions/** (documentation): Registro de decisiones técnicas de ai-orchestrator : qué se decidió, qué se propuso y no se cerró, y qué evidencia respalda cada cosa. Evidence: `docs/decisions/README.md`
- **analyses/** (documentation): Análisis técnicos independientes ANL-NNN-slug.md que informan una decisión futura sin fijarla por sí mismos: benchmarks, auditorías de una superficie del código, comparativas de prior art que no están atadas a un RFC específico. Evidence: `docs/decisions/analyses/README.md`
- **Evidencia de RFC-006** (documentation): RFC-006 ../../rfcs/RFC-006-provider-safe-routing.md afirma resultados medidos localmente: pytest tests/test egress.py → 15 passed, pytest tests/ → 126 passed / 1 failed pre-existente, PoC de cero bytes a DeepSeek en un proyecto restricted . Ese patch egress-gate.patch , +512/−28 fue efímero: se aplicó, se probó y se descartó sin publicar rama ni guardar el patch ni el script repro.py en este repo. No hay artefactos que archivar todavía. Evidence: `docs/decisions/evidence/RFC-006/README.md`
- **Evidencia de RFC-007** (documentation): Esta carpeta guarda la evidencia de ejecutar docs/decisions/rfcs/RFC-007-ai-control-plane.md Parte II los 13 commits de Fase 0 + Fase 1 contra código real. Distinto de ../RFC-006/README.md , que documenta el diseño original y su patch efímero histórico, nunca publicado — I1-I14 se diseñaron en RFC-006, pero se implementan y verifican acá , junto con I15 invariante nueva, exclusiva de RFC-007 . Evidence: `docs/decisions/evidence/RFC-007/README.md`
- **Catalogo de precios de modelos** (documentation): Fuente canonica y versionada de precios por modelo, referenciada en la ADR-002 ../decisions/adrs/ADR-002-model-pricing-catalog.md . Evidence: `docs/pricing/README.md`
- **Por qué** (documentation): Memoria, trazabilidad y control de costos para desarrollo asistido por agentes IA Rutea tareas entre Claude, OpenAI, DeepSeek y Gemini según el contexto del proyecto, con dashboard en vivo, tracking de costo y memoria RAG. Evidence: `README.md`
- **Administracion de llaves IA, catalogo de modelos y ruteo** (documentation): Administracion de llaves IA, catalogo de modelos y ruteo Evidence: `docs/ai-provider-keys-model-catalog-review.md`
- **Obtención de API Keys** (documentation): El orquestador necesita hasta cuatro API keys, una por proveedor. Solo son obligatorias las de los proveedores que vayas a usar. El mínimo funcional es tener DeepSeek para el router + al menos un proveedor destino . Evidence: `docs/api-keys.md`
- **Esquema de context.yaml** (documentation): Cada proyecto registrado tiene su propio .orchestrator/context.yaml , versionado junto al código. Este archivo es la fuente de verdad que el router consulta para decidir qué proveedor usar en cada tarea. Evidence: `docs/context-schema.md`
- **ADR-001: Chunking RAG de 1500 caracteres** (documentation): ADR-001: Chunking RAG de 1500 caracteres Evidence: `docs/decisions/adrs/ADR-001-rag-chunking.md`
- **ADR-002: Catálogo versionado de modelos y precios** (documentation): ADR-002: Catálogo versionado de modelos y precios Evidence: `docs/decisions/adrs/ADR-002-model-pricing-catalog.md`
- **RFC: Egress Gate para ai-orchestrator** (documentation): RFC: Egress Gate para ai-orchestrator Evidence: `docs/decisions/archive/RFC-001-egress-gate.md`
- **RFC-002: Egress Gate para ai-orchestrator** (documentation): RFC-002: Egress Gate para ai-orchestrator Evidence: `docs/decisions/archive/RFC-002-egress-gate.md`
- **RFC-003: Egress Gate + Provider-Safe Routing para ai-orchestrator** (documentation): RFC-003: Egress Gate + Provider-Safe Routing para ai-orchestrator Evidence: `docs/decisions/archive/RFC-003-provider-safe-routing.md`
- **RFC-004: Egress Gate + Provider-Safe Routing** (documentation): RFC-004: Egress Gate + Provider-Safe Routing Evidence: `docs/decisions/archive/RFC-004-egress-gate.md`
- **RFC-005: Project-Scoped Governed Decision Provenance** (documentation): RFC-005: Project-Scoped Governed Decision Provenance Evidence: `docs/decisions/archive/RFC-005-governed-decision-provenance.md`
- **RFC-007 — Local AI Control Plane para desarrollo asistido por IA** (documentation): RFC-007 — Local AI Control Plane para desarrollo asistido por IA Evidence: `docs/decisions/archive/RFC-007-ai-control-plane-v0.3.md`
- **RFC-006: Provider-Safe Routing para ai-orchestrator** (documentation): RFC-006: Provider-Safe Routing para ai-orchestrator Evidence: `docs/decisions/rfcs/RFC-006-provider-safe-routing.md`
- **RFC-007 — Local AI Control Plane: Plan de Implementación Definitivo** (documentation): RFC-007 — Local AI Control Plane: Plan de Implementación Definitivo Evidence: `docs/decisions/rfcs/RFC-007-ai-control-plane.md`
- **RFC-008 — Acceso MCP gobernado y superficie remota del Local AI Control Plane** (documentation): RFC-008 — Acceso MCP gobernado y superficie remota del Local AI Control Plane Evidence: `docs/decisions/rfcs/RFC-008-governed-mcp-access.md`
- **Mapa de implementación de ADR-002** (documentation): Este mapa aterriza ADR-002 catálogo versionado de modelos y precios en cambios concretos dentro de ai-orchestrator . La regla de orden es mantener primero compatibilidad con el calculo actual de costos y despues abrir nuevas superficies: API local, CLI, discovery y router. Evidence: `docs/decisions/support/ADR-002/implementation-map.md`
- **ADR-NNN: título de la decisión** (documentation): Estado: propuesta aceptada rechazada superseded deprecated Evidence: `docs/decisions/templates/ADR-TEMPLATE.md`
- **RFC-NNN — Título corto** (documentation): Estado: Draft Draft para validación final Draft para ejecución Codex Aceptado Superseded Versión: 0.1 Fecha: AAAA-MM-DD Repo de referencia: owner/repo@branch = verificado AAAA-MM-DD Relación con la serie: ¿a qué RFC sucede o complementa? ¿Qué queda fuera de alcance porque lo cubre otro documento? Evidence: `docs/decisions/templates/RFC-TEMPLATE.md`
- **Config.Example** (source_file): providers: claude: api key: "sk-ant-..." model: "claude-sonnet-4-6" openai: api key: "sk-..." model: "gpt-4o" deepseek: api key: "sk-..." model: "deepseek-v4-flash" gemini: api key: "AIza..." model: "gemini-2.5-flash" router: provider: "deepseek" model: "deepseek-v4-flash" fallback provider: "claude" defaults: default provider: "claude" pricing: claude-sonnet-4-6: input: 3.00 output: 15.00 cache write: 3.75 cache read: 0.30 claude-opus-4-8: input: 5.00 output: 25.00 cache write: 6.25 cache read: 0.50 claude-haiku-4-5-20251001: input: 1.00 output: 5.00 cache write: 1.25 cache read: 0.10 gpt-4o: input: 5.00 output: 15.00 gpt-4o-mini: input: 0.15 output: 0.60 deepseek-v4-flash: input: 0.14 out… Evidence: `config.example.yaml`
- **Init** (source_file): version = "0.4.0" Evidence: `orchestrator/__init__.py`
- **── 1. Entorno Python ──────────────────────────────────────────────────** (source_file): app = typer.Typer console = Console legacy windows=False ⋮---- def ensure db - None ⋮---- """Registra un proyecto en el índice y genera su context.yaml si no existe.""" ⋮---- project path = Path path .expanduser .resolve ⋮---- ctx path = context module.create default context ⋮---- claude md = context module.create claude md project path, alias ⋮---- @app.command name="list" def list command ⋮---- projects = index module.list projects ⋮---- table = Table title="Proyectos registrados" ⋮---- has context = context module.context exists Path path ⋮---- @app.command def remove alias: str = typer.Argument ..., help="Alias del proyecto a quitar del índice." ⋮---- """Renombra el alias de un proyecto… Evidence: `orchestrator/cli.py`
- **Context** (source_file): class ContextNotFoundError Exception ⋮---- @dataclass class ProjectContext ⋮---- name: str stack: str = "" description: str = "" conventions: list str = field default factory=list default provider: str None = None routing notes: str = "" keyword hints: list dict = field default factory=list daily budget usd: float None = None skip dirs: list str = field default factory=list raw: dict = field default factory=dict ⋮---- @property def context path self - Path None ⋮---- def context file path project path: Path - Path ⋮---- def context exists project path: Path - bool ⋮---- def load context project path: Path - ProjectContext ⋮---- ctx path = context file path project path ⋮---- raw = yaml.safe… Evidence: `orchestrator/context.py`
- **Db** (source_file): local = threading.local write lock = threading.Lock ⋮---- def conn - sqlite3.Connection ⋮---- conn = sqlite3.connect str paths.DB PATH , check same thread=False ⋮---- SCHEMA = """ ⋮---- def init db - None ⋮---- conn = conn ⋮---- ts = datetime.now timezone.utc .isoformat preview = task :150 .replace "\n", " " .strip ⋮---- cur = conn.execute ⋮---- def extract tokens result: CompletionResult - tuple Optional int , Optional int ⋮---- usage = result.raw response or {} .get "usage", {} ⋮---- def delete imported runs project: str, provider: Optional str = None - list int ⋮---- rows = conn.execute ⋮---- ids = r "id" for r in rows ⋮---- placeholders = ",".join "?" len ids ⋮---- """Inserta un run com… Evidence: `orchestrator/db.py`
- **Puede ser el primer commit sin padre** (source_file): PROVIDER NAME = "git" MAX DIFF BYTES = 8 000 MAX COMMITS = 200 ⋮---- def session id alias: str, commit hash: str - str ⋮---- def run git args: list str , cwd: Path - str ⋮---- result = subprocess.run ⋮---- def is git repo path: Path - bool ⋮---- def get commits path: Path, max commits: int = MAX COMMITS - list dict ⋮---- sep = "\x1f" fmt = f"%H{sep}%s{sep}%ai{sep}%an{sep}%b" raw = run git seen: set str = set commits = ⋮---- line = line.strip ⋮---- parts = line.split sep, 4 ⋮---- h = parts 0 ⋮---- def get diff path: Path, commit hash: str - str ⋮---- """Retorna el diff de un commit, truncado a MAX DIFF BYTES.""" diff = run git ⋮---- Puede ser el primer commit sin padre diff = run git "show",… Evidence: `orchestrator/git_scanner.py`
- **Index** (source_file): class ProjectNotFoundError Exception ⋮---- def ensure home dir - None ⋮---- def load index - dict ⋮---- data = yaml.safe load f or {} ⋮---- def save index data: dict - None ⋮---- def add project alias: str, path: str - None ⋮---- data = load index ⋮---- def remove project alias: str - None ⋮---- def rename project old alias: str, new alias: str - None ⋮---- def get project path alias: str - Path ⋮---- projects = data.get "projects", {} ⋮---- def list projects - dict Evidence: `orchestrator/index.py`
- **Mcp** (source_file): HANDLERS: dict str, Callable dict , Any = {} ⋮---- SERVER INSTRUCTIONS = ⋮---- SUPPORTED PROTOCOL VERSIONS = { DEFAULT PROTOCOL VERSION = "2025-06-18" ⋮---- TOOLS = ⋮---- def tool get context args: dict - dict ⋮---- conn = conn context id = args.get "context id" project = args.get "project" ⋮---- row = conn.execute "SELECT FROM contexts WHERE id=?", context id, .fetchone ⋮---- row = conn.execute ⋮---- def tool list steps args: dict - dict ⋮---- rows = conn .execute ⋮---- def tool confirm alignment args: dict - dict ⋮---- ts = datetime.now timezone.utc .isoformat ⋮---- cur = conn.execute ⋮---- def tool record tool call args: dict - dict ⋮---- def tool skip step args: dict - dict ⋮---- step i… Evidence: `orchestrator/mcp.py`
- **Migrate** (source_file): migration lock = threading.Lock ⋮---- def runs jsonl ⋮---- def already applied conn: sqlite3.Connection, name: str - bool ⋮---- row = conn.execute ⋮---- def mark applied conn: sqlite3.Connection, name: str - None ⋮---- def migrate jsonl conn: sqlite3.Connection - int ⋮---- runs jsonl = runs jsonl ⋮---- count = 0 ⋮---- line = line.strip ⋮---- r = json.loads line ⋮---- task preview = r.get "task preview", "" ⋮---- migrated = runs jsonl.with suffix ".jsonl.migrated" ⋮---- def index existing runs conn: sqlite3.Connection - int ⋮---- backend = get backend rows = conn.execute ⋮---- def run migrations - None ⋮---- conn = conn ⋮---- n = migrate jsonl conn ⋮---- cols = r 1 for r in conn.execute "PRA… Evidence: `orchestrator/migrate.py`
- **Rag** (source_file): CHUNK SIZE = 1500 CHUNK OVERLAP = 200 ⋮---- DISTANCE THRESHOLD = 0.9 SCAN EXTENSIONS = {".md", ".txt", ".yaml", ".yml", ".toml", ".rst", ".json"} CODE EXTENSIONS = { SKIP DIRS = { SKIP PATHS = {"storage/logs", "bootstrap/cache", "public/build"} SKIP FILENAMES = { SKIP SUFFIXES = { ⋮---- SECRET PATTERN = re.compile ⋮---- r"sk-ant- A-Za-z0-9\- {20,}" Anthropic API key r" sk- A-Za-z0-9 \- {30,}" OpenAI API key sk-proj-… / sk-svcacct-… r" APP USR- A-Za-z0-9\- {10,}" MercadoPago r" token\s =\s a-f0-9 {32,}" token= in URLs generic ⋮---- r" AKIA 0-9A-Z {16}" AWS access key ID r" ?:aws secret access key AWS SECRET \"' ?\s =: \s \"' ? A-Za-z0-9/+= {40}" AWS secret r" ghp A-Za-z0-9 {36}" GitHub PAT c… Evidence: `orchestrator/rag.py`
- **Validar que el provider elegido tenga API key configurada.** (source_file): ROUTER SYSTEM PROMPT = """Sos un router de tareas de desarrollo de software. ⋮---- @dataclass class RoutingDecision ⋮---- provider: str reason: str model: str None = None used fallback: bool = False router cost usd: float None = None system prompt addition: str None = None ⋮---- def calculate keyword signals task: str, ctx: ProjectContext - list dict ⋮---- task lower = task.lower signals = ⋮---- match = hint.get "match", "" ⋮---- def compress context ctx: ProjectContext, task: str, threshold chars: int = 3200 - ProjectContext ⋮---- total chars = len ctx.stack + len ctx.description + sum len c for c in ctx.conventions ⋮---- task words = set task.lower .split relevant = c for c in ctx.convent… Evidence: `orchestrator/router.py`
- **Pre-filtrar en DB: si hay proyecto seleccionado, traer solo sus runs** (source_file): console = Console legacy windows=False ⋮---- def serve port: int, project: Optional str , open browser: bool, config: dict - None ⋮---- class DashboardHandler http.server.BaseHTTPRequestHandler ⋮---- def log message self, fmt, args ⋮---- def handle error self, request, client address ⋮---- def do GET self ⋮---- parsed = urllib.parse.urlparse self.path path = parsed.path ⋮---- handler = { ⋮---- def get favicon self, parsed ⋮---- def get robots self, parsed ⋮---- def get static theme self, parsed ⋮---- fname = path.split "/" -1 ct = "text/css; charset=utf-8" if fname.endswith ".css" else "text/javascript; charset=utf-8" src = self. DOCS IMG.parent / fname .resolve ⋮---- body = src.read bytes… Evidence: `orchestrator/server.py`
- **Tracer** (source_file): def publish payload: dict - None ⋮---- @contextmanager def span name: str, run id: Optional int = None, detail: Optional str = None ⋮---- ts = datetime.now timezone.utc .isoformat ⋮---- t0 = time.monotonic ⋮---- elapsed = int time.monotonic - t0 1000 Evidence: `orchestrator/tracer.py`
- **Openai** (source_file): API URL = "https://api.openai.com/v1/models" ⋮---- def list models api key: str - list dict ⋮---- headers = {"Authorization": f"Bearer {api key}"} response = httpx.get API URL, headers=headers, timeout=10 ⋮---- data = response.json Evidence: `orchestrator/discovery/openai.py`
- **Base** (source_file): @dataclass class CompletionResult ⋮---- text: str provider: str model: str raw response: dict None = None cache creation tokens: int = 0 cache read tokens: int = 0 input tokens: Optional int = None output tokens: Optional int = None ⋮---- @dataclass class StreamResult ⋮---- text: str = "" provider: str = "" model: str = "" ⋮---- input tokens: int = 0 output tokens: int = 0 ⋮---- def to completion result self - CompletionResult ⋮---- class BaseProvider ABC ⋮---- name: str = "base" ⋮---- def init self, api key: str, model: str ⋮---- @abstractmethod def complete self, prompt: str, system: str = "" - CompletionResult ⋮---- """Envía el prompt al proveedor y devuelve el resultado completo.""" ⋮--… Evidence: `orchestrator/providers/base.py`
- **Claude** (source_file): API URL = "https://api.anthropic.com/v1/messages" ANTHROPIC VERSION = "2023-06-01" ⋮---- class ClaudeProvider BaseProvider ⋮---- name = "claude" ⋮---- def complete self, prompt: str, system: str = "" - CompletionResult ⋮---- headers = { body = { ⋮---- response = httpx.post API URL, headers=headers, json=body, timeout=120 ⋮---- data = response.json ⋮---- text = "".join usage = data.get "usage", {} ⋮---- sr = StreamResult provider=self.name, model=self.model ⋮---- data str = line 6: ⋮---- event = json.loads data str ⋮---- etype = event.get "type" ⋮---- usage = event.get "message", {} .get "usage", {} ⋮---- delta = event.get "delta", {} ⋮---- chunk = delta.get "text", "" ⋮---- usage = event.ge… Evidence: `orchestrator/providers/claude.py`
- **Factory** (source_file): REGISTRY: dict str, type BaseProvider = { ⋮---- def build provider config: dict, provider name: str - BaseProvider ⋮---- provider cfg = get provider config config, provider name provider cls = REGISTRY provider name Evidence: `orchestrator/providers/factory.py`
- **Openai** (source_file): API URL = "https://api.openai.com/v1/chat/completions" ⋮---- class OpenAIProvider BaseProvider ⋮---- name = "openai" ⋮---- def complete self, prompt: str, system: str = "" - CompletionResult ⋮---- headers = { messages = ⋮---- body = { ⋮---- response = httpx.post API URL, headers=headers, json=body, timeout=120 ⋮---- data = response.json usage = data.get "usage", {} ⋮---- text = data "choices" 0 "message" "content" ⋮---- sr = StreamResult provider=self.name, model=self.model ⋮---- data str = line 6: .strip ⋮---- event = json.loads data str ⋮---- choices = event.get "choices", ⋮---- delta = choices 0 .get "delta", {} chunk = delta.get "content" or "" ⋮---- usage = event.get "usage" Evidence: `orchestrator/providers/openai.py`
- **Manifest** (structured_config): { "name": "Your App Name", "short name": "Your App", "icons": { "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" }, { "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" } , "theme color": " ffffff", "background color": " ffffff", "display": "standalone" } Evidence: `docs/img/favicons/manifest.json`
- **Models** (structured_config): { "schema version": "1.0", "currency": "USD", "unit": "per 1m tokens", "updated at": "2026-07-08T00:00:00Z", "provider aliases": { "claude": "anthropic", "anthropic": "anthropic", "openai": "openai", "deepseek": "deepseek", "gemini": "google", "google": "google" }, "providers": { "anthropic": { "display name": "Anthropic", "models": { "claude-sonnet-4-6": { "id": "claude-sonnet-4-6", "provider": "anthropic", "status": "active", "aliases": , "pricing": { "input": 3.00, "output": 15.00, "cache write": 3.75, "cache read": 0.30 }, "purpose": { "summary": "Modelo balanceado de Claude para arquitectura, seguridad y código complejo.", "strengths": "architecture", "security review", "code review",… Evidence: `docs/pricing/models.json`
- **Schema** (structured_config): { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://github.com/ai-orchestrator/docs/pricing/schema.json", "title": "ai-orchestrator model pricing catalog", "type": "object", "required": "schema version", "currency", "unit", "updated at", "providers" , "properties": { "schema version": { "type": "string" }, "currency": { "type": "string", "const": "USD" }, "unit": { "type": "string", "const": "per 1m tokens" }, "updated at": { "type": "string", "format": "date-time" }, "provider aliases": { "type": "object", "additionalProperties": { "type": "string" } }, "providers": { "type": "object", "additionalProperties": { "type": "object", "required": "display name", "models"… Evidence: `docs/pricing/schema.json`
- **Config.Toml** (source_file): mcp servers.ai orchestrator command = ".venv\\Scripts\\python.exe" args = "-u", "-m", "orchestrator.mcp" cwd = "." startup timeout sec = 15 tool timeout sec = 60 enabled = true required = true default tools approval mode = "auto" Evidence: `.codex/config.toml.example`
- **.gitattributes** (source_file): text=auto eol=lf .py text eol=lf .yaml text eol=lf .md text eol=lf .toml text eol=lf .txt text eol=lf Evidence: `.gitattributes`
- **Entornos virtuales** (source_file): Entornos virtuales venv/ .venv/ env/ Evidence: `.gitignore`
- **.Mcp.Json** (source_file): { "mcpServers": { "ai-orchestrator": { "command": ".venv/Scripts/python.exe", "args": "-m", "orchestrator.mcp" } } } Evidence: `.mcp.json.example`
- **Docs Theme** (source_file): :root { ⋮---- data-theme="light" { data-theme="midnight" { data-theme="nord" { data-theme="espresso" { data-theme="a11y" { ⋮---- nav{position:sticky;top:0;z-index:100;background:var --nav-bg ;backdrop-filter:blur 12px ;-webkit-backdrop-filter:blur 12px ;border-bottom:1px solid var --border ;padding:0 20px;display:flex;align-items:center;justify-content:space-between;height:52px;gap:12px} .nav-logo{display:flex;align-items:center;gap:10px;flex-shrink:0} .nav-logo img{height:22px} .nav-links{display:flex;gap:8px;font-size:13px;font-weight:500;align-items:center;flex-wrap:nowrap;overflow:hidden} .nav-links a{color:var --text-muted ;transition:color .15s;white-space:nowrap;padding:2px 6px;borde… Evidence: `docs/docs-theme.css`
- **Docs Theme** (source_file): function apply name Evidence: `docs/docs-theme.js`
- **Index** (source_file): ai-orchestrator — Paper de diseño {box-sizing:border-box;margin:0;padding:0} html{scroll-behavior:smooth} body{font-family:'Inter',system-ui,sans-serif;background:var --bg ;color:var --text ;-webkit-font-smoothing:antialiased;line-height:1.6} a{color:var --sky ;text-decoration:none} a:hover{text-decoration:underline} code,pre{font-family:'JetBrains Mono',monospace} / ── Hero ── / .hero{position:relative;overflow:hidden;text-align:center;padding:72px 32px 56px} .hero-banner{width:100%;max-width:900px;border-radius:12px;display:block;margin:0 auto 40px} .hero h1{font-size:clamp 28px,5vw,48px ;font-weight:700;letter-spacing:-.5px;margin-bottom:14px} .hero h1 span{color:var --green } .hero p{fo… Evidence: `docs/index.html`
- **Mcp** (source_file): ai-orchestrator — MCP Server {box-sizing:border-box;margin:0;padding:0} html{scroll-behavior:smooth} body{font-family:'Inter',system-ui,sans-serif;background:var --bg ;color:var --text ;-webkit-font-smoothing:antialiased;line-height:1.6} a{color:var --sky ;text-decoration:none} a:hover{text-decoration:underline} code,pre{font-family:'JetBrains Mono',monospace} code{font-size:12px;background:var --surface2 ;padding:2px 6px;border-radius:4px;color: e2e8f0} .hero{text-align:center;padding:64px 32px 48px;border-bottom:1px solid var --border } .hero-tag{display:inline-block;background:var --sky-bg ;color:var --sky ;border:1px solid rgba 56,189,248,.25 ;border-radius:20px;font-size:11px;font-weig… Evidence: `docs/mcp.html`
- **Security** (source_file): ai-orchestrator — Seguridad · Secretos {box-sizing:border-box;margin:0;padding:0} html{scroll-behavior:smooth} body{font-family:'Inter',system-ui,sans-serif;background:var --bg ;color:var --text ;-webkit-font-smoothing:antialiased;line-height:1.6} a{color:var --sky ;text-decoration:none} a:hover{text-decoration:underline} code,pre{font-family:'JetBrains Mono',monospace} code{font-size:12px;background:var --surface2 ;padding:2px 6px;border-radius:4px;color: e2e8f0} .hero{text-align:center;padding:64px 32px 48px;border-bottom:1px solid var --border } .hero-tag{display:inline-block;background:var --red-bg ;color:var --red ;border:1px solid rgba 248,113,113,.25 ;border-radius:20px;font-size:11p… Evidence: `docs/security.html`
- **Index.Example** (source_file): projects: {} Evidence: `index.example.yaml`
- **Agents** (source_file): log = logging.getLogger name write lock = threading.Lock ⋮---- @dataclass class AgentDefinition ⋮---- name: str display name: str = "" description: str = "" provider: str None = None model: str None = None system prompt addition: str = "" strengths: list str = field default factory=list recommended for: list str = field default factory=list avoid for: list str = field default factory=list ⋮---- def to dict self - dict ⋮---- KNOWN FIELDS = {f.name for f in fields AgentDefinition } - {"name"} ⋮---- def to agent name: str, data: dict - AgentDefinition ⋮---- known = {k: v for k, v in data or {} .items if k in KNOWN FIELDS} ⋮---- def load all - dict str, dict ⋮---- data = yaml.safe load f or {}… Evidence: `orchestrator/agents.py`
- **Background** (source_file): log = logging.getLogger name ⋮---- MAX RETRIES = 3 RETRY BASE = 2.0 MAX PARALLEL = 4 semaphore = threading.Semaphore MAX PARALLEL ⋮---- active = fetch active context project step id = active "active step" "id" if active and active.get "active step" else None ⋮---- run id = insert run ⋮---- thread = threading.Thread ⋮---- project path = index module.get project path project ctx = context module.load context project path ⋮---- ctx = None ⋮---- decision = router module.force provider forced model ⋮---- decision = router module.decide provider task=task, ctx=ctx, config=config ⋮---- decision = router module.force provider ⋮---- provider = build provider config, decision.provider ⋮---- system pr… Evidence: `orchestrator/background.py`
- **Catalog** (source_file): log = logging.getLogger name ⋮---- SCHEMA VERSION = "1.0" STATIC CATALOG PATH = Path file .resolve .parent.parent / "docs" / "pricing" / "models.json" ⋮---- DEFAULT REFRESH TTL HOURS = 168.0 ⋮---- def load json path: Path - dict None ⋮---- def extract pricing catalog: dict - dict ⋮---- pricing: dict = {} ⋮---- price = model data.get "pricing" ⋮---- def cache is valid cache: dict, ttl hours: float - bool ⋮---- fetched at = cache.get "fetched at" ⋮---- fetched = datetime.fromisoformat fetched at ⋮---- age hours = datetime.now timezone.utc - fetched .total seconds / 3600 ⋮---- def read cache config: dict - dict None ⋮---- cache = load json PRICING CACHE PATH ⋮---- ttl hours = config.get "catal… Evidence: `orchestrator/catalog.py`
- **Codex Watcher** (source_file): PROVIDER NAME = "codex" CODEX HOME = Path.home / ".codex" ⋮---- def find state db - Optional Path ⋮---- candidates = sorted ⋮---- def strip cwd prefix cwd: str - str ⋮---- def cwd to alias cwd: str, index: dict - str ⋮---- """Mapea un cwd ya sin prefijos al alias de proyecto más cercano registrado.""" ⋮---- cwd path = Path cwd .resolve ⋮---- best alias = "" best len = 0 ⋮---- p = Path proj path .resolve ⋮---- best len = len str p best alias = alias ⋮---- def parse jsonl tokens rollout path: str - dict ⋮---- """Lee el JSONL de rollout y devuelve el último total token usage acumulado. Los event msg acumulan tokens turno a turno; el último da el total de la sesión. """ last usage: dict = {} ⋮-… Evidence: `orchestrator/codex_watcher.py`
- **Config** (source_file): class ConfigError Exception ⋮---- def load config - dict ⋮---- data = yaml.safe load f or {} ⋮---- def get provider config config: dict, provider: str - dict ⋮---- providers = config.get "providers", {} ⋮---- def get router config config: dict - dict ⋮---- def get default provider config: dict - str ⋮---- def get pricing table config: dict - dict ⋮---- def get budget config config: dict - dict Evidence: `orchestrator/config.py`
- **Costs** (source_file): log = logging.getLogger name ⋮---- DEFAULT PRICING: dict str, dict str, float = { ⋮---- def calculate cost result: CompletionResult, pricing: dict - float None ⋮---- model key = result.model table = pricing.get model key or pricing.get model key.split "/" -1 ⋮---- table = pricing key ⋮---- usage = result.raw response or {} .get "usage", {} inp = result.input tokens or usage.get "input tokens" or usage.get "prompt tokens" or 0 out = result.output tokens or usage.get "output tokens" or usage.get "completion tokens" or 0 cc = getattr result, "cache creation tokens", 0 or 0 cr = getattr result, "cache read tokens", 0 or 0 ⋮---- inp billable = max inp - cc - cr, 0 cost = ⋮---- def check budget p… Evidence: `orchestrator/costs.py`
- The remaining 13 evidence entries are in `AI_CONTEXT_PACK.json` or `EVIDENCE_INDEX.json`.

## Rules the Host AI Must Follow

- **Treat this asset as pre-work context, not a runtime environment.**: The AI Context Pack contains only an evidence-backed understanding of the project, not the project's executable state. Evidence: `docs/decisions/README.md`, `docs/decisions/analyses/README.md`, `docs/decisions/evidence/RFC-006/README.md`
- **When answering the user, distinguish what can be previewed from what can only be verified after install.**: The consumer value of the pre-install experience comes from reducing bad installs and misjudgments, not from pretending to be a real run. Evidence: `docs/decisions/README.md`, `docs/decisions/analyses/README.md`, `docs/decisions/evidence/RFC-006/README.md`

## Questions the User Should Answer First

- Which host AI or local environment do you plan to use it in?
- Do you just want to experience the workflow first, or are you ready to actually install?
- What matters most to you: install cost, output quality, or conflicts with your existing rules?

## Acceptance Checks

- Every capability claim can be traced back to a file path in evidence_refs.
- AI_CONTEXT_PACK.md does not package previews as a real run.
- The user can understand who it fits, what it can do, how to start, and the risk boundaries within 3 minutes.

---

## Doramagic Context Augmentation

The following sections strengthen the repository context for a host AI. Human Manual data is a reading route, and pitfall notes become operating constraints.

## Human Manual Outline

Usage rule: this is only a reading route and salience signal, not factual authority. Concrete claims must still return to repo evidence or Claim Graph.

Host AI hard rules:
- Do not treat page titles, section order, summaries, or importance values as factual project evidence.
- When explaining the Human Manual outline, state that it is only a reading route or salience signal.
- Capability, installation, compatibility, runtime state, and risk claims must cite repo evidence, source paths, or Claim Graph.

- **Project Overview and Capabilities**: importance `high`
  - source_paths: README.md, orchestrator/__init__.py, orchestrator/cli.py, orchestrator/server.py, orchestrator/mcp.py
- **System Architecture and Module Layout**: importance `high`
  - source_paths: orchestrator/cli.py, orchestrator/server.py, orchestrator/router.py, orchestrator/db.py, orchestrator/rag.py
- **Routing, Providers, Pricing and Model Discovery**: importance `high`
  - source_paths: orchestrator/router.py, orchestrator/providers/__init__.py, orchestrator/providers/base.py, orchestrator/providers/factory.py, orchestrator/providers/claude.py
- **Data Persistence, RAG Memory, Dashboard, MCP, Sync and Operations**: importance `high`
  - source_paths: orchestrator/db.py, orchestrator/migrate.py, orchestrator/rag.py, orchestrator/context.py, orchestrator/index.py

## Repo Inspection Evidence

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `13dbcbcbe825a0e362d1b5f9a47e517ff9eb3457`
- inspected_files: `README.md`, `pyproject.toml`, `requirements.txt`, `docs/ai-provider-keys-model-catalog-review.md`, `docs/api-keys.md`, `docs/context-schema.md`, `docs/decisions/README.md`, `docs/decisions/adrs/ADR-001-rag-chunking.md`, `docs/decisions/adrs/ADR-002-model-pricing-catalog.md`, `docs/decisions/analyses/README.md`, `docs/decisions/archive/RFC-001-egress-gate.md`, `docs/decisions/archive/RFC-002-egress-gate.md`, `docs/decisions/archive/RFC-003-provider-safe-routing.md`, `docs/decisions/archive/RFC-004-egress-gate.md`, `docs/decisions/archive/RFC-005-governed-decision-provenance.md`, `docs/decisions/archive/RFC-007-ai-control-plane-v0.3.md`, `docs/decisions/evidence/RFC-006/README.md`, `docs/decisions/evidence/RFC-007/README.md`, `docs/decisions/rfcs/RFC-006-provider-safe-routing.md`, `docs/decisions/rfcs/RFC-007-ai-control-plane.md`

Host AI hard rules:
- Without repo_clone_verified=true, do not claim that the source code has been read.
- Without repo_inspection_verified=true, do not write README, docs, or package-file conclusions as facts.
- Without quick_start_verified=true, do not claim that the Quick Start path has run successfully.

## Doramagic Pitfall Constraints

These rules come from Doramagic discovery, validation, or compilation findings. The host AI must treat them as operating constraints, not background notes.

### Constraint 1: Capability evidence risk requires verification

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: capability.assumptions | https://github.com/csantisdev/ai-orchestrator
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 2: Security or permission risk requires verification

- Trigger: no_demo
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: downstream_validation.risk_items | https://github.com/csantisdev/ai-orchestrator
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 3: Security or permission risk requires verification

- Trigger: no_demo
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: risks.scoring_risks | https://github.com/csantisdev/ai-orchestrator
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 4: Maintenance risk requires verification

- Trigger: issue_or_pr_quality=unknown。
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: evidence.maintainer_signals | https://github.com/csantisdev/ai-orchestrator
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 5: Maintenance risk requires verification

- Trigger: release_recency=unknown。
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: evidence.maintainer_signals | https://github.com/csantisdev/ai-orchestrator
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.
