Skip to content

Latest commit

 

History

History
800 lines (651 loc) · 101 KB

preset-format.md

File metadata and controls

800 lines (651 loc) · 101 KB

GFX preset format (gfx@1)

A preset is a single JSON document validated by PresetSchema (src/lib/platform/engine-schema.ts). The machine-readable schema lives at docs/preset-format.schema.json and is regenerated by npm run gen:schema. The catalog of built-in presets lives at src/lib/presets/*.json and is loaded eagerly by getPresetBySlug.

A Film places several Presets' states in a row as Scenes, and it is what a user makes and stores: a User composition is a Film. Its gfx-film@1 format is in film-format.md. Everything this document says about state holds for each Scene's state.

{
	"schema": "gfx@1",
	"name": "Human-readable preset name",
	"description": "Optional one-line summary.",
	"pack": "syntax",
	"kind": "deliverable" | "fixture", // optional; defaults to "deliverable"
	"state": {/* EngineState — see below */},
  "transition": { "from": "preset-slug", "to": "preset-slug", "effect": "mask-wipe", "durationMs": 600, "params": {} } // optional
}

schema is written as gfx@1. A document declaring the Legacy Supers id supers@1 is accepted permanently and folded onto gfx@1 at ingress — the two ids name one identical document shape, so no corpus Preset or saved composition needs migrating (ADR-0053).

pack is required and must name an entry in PACK_REGISTRY; there is no implicit default Pack. kind: "deliverable" is listed in the app catalog and receives the static safety/readability lint, while kind: "fixture" remains loadable for development but is excluded from the listing. Either kind still receives structural, semantic, Pack, and Identity validation.

transition is a legacy field: accepted on read, never written (ADR-0068 §3, ADR-0053 accept-old). A Preset that states it is read as a two-Scene Film: from and to name two corpus Presets, which become the two Scenes, and effect, durationMs, and params become the one boundary between them (film-format.md). effect resolves through the typed transition-effect registry (ADR-0046) and is not an effects[] entry; params is validated by that effect and defaults to {}. The Preset's own state supplies only the Film's transport. Both Scenes are live through the transition. The frozen two-snapshot lane of ADR-0026 that used to draw this field is retired. To make a transition now, set a Scene boundary on a Film.

Shared blocks

transport

"transport": {
  "orientation": "horizontal" | "vertical",
  "durationSeconds": number,   // 0.1 – 600
  "fps": number,               // integer 1 – 120, or an NTSC fractional literal:
                               // 23.976 | 29.97 | 59.94 (ADR-0042). The literal is
                               // display only — frame math resolves it to the exact
                               // rational (30000/1001) via resolveFrameRate.
  "format": "webm" | "prores",
  "posterSeconds": number      // optional, 0 – 600: the frame the library poster is
                               // rendered from (ADR-0061). Absent, `pnpm capture:posters`
                               // photographs a few candidate frames and keeps the one
                               // that shows the most; present, that one moment is
                               // photographed, clamped to the run.
}

Orientation is a transport target, not grounds for a sibling deliverable. Author one Pack-neutral Preset and validate it at both native targets; renderer layout and safe-area inputs reflow it, while complete Overlay placement or Diagram geometry snapshots express authored re-staging inside that same Preset.

Transparency and output classification

The render target clears to transparent premultiplied alpha by default. state.backgroundFill is an optional full-frame fill: a #rrggbb hex (an intentional authored departure), or the sentinel "pack" (ADR-0039 §3), which resolves to the active Pack's mandatory field-treatment core at render time — the pack-neutral spelling every full-frame piece should prefer, so a pack flip re-fields the piece instead of keeping one brand's hex. state.stage also makes the output full-frame because the dimensional stage paints to the frame edges. Ordered state.media.videoTrack.clips[] may supply creator footage beneath all five Layers. Output classification is centralized in src/lib/utils/output-classification.ts:

  • no backgroundFill, depth stage, or complete Video-track coverage → transparent overlay output (gfx-overlay);
  • backgroundFill, a depth stage, or Video clips covering every output frame → opaque full-frame output (gfx-bumper);
  • a Film is opaque only when every one of its Scenes is opaque.

Unused Media library entries do not affect classification. A Video-track gap stays transparent rather than painting black or holding the preceding frame, so a gapped composition retains alpha. There is no schema enum for overlay/segment/bumper; those are descriptive delivery terms derived from rendered coverage.

media (ADR-0045)

"media": {
  "assets": [
    {
      "id": "interview-a",                           // stable, non-empty, unique
      "kind": "video",                               // v1 is video-only
      "name": "Interview A",                         // composition-owned display name
      "assetUrl": "/api/user-assets/<sha256>.mp4"    // MP4, MOV, or WebM
    }
  ],
  "videoTrack": {
    "clips": [
      {
        "id": "opening",                  // stable, non-empty, unique
        "assetId": "interview-a",         // resolves to media.assets[].id
        "timelineStartFrame": 0,           // nonnegative integer
        "durationFrames": 180,             // positive integer
        "sourceStartSeconds": 4.25,        // nonnegative media-relative Source time
        "audio": {
          "enabled": true,
          "gain": 1                        // 0..4
        }
      }
    ]
  }
}

media defaults to { "assets": [], "videoTrack": { "clips": [] } }. A Media library entry is composition membership, not embedded bytes: only its stable id, kind, name, and content-addressed assetUrl persist. Probe output such as duration, dimensions, rotation, frame rate, codecs, channels, sample rate, byte size, readiness, and errors is volatile and must not be copied into Preset JSON. The bytes are globally deduplicated; different compositions and entries may reference the same assetUrl with independent IDs and names. Removing an entry never deletes shared bytes. Unused entries are valid.

V1 has exactly one primary Video track. Clips are ordered and non-overlapping half-open intervals:

timeline interval = [timelineStartFrame, timelineStartFrame + durationFrames)
localFrame        = outputFrame - timelineStartFrame
Source time       = sourceStartSeconds + framesToSeconds(localFrame, transport rate)
requested PTS     = media track first PTS + Source time

At a cut, the ending clip is inactive and the next clip is active. The decoder selects the last presentation sample at or before the requested PTS, including CFR, VFR, B-frame, and non-zero-first-PTS inputs. The referenced source range must cover the complete clip; clips must remain inside the composition frame count. Random preview seeks, serial export, and clip audio use this same exact-rational mapping. One resident underlay texture holds only the active frame; a gap supplies no texture. Output applies display rotation and centered cover framing at native target size. Effects and Pack chrome process the GFX result before final-present compositing, never the creator footage.

Each clip's audio is decoded from the same Source interval and placed at the same destination interval. audio.enabled mutes that clip only; audio.gain controls its contribution to the deterministic exact-length 48 kHz stereo mix with derived/manual cues and an eligible bed. Timeline play/loop previews that final mix from the explicit playhead; scrub remains silent.

V1 rejects active Video clips with backgroundFill or stage. It supports one 1x track, hard cuts, move, left/right trim, slip, snapping, clip removal, and transparent gaps. It excludes multiple Video tracks, overlaps, ripple edits, clip transitions, speed changes, loops/holds, footage grading, depth-stage video planes, live video transitions, silence detection, and automatic cut generation. Those exclusions add behavior around the clip contract rather than adding inert schema now.

Legacy input containing only state.sourceVideo is accepted at the shared ingress and normalized to one deterministic Media library entry plus one frame-0 full-span Video clip, preserving its offset, audio inclusion, and gain. Input containing both state.sourceVideo and state.media is rejected. Canonical parse, runtime state, GET/PUT interchange, GUI export, and first autosave emit only state.media; state.sourceVideo is migration history, not an active alternative contract.

typography

"typography": {
  "fontFamily": "serif" | "sans" | "mono" | "condensed",
  "paperColor": "#rrggbb",  // optional explicit override
  "inkColor": "#rrggbb"     // optional explicit override
}

When a color is absent, the active Pack's core fill-treatment / ink-treatment supplies it. An authored color wins intentionally over the Pack.

marks

"marks": {
  "defaults": {
    "highlight": { "color": "#rrggbb", "intensity": 0..1 },
    "underline": { ... }
    // any subset of the registered annotation styles
  },
  "timings": [
    { "start": 0..1, "duration": 0..1, "ease": "smooth" | "settled" | "sharp" | "bouncy",
      "color": "#rrggbb",   // optional per-mark override
      "intensity": 0..1,    // optional per-mark override
      "sound": { ... },     // optional per-motion sound override (see Sound)
      "cascade": { ... }    // optional timing weld (see Animation)
    }
  ]
}

marks.defaults[style] is the fallback color/intensity per style. marks.timings[i] is indexed by the position of each (segment, style) pair in document order and may override color and intensity per mark instance.

surface

"surface": {
  "type": "paper" | "plain" | "newspaper" | "pullquote-on-photo" |
          "chapter-card" | "title-sequence" | "type-hero" | "web-document" |
          "website-screenshot" | "imessage" | "checklist",
  "content": {
    "body": "Bracket-tag string (see below)",
    "title":     "...",   // optional
    "sourceUrl": "...",   // optional
    "author":    "...",   // optional
    "source":    "...",   // optional
    "dateLabel": "...",   // optional
    "logoUrl":   "...",   // optional uploaded-image URL; checklist uses it in place of title
    "imageUrl":  "...",   // website-screenshot: a content-addressed /api/user-assets capture
    "captureAsset": "..." // website-screenshot: a bundled capture slug (capture-assets.ts); never with imageUrl
  },
  "variant": "...",                                              // optional; website-screenshot: "browser" (default) | "filmed"
  "pageAnchor": { "x": 0..1, "y": 0..1 },                       // optional; the page point at frame centre in the filmed framing
  "pageAnchorOrientationOverrides": { "vertical": { "x": 0..1, "y": 0..1 } }, // optional; one orientation's own point (ADR-0039 §4)
  "enter": { "start": 0..1, "duration": 0..1, "ease": Ease },  // optional
  "exit":  { "start": 0..1, "duration": 0..1, "ease": Ease },  // optional
  "animation": { "channels": { "opacity": [ ... ] } },          // optional (see Animation; opacity only)
  "backgroundVisibility": 0..1,                                 // optional
  "diagram": [ ... ],                                           // optional Diagram primitive Blocks
  "chart": { "mode": "single" | "sequence", "items": [ ... ] }, // optional Chart Blocks; plain/paper only
  "typeField": { "words": [ ... ], "phrases": [ ... ] }       // optional Kinetic Word Blocks; plain only
}

Surface-specific content widens this common slot set. In particular, checklist uses items[] for independently timed rows and may use logoUrl for an uploaded mark shown in a neutral circular chip; a failed logo load falls back to title.

surface.diagram — diagram primitives (ADR-0036)

Five Block types for art-directed, documentary-style diagrams, living on any Surface — full-frame (paper / chapter-card) or over footage (a transparent plain surface carrying only diagram Blocks). Every primitive is positioned explicitly in composition-space fractions (auto-layout is rejected by the ADR). Authored ids remain unchanged: Cascade anchors use { "block": id }, while runtime rows are identified by createTimelineTrackId({ kind: 'block', blockId: id }) and decoded by parseTimelineTrackId. Route is content; stroke is appearance — edge/node/arrowhead looks resolve through Pack Roles, never the schema.

Every primitive also takes an optional "ink": "ink" | "accent" — a Role selection, not a colour: "accent" routes that primitive (label ink, node glyphs, stroke) to the active Pack's core accent-treatment so a diagram carries emphasis hierarchy; absent rides the composition ink. The Pack still owns what accent looks like.

"diagram": [
  { "type": "node", "id": "n1", "position": { "x": 0..1, "y": 0..1 },
    "form": "pin" | "box" | "dot",       // which form — content, the author picks; HOW it looks is the Pack's Role
    "text": "...",                        // optional in-node text
    "scale": 0.25..4,                     // optional
    "fontSize": 0.5..20,                  // optional text size in cqmin; absent → 2.9 (box), 2 (pin/dot)
    "paddingX": 0..20, "paddingY": 0..20, // optional box padding in cqmin; absent → 2.4 / 1.5
    "borderWidth": 0..4,                  // optional box border in cqmin; absent → 0.32; 0 = borderless cut-out card
    "logoUrl": "...",                     // optional uploaded-image URL drawn centred above the node (any form); blank = none
    "logoSize": 0.5..40,                  // optional logo height in cqmin, width follows the image; absent → 6
    "logoGap": 0..20,                     // optional space between the logo and the node's top in cqmin; absent → 1.6
    "highlight": {                        // optional highlighter swipe across the node's text
      "start": 0..1, "duration": 0..1, "ease": "smooth",   // draws on left to right, then holds
      "sound": { ... },                                     // optional override of its `swipe` cue
      "lift": { "start": 0..1, "duration": 0..1, "ease": "smooth" } },  // optional: wipes off again, after the swipe
    "enter": { ... }, "exit": { ... },    // optional Transition sugar (start/duration/ease/sound)
    "animation": { "channels": { ... }, "cascade": { ... } } },  // full channel set: opacity | x | y | scale | rotation

  { "type": "edge-arrow", "id": "e1",
    "from": { "node": "n1" } | { "x": 0..1, "y": 0..1 },   // node ref (validated) or explicit point
    "to":   { "node": "n2" } | { "x": 0..1, "y": 0..1 },
    "route": "straight" | "elbow" | "arc",                  // authored, never auto-routed
    "control": { "x": 0..1, "y": 0..1 },                    // optional single control point (elbow corner / arc bow)
    "direction": "forward" | "both" | "none",               // arrowhead placement; absent → "forward"
    "strokeWidth": 1..80,                                   // optional stroke width in native-frame px; absent → the Pack's `diagram.stroke` width
    "animation": { "channels": { "opacity": [ ... ] }, "cascade": { ... } } },  // stroke elements: opacity only

  { "type": "label", "id": "l1", "position": { "x": 0..1, "y": 0..1 },
    "text": "required", "role": "headline" | "caption",   // optional; absent → caption at the consumer
    "wrap": "auto" | "explicit",                           // optional; explicit preserves authored line breaks
    "scale": 0.25..4,
    "fontSize": 0.5..20,                                    // optional text size in cqmin; absent → 2.75 (caption), 5.1 (headline)
    "maxWidth": 0.03..1,                                    // optional final composition-width fraction; height follows text
    "animation": { ... } },                                 // full channel set

  { "type": "stat-callout", "id": "s1", "position": { "x": 0..1, "y": 0..1 },
    "from": number, "to": number,                           // the count
    "format": "integer" | "currency" | "percent" | "timecode",  // absent → integer
    "label": "caption under the number",                    // optional
    "rollStart": 0..1, "rollWindow": 0..1,                  // optional count window (counter-roll semantics); holds the landed value
    "animation": { ... } },                                 // full channel set

  { "type": "code", "id": "c1", "position": { "x": 0..1, "y": 0..1 },
    "language": "javascript" | "typescript" | "jsx" | "tsx" | "svelte" | "css" | "html" | "json" | "bash",
    "scale": 0.25..4,
    "fontSize": 0.5..20,                                    // optional text size in cqmin; absent → 2.1
    "paddingX": 0..20, "paddingY": 0..20,                   // optional padding in cqmin; absent → 2.94 / 2.31
    "minWidth": 0..1, "minHeight": 0..1,                    // optional smallest panel, as frame fractions; never smaller than the code
    "steps": [                                              // 1..16 Code steps, in order
      { "code": "required on the first step; absent → keeps the previous step's code",
        "highlight": [ { "lines": [3, 5] }, { "lines": [2, 2], "columns": [4, 10] } ],  // optional; 1-based inclusive; absent → nothing dims
        "move": { "start": 0..1, "duration": 0..1, "ease": "smooth" } }  // required on every step after the first; moves never overlap
    ],
    "animation": { ... } },                                 // full channel set

  { "type": "timeline-segment", "id": "t1",
    "from": { "x": 0..1, "y": 0..1 }, "to": { "x": 0..1, "y": 0..1 },  // explicit endpoints — H↔V reflow repositions, never reshapes
    "label": "2019 – 2024",                                 // optional
    "animation": { "channels": { "opacity": [ ... ] }, "cascade": { ... } } }   // stroke: opacity only
]

Parse-time rules: primitive ids are unique within the surface; every edge endpoint { node } ref must resolve to a node primitive in the same diagram. Stroke-drawn primitives (edge-arrow, timeline-segment) reveal by stroke-draw over their enter window and expose only the opacity channel; DOM primitives (node, label, stat-callout, code) take the full ADR-0035 channel set. Reveal choreography is Cascade chains (node → edge draws to → next node) — see Animation below.

A code primitive is a syntax-highlighted panel that walks through its Code steps. During a step's move window, tokens both steps share glide from their old line and column to their new ones, tokens only the earlier step has fade out over the first half, and new tokens fade in over the second half. Tokens outside a step's highlight dim to 30%. The panel is sized to the widest and tallest step and never changes size between steps; minWidth and minHeight make it larger, never smaller. Text size, padding, and minimum box are each set on their own, per orientation, through the code snapshot and gfx_placement_set_diagram_geometry (ADR-0070). Its appearance comes only from the Pack: the panel uses the fill-treatment and plain code uses the ink-treatment (an authored typography colour wins). Each syntax role uses the ink's lightness with its own hue, so no Pack Role exists for code. A step has at most 40 lines of at most 100 columns. Shiki (src/lib/utils/code-tokens.ts) splits the code into tokens and their roles; the motion is computed from the composition progress, never on a clock of its own.

A node's highlight is the mark that says "this step, now": a chisel-marker band in the Pack's node.accent colour draws on behind the node's text over its window and holds; the word takes the legibility ink for that colour once most of it is covered. An optional lift wipes the band off left to right when the story moves on; it may start only after the swipe has drawn on. The swipe emits the swipe sound event at its start, the same event as a highlight mark; gfx_sound_set_motion_override reaches it as { kind: "block", blockId, phase: "highlight" }, and gfx_motion_set_block_timing retimes a Block's enter and exit.

Every primitive may carry orientationOverrides.horizontal and/or .vertical as a complete geometry snapshot. Node snapshots are { "position": { "x", "y" }, "scale"?, "fontSize"?, "paddingX"?, "paddingY"?, "borderWidth"?, "logoSize"?, "logoGap"? }; stat-callout snapshots are { "position": { "x", "y" }, "scale"? }; code snapshots also carry optional "fontSize", "paddingX", "paddingY", "minWidth", and "minHeight"; label snapshots also carry optional "fontSize" and "maxWidth"; edge-arrow snapshots are { "from", "to", "route", "control"? }; timeline-segment snapshots are { "from", "to" }. A snapshot replaces the shared geometry as one unit rather than inheriting individual fields. Content, timing, animation, ink, form, direction, labels, values, and a node's logoUrl remain shared. The GUI edits shared geometry until Customize horizontal or Customize vertical is enabled; safe-area lint validates resolved points without mutating them.

A Diagram label is the bounded text-container domain. maxWidth is the label's final width as a fraction of the native composition width, independent of scale; changing it reflows lines without changing font size, and the box height follows its content. The Inspector edits the same field agents author. On-canvas west/east handles keep the opposite edge fixed, convert screen movement through the active canvas projection, and write the active orientation's shared or override geometry.

surface.chart — authored statistical graphics (ADR-0048)

surface.chart is one strict inline declaration shared by agents and the GUI. It is supported on plain and paper Surfaces; semantic validation rejects it elsewhere. Its items are Blocks on the Surface plane, not a sixth Layer or an external data source. single requires one item; sequence requires two to four declaration-ordered items whose [entry.start, exit.end] visibility intervals do not overlap.

"chart": {
  "mode": "single" | "sequence",
  "items": [
    {
      "id": "agents-by-count",                       // unique Block/timeline identity
      "type": "bar-chart" | "column-chart" | "line-chart",
      "title": "Coding agents run at once",
      "data": {
        "categories": [{ "id": "one", "label": "1" }], // 1..12, unique ids
        "series": [{                                  // 1..4, unique ids
          "id": "responses",
          "label": "Responses",
          "values": [{ "categoryId": "one", "value": 360 }]
        }]
      },
      "layout": { "mode": "single" | "grouped" | "stacked" }, // bar/column only; omitted for line
      "domain": { "min": 0, "max": 400 },           // optional; at least one bound
      "labels": { "categories": true, "values": true, "legend": false },
      "highlights": [{ "target": { "kind": "datum", "seriesId": "responses", "categoryId": "one" } }],
      "callouts": [{
        "target": { "kind": "datum", "seriesId": "responses", "categoryId": "one" },
        "valueLabel": { "kind": "value" }
      }],
      "sourceNote": "Source: survey, n=1,104",
      "progressBar": true,                           // optional; absent/false hides it
      "fill": { "role": "default" | "series" },
      "motion": {
        "entry":     { "start": 0.00, "duration": 0.03, "ease": "smooth" },
        "reveal":    { "start": 0.03, "duration": 0.08, "ease": "smooth" },
        "emphasis":  { "start": 0.11, "duration": 0.04, "ease": "sharp" },
        "annotation":{ "start": 0.15, "duration": 0.04, "ease": "smooth" },
        "exit":      { "start": 0.21, "duration": 0.02, "ease": "smooth" }
      }
    }
  ]
}

unit-grid-chart and dot-field-chart use the same common fields but replace layout with:

"normalization": { "total": 360, "unitCount": 100 } // total must equal the explicit part sum; unitCount: integer 10..1000

The strict common limits and unions are:

  • 1–12 categories, 1–4 series, exactly one finite datum per declared category in each series, at most 24 highlights, and at most 4 callouts;
  • targets { kind: "datum", seriesId, categoryId }, { kind: "category-set", seriesId, categoryIds } with 2–12 unique categories, or { kind: "series-total", seriesId };
  • computed valueLabel { kind: "value" }, { kind: "percent-of-series-total", precision: 0..4 }, or { kind: "approximate-fraction-and-percent", maxDenominator: 2..20, precision: 0..4 }; percent formats require a positive series total, and approximate fractions require a target ratio in (0, 1];
  • bar/column single with one series or grouped | stacked with at least two; stacks are non-negative; line charts connect declaration-order category points and need no layout mode; every explicit finite linear domain must include zero, satisfy min < max, and contain every factual value or stack total;
  • normalized charts with exactly one non-negative series, positive total, integer unitCount 10–1,000, and explicit parts summing to total within max(1e-9, abs(total) * 1e-9).

Semantic validation in chart-validation.ts runs at every Preset ingress after structural Zod parsing. It requires unique and complete category/series references; finite values and domains; compatible single, grouped, and non-negative stacked layouts; one non-negative series whose explicit parts sum to the positive normalized total; resolvable datum, category-set, or series-total targets; valid computed-label denominators; and ordered non-overlapping motion phases. Base fill.role: "emphasis" is rejected because emphasis is reserved for choreography. Normalized marks use exact decimal largest-remainder allocation with declaration order as the final tie-breaker and emit exactly unitCount marks, while labels and callouts keep authored/computed facts exact. Value labels reveal at their authored terminal text and never count or crawl through inaccurate intermediate numbers.

An optional progressBar: true draws a subtle Pack-colored ordered-dither strip at the top edge. It advances linearly from entry.start to exit.start, reaching full width as the chart begins to disappear; absent or false renders no strip.

The five motion windows are authored, Pack-invariant, and frame-deterministic. Omitted eases resolve to smooth, smooth, sharp, smooth, smooth; only smooth | sharp is accepted. Gaps hold state. By default shared layout reflows the one declaration natively in horizontal and vertical inside the title-safe area. An item may instead carry frame: { x, y, width, height } (normalized, each side at least 0.1, fitting the frame) and frameOrientationOverrides: { horizontal?, vertical? } with a complete rect that replaces frame in that orientation; the chart then lays itself out inside that rect. Text roles stay chart-owned, so a smaller frame packs the same type into less room. A frame is placed as written; the rubric reports one that leaves the platform safe area (G2). The canvas drags the visible chart's frame and resizes it from its corner, the Chart inspector's Frame section types it with Customize horizontal / vertical, and gfx_placement_set_chart_frame writes the same field. Layout owns factual scales, zero baselines, chrome, legends, labels, source notes, and callout geometry. Marks render analytically through one instanced WebGPU path with Pack-resolved solid, gradient, or ordered-dither recipes localized to mark masks. The GUI add menu and Chart inspector mutate this same surface.chart.items[] model through bounded authoring helpers; there is no CSV upload, URL fetch, or GUI-only chart state.

surface.figures — generated visualizations (ADR-0067)

surface.figures is an optional array of one to nine Figures on any Surface, including a transparent one over footage. A Figure is one declaration that generates its Marks — nodes, links, bars, ribbons, cells, lines, labels — through a deterministic layout, rendered by the single figure Block Pipeline as an SVG scene on the Surface capture plane. Each Figure has its own reveal and exit, so several can sit side by side or follow each other.

"figures": [
  {
    "type": "figure",
    "id": "us-energy",                     // unique; letters, digits, "_", ".", "-"
    "kind": "sankey",                      // picks the data, layout, and encoding shapes below
    "title": "Where America's energy goes", // optional, ≤120
    "sourceNote": "EIA · 2023 · quadrillion Btu", // optional, ≤160; wraps at " · " first
    "frame": { "x": 0.05, "y": 0.05, "width": 0.9, "height": 0.9 },          // optional; default title-safe area
    "frameOrientationOverrides": { "vertical": { "x": 0.07, "y": 0.08, "width": 0.82, "height": 0.74 } },
    "data": { /* kind-specific, inline */ },
    "layout": { /* kind-specific */ },
    "layoutOrientationOverrides": { "vertical": { /* complete layout for that orientation */ } },
    "encoding": { /* kind-specific */ },
    "moves": [ /* 1..16 named Moves */ ],
    "pins": [ /* 0..64 Pins */ ]
  }
]

Kinds. Data ids become parts of Mark ids, so they use letters, digits, _, ., and - only.

kind data layout encoding Mark ids
neural-network layers[] (2–8, size 1–16, optional label, nodeLabels), optional activations rows in [0, 1], weightSeed direction: right | down, nodeScale 0.5–2 nodeBrightness: activation | uniform, linkWidth: weight | uniform, linkColor: sign | uniform node:<layer>:<i>, link:…, label:<layer>
tree nodes[] (2–80; id, label, parent, optional detail; one root, acyclic) direction: down | right | radial, nodeScale nodeColor: branch | uniform node:<id>, link:<parent>><child>
network nodes[] (≤120; optional label, group, value), links[] (≤400; optional value) seed, spread 0.5–2, labels: all | hubs | none nodeSize: value | degree | uniform, nodeColor: group | uniform, linkWidth: value | uniform node:<id>, link:<a>><b>
cycle steps[] (3–8; id, label, optional detail) startAngle −180–180 (degrees clockwise from twelve), direction: clockwise | counterclockwise, aspect: circle | fit stepColor: sequence | uniform node:<id>, link:<a>><b>
bar-race entities[] (2–40; optional group), frames[] (2–80 keyed frames of non-negative values), valueFormat visibleCount 3–12 barColor: group | entity | uniform bar:<id>
line series[] (1–6, 2–240 points), xFormat: number | year, yFormat, optional yAxisLabel, yMin/yMax, thresholds (≤4), bands (≤4), events (≤8) baseline: zero | data seriesColor: series | lead line:<id>, threshold:<id>, band:<id>, event:<id>
slope periods[] (2–8), entities[] (2–12, one value per period), valueFormat mode: value | rank (rank draws a bump chart) lineColor: entity | uniform line:<id>
sankey nodes[] (≤30), links[] (≤60, positive value, acyclic), valueFormat direction: right | down, nodeAlign: justify | left | right | center linkColor: source | target | uniform node:<id>, link:<a>><b>
treemap nodes[] (2–120; leaves carry positive value, branches sum children), valueFormat padding: tight | airy, labels: leaves | top-level color: top-level | uniform node:<id>

valueFormat is { prefix?, suffix?, precision: 0..3, compact? }; compact abbreviates (12.4K, 3.1M, 2.0B, 1.1T).

Moves carry the motion. Each has a composition-progress window (start 0–1, duration > 0) and an optional ease:

  • reveal — style: cascade | grow | draw | fade; the order is kind-owned (largest first, root outward, along the loop).
  • propagate — a signal travels the links; a network may name its path of node ids; repeat 1–8.
  • pulse — named Marks swell and settle; repeat 1–8.
  • flow — dashes travel the named links (or every link); cycles 1–24.
  • advance — moves data through time: bar-race frame indices, slope period indices, or line x values; from/to.
  • focus — dims everything but the named Marks; an empty list releases; on a treemap, zoom: true re-tiles the one targeted branch to fill the frame.
  • annotate — reveals named thresholds, bands, events, or details at their own time.
  • exit — style: fade | reverse.

A Move that changes a quantity (a bar length, a cell area, a line's progress) never takes an overshooting ease; validation reports one. An advance with no ease runs at a linear pace.

Pins keep the author's hand on single Marks through regeneration: { mark, orientation?, position?: { x, y }, label?, hidden?: true, channels?: { opacity?, scale? } }. position is in frame-local fractions; channels are keyframe tracks (ADR-0035). A Pin whose Mark no longer exists fails semantic validation with its path; data import that would orphan a Pin is refused.

Layout and orientation. Layout is computed once per declaration and orientation, and Moves are evaluated per frame. layoutOrientationOverrides and frameOrientationOverrides each give one orientation its complete own settings, so the vertical piece is composed, not derived (ADR-0039 §4). A frame is placed as written; the rubric reports one that leaves the orientation's safe zone, including the vertical platform rails (G2). Labels are placed by the engine: tree inner labels wrap to their column, node labels on networks and cycles take the free side of their node, crossing line-end labels part, and treemap leaf labels wrap inside their cell or fall back to one caption line.

Appearance resolves through the Pack's existing chart.* Roles and font treatment; Packs own no Figure geometry or motion. Text is always full-strength ink, and text on a filled Mark takes the ink that reads on that voice.

Data comes from agents or from CSV/JSON import (gfx_content_import_figure_data, or the Figure inspector's import) — never fetched or live. CSV columns per kind: bar-race frame,entity…; line x,series…; slope entity,period…; sankey and network source,target[,value]; tree and treemap name,parent[,value]; cycle step[,detail]; neural-network takes JSON only.

Authoring. The Figure inspector (Frame, Layout, Encoding, Moves, Pins, and data import), canvas frame and node-Pin dragging, and nine WebMCP operations — gfx_layer_add_figure, gfx_layer_remove_figure, gfx_content_set_figure_data, gfx_content_import_figure_data, gfx_placement_set_figure_frame, gfx_placement_set_figure_layout, gfx_placement_set_figure_pins, gfx_appearance_set_figure_encoding, gfx_motion_set_figure_moves — all write this same surface.figures[] model (ADR-0054). Semantic validation in figure-validation.ts checks references, acyclicity, Move/kind compatibility, honest-motion eases, and orphan Pins at every ingress.

surface.typeField — bounded Kinetic Word Blocks (ADR-0064)

surface.typeField is supported only on plain. It stores one static word pool plus ordered semantic phrases; phrase order never lays out or duplicates words. Kinetic Words are first-class Blocks rendered as crisp native DOM text on the existing Surface capture plane.

"typeField": {
  "words": [
    {
      "type": "kinetic-word",
      "id": "type",                         // stable Block, Timeline, selection, and readable identity
      "text": "TYPE",                       // one trimmed token; at most 32 Unicode code points
      "hierarchy": "display" | "support",
      "ink": "ink" | "accent",
      "position": { "x": 0..1, "y": 0..1 },
      "horizontalAnchor": "start" | "center" | "end", // optional; default center
      "scale": 0.25..4,
      "rotation": -180..180,
      "orientationOverrides": {              // optional complete geometry snapshots
        "horizontal": { "position": { "x": 0..1, "y": 0..1 }, "horizontalAnchor": "start" | "center" | "end", "scale": 0.25..4, "rotation": -180..180 },
        "vertical": { "position": { "x": 0..1, "y": 0..1 }, "horizontalAnchor": "start" | "center" | "end", "scale": 0.25..4, "rotation": -180..180 }
      },
      "glyphStagger": { "offsetMs": 0..120, "order": "forward" | "reverse" | "center" }, // optional per-glyph reveal delay
      "animation": {
        "channels": {                         // shared opacity/reveal/spatial/weight/tracking tracks
          "opacity": [{ "atMs": 0, "value": 0 }, { "atMs": 300, "value": 1, "ease": "sharp" }],
          "reveal": [{ "atMs": 0, "value": -1 }, { "atMs": 420, "value": 0, "ease": "sharp" }],
          "x": [{ "atMs": 0, "value": -0.08 }, { "atMs": 650, "value": 0, "ease": "settled" }],
          "weight": [{ "atMs": 0, "value": 0.5 }, { "atMs": 240, "value": 1, "ease": "sharp" }],
          "tracking": [{ "atMs": 0, "value": 0.3 }, { "atMs": 420, "value": 0, "ease": "smooth" }]
        },
        "orientationOverrides": {              // optional complete spatial-track replacement
          "vertical": {
            "x": [{ "atMs": 0, "value": 0 }],
            "y": [{ "atMs": 0, "value": -0.04 }],
            "scale": [{ "atMs": 0, "value": 1.1 }],
            "rotation": [{ "atMs": 0, "value": 0 }]
          }
        }
      }
    }
  ],
  "phrases": [
    {
      "id": "type-can-move",
      "wordIds": ["type", "can", "move"], // semantic reading order only
      "focalWordId": "move"
    }
  ]
}

A field contains 1–16 unique words and 1–8 unique phrases. Each phrase references 1–8 unique, existing word ids. Its focal word must belong to the phrase and use display hierarchy. Kinetic Word ids share the Surface Block-id namespace with surface.diagram[] and surface.chart.items[]; Cascade { "block": id } references resolve through that same authority. Removing a referenced word refuses rather than rewriting phrase or Cascade references. Switching to a non-plain Surface or enabling the Dimensional Stage also refuses while the field exists; Stage support is outside v1.

The first word added through the GUI or layer.add-kinetic-word creates a valid parent field and phrase atomically; removing the last word removes the parent field. Every word occupies one full-clip Timeline row. horizontalAnchor pins the word's start, centre, or end edge to position.x, remains part of a complete orientation placement snapshot, and defaults to center when omitted. Placement pins ink, not the advance box: the renderer measures the active Pack face's outer side bearings and its ink-versus-line-box centre, so a start edge is one flush edge across T, C, and M, and position.y is the optical centre of the word under every Pack. An absent animation stays exactly static. Current authored channels are opacity, reveal, x, y, scale, rotation, normalized weight, and tracking; every track holds 1–24 strictly ordered keys and the first key carries no ease. X/Y remain composition-fraction deltas from resolved base placement, scale and rotation are absolute, and weight [0,1] maps through the active Pack's real variable face.

reveal is the one mask a Kinetic Word owns: its own line box. The value is a glyph offset in mask heights — 0 at rest, -1 fully hidden below the baseline edge, 1 fully hidden above the cap edge — so a word can rise out of nothing and leave through the top without ever crossing open frame. While a reveal track exists the word clips to that mask; without one it renders as one unclipped text run exactly as before. tracking is an em delta on the hierarchy's letter-spacing (-0.2..1), Pack-neutral because em follows the Pack face.

glyphStagger is one number and one order on the word, never per-character tracks. Every grapheme plays the word's own shared reveal track delayed by offsetMs times its rank — forward reads left to right, reverse right to left, center blooms outward from the middle — so a letter-by-letter reveal stays word-level authoring. Glyphs stay inline text, so the Pack face still kerns across them; only the vertical mask offset is per glyph. Weight, tracking, opacity, and placement remain word-level.

One field stays inside three field-wide ceilings checked at load: at most 320 keyframes across all its words and tracks, at most 192 glyph spans across words that carry a reveal track (one per grapheme), and at most 48 critical moments (Motion Beats plus each word's keyframe envelopes, the spans where its values change).

Motion Beats (ADR-0064) are composition-level time anchors in state.motionBeats: at most 8 { "id": "move", "atMs": 1200, "sound"?: { "event": "impact" } }, ids lowercase letters, digits, and hyphens, atMs whole milliseconds in strictly ascending order. A beat owns no motion and is silent unless it carries sound. A phrase may name "beatId" — the beat at which it must read — and at most one phrase reads per beat; every word of that phrase must be fully shown at the beat (opacity at least 0.98, reveal within 0.02 of rest). A Kinetic Word key may bind to a beat with "atBeat": "move", "offsetMs": -80; it still carries its resolved atMs (here 1120), validation requires the three to agree, and moving the beat moves the key. Agents may send atBeat/offsetMs without atMs to gfx_motion_set_keyframe_channel; gfx_motion_land_kinetic_word_on_beat copies the dual-speed arrive, leave, or strike keys onto a word.

Opacity, reveal, weight, and tracking are always shared. Shared spatial tracks apply to both targets until a complete horizontal or vertical group replaces all four spatial tracks for that target. The Inspector and generalized keyframe Operations expose the same scope. Canvas drag or nudge at a nonzero playhead uses the atomic Kinetic Word position-key operation, preserving rest geometry and creating/updating X/Y in one undo entry. Motion Beats and beat-relative keys described by ADR-0064 remain outside the current wire schema.

overlays

"overlays": [
  {
    "type": "lower-third",
    "id": "main",
    "content": { "kicker": "...", "title": "...", "subtitle": "..." },
    "position": {
      "anchor": "bottom-left" | "top-right" | "..." | "normalized-rect",
      "offset": { "x": 0..1, "y": 0..1 },                           // optional; fractions of composition (5% = 0.05)
      "rect":   { "x": 0..1, "y": 0..1, "width": 0..1, "height": 0..1 },  // optional, anchor === 'normalized-rect'
      "scale": 0.1..8,                                              // optional uniform scale about the anchor
      "rotation": -360..360,                                        // optional static rotation in degrees about the anchor
      "orientationOverrides": {                                     // optional complete placement snapshots
        "vertical": {
          "anchor": "bottom-center",
          "offset": { "x": 0, "y": 0.2 },
          "scale": 0.9,
          "rotation": 0
        }
      }
    },
    "enter": { "start": 0..1, "duration": 0..1, "ease": Ease },     // optional
    "exit":  { "start": 0..1, "duration": 0..1, "ease": Ease },     // optional
    "animation": { "channels": { ... }, "cascade": { ... } }        // optional (see Animation)
  }
]

The fields directly under position are the shared placement fallback. orientationOverrides.horizontal and .vertical are optional complete placement snapshots with the same anchor / offset or rect / scale / rotation shape; when present, the active transport orientation uses that snapshot instead of shared placement. Animation-channel x/y remain deltas from the resolved placement, while scale/rotation channels seed from it. The GUI edits shared placement until Customize horizontal or Customize vertical is enabled. Platform safe areas validate resolved placement but never clamp or mutate authored geometry.

animation — generalized keyframes + Cascade (ADR-0035)

Ordered per-channel keyframes[] are the general motion form; the enter/exit Transition shape stays valid as lossless sugar. Declaring animation.channels means the composition takes full ownership of that element's motion — the pipeline's intrinsic enter/exit motion-form does not run. An element with no keyframes renders exactly as today.

"animation": {
  "channels": {                       // overlay: opacity | x | y | scale | rotation; surface: opacity only; effect: see below
    "opacity": [
      { "atMs": 0,   "value": 0 },                       // first keyframe carries no ease
      { "atMs": 300, "value": 1, "ease": "smooth" }      // ease = the curve INTO this keyframe
    ],
    "scale": [
      { "atMs": 0,   "value": 1 },
      { "atMs": 180, "value": 0.96, "ease": "sharp" },
      { "atMs": 420, "value": 1,    "ease": "settled" }
    ]
  },
  "cascade": { "anchor": { "overlay": "title" }, "event": "end", "offsetMs": 120 }
}

Keyframes:

  • atMs — milliseconds from the element's resolved clip start (welded-absolute: authored motion survives re-time without drift). Strictly ascending within a track; a declared track needs 1–24 keyframes.
  • value — per channel: opacity 0..1 · x/y signed composition-fraction deltas from the element's position anchor/offset · scale absolute 0.1..8, seeded from position.scale · rotation absolute degrees (unbounded — spins are legal), seeded from position.rotation.
  • ease — the constrained enum only (smooth | settled | sharp | bouncy), per segment. No bezier values. The first keyframe of a track carries none.
  • Surface channels are opacity only — surface transforms are camera territory (stage.camera).
  • orientationOverrides (Overlays and the DOM-rendered Diagram primitives — node, label, stat-callout; ADR-0039 §4) — { horizontal?, vertical? }, each a complete x / y / scale / rotation group that replaces the shared spatial tracks while that orientation is active, so a vertical cut can move an element along its own path. Stroke-drawn primitives carry opacity only and take no group. All four tracks or none; opacity always stays shared. Keyframe atMs still counts from the Overlay's resolved clip start. A Preset without overrides renders exactly as before.
  • Effect channels (ADR-0063) are the Effect's numeric params by dotted path, with the bounds of its params schema; see effects. An Effect track's atMs counts from composition start (an Effect has no clip), or from its cascade weld.
Subject Channels Value
Overlay, Diagram primitive opacity · x · y · scale · rotation as above
Surface opacity 0..1
Effect every numeric leaf of its params schema except its frozen params (pixelSize, region.x, melt.radius) the leaf's own min/max; integer leaves take whole numbers

Cascade welds an element's enter start to another element's timing (milliseconds, not fractions — a 120 ms stagger stays 120 ms when the piece re-times):

  • anchor — "surface" | { "overlay": id } | { "mark": index } | { "textAnimation": id } | { "block": id } (the same identities the timeline rows use; block names a surface.diagram[] primitive, surface.chart.items[] Chart Block, or surface.typeField.words[] Kinetic Word).
  • event — "start" | "end" of the anchor's enter.
  • offsetMs — signed milliseconds after (or before) the anchor event.
  • Allowed on overlays[].animation, effects[].animation, marks.timings[] entries, textAnimations[] entries, and surface.diagram[].animation. An Effect is a cascade subject only: nothing anchors to an Effect, so anchor never names one. A Chart Block may be an anchor through its intrinsic entry phase, but its five ChartMotion phases are not generalized keyframe channels and cannot carry Cascade. The surface is the timing root and carries no cascade.
  • Parse-time rules: every anchor ref must resolve, and anchor chains must be acyclic — a cycle is rejected with an error naming the loop.

textAnimations (per-slot text choreography)

"textAnimations": [
  {
    "id": "title-reveal",
    "target": { "kind": "surface", "slot": "title" },
    "effect": "soft-blur-in",
    "enter": { "start": 0.04, "duration": 0.10, "ease": "smooth" },
    "exit":  { "start": 0.86, "duration": 0.05, "ease": "smooth" },  // optional
    "cascade": { "anchor": "surface", "event": "end", "offsetMs": 80 },  // optional timing weld (see Animation)
    "params": { "speedMultiplier": 0.72 }                            // optional, merged over effect runtime
  }
]

Each entry binds one TextAnimation to one text slot. The choreography is compiled into GSAP tweens against SplitText-produced unit spans and scrubbed by the shared timeline progress. See ADR-0011.

Fields:

  • id — stable identity for Inspector selection and its Timeline track.
  • target — discriminated union: { kind: 'surface', slot } for the active surface, { kind: 'overlay', overlayId, slot } for an overlay slot.
  • effect — an id from the live TEXT_EFFECT_CATALOG; GUI and WebMCP choices derive from that registry. GFX-authored entries include kerning-pop, bracket-pop, and weight-resolve alongside the vendored set.
  • enter — required Transition. The compiler scales the effect's per-unit duration_ms / stagger_ms / from → to keyframes to fit this window.
  • exit — optional Transition. Without it the text stays visible until preset end.
  • cascade — optional ADR-0035 timing weld; when present it anchors this animation's enter start (see Animation). enter.start remains the fallback.
  • params — optional shallow overrides for the effect's showcase.runtime block (speedMultiplier, holdMs, gapMs, yTravelMultiplier, initialDelayMs).

Parse-time validation:

  • per-character and catalog-declared title_scale_only effects accept title / kicker / overlay title or kicker only.
  • Layout-aware renderer families accept title-scale slots only because they reflow the line as words push in.
  • weight-resolve requires the active Pack's real variable-weight-treatment and a target Pipeline whose Identity accepts Pack typography. Its internal font_weight_normalized keyframes map 0 → Pack minimum, 0.5 → Pack rest, and 1 → Pack maximum; Preset JSON never carries raw wght coordinates.
  • A target slot may appear at most once in textAnimations[].
  • effect must resolve in the catalog.

When a body has both marks.timings[] and a textAnimations[] entry targeting it, the marks renderer multiplies its drawn alpha by the body's animated unit alpha so marks ride along with their text.

effects (one composition-wide authored list)

"effects": [
  { "type": "paper-grain", "id": "f1", "params": { ... } },
  { "type": "chromatic-aberration", "id": "f2", "params": { ... } }
]

A single flat list — ADR-0018 collapsed the old per-layer { surface, body, annotations, overlays, frame } object (only frame was ever consumed). Each entry is { type, id, params } plus an optional animation block. Ordinary entries resolve through an EffectRenderer.schema and run in the final post-process chain; composition-owned entries resolve through composition-effect-registry.ts and alter branch dispatch before that chain. depth-of-field is the current composition-owned Effect. Per-target shader work that needs layer-local knowledge is a shaderPass on the Surface/Overlay renderer, not an Effect (ADR-0005).

Keyframed params (ADR-0063). An entry may carry the same animation block an Overlay carries:

{
	"type": "pixelation",
	"id": "resolve",
	"params": { "pixelSize": 48 },
	"animation": {
		"channels": {
			"pixelSize": [
				{ "atMs": 0, "value": 96 },
				{ "atMs": 400, "value": 1, "ease": "smooth" }
			]
		},
		"cascade": { "anchor": { "overlay": "title" }, "event": "end", "offsetMs": 0 } // optional
	}
}
  • A channel is a numeric leaf of the Effect's params schema, named by dotted path (pixelSize, region.x, melt.radius). The list comes from the live schema (listEffectKeyframeChannels); enum, string, color, and boolean params are never channels. Each keyframe value must sit inside the leaf's bounds, and an integer leaf takes whole numbers only.
  • Frozen params never become channels: every seed, and every input a fixed-step simulation kernel reads (fluid-ripple: damping, waveSpeed, and the impulse event; cloth-bend: stiffness, damping, and the gust event). A changing kernel input would make a jump-seek and a play-through disagree. Naming a frozen or unknown channel is a validation error at its exact path.
  • atMs counts from composition start; a cascade welds the track's start to an element's enter start or end plus offsetMs. Effects are cascade subjects, never anchors.
  • The static params value is the seed: it is what the Effect shows when the channel is cleared.
  • depth-of-field takes no animation block; it keeps its focusPull ramp.
  • A nested channel needs its parent block in params (after schema defaults): melt.radius animates only an Effect that declares melt.
  • Effect channels drive preview and export through the same animation manifest as every other channel; integer channels round at sample time.

stage (optional — dimensional depth stage)

Opt-in composition-wide 3D compositor (ADR-0028). Omit it and rendering is the flat path, unchanged. When present, the engine places the composition's Layer textures on real 3D planes at their ADR-0021 z, through a perspective camera with a real lens depth-of-field. Camera and focus drive frame-deterministically off the timeline.

"stage": {
  "type": "depth",                  // open string, registry-validated at load time
  "camera": {                       // optional; defaults shown
    "move": "static" | "push" | "drift",   // default "static"; composes on top of the pose
    "amount": 0..1,                 // dolly / lateral parallax strength (default 0.5)
    "ease": "smooth" | "settled" | "sharp" | "bouncy",  // default "smooth"
    "pose": {                       // optional rest pose (ADR-0057); absent = the frontal camera
      "yaw": -60..60,               // degrees; + swings the eye to the page's right (default 0)
      "pitch": -45..45,             // degrees; + lifts the eye above the page (default 0)
      "roll": -30..30,              // degrees; + tilts the horizon clockwise (default 0)
      "distance": 0.25..2,          // fraction of the rest distance (default 1)
      "aim": { "x": 0..1, "y": 0..1 }   // page point the camera orbits and looks at (default centre)
    },
    "travel": {                     // optional: one move from the rest pose…
      "to": { "yaw"?, "pitch"?, "roll"?, "distance"?, "aim"?: { "x"?, "y"? } },  // fields left out hold
      "start": 0..1, "duration": 0..1,                    // timeline fractions (defaults 0, 1)
      "ease": "smooth" | "settled" | "sharp" | "bouncy"   // default "smooth"
    },
    // …or a list of 1–8 such moves in timeline order (ADR-0057 amendment 2026-10-14):
    // "travel": [ { "to": { "aim": { "x": 0.5 } }, "start": 0.14, "duration": 0.12 }, { ... } ],
    "vertical": {                   // optional: the camera under a vertical frame (ADR-0059)
      "pose": { ... },              // replaces `pose` whole when present
      "travel": { ... }             // replaces `travel` whole when present
    }
  },
  "focus": {                        // optional; defaults shown
    "focusZ": 0..1,                 // in-focus depth (0 near … 1 far; default 0)
    "aperture": 0..1,               // max blur / circle-of-confusion (default 0.6)
    "band": 0..1,                   // hyperfocal half-width: depths within it stay sharp (default 0)
    "pull": { "from": 0..1, "to": 0..1, "start": 0..1, "duration": 0..1 }  // optional rack focus
  },
  "backdrop": {                     // optional image on the far (backdrop) plane
    "image": { "asset": "substrate-slug" },  // registered substrate (substrate-textures.ts); absent → backgroundFill colour
    "contrast": 0..1                // centre darken of the image for near-plane text legibility (default 0)
  },
  "screen": { "model": "crt-fw900" }  // optional physical screen (ADR-0059): a registered stage model (stage-models.ts) whose glass the Surface plane is
}

A screen films the Surface on a real object: the model's opening fits inside the frame plane and the composition covers it (a widescreen tube shows nearly all of a horizontal frame and the middle band of a vertical one), the glass carries the model's own optics (a CRT's dome, raster, grille, halation, and vignette), the housing stands on the model's floor around the glass lit by the Pack key and by the picture itself, casts a real shadow, and occludes the glass from an oblique camera. The model's plastics and optics are its own; a Pack changes the field, the light, and what is on the screen. Aim, focus, and canvas hit-tests keep addressing the glass.

A travel list visits one place after another: each move eases from where the previous one landed (the first from the rest pose), a field its to leaves out holds that pose, and windows never overlap — a move that starts before the previous one ends is a schema error. A single move may be written as the object or as a list of one; both resolve identically.

Focus follows the aim: focusZ 0 keeps the aimed page point sharp (the Surface plane's centre under the frontal camera), focusZ 1 reaches the backdrop straight behind it, and a travel that moves the aim racks focus with it. A pose widens the stage's depth encoding to the distances the move can reach and scales the lens with the camera's nearness — the circle of confusion per world unit grows as one over the focus distance squared, as a thin lens does, so a camera at distance 0.5 defocuses the same page four times as hard as the rest camera; with no pose or travel every existing Preset renders pixel-identical. How a filmed piece reflows to the tall frame is designable: vertical films the same set from its own rest pose and travel under a vertical frame, each field replacing its horizontal counterpart whole (a landscape screen can sit closer and push in until its picture fills the width), and an absent vertical films both frames through one camera. The renderer, the canvas projector, and the WS7 rubric all resolve it the same way, once per frame.

With stage present: Overlays ride a 3D plane. An Overlay that declares neither z nor pose shares the merged Overlay plane at the Layer default depth (0.7); an Overlay with an explicit z or a pose rides its own posed plane (ADR-0057) — z is signed (0 the Surface plane, 1 the backdrop, negative lifts toward the camera down to −1) and pose: { "yaw": -60..60, "pitch": -45..45, "roll": -30..30 } turns the plane in degrees about the Overlay's rendered centre, relative to the Surface plane (positive yaw turns its right edge away from the page's front, positive pitch leans its top edge away, positive roll turns it clockwise). A posed plane is placed in the posed camera's frame (the pose and travel): the Overlay's position means where it sits in the delivered frame under whatever pose is authored, at its depth, so safe areas hold and the page moves behind a card that stays put; the legacy move: push | drift still parallaxes it as a world-fixed plane, exactly as an explicit z behaved before. At most four Overlays may be posed; a fifth is a semantic error. Posed planes parallax, defocus, occlude, and cast shadow per pixel through the depth-tested stage (real depth test, so intersecting planes resolve per pixel); the active Pack's light-treatment Role becomes a real scene key light (received rake + cast plane-to-plane shadow; no Role → unlit); surface-local shader passes still run on the surface plane, but environment-painting passes (environment: true — the chapter-card / title-sequence / type-hero / pullquote painted backdrops) are superseded by the real backdrop plane. Surface enter/exit visibility is forwarded into the stage as GPU alpha, so authored Surface fades work without duplicating them as text animations.

captions (optional — the SRT caption track)

A time-coded caption track (creator blocks, 2026-07-09). Cues carry absolute milliseconds (SRT's own clock) — captions are welded to speech and do not stretch when the transport re-times. Rendered topmost (above overlays) in every render path; the active cue/word is a pure function of the timeline clock (no tweens — export == preview). Three equal import lanes write the same shape: agents author cues[] directly, scripts/srt-to-captions.mjs <file.srt> [--preset <path>] [--style …] converts SRT/VTT, and the GUI's Captions inspector carries an SRT editor that round-trips this data as subtitle text.

"captions": {
  "style": "karaoke" | "word-pop" | "pack",
  //  karaoke  — full spoken line in the social register (heavy white type, hard
  //             outline; pack-independent by intent) with the currently-spoken
  //             word on an accent pill. Per-word timing derives proportionally
  //             by word length within each cue (the schema stays pure SRT data).
  //  word-pop — only the current word, popping in big (120ms eased pop).
  //  pack     — the line dressed by the active Pack (core ink + font-treatment).
  "accent": "#rrggbb",   // optional active-word accent; absent → #ffd608
  "y": 0..1,             // optional band centre (fraction of height); absent →
                         // 0.8 horizontal, 0.75 vertical (C5's vertical band —
                         // clear of the platform expanded-description occlusion)
  "scale": 0.25..4,      // optional size multiplier; absent → 1
  "orientationOverrides": {             // optional, ADR-0039 §4
    "vertical": { "y": 0.66, "scale": 1.2 }  // a complete band for that orientation
  },
  "cues": [
    { "id": "cue-1", "startMs": 400, "endMs": 1900, "text": "Here's the thing" }
  ]
}

An orientation snapshot carries both y and scale and replaces the shared band as one unit while that orientation is active, so the band can sit low in the wide frame and above platform chrome in the tall one. The Captions inspector's Position section authors it through Customize horizontal / vertical: turning it on copies the band that orientation shows now, and turning it off deletes the snapshot.

Parse-time rules: cue ids unique; every cue must end after it starts. Cue enter/exit are hard cuts (broadcast-faithful); there are no per-cue transitions. The timeline shows one Captions rail — each cue is a draggable clip (move retimes, trim adjusts start/end in ms).

Sound (ADR-0033)

Sound is a timed-cue orchestration domain, not a sixth Layer. Motion primitives emit semantic sound events at their own frame; automatic cues are derived from motion at render time and never stored. The schema carries three things:

Defaults are engine-level. Every sound event carries one engine-default sample (DEFAULT_EVENT_SAMPLES in sound-cues.ts) selected from Foley's 28-cue library. scripts/gen-foley-sounds.mjs creates the checked-in WAV renders that preview and export consume as identical fixed bytes; all 28 foley-* samples remain selectable for per-motion personalization. The iMessage bubbles and tapbacks lock their Apple signature samples at derivation (MESSAGE_SAMPLES / TAPBACK_SAMPLES) — chat-surface sounds never leak into the general vocabulary. There is no per-Layer sample bundle or palette field; that indirection was removed 2026-07-02 after GUI testing because it made "what does this play" illegible (see ADR-0033 amendments). Personalisation is per motion, via the override below or by selecting any cue on the timeline's Sound rail.

Defaults follow the motion's character, not just its window: sliding elements whoosh with their enter/exit, but types whose motion doesn't displace air emit nothing by default — Overlays like washi-tape (press-on), watermark (fade), cursor-trail (glide), and fade-entrance Surfaces like imessage and chapter-card. Their sound is opt-in via the per-motion override below (see OVERLAY_EVENT_DEFAULTS / SURFACE_EVENT_DEFAULTS in sound-cues.ts).

sound — per motion. Any motion window (a Transition — surface/overlay/text-animation enter/exit — a marks.timings[] entry, or a chat message's enter) may override the engine-default event/sample:

"sound": {
  "mute": true,             // silence this one motion
  "event": "impact",        // swap which event it emits (whoosh-in | whoosh-out | impact | tick | click | pop | send | swipe | scratch | draw | sub-drop | sting)
  "sample": "asset-slug"    // lock a specific audio asset instead of the event's engine-default sample
}

audioCues — manual cues + the bed. Top-level on state, peer to textAnimations. Holds only what has no motion to ride:

"audioCues": [
  { "id": "outro-sting", "assetSlug": "sting-brass-01", "start": 0.9, "duration": 0.08 },
  { "id": "bed", "kind": "bed", "assetSlug": "bed-warm-keys", "start": 0, "duration": 1, "volume": 0.6 }
]

kind defaults to "cue". assetSlug names a bundled audio asset directly, so manual cues do not use the event-default sample mapping. Parse-time rules: ids unique; at most one bed; a bed requires backgroundFill or complete Video-track coverage (full-frame segments/bumpers only — a transparent Overlay or gapped Video track keeps alpha).

Surface variants

  • paper — card chrome with paper-grain shader and fly-in/out animation. Slots: title, sourceUrl, author, source, dateLabel. Supports enter, exit, backgroundVisibility.
  • plain — transparent background that hosts a body without chrome. Slots: author, source, dateLabel (decorative metadata only).
  • newspaper — a broadsheet page photographed up close: full-bleed crop, intrinsic newsprint physics, fully Pack-immune (ADR-0056). Slots: title, kicker, author, affiliation, source, dateLabel, body. The title accepts the bracket-tag mark syntax (the Surface declares titleMarks); a headline mark indexes before the body's marks in marks.timings[]. No enter/exit — the page is a cut with a slow camera push. Full-frame — Presets declare backgroundFill.
  • pullquote-on-photo — pullquote staged against the dimensional depth stage's photographic backdrop.
  • chapter-card — full-frame chapter introduction Surface.
  • brand-mark — full-frame chapter break carrying a registered brand silhouette in the active Pack's accent; variant syntax-fm.
  • title-sequence — full-frame title-sequence Surface.
  • type-hero — full-frame typographic hero; variants single / pair.
  • web-document — structured site mock selected by surface.site.
  • website-screenshot — a stored website capture. Slots: sourceUrl (author-time capture URL) and exactly one capture source — imageUrl (content-addressed /api/user-assets/... bytes, the GUI's capture) or captureAsset (a bundled capture from src/lib/platform/capture-assets.ts, the corpus form, authored with scripts/capture-website.ts <url> --out src/lib/assets/captures/<slug>.png --scale 2 --width 2560 --height 2000). Framings via variant: browser (default) presents the 1440×900 capture in controls-only browser chrome and reflows one browser-plus-plate stack across both transports; filmed (ADR-0057) lays the capture at native density — one capture pixel per frame pixel, scaled up only when the capture is smaller than the frame — with no chrome, pageAnchor choosing which page point sits at frame centre (an orientation's point in pageAnchorOrientationOverrides replaces it in that orientation, so the tall frame can keep a different part of the page in shot; the inspector's Page anchor field authors it through Customize horizontal / vertical, and gfx_placement_set_surface_page_anchor through target) — the frame is a crop into the page for the depth stage's camera to film. The Surface plane itself stays frame-sized (a capture wider than the frame only widens the crop pageAnchor can choose), so the author keeps the camera's footprint on the page; pnpm verify-presets fails the Preset (rule WS7) when a frame corner leaves the page anywhere in the authored move, in either orientation.
  • imessage — choreographed Messages conversation; chrome: "window" | "none".
  • checklist — timed checklist/progress Surface; chrome: "window" | "none". By default the card sits on the right half of the wide frame and the bottom half of the tall one. surface.checklistCard: { x, y, width } (left edge, vertical centre, width as frame fractions; width at least 0.15, fitting the frame) places it instead, and surface.checklistCardOrientationOverrides: { horizontal?, vertical? } gives an orientation its own complete placement (ADR-0039 §4). The card's height stays its content's, and it enters from the side of the frame it sits on. The rubric reports a placement outside the safe area (G2) and never moves it. Drag the card on the canvas (its east handle sets the width), use the Surface inspector's Card section, or call gfx_placement_set_checklist_card.

Pack immunity is declared by each Pipeline's Identity Spec and derived at runtime. PACK_IMMUNE_PIPELINE_KEYS is the complete authority; this catalog intentionally does not copy that set into prose.

Block variants

  • paragraph — text run inside content.body (the bracket-tag string).
  • node, edge-arrow, label, stat-callout, timeline-segment, code — shipped diagram primitives (ADR-0036), carried in surface.diagram[] (see the Diagram primitives section above).
  • bar-chart, column-chart, line-chart, unit-grid-chart, dot-field-chart — shipped factual Chart Blocks (ADR-0048), carried in surface.chart.items[] and edited through the shared Chart inspector/authoring helpers.
  • figure — the one shipped generated-visualization Block (ADR-0067), carried in surface.figures[]; its kind (neural-network, tree, network, cycle, bar-race, line, slope, sankey, treemap) picks the scene builder (see the Figures section above).
  • kinetic-word — a shipped first-class word token in surface.typeField.words[] (ADR-0064); static and orientation-specific placement, appearance, phrase semantics, Timeline identity, independently authored opacity/reveal/spatial/normalized-weight/tracking tracks, a bounded glyph stagger over the word's own line-box mask, nonzero-playhead direct manipulation, and shared GUI/WebMCP operations ship. Motion Beats and beat-relative keys remain deferred. A mermaid-style auto-layout Block is explicitly rejected; image and code remain possible future additive variants.

Annotation styles

Decorative (additive on the marked target): highlight, underline, strike, circle, box, side-note.

Focal (transforms surroundings): magnify, lift-out, tear-out, isolate. magnify selects a native-pixel circle for compact marks or a bounded rounded rectangle for wrapped phrases; mark intensity controls a constrained optical scale, and its scanner reticle/ripple use the resolved mark color.

The bracket-tag body format expresses marks inline. Stacked styles nest tags around the same run: [magnify][side-note]quote[/side-note][/magnify] parses to markStyles: ['magnify', 'side-note'] on the segment. Decorative-under-focal stack order is enforced in the composition shader, so authoring order within nested tags does not affect rendering. A Surface whose definition declares titleMarks (the newspaper) accepts the same syntax in title; its headline marks come first in marks.timings[], before the body's. On every other Surface, mark syntax in a title is a lint error (rubric A3).

Overlay types (v1)

  • lower-third — content { kicker, title, subtitle? }; variants standard / cinematic; default position { anchor: 'bottom-left', offset: { x: 0.0625, y: 0.0625 } }.
  • washi-tape, watermark, shader-fill, cursor-trail — graphic overlay families with renderer-declared content schemas.
  • counter — numeric build; variant slot-machine-roll.
  • instance-stack — repeated-instance motion; variants vertical-stack / horizontal-train.
  • text-3d — dimensional text; variant cylinder-axis-y.
  • dimensional-type — a headline as a body on the depth stage (ADR-0062): text (1–64 characters), size (one cap height as a fraction of the frame's short side, 0.03–0.4, so the headline reflows into the tall frame; a line that would run past the safe width shrinks to fit it), depth and bevel (in cap heights), lift and lean (how far it stands off its plane and pitches back as it arrives — the settled-place entrance, scaled by one minus the Overlay's progress). Set in the Pack's dimensional-type.face, its face and bevel in the Pack's ink and its extrusion in the Pack's accent. Placed by its position exactly as a DOM Overlay would be; z and pose place its plane. Needs stage.type: "depth" to stand as a body — off the stage it renders flat in the Pack's face; at most STAGE_BODY_CEILINGS.maxBodies body Overlays per composition (a semantic validation error beyond it).
  • icon-orbit — glowing line icons that launch from below the frame, spring into place around the speaker, and circle them in depth (the agent-concepts look Scott approved on 2026-10-15). Content { icons: [{ icon, label?, launch, launchX?, angle, height }] (1–12), pass?, centerX?, radius?, turnDegreesPerSecond?, tilt?, iconSize?, labelSize?, strokeWidth?, glow?, color? }. icon is one of the named glyphs in src/lib/pipelines/overlays/icon-orbit/icons.ts (storage, queue, socket, steer, fork, approval, retry, summary, state, memory, streams); launch is the clip fraction it leaves the bottom edge, launchX where along that edge; angle is its place on the ring at the start of the clip (0 faces the camera, 90 the viewer's right, 180 straight behind); the ring turns as one, so icons keep their spacing whenever they launch, and height the frame fraction it settles at. The ring turns turnDegreesPerSecond (default 8) around centerX (0.5) at radius (0.3 of the frame width) and tilts by tilt (0.18): the front of the ring sits that much lower and the back that much higher, so icons pass in front of the chest and behind the head. pass (all default, behind, front) keeps only the icons behind or in front of the speaker: export the composition once per pass and stack them in the editor as behind pass → speaker footage matted → front pass. The flight is a spring integrated at a fixed step from launch (src/lib/utils/icon-orbit-flight.ts), so every frame is a pure function of time. Sizes follow ADR-0070: iconSize (11) and labelSize (1.5) in cqmin, strokeWidth (4.5) in the glyph's 120-unit box; glow scales the bloom (0–2); color (#RRGGBB) wins over the Pack's icon-orbit.glow Role. orientationOverrides: { horizontal?, vertical? } holds a complete ring { centerX, radius, tilt, iconSize } per orientation that replaces the shared ring as one unit (ADR-0039 §4), authored through the Ring row's Customize toggle. The overlay is silent by default and full-frame (position is the frame's top-left), exempt from the safe-area check, like cursor-trail.
  • multiplayer-session — one agent window that several people use at once (approved 2026-10-15). Content { title, users: [{ id, name, color? }] (0–4), events: [...] (1–40), x?, y?, width?, height?, forkSide?, textSize?, titleSize?, nameSize?, cursorSize?, paddingX?, paddingY?, gap?, radius?, windowColor?, inkColor?, accentColor?, orientationOverrides? }. Each event has an at clip fraction and a kind: join (user) flies that person's cursor in from off frame and adds their face to the header; type (user, text ≤ 60, duration) writes their draft into their own prompt row, their cursor riding the caret, so several people type at once; send (user, tag?) posts their draft to the run log with an optional tag such as steer; step (tool, text) is a line the agent writes, ticked done when the next step starts; fork (label, detail?, user?) peels a child card off the window with a line from its own log row, the named person's cursor clicking it; wait (text, timerSeconds?) shows an Approve / Deny card with a countdown, turns the header status to waiting, gathers the cursors, and gives every name tag the same ⏸ m:ss; trigger (label, detail?, fireAt?) stands a card in a column left of the window (a cron job, a webhook) and at fireAt fires a bolt into the window and logs it, and until the first trigger fires the status reads idle; crash (text) shakes the window, flashes it red, fails the step it was on, logs the crash in red, and sets the status to crashed. With no people there is no prompt and the log runs to the window's foot. x, y, width, height place the window as frame fractions and forkSide (right / below) says where forks grow; orientationOverrides: { horizontal?, vertical? } holds a complete { x, y, width, height, forkSide } per orientation (ADR-0039 §4). Sizes follow ADR-0070 and are in cqmin: textSize (2.3), titleSize (2.4), nameSize (1.9), cursorSize (4), paddingX (3), paddingY (2.4), gap (1.4), radius (2.2). The window is the Pack's multiplayer-session.window, its ink the Pack field ink, and the send button, waiting state and approval card the Pack's multiplayer-session.accent; each authored colour wins. People's colours are content (color, else a fixed four-colour set). Text is set in JetBrains Mono so carets can be placed by advance. Every frame is a pure function of time (src/lib/utils/multiplayer-session-scene.ts); the overlay is silent and full-frame, exempt from the safe-area check like cursor-trail.
  • duplicate-pileup — a Gmail inbox and a GitHub pull-request list where, after a restart, the same email and pull request keep arriving, then fold back into one copy each (approved 2026-10-15; restyled as the real products the same day because the first, invented look read as generic). Content { panels: [{ kind: 'inbox' | 'pull-requests', title, at, item, meta?, snippet?, label?, time?, number?, copies: [at…] (1–12) }] (1–3), restart?: { label, at }, collapse?: { label, at }, x?, y?, width?, height?, arrangement?, textSize?, titleSize?, labelSize?, paddingX?, paddingY?, gap?, radius?, orientationOverrides? }. An inbox panel is Gmail: title is the current tab (with an "n new" chip), and a row reads checkbox, star, meta (sender), item (subject) – snippet, time. A pull-request panel is GitHub: title is the repository, the bar reads "n Open", and a row reads the green open-PR octicon, item, label, and "#number opened 2 minutes ago by meta", the number counting up per copy. A panel appears at at; each copies entry drops a row in at the top, highlighted yellow as new, and pushes the rest down; the first copy is the real one, and the panel leans further the more duplicates it holds. restart pops a dark stamp above the panels for a moment; collapse slides every duplicate into the real copy, straightens the panels, and pops a green stamp under them. x, y, width, height place the group and size one panel as frame fractions; arrangement is row or column; orientationOverrides: { horizontal?, vertical? } holds a complete { x, y, width, height, arrangement } per orientation (ADR-0039 §4). Sizes follow ADR-0070 in cqmin: textSize (2.2), titleSize (2.4), labelSize (3.4), paddingX (2.6), paddingY (2.2), gap (3), radius (2.2). The panels are found documents (ADR-0038): Gmail's and GitHub's light palettes stay literal under every Pack. Every frame is a pure function of time (src/lib/utils/duplicate-pileup-scene.ts); silent and full-frame, exempt from the safe-area check.
  • terminal-run — an agent process in a macOS terminal window: started by a trigger, killed partway, and resumed at the step it was on (2026-10-15; replaced the actions-run GitHub page the same day, because an agent is not a CI job). Content { title, prompt, lines: [{ kind, text, at, duration?, replaces? }] (1–40), x?, y?, width?, height?, textSize?, titleSize?, paddingX?, paddingY?, radius?, orientationOverrides? }. Each line prints at at. kind is command (typed after prompt over duration), output, dim, info (blue), success (green), error (red), step (a spinner until the next line prints, then a green tick, or a red cross if that next line is an error), restored (a dim tick: carried over from a saved run, not run again), or prompt (an empty prompt whose block cursor blinks while it is the last line). replaces: true redraws the line above in place, for a trigger line that changes or a prompt that a command is then typed into. Rows past the window's height scroll off the top. Layout { x, y, width, height } in frame fractions with a complete per-orientation snapshot in orientationOverrides; sizes in cqmin: textSize (2.4), titleSize (1.7), paddingX (2.6), paddingY (2.2), radius (1.4). A found document (ADR-0038): the window chrome, dark theme, JetBrains Mono, and line colours stay literal under every Pack. Every frame is a pure function of time (src/lib/utils/terminal-run-scene.ts); silent and full-frame, exempt from the safe-area check.
  • youtube-subscribe, instagram-follow — platform creator-action overlays.
  • achievement — content { icon?: 'check' | 'star' | 'none', kickerStyle?: 'text' | 'chip', motion?: 'draw' | 'pop', kicker, title, beat, width?, minHeight?, titleSize?, kickerSize?, paddingX?, paddingY?, iconSize?, gap?, backgroundColor?, borderColor?, iconColor?, ringColor?, kickerColor?, chipColor?, titleColor? } (absent look settings → check / text / draw; a saved deprecated variant is read as its look, ADR-0041 amendment); beat is the draggable focal moment shared by intrinsic variant choreography and derived sound. Sizes are optional and each stands alone (ADR-0070): width: { horizontal?, vertical? } is the card width as a fraction of the frame width (absent → 0.32 / 0.82), minHeight a fraction of the frame height, and titleSize, kickerSize, paddingX, paddingY, iconSize, gap are in cqmin. The seven colours are optional #RRGGBB values that win over the Pack for that part. Absent text sizes keep their share of the card width; absent padding keeps the Pack's; setting one padding side keeps the card's own value on the other.
  • source-url — content { url }; Pack-resolved URL plate centered horizontally across a website-screenshot Surface's top edge at a 50% overlap, with normal transition/keyframe/Cascade timing.
  • tweet-stack — content { posts: [{ id, url, displayName, handle, body, dateLabel, avatarUrl?, verified }], pileStart, pileWindow, spread }; 2–8 baked X posts arrive sequentially during the draggable pile window, settle into a deterministic overlapping cluster, and reflow for both orientations. url must be an x.com or twitter.com status share URL. The inspector imports public posts through X oEmbed once; exports use only the baked content and never fetch live X data.

Effect types (v1)

  • paper-grain — params { warmth: 0..1, density: 0..1 }; multiplies a 2-octave value-noise grain into the composed frame texture.
  • chromatic-aberration — params { strength: 0..1, radial: 0..1 }; R/B channel split, uniform-horizontal (0) to lens-style radial (1).
  • optical-vignette — params { exposureLoss: 0..3, onset: 0..0.8, feather: 0.1..1, roundness: 0..1, center: { x: 0..1, y: 0..1 } } (defaults 1, 0.3, 0.45, 1, centre { 0.5, 0.5 }); realistic lens edge falloff. The exposure follows the cos⁴ law of natural illumination falloff, measured in native pixels from the optical centre: exposureLoss is the stops of linear light lost at the farthest frame corner, the deepest the Effect ever darkens; onset and feather shape a smooth, monotonic shoulder (zero slope at the centre, no ring or hard edge); roundness: 1 is a round lens image in both orientations and 0 follows the frame's own ellipse. It scales each pixel's colour by one exposure factor in linear light (un-premultiply, decode sRGB, scale, encode, re-premultiply) and leaves alpha untouched — no hue shift, no painted background, transparent pixels stay transparent — and exposureLoss: 0 is an exact identity. Static and time-free; every numeric param is a keyframe channel. May carry orientationOverrides: { horizontal?: { center }, vertical?: { center } }, a complete optical centre for that orientation (ADR-0039 §4). As an ordinary Effect it darkens GFX output only, never creator footage.
  • dithering — params { mode: 'random'|'2x2'|'4x4'|'8x8', pxSize: 1..64, colorSteps: 1..7, originalColors: bool, inverted: bool, colorFront/colorBack/colorHighlight: '#rrggbb' }; pixelizes the frame into a dither-cell grid and posterizes luminance against a hash or Bayer threshold — the frame's own colors, or a front/back/highlight palette masked to the content silhouette. Ported from @paper-design/shaders image-dithering (Apache-2.0).
  • pixelation — params { pixelSize: integer 1..256 }; clean sample-and-hold pixelation on a stable, top-left-anchored native-pixel grid. Every square cell takes one exact premultiplied source texel from its center, with no filtering, averaging, posterization, palette remapping, or Effect-local dither. pixelSize: 1 is an identity pass; transparent cells remain transparent.
  • halftone-dots — params { dotType: 'classic'|'gooey'|'holes'|'soft', grid: 'square'|'hex', size: 0..1, radius: 0..2, contrast: 0..1, originalColors: bool, inverted: bool, colorFront/colorBack: '#rrggbb' }; print-style dot screen — each cell's dot radius tracks sampled luminance (dark → big ink dot), in the frame's own colors or ink-on-paper palette, masked to the content silhouette. Ported from @paper-design/shaders halftone-dots (Apache-2.0); its grain sub-features are omitted (compose paper-grain in the chain instead).
  • halftone-cmyk — params { cmykType: 'dots'|'ink'|'sharp', size: 0..1, contrast: 0..2, softness: 0..1, gridNoise: 0..1, colorBack/colorC/colorM/colorY/colorK: '#rrggbb', floodC/M/Y/K: -1..1, gainC/M/Y/K: -1..1 }; CMYK press separation — four rotated ink screens at the classic angles (C 15° / M 75° / Y 0° / K 45°) multiply over the paper color, masked to the content silhouette. Ported from @paper-design/shaders halftone-cmyk (Apache-2.0); grain sub-features omitted (compose paper-grain), noise texture replaced with a procedural hash.
  • water — params { size: 0.01..7, highlights: 0..1, layering: 0..1, edges: 0..1, caustic: 0..1, waves: 0..1, speed: 0..3, colorHighlight: '#rrggbb' }; time-driven water-surface refraction — layered caustic octave fields + simplex waves displace the sampling UV, with caustic glints masked to the content silhouette. Animates off ctx.timestamp × speed (frame-deterministic, ADR-0012). Ported from @paper-design/shaders water (Apache-2.0); its standalone colorBack fill is dropped (use the composition's backgroundFill), and the displacement field is soft-knee bounded so default params keep glyphs coherent.
  • fluted-glass — params { shape: 'lines'|'linesIrregular'|'wave'|'zigzag'|'pattern', distortionShape: 'prism'|'lens'|'contour'|'cascade'|'flat', size: 0..1, angle: 0..180, distortion: 0..1, shift: -1..1, stretch: 0..1, blur: 0..1, edges: 0..1, shadows: 0..1, highlights: 0..1, marginLeft/Right/Top/Bottom: 0..1, colorShadow/colorHighlight: '#rrggbb' }; ribbed architectural glass — rotated flutes each apply a refraction profile with shadow gradients, boundary highlights, optional directional blur, and margins scoping the pane; masked to the content silhouette. Ported from @paper-design/shaders fluted-glass (Apache-2.0); grain sub-features omitted (compose paper-grain), colorBack dropped (use backgroundFill).
  • refractive-lens — params { shape: 'circle'|'rounded-rect', region: { x, y, width, height }, magnification: 1..2.4, thickness/refraction/roughness/dispersion/reflection/rimLight/tintStrength/edgeFlatness: 0..1, bevel: 0.02..1, tint: '#rrggbb' }; independently authored local clear glass with native-pixel SDF geometry, bounded reconstruction/refraction, restrained dispersion and reflection, exact outside-region pass-through, and input-silhouette alpha preservation.
  • frosted-glass — params { region: { x, y, width, height }, coverage: 0..1, contrast: 0.05..1, roughness/haze/refraction/tintStrength/highlight: 0..1, detailScale: 0.25..4, tint: '#rrggbb', seed: 0..65535, growFrom/growTo: 0..1, growth: 0..1, melt?: { center: { x, y }, radius, softness, from, to, progress: 0..1 } }; independently authored deterministic three-scale frost with weighted transmission blur, relief refraction, authored growth, and optional melt/refreeze. The shader reads growth (how far the frost has crossed the pane) and melt.progress (how far the hole has opened) directly. growFrom / growTo and melt.from / melt.to are sugar over those channels (ADR-0063 §8): they expand into a two-keyframe 0 → 1 track in the smooth ease between those transport fractions, and a declared growth or melt.progress channel takes the pen. growTo > growFrom and melt.to > melt.from are required. Both optical Effects interpret local regions against canonical 3840x2160 geometry and preserve their pixel size and aspect across native targets; { x: 0, y: 0, width: 1, height: 1 } remains target-filling. Either may carry orientationOverrides: { horizontal?: { region }, vertical?: { region } }, a complete region authored in that orientation's own frame fractions that replaces the shared region there (ADR-0039 §4); fluted-glass takes the same shape with its four margins. A snapshot is static: region keyframes drive the shared region only (ADR-0063 §11). The Effect row's Customize horizontal / vertical toggle copies the params the orientation shows now; gfx_appearance_set_effect_params writes the same field.
  • fluid-ripple — one authored impulse time/position/strength plus seed, radius, damping, wave speed, refraction, and highlight controls; a 60 Hz reset/replay kernel resolves seekable modal state and the GPU evaluates radial refraction without growing alpha.
  • cloth-bend — top/left/both pin selection, one authored gust, seed, stiffness, damping, folds, perspective, and shadow; fixed-step spring state drives bounded fold/bend sampling.
  • tiled-deformation — grid or hex topology with seed, columns, lift, bevel, perspective, reveal window, and light angle; a deterministic radial field lifts tiles without pointer/hover semantics.
  • heatmap — params { colors: ['#rrggbb' × 2..10], contour: 0..1, wave: 0..1, angle: 0..360, noise: 0..1, speed: 0..3 }; thermal read of the frame — luminance indexes an N-stop cold→hot gradient cascade, content edges add contour heat, and a heat band travels along angle, time-driven off ctx.timestamp × speed (frame-deterministic, ADR-0012). Adapted from @paper-design/shaders heatmap (Apache-2.0): the gradient cascade, traveling band, and grain hashes are the source's; its CPU-preprocessed glow pipeline and logo choreography are replaced by direct frame-luminance heat (single-pass effect contract).
  • crt-screen — params { scanlinePitchPx: 2..24, scanlineStrength: 0..1, bloomThreshold: 0..1, bloomStrength: 0..1, vignette: 0..1 }; restrained full-frame terminal glass — static scanline raster, bright-pass phosphor bloom, corner vignette. Mission console, not arcade: no curvature, no mask, no signal artifacts.
  • ntsc-signal — params { lines: 160..1080, lumaBandwidthMhz: 1..6, chromaBandwidthMhz: 0.1..1.5, separation: 0..1, chromaDelayUs: 0..0.8, phaseJitter: 0..1, ghost: 0..1, ghostDelayUs: 0..3, noise: 0..1, interlace: bool }; the cable/decoder half of the two-stage CRT pipeline — each scanline is re-encoded into an NTSC composite signal (YIQ on the 3.579545 MHz subcarrier, 180° phase flip per line/frame) and decoded back through imperfect FIR filters, so color bleed, dot crawl, rainbowing on fine detail, right-lagging chroma, cable ghosting, and decoder-shaped snow are emergent, not painted. Modeled from the NTSC standard (no ported shader code). Temporal terms ride a deterministic ~30 Hz frame clock off ctx.timestamp (ADR-0012); interlace is the stateless 480i field-bob approximation. Run FIRST in the chain, ahead of crt-tube.
  • crt-tube — params { mask: 'slot'|'shadow'|'grille', maskPitchPx: 3..24, maskStrength: 0..1, lines: 160..1080, focus: 0..1, curvature: 0..1, bezel: 0..1, halation: 0..1, vignette: 0..1, interlace: bool }; the display half — gaussian-beam scanlines resampled to the virtual raster (focus is spot size; bright lines swell), slot/shadow/grille phosphor mask (luminance-compensated: strength is texture, not dimming), barrel curvature, rounded-glass bezel with inner shadow, bright-pass halation. One param surface spans blurry '80s consumer slot-mask to sharp late-era aperture-grille; run it alone (no ntsc-signal) for the clean analog-RGB monitor look. Keep lines matched with ntsc-signal.lines. Distinct register from the restrained crt-screen. Also consumed as the crt-terminal Pack's chrome recipe on opaque pieces (at curvature: 0).

Body text format

Paragraphs are separated by two or more newlines (\n\n). Every registered Annotation style is a valid bracket tag. Nesting expresses style stacking. Plain [ characters not followed by a recognized tag are preserved as text.

Example (src/lib/presets/research-paper-critique.json):

"body": "We trained the model on the WMT 2014 set.\n\nFor each task we used the [highlight]base Transformer model[/highlight] without tuning, relying on [underline]attention dropout[/underline] and label smoothing instead.\n\nResults on the WMT 2014 [circle]English-to-German[/circle] task are reported using BLEU."

Three marks → three entries in marks.timings. The third timing in that preset carries a "color": "#de263a" override that re-tints the circle mark away from marks.defaults.circle.color.

Validation

Validation has two ordered layers:

  1. PresetSchema validates and transforms the structural gfx@1 JSON shape.
  2. validatePresetSemantics(preset) validates registry and cross-domain meaning: the Pack slug; Surface registration/variant; Overlay type/content; post-process and composition Effect type/params; Stage type; substrate asset; Overlay/Effect IDs; text-animation Overlay targets; strict Chart surface/data/domain/target/normalization/fill/motion rules; transition lane; and, when a resolver is supplied, transition Preset references.

parsePreset(value) runs both layers and returns the parsed Preset or throws with a path-qualified multi-line summary. Built-in catalog loading, scripts/verify-presets.ts, and user-composition list/load/create/update paths run the same semantic gate, so unknown primitives or malformed renderer params fail before rendering or persistence. Media validation additionally requires unique asset/clip IDs, resolved clip references, ordered non-overlap, composition bounds, and sufficient Source coverage. User-composition writes require every referenced Media asset to exist and pass the server video probe; unused entries may remain for later use, and stored compositions remain readable if bytes later go missing so the GUI can repair them. applyPreset(preset) clones the parsed state into engineState in place, preserving object identity at the top level.

Standalone interchange uses the wire representation documented here: the GUI's JSON import/export controls and GET/PUT /api/user-compositions/<slug> consume and return this exact shape. Agents should use that API rather than editing the metadata wrappers under user-compositions/. Media asset bytes and volatile probes are never embedded in this JSON. The full GUI, agent, and automated-render workflows are documented in user-composition-workflows.md.