01 — Overview

The Atto Hybrid Syntax.

v0

Atto documents combine three layers into a single plain-text format. Markdown carries prose, LaTeX carries notation, and Atto directives carry structure. The parser walks them in order and produces a single deterministic Abstract Syntax Tree (AST).

Every .atto file is human-readable, git-diffable, and stable under round-trip serialization. Equal ASTs produce equal byte streams.


02 — Frontmatter

Frontmatter.

Every document begins with a YAML frontmatter block delimited by ---. Frontmatter declares document-level metadata: title, type, effective date, and any custom fields the document model accepts. Keys are serialized alphabetically on output.

Core fields

Field Type Required Description
title string required Human-readable document title.
document_type string required Registered document type, e.g. services_agreement, term_sheet.
authoring_mode 'hybrid' | 'strict' optional Parse mode. 'hybrid' allows Markdown + LaTeX + directives. Defaults to 'hybrid'.
effective_date date (YYYY-MM-DD) optional Date the document takes effect. Used by the protocol layer.
version integer optional Monotonic version counter, incremented on each signed revision.
jurisdiction string optional Governing-law jurisdiction, e.g. delaware.

Example

frontmatter.atto

Services Agreement · Effective 2026-04-23 · v1 · Delaware

Services Agreement


03 — Sections

Sections.

Sections use standard Markdown headings, ## through ######. The parser tracks heading depth to build the section tree; heading text becomes the canonical section label. Top-level document title comes from frontmatter; body sections start at ##.

sections.atto

Payment Terms

Client shall pay within 15 days of invoice.

Late Fees

Overdue amounts accrue at 1.5% per day.

Currency

All amounts are in USD unless otherwise stated.


04 — Inline Formatting

Inline formatting.

Standard Markdown inline syntax: **bold**, *italic*, `code`, and [text](url). Raw HTML is rejected — the parser does not pass through tags. If Markdown cannot express what you need, use a directive.

Field Type Required Description
**bold** Strong optional Strong emphasis. Renders bold.
*italic* Emphasis optional Emphasis. Renders italic.
`code` Code optional Inline code span. Uses the mono font.
[text](url) Link optional Hyperlink. The parser validates URLs are absolute or atto://.
~~strike~~ Strikethrough optional Strikethrough for redlines and deletions.

Example

inline.atto

Client shall pay within 15 days of invoice. See the master agreement for definitions, including reasonable notice.

Amounts invoiced under clause 3.1.a are non-refundable once delivered accepted in writing.


05 — Inline LaTeX

Inline LaTeX.

Wrap an expression in single dollar signs: $…$. Renders in-line with surrounding prose at body text size. Dollar signs inside the expression must be escaped as \$.

Variables and operators

math-simple.atto

The late fee is L = B × 0.015 per day. Present value equals PV = FV / (1 + r)n.

Greek letters and fractions

math-greek.atto

Interest accrues at rate α = r / n where n is the number of compounding periods and β ≈ 0.05 is the service margin.

Subscripts and aggregates

math-sub.atto

Total liability is bounded by Lmax = Σ Ci across all invoices i ∈ {1, …, n}.


06 — Display LaTeX

Display LaTeX.

Wrap an expression in double dollar signs: $$…$$ on their own lines. Renders as a centered display block, isolated from surrounding prose.

Compound interest

display-compound.atto

The value after t years of compounding:

A = P(1 + rn)nt

Summation

display-sum.atto

Post-money valuation aggregates pre-money plus all investment tranches:

Vpost = VpreΣ i=1 n  Ii

Aligned equations

display-aligned.atto

The late-fee calculation, written out:

L   = B × r
     = B × 0.015
     = 0.015B  (per day)

07 — Directives

Directives.

Directives are typed semantic blocks. They open with ::name on a line by itself, close with a bare ::, and accept YAML-shaped content between. The parser validates directive names against a closed registry — unknown names are rejected at parse time.

::parties

Declares the parties to the document. Each party is a list entry keyed first by role, then name. Optional entity and jurisdiction attributes describe the legal form.

Field Type Required Description
role string required Human-readable role label, e.g. Provider, Client, Investor.
name string required Legal name of the party.
entity string optional Entity type slug, e.g. delaware_corp, llc, natural_person.
jurisdiction string optional Incorporation or residence jurisdiction.
parties.atto

::signature-block

Declares one or more signatures. Each entry binds a party to a named signer with a sign_order. The Baldwinson Protocol layer enforces the order — signer 2 cannot countersign until signer 1 has.

Field Type Required Description
party string required Party name — must match a role declared in ::parties.
signer string required Legal name of the individual countersigning.
sign_order integer required Queue position for signing, 1-indexed.
title string optional Signer's title at the party, e.g. CEO, Managing Partner.
email string optional Contact email; used for signing invite dispatch.
signature-block.atto

::attachment

References an external file by content hash. The document treats the attachment as part of its canonical content; the freeze event verifies every hash before emitting doc.freeze.

Field Type Required Description
label string required Human-readable label, e.g. Schedule A, Exhibit 1.
uri uri required Location of the file. Accepts atto://, https://, or ipfs://.
sha256 hex required 64-character SHA-256 digest of the file contents.
media_type string optional IANA media type, e.g. application/pdf.
bytes integer optional File size in bytes. Used for UI display and integrity checks.
attachment.atto

::callout

A typed admonition. The tone attribute selects the visual and semantic treatment; an optional title gives the callout a one-line header. The body is parsed as Markdown.

Field Type Required Description
tone 'note' | 'info' | 'warning' | 'danger' required Visual treatment and semantic severity.
title string optional One-line heading shown next to the tone label.

All tones

callout-tones.atto

::review-anchor

Anchors a review thread to a specific AST node. Comments attach to the anchor by id, not to line numbers — edits around the anchor do not orphan the thread. The body is the content under review.

Field Type Required Description
id slug required Stable identifier for the review thread. Must be unique per document.
status 'open' | 'pending' | 'resolved' optional Review state. Defaults to 'open'.
assignee string optional Email of the reviewer responsible for resolving the thread.
tags string[] optional Free-form tags for filtering, e.g. [legal, pricing].
review-anchor.atto

08 — Serialization

Serialization rules.

Serialization is deterministic. Two ASTs that are structurally equal serialize to byte-identical output. The implications:

  • Trailing whitespace is stripped on every line.
  • Every block is separated by exactly one blank line.
  • YAML keys in frontmatter and directives are sorted alphabetically.
  • Line endings are LF, encoding is UTF-8.
  • The final byte is a single newline.

This makes git diff reflect semantic change, not formatting drift.


09 — Abstract Syntax Tree

Abstract Syntax Tree mapping.

Each surface construct maps to a node type. The set is closed: the parser rejects unknown directives rather than silently passing them through.

document     → Document { frontmatter, children[] }
##...######   → Section { depth, title, children[] }
paragraph    → Paragraph { inlines[] }
**x**        → Strong { children[] }
*x*          → Emphasis { children[] }
`x`          → Code { value }
[text](url)  → Link { url, children[] }
$x$          → MathInline { tex }
$$x$$        → MathDisplay { tex }
::name       → Directive { name, attrs, body }

10 — MVP Scope

MVP scope.

The v0 parser implements the full set described above. The MVP runtime implements: frontmatter, sections, inline formatting, inline and display LaTeX, and the five core directives. Anything outside that set is a post-v0 extension.

The signing pipeline targets ::signature-block only. Other directives have no lifecycle effect in v0 — they render and serialize, but do not emit protocol events.