Architectureยถ
flowchart TB
%% --- STYLING ---
classDef hardware fill:#000,stroke:#fff,stroke-width:2px;
classDef bus fill:#b82e2e,stroke:#fff,stroke-width:4px,color:#fff;
classDef reflex fill:#2d5a27,stroke:#fff,stroke-width:2px,color:#fff;
classDef engine fill:#5e2a84,stroke:#a855f7,stroke-width:3px,color:#fff;
classDef abi fill:#0f766e,stroke:#2dd4bf,stroke-width:2px,color:#fff,stroke-dasharray: 5 5;
classDef mind fill:#1c3a6e,stroke:#fff,stroke-width:2px,color:#fff;
classDef memory fill:#444,stroke:#888,stroke-width:1px,stroke-dasharray: 2 2;
classDef highlight fill:#BB2528,stroke:#fff,stroke-width:3px,color:#fff;
classDef sandbox fill:#222,stroke:#BB2528,stroke-width:2px,color:#fff,stroke-dasharray:5 3;
classDef cloud fill:#333,stroke:#fff,stroke-width:1px,stroke-dasharray:2 2;
classDef quarantine fill:#1a1a2e,stroke:#BB2528,stroke-width:3px,color:#fff;
classDef darkstore fill:#2d2d42,stroke:#666,stroke-width:2px,color:#fff;
%% --- REALITY LAYER ---
subgraph Reality ["Reality (Physical Layer)"]
Sensors:::hardware
Actuators[("๐ฆ Actuators")]:::hardware
NewsFeeds[("๐ก News/Audio Streams")]:::hardware
DarkWeb[("๐ธ๏ธ Legacy Govt Portals")]:::hardware
end
%% --- QUARANTINE & VALIDATION ZONE ---
subgraph Quarantine ["๐ก๏ธ QUARANTINE ZONE (Dark Data Gateway)"]
direction TB
Validator["๐ Validator Engine"]:::quarantine
subgraph Checks ["Validation Stack"]
C1["๐ก๏ธ Adv. Detect"]
C2["๐ Fact Grounding"]
C3["๐ง LLM-as-Judge"]
C4["๐ Drift Monitor"]
end
DarkStore[("๐ Dark Data Store<br/>(Scored & Flagged)")]:::darkstore
end
%% --- THE SOURCE OF TRUTH ---
subgraph Truth
Redpanda{{"๐ด Event Log<br/>(Redpanda)"}}:::bus
end
%% --- SYSTEM 1: REFLEX ---
subgraph System1 ["System 1: Reflex (Fast)"]
Flink:::reflex
CBF["Safety Barrier<br/>(CBF / Rust)"]:::reflex
end
%% --- SYSTEM 2: COGNITION ---
subgraph System2 ["System 2: Cognition (Slow)"]
direction TB
subgraph Sandbox ["๐ณ Docker Sandbox"]
subgraph Ingest ["Refinery (Metabolism)"]
Refinery["๐๏ธ RefineryEngine"]:::engine
Crawl4AI[("๐ท๏ธ Scrapers & Crawlers (+ LaVague for Dark Data)")]:::mind
end
subgraph Protect ["Sentinel (Immunity)"]
Sentinel["๐ก๏ธ SentinelEngine"]:::engine
end
subgraph Solve ["Solver (Cognition)"]
Solver["โ๏ธ SolverEngine"]:::engine
end
subgraph Mind ["Reasoning Core"]
Gemini(("โจ Gemini 3")):::highlight
Warp["โก NVIDIA Warp"]:::mind
LATS["๐ฒ LATS"]:::mind
end
end
subgraph Cloud ["Google Cloud"]
GeminiLive["๐ฅ๐ Gemini Live API"]:::highlight
end
subgraph ABI_Layer ["Cognitive ABI"]
PydanticAI["๐งฉ Pydantic-AI"]:::abi
end
end
%% --- MEMORY ---
subgraph Memory ["Semantic Working Memory"]
Postgres:::memory
Vector[("pgvector")]:::memory
Graph[("NetworkX")]:::memory
end
%% ================== DATA FLOWS ==================
%% 1. REFLEX LOOP (Unchanged, Pure)
Sensors ==> Redpanda ==> Flink ==> CBF ==> Actuators
%% 2. DARK DATA INGESTION โ QUARANTINE
DarkWeb -.->|Raw HTML/PDF| Validator
NewsFeeds -.->|Raw Streams| Validator
%% 3. VALIDATION PROCESS
Validator --> Checks
Checks --> Validator
%% 4. QUARANTINE OUTPUT โ CONTEXT, NOT CORE LOG
Validator -->|"Flagged & Scored Data"| DarkStore
%% 5. SANDBOX ENGINES QUERY QUARANTINE (READ-ONLY)
Solver -.->|"Query: Context Only"| DarkStore
Refinery -.->|"Query: Entity Check"| DarkStore
%% 6. CORE SANDBOX PROCESSES (Now Protected)
Refinery -- "Spawn" --> Crawl4AI
Crawl4AI -- "Screenshot" --> Gemini
Sentinel <==>|Stream| GeminiLive
%% 7. CORE REASONING & OUTPUT
Redpanda -.->|Drift Detected| Solver
Solver -- "Plan" --> PydanticAI <==> Gemini
Solver ==>|"Control Signal"| Redpanda ==> CBF
%% ================== KEY ANNOTATIONS ==================
linkStyle 1,2 stroke:#BB2528,stroke-width:2px,stroke-dasharray:5 5
linkStyle 8,9 stroke:#2dd4bf,stroke-width:2px,stroke-dasharray:5 5
linkStyle 0,6,7,10,11 stroke:#666,stroke-width:2px
note1["โ ๏ธ All Dark Data MUST Route Through Quarantine"]:::quarantine
note2["๐ Core Log Integrity Preserved<br/>No direct writes from untrusted data"]:::bus
note3["๐ Solver can query for context,<br/>but actions are grounded in core telemetry"]:::quarantine
Quarantine -.-> note1
Redpanda -.-> note2
Solver -.-> note3
%% --- STYLING ---
classDef budget fill:#2b1d1d,stroke:#BB2528,stroke-width:2px,color:#fff,stroke-dasharray:3 3;
%% --- GPU EXECUTION CONTROL ---
subgraph GPUControl ["๐งฎ GPU Execution Control Plane"]
BudgetGate["๐ Budget Gate<br/>(VRAM / Grid / Time)"]:::budget
subgraph DomainPrimary ["GPU Domain: PRIMARY"]
WarpPrimary["โก Warp Kernels<br/>(Trusted)"]:::mind
end
subgraph DomainExperimental ["GPU Domain: EXPERIMENTAL"]
WarpSandbox["โก Warp Kernels<br/>(Constrained)"]:::mind
end
end
%% --- EXISTING CONNECTIONS (EXTENDED) ---
PydanticAI -- "Validated Plan + Budget" --> Solver
Solver -- "Pre-flight Check" --> BudgetGate
BudgetGate -- "Approved (Primary)" --> WarpPrimary
BudgetGate -- "Approved (Sandboxed)" --> WarpSandbox
WarpPrimary --> Solver
WarpSandbox -.->|Timeout / Abort| Solver
%% --- VISUAL ANCHOR ---
noteBudget["๐ No kernel launches without passing the Budget Gate"]:::budget
BudgetGate -.-> noteBudget
%% --- REFINERY INTERNAL SANITATION LAYER ---
subgraph RefineryInternals ["๐งช Refinery Internal Pipeline"]
direction TB
GeminiFlash["โก Gemini Flash<br/>(Schema + SQL Proposer)"]:::highlight
DuckDB["๐ฆ DuckDB<br/>(Ephemeral Sanitation Engine)"]:::engine
RawArtifacts[("๐ Raw Artifacts<br/>(HTML / PDF / OCR)")]:::quarantine
CleanViews[("โ
Clean Views<br/>(Typed Tables)")]:::memory
end
%% --- INTERNAL FLOWS ---
Crawl4AI -->|"Raw Capture"| RawArtifacts
RawArtifacts --> DuckDB
DuckDB -->|"Sample + Stats"| GeminiFlash
GeminiFlash -->|"Proposed Schema + SQL"| DuckDB
DuckDB -->|"Validated Tables"| CleanViews
%% --- EMISSION TO EXISTING MEMORY ---
CleanViews -.->|Entities| Graph
CleanViews -.->|Facts| Postgres
CleanViews -.->|Embeddings| Vector
%% --- SAFETY ANNOTATION ---
noteFlash["๐ง Gemini Flash proposes structure only<br/>โ No direct writes beyond DuckDB"]:::abi
GeminiFlash -.-> noteFlash
Unsprawl Architectureยถ