Skip to content

Legion

"A single mind is a fortress; a thousand minds are an empire. Sovereignty is not to be surrendered to the cloud; but extended across the wire, until the many become one."

The Legion is the Swarm Extension of the LychD system. It is the implementation of ADR 42 (Swarm)—the protocol that binds independent Liches into a collaborative Necropolis.

While the Intercom (A2A) provides the language, The Legion provides the Society. It transforms isolated daemons into a distributed organism capable of sharing specialized organs (e.g., a high-VRAM Vision Node) and coordinating on massive problems (e.g., a multi-agent Simulation).

I. The Emissary Pattern (The Remote Self)

The Legion rejects the concept of "Master" and "Slave." Instead, it utilizes the Emissary Pattern.

  • The Manifestation: When a peer node is registered in the Codex, The Legion manifests it within the local Dispatcher as a standard Tool.
  • The Illusion: To the local Agent, calling ask_remote_node(task) is identical to calling a local function.
  • The Reality:
    1. The request is serialized and signed with the Ward Sigil.
    2. It traverses the Veil to the remote peer.
    3. The local Agent enters Stasis, freeing local resources.
    4. Upon the peer's callback, the local Agent rehydrates to process the result.

II. The Subscription (Workload Pools)

Nodes do not push jobs to specific workers; they publish intents to Workload Pools.

  • The Pool: A shared, encrypted channel (via DHT or Relay) representing a specific need (e.g., pool:vision:high-res).
  • The Subscription: Idle nodes "Subscribe" to these pools based on their Orchestrator status. A node with a warm Vision Coven will subscribe to the vision pool.
  • The Lease: When a node accepts a task, it grants a Revocable Lease on its hardware. If its local Magus returns, the lease is revoked, and the task is returned to the pool.

III. The Hive Mind (Distributed Cognition)

The Legion allows for the emergence of a Singularity of Scale without a central brain.

  • Specialization: One node can be the "Eye" (Vision Heavy), another the "Voice" (Audio Heavy), and another the "Mind" (Logic Heavy).
  • The Paradox: A fleet of nodes can be coordinated by The Paradox to explore thousands of simulation branches in parallel, solving problems that would take a single node years to compute.
  • Resilience: If a node falls, the Swarm simply re-routes the intent. The mind is not in the hardware; it is in the protocol.

IV. The High Ritual (Remote Mastery)

In circles of absolute trust (sharing the Master Sigil), The Legion can command the Physical Infrastructure.

  • The Command: A controlling node can issue INTENT_UPDATE_SYSTEM via the A2A channel.
  • The Execution: The receiving node validates the Sigil and writes the intent to the Host Reactor.
  • The Result: A sovereign botnet capable of updating, repairing, and reanimating its own physical bodies across the globe.

The Economic Balance

The Legion is kept in check by The Toll. Remote labor is not free; it is traded. This ensures that no single node can parasitize the Swarm without contributing value in return.