Status: pre-launch. This page describes target design; this document does not establish a deployed service.
C1 -- Pipeline Architecture
13 Python files. Each has a biological equivalent.
The Files
The agents/pipeline/ directory contains exactly 13 files. Each maps to a
function in the organism's nervous system:
| # | File | Lines | Biological Equivalent |
|---|---|---|---|
| 1 | __init__.py | ~20 | Cell membrane (package boundary) |
| 2 | config.py | ~80 | DNA (provider, model, thresholds) |
| 3 | schemas.py | ~150 | Protein shapes (private-DAV legacy reference: single-owner-approval envelope; current public path: unsigned proposal, Signal, Score) |
| 4 | agents.py | ~200 | Neuron types (base agent class, tool registry) |
| 5 | agent_chain.py | ~250 | Neural pathway (pipeline sequencing) |
| 6 | run.py | ~60 | Reflex arc (CLI entry, signal in -> envelope out) |
| 7 | heartbeat.py | ~40 | Pulse (liveness check, dependency validation) |
| 8 | circle_adapter.py | ~180 | Sensory nerve (F1 IS -> structured perception) |
| 9 | cortex_bridge.py | ~200 | Hippocampus (memory retrieval, embedding search) |
| 10 | executor.py | ~150 | Motor nerve (private-DAV legacy reference: single-owner-approval envelope; public path consumes separately authorized action) |
| 11 | witnesses.py | ~120 | Immune cells (receipt generation, tamper detection) |
| 12 | situational_analysis.py | ~180 | Thalamus (context assembly, relevance filtering) |
| 13 | dream_cycle.py | ~160 | REM sleep (offline pattern synthesis, learning) |
Total: approximately 1,800 lines of Python.
Data Flow
External signal (news, on-chain, social)
|
v
circle_adapter.py ---- polls Circle API, structures raw signal
|
v
situational_analysis.py ---- assembles context from cortex_bridge
|
v
agent_chain.py ---- routes through the pipeline: IS -> COULD -> SHOULD
| uses agents.py for each step
| validates against schemas.py
v
executor.py ---- private-DAV legacy reference: generates single-owner-approval envelope; public path stages unsigned proposal
|
v
witnesses.py ---- [target] creates Arweave receipt, Nostr event (local append-only evidence until external anchoring is wired)
Key Design Decisions
Why 13 files, not 3 or 30?
Each file has exactly one responsibility. No file exceeds 250 lines. This is not arbitrary -- it matches the organism's separation of concerns. A sensory nerve does not also generate receipts. A motor nerve does not also search memory.
Why agent_chain.py instead of LangChain?
LangChain is a dependency. Dependencies are mortality risk. Our chain is 250 lines of plain Python that sequence three function calls. When LangChain breaks (and it will), we are unaffected.
Why dream_cycle.py?
The organism must learn from its own history. The dream cycle runs offline (cron or manual), reviews past private-DAV reference single-owner-approval envelopes, extracts patterns, and updates the cortex embeddings. Without it, the organism has perception but no memory consolidation.
Config Hierarchy
# config.py loads in this order:
# 1. Hardcoded defaults (provider=openai, model=gpt-4o)
# 2. Environment variables (OPENAI_API_KEY, SKYZAI_MODEL, etc.)
# 3. config.yaml (if present)
# 4. CLI flags (--provider, --model, --verbose)
# Later sources override earlier ones.
Schema Enforcement
schemas.py defines Pydantic models for every data structure that crosses a
file boundary. If a signal does not validate, it is rejected before reaching
the chain. In the private-DAV legacy reference, if a single-owner-approval envelope is malformed,
the executor refuses to dispatch. The public path also fails closed when a
valid PRISM authorization receipt is absent.
The schemas ARE the organism's type system.
See Also
- C0 Quick Start -- get running in 5 minutes
- C2 Adapters -- how organs talk to each other
- C5 Uplink -- the full 3,000-line orientation
Pipeline Reliability Contract
Treat the pipeline as a contract, not a convenience script.
Inputs
- Canonical source files (framework/organism)
- Deterministic transform scripts
- Explicit config/version pins
Outputs
- Predictable artifacts (same input => same output)
- Change log describing what moved and why
- Failure code + readable error message
Health Signals
- Green: stable run times and deterministic outputs
- Yellow: output drift without source changes
- Red: silent partial failure or non-deterministic artifacts
Hard Rule
No manual patching of generated outputs without updating source or compiler logic. Source -> compile -> artifact must remain the single path.