.mini playground · spec 1.0

This editor starts with a sample help-desk contract. Change the document, or design a contract for your own data in the wizard. The sample is not required to use .mini. Explore explained examples →

.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 your own contract: start blank or extend the sample, add fields, inspect the generated document and prompt, then download contract.json. To check a directory of contracts and fixtures later, run mini --forks DIR check-forks.

    1 · Identity

    2 · Fields

    types: str, int, float, bool, date, decimal, enum{a|b}, list<str>, mlist<str>, tuple(a:float,b:int)

    Invariant check

    3 · Generated contract

    
          

    Prompt block

    
          

    Example document

    
        

    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

    CodeCondition
    E01no header
    E02prefix ≠ contract
    E03missing n
    E04record count ≠ n
    E05record arity outside core…core+extensions
    E06type mismatch / required empty
    E07list or tuple arity
    E08marker rule violated
    E09bad escape
    E10enum violation
    E11duplicate unique value
    E12header entry malformed/missing
    E13numeric range
    E20/E21invalid contract / fork invariant

    Full specification: SPEC.md in the repository. Reference implementation: Python (src/minifmt) and TypeScript (ts/src); the engine of this page, js/mini.js, is generated from the TypeScript library and passes the conformance suite.