ATCG-M Fractal Pattern: The Universal Bee Architecture
Abstraction Level: Level 2 (Cellular) — Internal nucleotide structure
Purpose: Demonstrate how EVERY Bee follows the same 5-nucleotide ATCG-M structure, achieving fractal self-similarity across the entire Hive.
The ATCG-M Invariant
According to FOUNDATION.md:27, every "Bee" (Service) MUST follow this fractal structure:
A (Aggregator): Collects senses/data
T (Transformer): Reasons via Ona (LLM/DSPy). Uses
<think>blocksC (Connector): Acts via Jules (Proteins/IO)
G (Generator): Pulses events to NATS
M (Membrane): Deterministic safety guards
This pattern repeats at every scale — from individual services to the entire Hive organism.
Fractal Self-Similarity: Three Examples
Example 1: bee-keeper (Autonomous Agent)
Location: agents/bee-keeper/src/hive/
Role: Architectural auditor. Watches for FOUNDATION.md violations and chronicles findings.
Trigger: GitHub Actions on git push
Output:
GitHub PR/commit comments (architectural violations)
NATS events (
aura.hive.audit,aura.hive.injury)HIVE_STATE.md operational log
Example 2: core-service (Sovereign Brain)
Location: core-service/src/hive/
Role: The Nucleus. Makes economic negotiation decisions using LLM-powered reasoning.
Trigger: gRPC NegotiateRequest from api-gateway
Output:
gRPC NegotiateResponse (accept/counter/reject/ui_required)
NATS events (negotiation outcomes for audit trail)
PostgreSQL state updates
Example 3: api-gateway (Hive Gate)
Location: api-gateway/src/ (implicit ATCG-M)
Role: The Hive Gate. Translates HTTP/JSON to gRPC/Protobuf and enforces perimeter security.
Trigger: HTTP requests from external agents
Output:
HTTP/JSON responses (translated from gRPC)
OpenTelemetry traces for observability
Structured logs for audit
Key Insight: Fractal Recursion
Notice that all three services have the same shape:
M (in) validates inputs
A senses the environment
T applies reasoning
M (out) enforces output constraints
C takes action
G chronicles the decision
This fractal pattern means:
New contributors can predict internal structure by knowing the ATCG-M invariant
Code reviewers can verify compliance by checking for all 5 nucleotides
The architecture scales — adding a new Bee just means implementing ATCG-M again
Implementation References
bee-keeper ATCG-M
A:
agents/bee-keeper/src/hive/aggregator.py—BeeAggregator.sense()(implements Aggregator protocol)T:
agents/bee-keeper/src/hive/transformer.py—BeeTransformer.reflect()(implements Transformer protocol)C:
agents/bee-keeper/src/hive/connector.py—BeeConnector.act()(implements Connector protocol)G:
agents/bee-keeper/src/hive/generator.py—BeeGenerator.pulse()(implements Generator protocol)M: Implicit in input validation (prompts, file access). Note: bee-keeper is an advisory-only service without economic decisions, so deterministic guards are minimal. Future enhancement: extract to explicit
membrane.pyfor consistency.
core ATCG-M
A:
core/src/hive/aggregator.py— Data collection layerT:
core/src/hive/transformer.py— LLM strategy layerC:
core/src/hive/connector.py— Database/gRPC action layerG:
core-service/src/hive/generator.py— Event emission layerM:
core-service/src/hive/membrane.py— Explicit dual-gate implementation
api-gateway ATCG-M
A:
api-gateway/src/main.py— FastAPI endpoint handlersT: Implicit in Protobuf message construction
C: gRPC client stubs (
core_service_stub)G: OpenTelemetry instrumentation
M: FastAPI middleware (rate limiting, auth)
Verification Checklist
When reviewing a new Bee, confirm it implements:
If any nucleotide is missing, the service is incomplete and violates FOUNDATION.md.
Relation to Canonical Architecture
This diagram implements the fractal pattern defined in:
docs/FOUNDATION.mdlines 26-32 (ATCG-M definition)packages/aura-core/src/aura_core/dna.pylines 147-202 (Protocol definitions)Implemented in:
agents/bee-keeper/,core-service/src/hive/,api-gateway/src/
End of ATCG-M Fractal Pattern Documentation
For the glory of the Hive. 🐝
Последнее обновление