.mini is a family of contracts. Each card is a fork: a contract (data, not code) that the same parser interprets. Click a card to load its example in the editor. Lineage arrows show parent → child forks that keep the core stable and only append fields.
.mini document
Canonical JSON (edit and press “JSON → .mini”)
Contract signature
Prompt block for a generative model (EN)
Bloque de especificación para un modelo generativo (ES)
contract.json
The current editor document (canonical object) serialized into every format from the same data. TOON is encoded with the official TOON reference implementation (v4.1.1, bundled). Token counts use ….
Tokens per format
Serialized output
Design a fork in four steps: (1) choose a parent or start blank, (2) add fields — inherited fields stay fixed, new ones are appended, (3) read the contract + prompt block, (4) download contract.json and run mini check-forks. The invariants of §10 are checked live.
1 · Identity
2 · Fields
Invariant check
3 · Generated contract
Prompt block
Example document
Pre-computed results of benchmark/run_benchmark.py (o200k_base, n = 12 records per fork). Bars are tokens; the dotted line is the content-only lower bound (payload).
Tokens by format and fork (n = 12)
Summary
Structure
prefix|n=12|key=value|key=a,b,c ← header (contract + count + metadata)
f1|f2|f3,f4*,f5|a,b,c|… ← one record per line, fields by position
list elements separated by ','
selected element ends with *
tuple = fixed comma-separated group
Escapes
\| literal vertical bar (everywhere) \\ literal backslash (everywhere) \n line break inside a value (everywhere) \, literal list separator (inside list elements) \* literal trailing asterisk (inside list elements)
Fork invariants
I1 one line = one valid record I4 new fields only at the tail I2 prefix and n are mandatory I5 fixtures must round-trip I3 inherited core never changes (breaking change ⇒ new prefix)
Error codes
| Code | Condition |
|---|---|
| E01 | no header |
| E02 | prefix ≠ contract |
| E03 | missing n |
| E04 | record count ≠ n |
| E05 | record arity outside core…core+extensions |
| E06 | type mismatch / required empty |
| E07 | list or tuple arity |
| E08 | marker rule violated |
| E09 | bad escape |
| E10 | enum violation |
| E11 | duplicate unique value |
| E12 | header entry malformed/missing |
| E13 | numeric range |
| E20/E21 | invalid contract / fork invariant |
Full specification: SPEC.md in the repository. Reference implementation: Python (src/minifmt) and JavaScript (js/mini.js, the engine of this page).