Operon v0.13: Multicellular

Plasmid Registry, Denaturation Layers, and Tissue Architecture

Bogdan Banu · bogdan@banu.be

operon-ai v0.13.0

Summary

Operon v0.13 implements five paper concepts across three feature areas: Plasmid Registry for dynamic tool acquisition via horizontal gene transfer (Paper §6.2), Denaturation Layers for wire-level anti-injection filtering (Paper §5.3), and Multicellular Organization—metabolic-epigenetic coupling, cell type specialization, and tissue architecture (Paper §6.5). The release adds 64 new tests (760 total, zero regressions), 5 examples, and 2 interactive Gradio demos.

1. From Cells to Organisms

Previous releases built the individual cell: membrane, mitochondria, chaperone, ribosome, lysosome, nucleus. Each organelle does one thing well. But a cell in isolation is a bacterium. The interesting biology starts when cells specialize, group into tissues, and coordinate as organisms.

v0.13 crosses that threshold. An agent can now dynamically acquire tools from a shared pool (horizontal gene transfer), protect its wiring from injection cascades (denaturation), and participate in hierarchical multi-agent architectures where topology enforces security (tissues).

flowchart TB subgraph Organism["Organism (WiringDiagram)"] subgraph T1["ClassificationTissue"] C1[Classifier Cell] end subgraph T2["ResearchTissue"] R1[Researcher Cell] R2[Researcher Cell] end subgraph T3["ValidationTissue"] V1[Validator Cell] end T1 -->|"denatured wire"| T2 T2 -->|"denatured wire"| T3 end PR[(Plasmid Registry)] -.->|"acquire()"| R1 PR -.->|"acquire()"| R2

2. Plasmid Registry: Horizontal Gene Transfer

In molecular biology, plasmids are small circular DNA molecules that bacteria exchange via conjugation, transformation, or transduction. A bacterium that acquires a plasmid carrying an antibiotic resistance gene gains that capability without vertical inheritance. This is horizontal gene transfer (HGT)—the mechanism by which bacteria share tools.

The paper’s Equation 12 formalizes this for agents:

$$\text{Agent}_\text{new} = \text{Agent}_\text{old} \otimes \text{ToolSchema}$$

The tensor product $\otimes$ extends the agent’s polynomial interface with a new tool. In implementation, the PlasmidRegistry acts as the environmental gene pool, and Mitochondria.acquire() performs the uptake:

registry = PlasmidRegistry()
registry.register(Plasmid(
    name="reverse",
    description="Reverse a string",
    func=lambda s: s[::-1],
    tags=frozenset({"text"}),
))
registry.register(Plasmid(
    name="fetch",
    description="Fetch a URL",
    func=lambda url: f"<html>{url}</html>",
    required_capabilities=frozenset({Capability.NET}),
))

mito = Mitochondria(allowed_capabilities={Capability.READ_FS})

mito.acquire("reverse", registry)       # OK
mito.acquire("fetch", registry)          # Blocked: needs NET

mito.metabolize('reverse("hello")')      # "olleh"
mito.release("reverse")                  # Plasmid curing

2.1 Capability Gating

The critical constraint is capability gating. A plasmid’s required_capabilities must be a subset of the agent’s allowed_capabilities. This prevents privilege escalation—an agent restricted to filesystem reads cannot absorb a plasmid that requires network access, regardless of what’s available in the registry.

Biological Parallel

Bacteria have restriction enzymes that degrade foreign DNA lacking the correct methylation pattern. Capability gating is the computational equivalent: only plasmids compatible with the agent’s security profile survive uptake.

2.2 API Surface

MethodDescription
PlasmidRegistry.register()Add a plasmid to the gene pool
PlasmidRegistry.search()Case-insensitive search by name, description, and tags
PlasmidRegistry.list_available()List all plasmids with metadata
Mitochondria.acquire()Capability-gated tool uptake from registry
Mitochondria.release()Remove tool (plasmid curing)
Reference Implementation: operon_ai/organelles/plasmid.py, Mitochondria.acquire() and .release() in operon_ai/organelles/mitochondria.py

3. Denaturation Layers: Anti-Prion Defense

Prion diseases (Creutzfeldt-Jakob, BSE) cascade because a single misfolded protein refolds its neighbors into the same pathological conformation. The analogy to multi-agent systems is prompt injection cascading: a compromised agent’s output, passed as input to the next agent, carries the injection payload forward through the pipeline.

The paper (§5.3) prescribes denaturation—wire-level transformation that destroys the syntactic structure injections rely on, without destroying semantic content. Like heat denaturing a protein unfolds its tertiary structure, these filters unfold the markup structure that carries the attack.

3.1 Four Filter Strategies

FilterStrategyTargets
StripMarkupFilter Pattern removal Code blocks, ChatML (<|im_start|>), [INST] tags, XML role tags, role delimiters
NormalizeFilter Canonical form Lowercase, strip control chars, Unicode NFKC (collapses homoglyphs)
SummarizeFilter Compression Truncation + prefix, whitespace collapsing
ChainFilter Composition Apply multiple filters in sequence (left-to-right)

3.2 Wire-Level Integration

Filters attach to wires, not to modules. The Wire dataclass gains an optional denature field, and DiagramExecutor applies the filter automatically as data flows through the wire:

diagram = WiringDiagram()
diagram.add_module(ModuleSpec(
    name="agent_a",
    outputs={"resp": PortType(DataType.TEXT, IntegrityLabel.VALIDATED)},
))
diagram.add_module(ModuleSpec(
    name="agent_b",
    inputs={"data": PortType(DataType.TEXT, IntegrityLabel.VALIDATED)},
))

diagram.connect(
    "agent_a", "resp", "agent_b", "data",
    denature=ChainFilter(filters=(
        StripMarkupFilter(),
        NormalizeFilter(),
    )),
)

Why Wire-Level?

Filtering at the wire level rather than the module level is the key design decision. Module-level filtering depends on each agent implementing it correctly—a behavioral property. Wire-level filtering is a topological property: it’s enforced by the wiring diagram itself, regardless of what the modules do. Safety from structure, not from strings.

3.3 Backward Compatibility

The denature field defaults to None. Existing wires, diagrams, and executor calls work unchanged. The filter is only applied when explicitly attached. This makes denaturation opt-in and composable: you can denature inter-tissue wires while leaving intra-tissue wires raw.

Reference Implementation: operon_ai/core/denature.py (filters), Wire.denature in operon_ai/core/wagent.py, denaturation block in DiagramExecutor.execute() in operon_ai/core/wiring_runtime.py

4. Multicellular Organization

The remaining three features complete the paper’s §6.5 hierarchy: Cell → Tissue → Organ → Organism.

4.1 Metabolic-Epigenetic Coupling

Memory retrieval now costs energy. A MetabolicAccessPolicy defines which marker strengths are accessible at each metabolic state:

Metabolic StateAccessible MarkersAnalogy
FEASTING / NORMALAll (WEAK+)Fed cell: full chromatin access
CONSERVINGSTRONG+ onlyStressed cell: silences weak enhancers
STARVINGPERMANENT onlyStarving cell: only constitutive genes active
DORMANTNoneDormant spore: full chromatin compaction

The coupling is optional. HistoneStore without an energy_gate behaves exactly as before.

4.2 Cell Type Specialization

Every cell in your body shares the same DNA but expresses different gene programs. A neuron silences muscle genes; a liver cell silences neuron genes. The same genome, different phenotypes.

CellType + ExpressionProfile implement this pattern. A CellType defines which genes to overexpress, silence, or leave at baseline. Calling differentiate(genome) produces a DifferentiatedCell with the appropriate configuration:

classifier = CellType(
    name="Classifier",
    expression_profile=ExpressionProfile(overrides={
        "classification": ExpressionLevel.OVEREXPRESSED,
        "verification": ExpressionLevel.SILENCED,
    }),
    required_capabilities={Capability.NET},
)
cell = classifier.differentiate(genome)

4.3 Tissue Architecture

Cells form tissues—groups sharing a morphogen gradient and a security boundary (TissueBoundary). The boundary defines:

A cell’s required_capabilities must be a subset of its tissue’s allowed_capabilities. This is capability isolation at the organizational level: a validation tissue with no capabilities cannot contain a researcher cell that requires network access.

Tissues export themselves as ModuleSpec objects, so they can be composed into organism-level WiringDiagrams:

organism = WiringDiagram()
organism.add_module(classification_tissue.as_module())
organism.add_module(research_tissue.as_module())
organism.add_module(validation_tissue.as_module())

organism.connect("ClassificationTissue", "label",
                 "ResearchTissue", "query")
organism.connect("ResearchTissue", "findings",
                 "ValidationTissue", "draft")

Compositionality

The same WiringDiagram that wires modules within a cell also wires tissues within an organism. This is the category-theoretic compositionality the paper prescribes: the same mathematical object at every level of the hierarchy.

Reference Implementation: operon_ai/multicell/cell_type.py, operon_ai/multicell/tissue.py, operon_ai/state/metabolism.py (MetabolicAccessPolicy)

5. Test Coverage

SuiteTestsStatus
Denaturation Layers 35 All pass
Plasmid Registry / HGT 29 All pass
Metabolic-Epigenetic Coupling 14 All pass
Cell Type Specialization 18 All pass
Tissue Architecture 14 All pass
Existing (regression) 650 All pass
Total 760 All pass

6. Examples and Demos

6.1 Examples

ExampleFeature
56_metabolic_epigenetic_coupling.pyCost-gated memory retrieval under metabolic pressure
57_cell_type_specialization.pyDifferential gene expression → agent phenotypes
58_tissue_architecture.pyHierarchical multi-agent organization with capability isolation
59_plasmid_registry.pyDynamic tool acquisition with capability gating
60_denaturation_layers.pyWire-level anti-injection filters

6.2 Interactive Gradio Demos

Two new Hugging Face Spaces provide interactive exploration:

7. What’s Next

The highest-priority items for v0.14 are:

Code and examples: github.com/coredipper/operon