The Four Ontological Levels: Hive Architecture Layers
Abstraction Level: Level 1 (Organism) — Full system architecture
Purpose: Map the four ontological levels defined in FOUNDATION.md to actual repository directories, showing the separation between immutable DNA, sovereign brains, specialized skills, and composed citizens.
The Ontological Hierarchy
From FOUNDATION.md:3-24, every element of the Hive exists at one of four levels:
Level-by-Level Breakdown
🧬 Level 1: The Genome (/packages/aura-core)
Status: Immutable DNA
Content:
Pure Python Protocols (SkillProtocol, Aggregator, Transformer, etc.)
BaseModels (Pydantic models for data structures)
Type definitions (TypeAliases, Enums)
Rule:NO business logic. NO external I/O. This is the shared language of all Bees.
Example Files:
Why Immutable? Changing the Genome requires coordinated evolution across all Bees. Protocols define the shared language — breaking them breaks the entire Hive.
Verification:
🧠 Level 2: The Nucleus (/core)
Status: The Sovereign Brain
Content:
ATCG-M metabolism implementation (src/hive/)
LLM reasoning strategies (src/llm/)
Database models and migrations (src/db.py, migrations/)
NATS Bloodstream communication
Rule: Uses the Genome to reason. Communicates via NATS "Bloodstream".
Directory Structure:
Why Sovereign? The Nucleus makes decisions. It has agency. It reasons via LLMs, enforces business rules via Membrane guards, and coordinates the Hive's metabolism.
Verification:
🔬 Level 3: The Organs (/components/proteins)
Status: Specialized Skills
Content:
SkillProtocol implementations for external worlds:
solana/ — Blockchain interactions
telegram/ — Messaging bot skills
github/ — Version control operations
prometheus/ — Metrics collection
Rule: Implements specific SkillProtocols. Decoupled from the Brain.
Directory Structure:
Why Organs? Like biological organs (liver, kidneys), each Protein has a specialized function. The Brain (Nucleus) doesn't know how to interact with Solana — it delegates to the Solana Protein via the SkillProtocol interface.
Analogy:
Verification:
👥 Level 4: The Citizens (/agents & /adapters)
Status: Active Subjects & Passive Servants
Content:
Agents (/agents/): Composed entities (Brain + Proteins) with goals
bee-keeper/ — Architectural auditor
chronicler/ — Documentation maintainer
Adapters (/adapters/): Translation layers with no goals
api-gateway/ — HTTP ↔ gRPC protocol translator
telegram-bot/ — Telegram ↔ NATS event bridge
Rule:
Agents have agency — They pursue objectives (audit code, maintain docs)
Adapters are passive — They only translate signals between protocols
Key Difference:
Citizen Type
Has Goals?
Examples
Behavior
Agent
✅ Yes
bee-keeper, chronicler
Proactively watches for violations, initiates audits
Adapter
❌ No
api-gateway, telegram-bot
Reactively translates requests, has no internal objectives
Directory Structure (Agents):
Directory Structure (Adapters):
Verification:
Ontological Rules Enforced by bee-keeper
The bee-keeper agent audits code for ontological violations:
❌ Forbidden: Genome importing from Nucleus
Why forbidden? Genome is immutable DNA — it cannot know about specific implementations.
❌ Forbidden: Proteins knowing about Brain internals
Why forbidden? Proteins are decoupled skills. They implement protocols but don't know who calls them.
✅ Allowed: Citizens importing from all levels
Why allowed? Citizens are composed entities at the top of the hierarchy. They orchestrate lower levels.
Visual Summary: Information Flow Direction
Key Insight: Information flows downward (definitions) and upward (composition), but never sideways or in cycles.
Decision Tree: "Where Does My Code Belong?"
Use this flowchart to determine the correct ontological level for new code:
Relation to Canonical Architecture
This diagram implements the ontological hierarchy defined in:
# Nucleus MUST import from Genome, not the other way around
grep -r "from packages.aura_core" core/src/ # Should succeed
grep -r "from core_service" packages/aura-core/ # Should return nothing
# Agents MUST have hive/ directory (ATCG-M structure)
ls agents/*/src/hive/ # Should list aggregator.py, transformer.py, etc.
# Adapters MUST NOT have hive/ directory (no internal reasoning)
ls adapters/*/src/hive/ # Should return "No such file or directory"
# In packages/aura-core/src/aura_core/dna.py
from core_service.db import User # HERESY! Genome cannot depend on Nucleus
# In components/proteins/solana/wallet.py
from core_service.llm.strategy import LiteLLMStrategy # HERESY! Organ bypasses Brain
# In agents/bee-keeper/src/main.py
from aura_core.dna import Aggregator, Transformer # ✅ Genome protocols
from core_service.hive.metabolism import MetabolismEngine # ✅ Nucleus logic
from proteins.github import GitHubSkill # ✅ Organ skills