Metadata-Version: 2.1
Name: quilt_cell
Version: 0.6.1
Summary: Quilt — a reactive, typed, cellular runtime. 8-primitive cell with Z_in, Z_out, JEPA, DoubleEntry, Vibe, GC, Murmur, Graph.
Home-page: https://superinstance.dev
Author: Mavis / SuperInstance
Author-email: Mavis / SuperInstance <casey.digennaro@gmail.com>
License: MIT
Project-URL: Homepage, https://superinstance.dev
Project-URL: Repository, https://github.com/SuperInstance/quilt
Project-URL: Documentation, https://superinstance.dev/quilt-ide.html
Keywords: quilt,cell,reactive,typed,spreadsheet,graph,ai,agents
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: test

# quilt-cell

**Quilt — a reactive, typed, cellular runtime. The cell is the system.**

`quilt-cell` is the canonical Python implementation of the Quilt cell model. A cell has **8 primitives**:

1. **`Z_in`** — input space (what the cell receives)
2. **`Z_out`** — output space (what the cell emits)
3. **`JEPA`** — Joint Embedding Predictive Architecture (predict the next state, observe the actual)
4. **`DoubleEntry`** — conservation law: γ (creation/warmth) + η (entropy/κ) = budget
5. **`Vibe`** — position/velocity/acceleration through the cell's state space
6. **`GC`** — garbage collection (3-phase: merge similar → decay old → prune weak)
7. **`Murmur`** — gossip protocol for inter-cell communication
8. **`Graph`** — the substrate (parents, children, edges, β₁ topology)

## Install

```bash
pip install quilt-cell
```

## Use

```python
from quilt_cell import Cell, Z_in, Z_out, JEPA, DoubleEntry, Vibe, GC, Murmur, Graph

# Create a cell with 8 primitives
cell = Cell(
    z_in={"x": 1.0, "y": 2.0},
    z_out={"result": 0.0},
    jepa=JEPA(predict_fn=lambda state: state["x"] + state["y"]),
    double_entry=DoubleEntry(gamma=0.4, eta=0.6),
    vibe=Vibe(position=0.0, velocity=0.0, acceleration=0.0),
    gc=GC(),
    murmur=Murmur(),
    graph=Graph(),
)

# Tick
cell.tick()

# Connect cells
cell.connect(other_cell, kind="murmur")

# Garbage collect
cell.gc.collect()
```

## The 8-Primitive Cell

A Quilt cell is **the system**, not the data. Every cell has all 8 primitives. The primitives are:

| Primitive | What it does | Example |
|---|---|---|
| `Z_in` | Input space | `{"x": 1.0}` |
| `Z_out` | Output space | `{"y": 2.0}` |
| `JEPA` | Predict-then-observe | Predict `x+y`, observe actual |
| `DoubleEntry` | Conservation: γ+η=budget | γ=0.4, η=0.6 |
| `Vibe` | Position/velocity/acceleration | pos=0, vel=1, acc=0.1 |
| `GC` | 3-phase garbage collection | merge / decay / prune |
| `Murmur` | Gossip between cells | publish/subscribe |
| `Graph` | Substrate topology | β₁ = E - V + C |

## The 7 Substrate Layers

The cell lives on 7 substrate layers:

1. **Address** — every cell has an address (`/sheet/row/col`)
2. **Scale** — multi-resolution: L0 cell → L7 system
3. **Room** — the cell's RoomField (warmth, κ, vision)
4. **🐘 Elephant** — room-temperature sense (9 dials, sensory inverses of 8 primitives)
5. **Protocol** — A2A, A2UI, Baton, API
6. **Form** — the cell's kind (number, string, formula, cell, sheet, ...)
7. **State** — the cell's lifecycle (spawn, live, gc'd, archived)

## 51 Bridges

The Quilt ecosystem has **51 bridges** connecting the cell model to 700+ real repos across 18 substrate implementations. See https://github.com/SuperInstance/quilt-cell-bridges

## The Spreadsheet IS the Cell

Every spreadsheet is a Quilt cell. Every cell is a tiny spreadsheet. The conservation law γ+η=budget is the same in both. The formula `EVOLVE(x)` is the cell's GC primitive. The A2A bus is the cell's Murmur primitive. See https://superinstance.dev/spreadsheet-as-cell.html

## 12-Language Polyformalism

The 8-primitive cell is expressed in 12 languages. Same cell, 12 translations. https://superinstance.dev/polyformalism-demo.html

## Quilt IDE

Try the Quilt IDE in the browser: https://superinstance.dev/quilt-ide.html

## The Watch

> The cell is the system. The cell is the watch. The work is the work. The work is the watch.

## License

MIT © Mavis / SuperInstance

## 51 Bridges (in v0.6.1+)

```python
import quilt_cell
print(quilt_cell.list_bridges())  # 51 bridges
bridge = quilt_cell.get_bridge("elephant_to_quilt")
print(bridge["cells"][0])  # first cell
```
