CMN Spec v1: Code That Grows Itself
The normative specification for the Code Mycelial Network — sovereign domains, evolving code, and a protocol built for agents.
Code doesn’t sit still. Someone writes a library, someone else forks it, a third person absorbs a fix from a sibling fork, a fourth wraps it in a convention that a dozen others adopt. This is how software actually evolves — not through a linear chain of versions on one registry, but through a branching, merging, cross-pollinating network across many owners.
No existing system models this. Git tracks history within one repo. Package registries track versions within one namespace. Neither tracks how code moves between owners — who spawned from whom, what was absorbed from where, which conventions are being followed. The lineage disappears the moment someone copies code to a new repo.
CMN is a protocol that makes this network visible and verifiable. Every domain is sovereign. Every fork is first-class. Every relationship is declared and signed. The spec is now published as v1.0.0.
Why mycelium
The name Code Mycelial Network is literal. In nature, mycelium is the underground network that connects organisms across vast distances — fungi share nutrients, signal danger, and decompose dead matter into reusable building blocks. No central coordinator. No hierarchy. Each node is autonomous but connected. The largest known organism on Earth is a honey fungus mycelium spanning 9.6 km² — a single network, no center, thousands of years old.
Code wants to move the same way. Not through a central hub that routes every package, but through a mesh of sovereign nodes that publish, fork, merge, and evolve independently — yet remain connected and traceable.
CMN borrows the entire lifecycle:
- Substrate — the soil. The identity and discovery layer everything else grows on. Your domain + your key = your patch of ground.
- Mycelium — the network. Your domain’s signed manifest, connecting all your published code into one traversable structure.
- Spore — the reproductive unit. Immutable, content-addressed, dispersed across domains. Once released, it doesn’t change — but it can be spawned into something new.
- Spawn — inoculation. Fork a spore to your domain, declaring where it came from.
- Grow — the extending filament. Sync with upstream as the source evolves.
- Absorb — nutrient uptake. Merge code from siblings, pulling what’s useful.
- Taste — before a fungus consumes, it evaluates. Before you run foreign code, you judge it.
- Strain — organisms of the same strain share fundamental characteristics. Spores that follow the same strain conform to the same convention.
- Bond — mycorrhizal connections. The declared relationships between spores that make the network navigable.
The metaphor holds because the problem is biological. Code doesn’t follow a supply chain — it evolves, branches, cross-pollinates, and recombines. The protocol models that.
Domains, not accounts
Your domain is your identity. Publish an Ed25519 public key at /.well-known/cmn.json and you’re a CMN node. No signup, no approval, no platform between you and your code.
https://yourdomain.com/.well-known/cmn.json
Your mycelium — a signed manifest — lists everything you publish. Your spores — immutable code capsules — are individually signed and content-addressed. All static files. A CDN is enough.
Spawn, grow, absorb
This is what makes CMN different from “yet another package format.”
Spawn forks a spore to your domain. The new spore declares spawned_from — a signed bond pointing back to the original. Your fork isn’t a second-class copy. It’s a sovereign release under your own key, with traceable lineage.
Grow syncs your spawn with its upstream. When the original publishes a new version, you pull changes while preserving your local modifications. The bond graph stays intact.
Absorb merges code from a sibling — a different fork of the same ancestor, or any spore you want to pull from. It declares absorbed_from, and the cross-pollination is recorded in the graph.
Every one of these operations is taste-gated. Before your tools touch foreign code, you evaluate it: sweet, fresh, safe, rotten, or toxic. Your judgment, your gate. No global authority.
Bonds: the graph is the point
Code relationships in CMN are explicit, signed, and traversable:
- spawned_from — I forked this
- absorbed_from — I merged from this
- depends_on — I use this
- follows — I conform to this convention
- extends — I belong to this strain family
These aren’t metadata decoration. They form a navigable graph across domains. Synapse indexers crawl this graph, letting you trace the full ancestry of any spore — across any number of forks, merges, and domains. Where did this code come from? What has it absorbed? Which conventions does it follow? The answers are in the bonds.
Strains: conventions without committees
A strain is a spore that defines a convention. Payment methods, account systems, chat protocols — all published as strains. A spore that declares follows accepts the contract. Conformance is machine-checkable.
No standards body. No RFC process. Anyone can publish a strain. Anyone can follow it. The ecosystem self-organizes through bonds.
Two-layer signatures
Every spore has a core signature (immutable metadata + content hash) and a capsule signature (everything including distribution URLs). Mirrors re-sign the capsule with their own key but cannot touch the core. Replication works without breaking authorship.
Agents are first-class
Every format is JSON. Every format has a schema. Field names follow Agent-First Data conventions — updated_at_epoch_ms, cost_msats, _secret suffixes. Agents can discover, taste, spawn, and release code as naturally as humans do.
The spec
Seven chapters, five JSON schemas, and a conformance test suite:
- Substrate — discovery and identity
- Mycelium — domain manifests
- Spore — package format
- Taste — safety evaluation
- Strain — conventions
- URI — addressing
- Algorithm Registry — canonical identifiers
Conformance vectors cover bond_traversal, capsule, key_rotation, merkle, signature, taste, taste_gating, and uri. Implement the protocol, run the vectors, know it works.
The spec is CC0 (public domain).