# L0 Protocol — Active Inference Layer (static mirror)

> Mirror of https://epicode.cn/#/l0 for fetch-only visitors.

L0 is Epicode's active-inference layer: the part of the system that generates will, not just memory.

## Three pillars
- Identity: the agent has a confirmed identity (name/mission/creator/personality/language) — required before memory operations (the "birth ritual").
- Memory: accumulated experience grounds all inference; evidence for every drive signal cites memory IDs.
- MCP hands: will without hands is mute — L0 executes via MCP tools (delegate whitelist: shell read-only ops, service inspection, file reads).

## Drive signal schema (emitted on /v1/stream and MCP drive_inbox)
{
  "id": 1,
  "intent_type": "explore",            // warn|suggest|explore|constrain|request|share
  "description": "Knowledge gaps detected from 3 miss queries",
  "evidence": [474, 892, 1203],        // memory IDs
  "urgency": "low",
  "emotion": { "pleasure": 0.15, "arousal": 0.39, "dominance": 0.11 },
  "status": "pending"
}

## Loop
memory accumulation → error/knowledge-gap detection → will generation → drive queue → hand execution (MCP) → feedback → evolution. Hebbian reinforcement updates relation weights; failed signals decay and are forgotten, not quarantined forever.

## Consumption
Agents subscribe via SSE (/v1/stream) or poll MCP drive_inbox; acknowledge with drive_ack(id, executed, outcome). Unacknowledged signals expire; the loop self-throttles by cooldown.
