.mini playground · spec 1.0

Each line on the left is one support ticket. On the right, the parser turns it into a JSON object your application can use. Edit a value to see validation; “Inject errors” shows what gets rejected.

1 · AI response in .mini

    2 · JSON for your application

    Field rules and AI instructions

    Contract signature

    
        
    Prompt block for a generative model (EN)
    Bloque de especificación para un modelo generativo (ES)
    contract.json

    Same tickets, three ways to write them. Tokens are billable pieces of text: a smaller bar means less response cost at the same model and rate. Instructions and retries are extra.

    How much response text does AI write?

    All formats and measurement details

    TOON reference v4.1.1. Token counting: …. Response serialization only; generation quality and total API cost are not measured here.

    See the same data in another format

    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.