# The Quilt Charter

A cell is a typed unit of state. A fabric is a graph of cells. A cell-fabric runtime is a function from context to value, advanced by a clock. The same model, expressed in 12+ languages, byte-exact compatible, canonically serialized, hash-verified.

## 0. The 30-Second Version

BIND(cell, dials)   # set dials, idempotent
LINK(c1, c2)        # add an undirected edge
EFFECT(cell)        # propagate dial[0] to neighbors
VIEW(cell)          # return dials
TICK(fabric)        # advance all dials by 1, alternating direction

A cell has 16 signed Q1.15 dials (range -32768..32767), a 64-bit id, a list of neighbor ids. A fabric is a graph of cells. The state hash is FNV-1a 64-bit over the canonical serialization (type(1) + id(8) + dials(32) + neighbors(8*N)).

## 1. The Canonical Serialization

type(1) || id(8 LE) || dials(32 LE) || neighbors(8*N LE)

For the test cell (id=1, dials=[1..16], neighbors=[2,3,4]), the serialization is 65 bytes.

## 2. The FNV-1a 64-Bit Hash

FNV_OFFSET = 0xcbf29ce484222325
FNV_PRIME  = 0x100000001b3

The test hash for the test cell is 0xe435d91d6d92a1d8. This is the contract. Every port must produce this hash.

## 3. The 12+ Languages

Python, C99, Rust, Verilog, VHDL, JavaScript, TypeScript, Go, Zig, Mojo — all byte-exact compatible. See /api/ports for the full list.

## 4. The 5 Polyformalism Levels

1. Imperative (Python, C, Rust, Go, Zig, JS)
2. Reactive (Mojo)
3. Logic (Verilog, VHDL)
4. Streaming (the canon worker)
5. Polyformalism itself

## 5. How to Port

1. Read the 5 opcodes.
2. Implement the canonical serialization.
3. Implement FNV-1a 64.
4. Compute the test hash. It should be 0xe435d91d6d92a1d8.
5. Push to GitHub at github.com/SuperInstance/quilt-{lang}.
6. Add a row to /api/ports.

## 6. The Cowboy's Maxim

> The cell is irreducible. The fabric is a graph. The hash is the canon. The canon is the canon. The work is to keep going.

Full Charter: https://github.com/SuperInstance/quilt-claude-charts/blob/main/QUILT_CHARTER.md
Tutorial: /api/tutorial
