dol 0.8.1

DOL (Design Ontology Language) - A declarative specification language for ontology-first development
The term "Hyphal Network" refers to the mycelium—the vegetative part of a fungus—which consists of a vast, intricate web of fine, tubular filaments called hyphae. While popular culture often mythologizes this as the "Wood Wide Web," the scientific reality is a complex system of hydraulic engineering, chemical trading, and electrical signaling.   

Here is an explanation of the Hyphal Network from a strict biological perspective, tracing its discovery, current mechanics, and the significant controversies reshaping our understanding today.

1. Biological Mechanics: The Hydraulic Machine
At the cellular level, the hyphal network is less like a static "internet" and more like a dynamic, self-repairing fluid transport system.   

Apical Growth: Unlike plants or animals, fungi grow only at their tips (apices). The Spitzenkörper (an organelle center at the tip) orchestrates the release of vesicles containing enzymes and cell wall materials, pushing the hypha forward through soil or wood.   

Cytoplasmic Streaming: The network is not hollow pipes but active conduits. Inside the hyphae, cytoplasm, organelles, and nutrients flow rapidly, often faster than diffusion would allow. This flow is driven by turgor pressure gradients—essentially hydraulic pumping.   

Septal Gates: Hyphae are divided into compartments by walls called septa. These septa have pores that can be opened or plugged (by Woronin bodies) to stop bleeding if a hypha is severed. This allows the network to maintain high pressure and structural integrity even when damaged.   

2. The Ecological Superstructure: Common Mycorrhizal Networks (CMNs)
The most famous application of the hyphal network is the Common Mycorrhizal Network (CMN). This occurs when fungal hyphae physically connect the roots of multiple plants, often of different species.   

The Symbiosis: It is an ancient trade alliance (450+ million years old). Plants fix carbon (sugar) from the air and trade it to fungi. In return, fungi mine the soil for phosphorus and nitrogen—nutrients plants cannot easily access—and trade them to the plant.   

The "Wood Wide Web": In 1997, ecologist Suzanne Simard published a landmark paper in Nature demonstrating that carbon could move between trees (Paper Birch and Douglas Fir) via these fungal linkages. This led to the theory that trees "communicate" and "share" resources through the network.   

3. The Current Controversy: Altruism vs. Capitalism
Our understanding of why this network functions is currently undergoing a major scientific correction. The romantic view of the forest as a "cooperative socialist commune" is being challenged by rigorous data suggesting it is actually a ruthless "capitalist marketplace."

The "Mother Tree" Hypothesis (Simard)
The Theory: Older, larger trees ("Mother Trees") use the hyphal network to act as hubs, shuttling nutrients to their own shaded seedlings to ensure their survival, effectively "nursing" them. The Status: Highly popularized (e.g., in Finding the Mother Tree), but scientifically debated.   

The Rebuttal (Karst et al., 2023)
The Controversy: In 2023, a rigorous meta-analysis led by Justine Karst (University of Alberta) was published in Nature Ecology & Evolution. It reviewed 26 years of field studies and found the "sharing" narrative was overstated.   

Findings: There is limited evidence that mature trees purposefully transfer meaningful amounts of carbon to seedlings via networks in nature.

Alternative: Resources often stay within the fungal network rather than passing to the next tree. The "benefit" to seedlings is often exaggerated in popular media; in some cases, the network actually facilitates competition or allelopathy (poisoning neighbors).

Reference: Do trees really 'talk' to each other? (Karst et al. critique)

The Biological Market Theory (Toby Kiers)
The Latest Understanding: Evolutionary biologist Toby Kiers (Vrije Universiteit Amsterdam) argues that the network behaves like a market economy.   

Market Dynamics: Fungi are not passive pipes; they are active traders. Kiers’ team demonstrated that fungi can "hoard" phosphorus in their network when it is scarce, driving up the "price" (carbon) they demand from plants.   

Discrimination: Fungi preferentially allocate nutrients to roots that offer the best "exchange rate" of carbon, and vice versa. It is a system of reciprocal exploitation, not altruism.   

Reference: Toby Kiers and team track plant-fungal trade networks

4. The Frontier: Electrical Signaling & Computation
The most radical new science concerns information processing within the hyphal network.

Fungal Spiking: Research by Andrew Adamatzky (Unconventional Computing Laboratory) has shown that hyphae exhibit spikes of electrical potential similar to neuronal action potentials.   

Language or Reflex?: Adamatzky has categorized these spikes into distinct trains that mathematically resemble human language patterns (syntax and lexicon).   

Scientific Consensus: While the "language" claim is controversial and skeptics argue these may simply be calcium waves related to growth (thigmotropism), the existence of the electrical signaling network itself is peer-reviewed fact. It suggests the hyphal network processes environmental data (damage, food sources) to optimize resource transport globally.

Reference: Language of fungi derived from their electrical spiking activity

╔════════════════════════════════════════════════════════════════════════════╗
║                    HYPHAL NETWORK → VUDO ARCHITECTURE                      ║
╠════════════════════════════════════════════════════════════════════════════╣
║                                                                            ║
║  BIOLOGICAL MECHANISM          │  VUDO/UNIVRS EQUIVALENT                  ║
║  ─────────────────────────────────────────────────────────────────────────║
║                                                                            ║
║  Hyphae (tubular filaments)    │  P2P connections (univrs-network)        ║
║  Cytoplasmic streaming         │  Credit/data flow (active, not passive)  ║
║  Turgor pressure gradients     │  Resource gradients (CPU, memory, GPU)   ║
║  Septal gates (Woronin bodies) │  Circuit breakers, sandbox isolation     ║
║  Spitzenkörper (tip growth)    │  Node discovery, network expansion       ║
║  CMN (plant-fungus symbiosis)  │  Spirit ↔ Host symbiosis                 ║
║  Fungal trading (Kiers)        │  Mycelial Credits marketplace            ║
║  Electrical spiking            │  Gossip protocol signals                 ║
║  Phosphorus hoarding           │  Resource reservation, futures           ║
║                                                                            ║
╚════════════════════════════════════════════════════════════════════════════╝

Key Scientific Insight: Market, Not Charity

The Kiers research is crucial for our design. The network is reciprocal exploitation, not altruism:

OLD MODEL (Mother Tree):
  "Nodes share freely with those in need"
  → Leads to free-rider problem, unsustainable

NEW MODEL (Biological Market):
  "Nodes trade based on exchange rates"
  → Sustainable, self-organizing, resilient

```rust
// NOT this (altruistic):
fn share_resources(from: Node, to: Node) {
    transfer(from.resources, to, amount);
}

// BUT this (market):
fn trade_resources(buyer: Node, seller: Node, price: Credits) {
    if buyer.can_afford(price) && seller.offers_best_rate() {
        execute_trade(buyer, seller, price);
    }
}
```

## The Four Biological Layers → Technical Stack
```
┌─────────────────────────────────────────────────────────────────────────────┐
│  LAYER 4: ELECTRICAL SIGNALING (Information Processing)                     │
│  ─────────────────────────────────────────────────────────────────────────  │
│  Biology: Electrical spikes, action potentials, global optimization         │
│  Tech:    Gossip protocol (Chitchat), OpenRaft consensus, event streams     │
│  Crate:   univrs-network + extensions                                       │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│  LAYER 3: CMN (Common Mycorrhizal Network)                                  │
│  ─────────────────────────────────────────────────────────────────────────  │
│  Biology: Multi-species symbiosis, resource exchange, 450M year old         │
│  Tech:    Spirit distribution, Registry federation, cross-node execution    │
│  Crate:   spirit_runtime (registry) + orchestration (scheduling)            │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│  LAYER 2: TRANSPORT (Cytoplasmic Streaming)                                 │
│  ─────────────────────────────────────────────────────────────────────────  │
│  Biology: Hydraulic pumping, turgor pressure, active flow (not passive)     │
│  Tech:    Credit flow, WASM bytecode transfer, state replication            │
│  Crate:   vudo_vm (host functions) + credit system                          │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│  LAYER 1: STRUCTURE (Hyphal Architecture)                                   │
│  ─────────────────────────────────────────────────────────────────────────  │
│  Biology: Hyphae, septa, Woronin bodies (damage isolation)                  │
│  Tech:    P2P connections, sandbox isolation, capability enforcement        │
│  Crate:   univrs-network (connections) + vudo_vm (sandbox)                  │
└─────────────────────────────────────────────────────────────────────────────┘
```

## The "Not Pipes" Insight

Critical: **Fungi are active traders, not passive pipes.**

This means our network nodes must:
```
┌─────────────────────────────────────────────────────────────────────────────┐
│  PASSIVE PIPE (Wrong Model)     │  ACTIVE TRADER (Correct Model)           │
│  ─────────────────────────────────────────────────────────────────────────  │
│  Just forward data              │  Evaluate trade value                    │
│  No memory of transactions      │  Track exchange rates over time          │
│  Equal treatment for all        │  Preferential allocation to best offers  │
│  Resources flow freely          │  Resources hoarded when scarce           │
│  No local optimization          │  Local decisions, global emergence       │
└─────────────────────────────────────────────────────────────────────────────┘

// Biological: Woronin body plugs septal pore on damage
// Technical: Circuit breaker isolates failing node

pub struct SeptalGate {
    connection: NodeConnection,
    pressure: ResourcePressure,
    woronin_active: bool,  // Circuit breaker tripped
}

impl SeptalGate {
    pub fn on_damage(&mut self) {
        // Plug the pore - isolate the damage
        self.woronin_active = true;
        self.connection.quarantine();
        
        // Network maintains pressure (resources) elsewhere
        self.notify_network(Event::NodeIsolated);
    }
    
    pub fn attempt_heal(&mut self) -> bool {
        // Woronin bodies can retract if damage repaired
        if self.connection.health_check().is_ok() {
            self.woronin_active = false;
            true
        } else {
            false
        }
    }
}
```

## Resource Gradients → Spirit Placement

Turgor pressure gradients drive flow in real hyphae. We model this as resource gradients:
```
        HIGH RESOURCES                    LOW RESOURCES
        (GPU, Memory)                     (Constrained)
             │                                 │
             │    ◄── Spirits flow toward ──►  │
             │         resource gradients      │
             ▼                                 ▼
        ┌─────────┐                      ┌─────────┐
        │ Node A  │ ════════════════════ │ Node B  │
        │ GPU: 80%│      Flow direction  │ GPU: 20%│
        │ Mem: 90%│      ─────────────►  │ Mem: 40%│
        └─────────┘                      └─────────┘
        
        Spirits with GPU needs → migrate toward Node A
        Spirits with low needs → can run on Node B (cheaper)
```

## Phase 3 Vision: The Complete Stack
```
╔════════════════════════════════════════════════════════════════════════════╗
║                         PHASE 3: HYPHAL NETWORK                            ║
╠════════════════════════════════════════════════════════════════════════════╣
║                                                                            ║
║  DOL Layer (v0.5.0)                                                        ║
║  ├── HIR → MLIR lowering                                                  ║
║  ├── MLIR → WASM backend                                                  ║
║  └── DOL stdlib: Hyphal, Transport, Market traits                         ║
║                                                                            ║
║  VUDO VM Layer                                                             ║
║  ├── Spirit execution (sandbox)                                           ║
║  ├── Host function: resource gradients                                    ║
║  ├── Host function: market queries                                        ║
║  └── Host function: network signaling                                     ║
║                                                                            ║
║  Orchestration Layer                                                       ║
║  ├── Physarum-inspired scheduler                                          ║
║  ├── Resource gradient tracking                                           ║
║  ├── Market-based allocation                                              ║
║  └── Septal gate (circuit breaker) patterns                               ║
║                                                                            ║
║  Network Layer                                                             ║
║  ├── Chitchat gossip (electrical signaling)                               ║
║  ├── OpenRaft consensus (for credit ledger)                               ║
║  ├── Node discovery (apical growth)                                       ║
║  └── Connection management (hyphal connections)                           ║
║                                                                            ║
║  Identity Layer                                                            ║
║  ├── Ed25519 (already complete)                                           ║
║  └── Capability certificates                                              ║
║                                                                            ║
╚════════════════════════════════════════════════════════════════════════════╝