# 1.2 How Everything Connects

# How Everything Connects

## The Flow: From Idea to Done

```
CEO Decision / Task Creation
        │
        ▼
   Mission Control (MC)          ← Task enters the system
        │
        ▼
   Pi-Orchestrator               ← Daemon picks it up every 30s
        │
        ├── 1. Classify           (complexity, domain, type)
        ├── 2. Route              (select model + company)
        ├── 3. Build Prompt       (inject company soul, blueprints, context)
        ├── 4. Execute            (via ollama-tool, llama-server, or claude)
        ├── 5. Quality Gate       (verify output, escalate if needed)
        └── 6. Complete           (mark done, advance pipeline, feed HiveMind)
                │
                ▼
         Pipeline Engine          ← Triggers next stage
                │
                ├── BUILD done   → Create REVIEW task (Proveo)
                ├── REVIEW done  → Create SECURITY task (Securion)
                ├── SECURITY done → Create OPS task (FlowForge) if deploy needed
                └── OPS done     → Create DOCS task (Lexicon) if docs needed
```

## Model Tier System

Tasks are classified by complexity (1-5) and routed to the appropriate AI model:

| Tier | Model | Host | Pipeline | Use Case |
|------|-------|------|----------|----------|
| 1 | qwen3:8b | FORGE | ollama-tool | Simple tasks, classification |
| 2 | qwen2.5-coder:32b | ANVIL | ollama-tool → ollama-simple | Medium complexity code |
| 3 | Kimi K2.5 (240GB) | FORGE | llama-tool → llama-server | Complex tasks, architecture |
| 4 | Claude Sonnet | Cloud | claude-cli | Client-facing, critical work |
| 5 | Human | — | human-queue | CEO decisions, sensitive ops |

## Safety Rails

Tasks matching these patterns are **never auto-processed**:
- `CEO` / `DECISION` — requires Alem's input
- `BankID` / `Vipps` / `Finanstilsynet` — regulated services
- `[TENDER]` — procurement (currently paused)