Skip to content

Spec Format

The spec format describes a dashboard as text, with sources, panels built from seven primitives, bindings and a layout, in a TOML form and a canonical JSON form.

Field Value
ID SPC-01
Status Shipped
Scope Core
Pillar Builder and Specs
Sprint None
Depends On None
Unblocks Spec Validator (SPC-02)
Builder Sessions (SPC-06)
Script Runtime for Specs (SPC-26)
Source Transforms (SPC-28)
Time Windows over Live Sources (SPC-38)
Series Labels and Colours (SPC-39)
Docs Manifest, Spec Applets
Branches None
Design Spec format

Coverage Ledger

  • design/applet-builder.md, under Applet builder. Earlier proposal: an agent builds applets as data, a declarative panel spec drawn by one host runtime, edited through a command layer; compiled applets remain for panels that outgrow the spec.
  • design/applet-builder.md, under Three ways an agent could build an applet. Declarative spec first, embedded script (Lua or WASM) for custom logic, generated native applet as an eject to C++ step.
  • design/applet-builder.md, under Three ways an agent could build an applet. Tabular transforms use DuckDB SQL; tensors get a small fixed set of GPU operations: slice, reduce and normalise.
  • design/applet-builder.md, under Proposed design. The command layer, the spec, the spec runtime, the saved applet as manifest plus spec, and the browser.
  • design/applet-builder.md, under Proposed design. An illustrative TOML spec for an attention-entropy dashboard.
  • design/applet-builder.md, under What would need to change. 3. A primitive library: drawing moves into caliper::viz with declared input slots.
  • design/applet-builder.md, under A first slice. Command layer and catalog, a spec runtime with four primitives (series, heatmap, scatter, table), bindings to data.v1 and live views, the capture service, all over MCP.
  • design/applet-builder.md, under Open decisions. The first primitives: which visuals and controls the spec supports first.
  • design/builder-overview.md, under The parts. Parts diagram and table: spec format, loaders, catalog, command layer, session, caliper-mcp, side chat, widget agent, caliper-agent.
  • design/builder-overview.md, under What is built. Spec library parses, validates, writes and merge-patches specs.
  • design/builder-pane.md, under Primitives. The primitive palette lists the seven primitives; a click adds a panel bound to the selected source by the pane's rules, and a primitive that does not fit is faint with the validator's message.
  • design/builder-pane.md, under Properties. The property inspector for a source: id, catalog id, shape and an ordered list of transforms (slice, reduce, normalise) with axis names, ranges and the shape after each.
  • design/builder-session.md, under The command table and the spec format. The command table's schemas accept exactly what the spec format accepts, and a conformance test keeps them in line.
  • design/command-layer.md, under spec, source, panel and layout. Commands that edit the open spec (spec.*, source.*, panel.*, layout.*) with dry_run, a unified diff and validation after every edit, and a flat layout form for layout.set.
  • design/loaders.md, under Tensor outputs and transforms. Tensor outputs select one tensor or all with tensor = "*" and may apply the slice, reduce and normalise transforms, whose CPU reference implementation fixes the numeric rules.
  • design/roadmap.md, under Phase 3: agent-built panels. The parts: command layer, loaders, catalog, spec format with seven primitives, spec applet kind, caliper-mcp, side chat, widget agent.
  • design/spec-format.md, under What is built and what is planned. The library caliper_builder_spec parses a spec, validates it, writes canonical TOML and JSON and applies a JSON merge patch to one panel or source.
  • design/spec-format.md, under What is built and what is planned. The JSON Schema of the canonical JSON form and the tests of the library.
  • design/spec-format.md, under Two examples. Two test fixtures, the contracts' attention-entropy spec and a three-panel dashboard over a table source and a tensor source, are embedded as examples.
  • design/spec-format.md, under The document. A spec is one strict TOML table with caliper_spec, applet, source, panel, layout and x; an unknown key is spec.unknown_key and a spec with no panels is valid.
  • design/spec-format.md, under The applet. The applet table gives the spec's id, title, description and extensions, and the id grammar shared by the applet, sources and panels.
  • design/spec-format.md, under Sources. A source has an id and exactly one of three forms: catalog, sql or from, with optional tensor transforms; a source of none or several forms is spec.source_form.
  • design/spec-format.md, under Tensor transforms. The three tensor transforms slice, reduce (mean, sum, min, max, std, var, norm, argmax, argmin, entropy) and normalise (minmax, zscore, softmax, l2), with result shapes and dtypes and shape checks when the source resolver knows the input.
  • design/spec-format.md, under Panels. A panel is one primitive with its slots bound to sources, a title, options and an extension table.
  • design/spec-format.md, under Bindings. A binding names a whole source or one column of a tabular source as source-id.column; series.y takes one binding or a list of up to 16.
  • design/spec-format.md, under The primitives. The seven primitives are the live view types of Caliper LIB plus table and text, each with a wire form and slot rules checked as spec.slot_mismatch.
  • design/spec-format.md, under series. The series primitive draws lines over an index or an x column, with up to 16 y bindings.
  • design/spec-format.md, under heatmap. The heatmap primitive draws a colour-mapped rank-2 tensor.
  • design/spec-format.md, under points. The points primitive draws a 2-D or 3-D point cloud from columns or one positions tensor, with colour, size and a class-label rule that draws integer colours with the categorical palette.
  • design/spec-format.md, under histogram. The histogram primitive counts the values of a numeric column or of any tensor in bins.
  • design/spec-format.md, under table. The table primitive shows the rows of a whole tabular source, with an optional columns option.
  • design/spec-format.md, under image. The image primitive draws a [H, W], [H, W, 3] or [H, W, 4] tensor as an image.
  • design/spec-format.md, under text. The text primitive shows static text, a bound value or both.
  • design/spec-format.md, under Options. Each primitive takes a small set of options: axis labels, ranges, log scales, colormap (viridis, magma, rdbu, greys), bins, columns and text.
  • design/spec-format.md, under Layout. The layout is a tree of panel ids, splits (horizontal or vertical, with a ratio for two children) and tabs, with depth and size limits and a default vertical stack.
  • design/spec-format.md, under Extensions. A table named x is allowed in the document, applet, sources, transforms, panels, options and layout nodes for a tool's own data; validation ignores it and the writers keep it.
  • design/spec-format.md, under Values. A spec holds only values the canonical JSON form carries to a browser: no dates, no null, no non-finite numbers, safe integers only and valid UTF-8.
  • design/spec-format.md, under The canonical forms. A spec has one canonical TOML text and one canonical JSON form, both deterministic functions of the parsed Spec.
  • design/spec-format.md, under Canonical TOML. The canonical TOML writer fixes table and key order, keeps no comments and writes floats so they read back exactly.
  • design/spec-format.md, under Canonical JSON. The canonical JSON form has sorted keys and compact UTF-8, and the JSON Schema caliper-spec-v0.schema.json (draft 2020-12) describes its structure.
  • design/spec-format.md, under Versioning. caliper_spec is the format version; a new key, primitive, option, colormap or transform makes a new version, an unknown version is refused with spec.unsupported_version, and later readers migrate older documents in their JSON form.
  • design/spec-format.md, under Limits. Every size of a spec is bounded with its own error code: 512 KiB text, 64 sources, 64 panels, 16 transforms, 8 layout levels and so on.
  • design/spec-format.md, under Recorded limits of version 0. The canonical writer keeps no comments, so description carries prose.
  • design/spec-format.md, under Recorded limits of version 0. A split of more than two children shares its space equally, with no uneven ratios.
  • design/spec-format.md, under The library. The library's four headers: spec.h value types, format.h parse and write, validate.h with SourceResolver and check_toml, and patch.h with RFC 7386 merge patches.
  • design/spec-format.md, under Tests. The builder_spec tests: fixtures, round trips, every error code, hostile input, merge patches and the JSON Schema checked with a test-only checker.
  • design/spec-format.md, under Decisions. Recorded design decisions of the spec format: separate id sets, no x in bind, strict parsing, safe integers, 512 KiB limit, no id change by a patch and others.
  • design/spec-format.md, under Defects in the contracts. Four fixes to the sprint 3 contracts: no x table in bind, ratio only with two children, applet.save maps _ to -, and abi_epoch not required for a spec applet.
  • Builder Pane, Primitives. The seven primitives Series, Heatmap, Points, Histogram, Table, Image and Text.
  • Builder Pane, Spec Text. The spec text strip shows and edits the canonical TOML of the open spec.
  • Manifest, Spec Applets. A spec applet is a folder with a manifest of kind spec and a spec, found in the search folders one folder down.
  • Pull request #17. Pull request 17 (merged) delivers sprint 3: the builder libraries, spec format, loaders, catalog, command layer and session, caliper-mcp, the side chat, the widget agent, command endpoints of Caliper API, the spec runtime and applets, the builder pane, drag and drop, approval cards and the first slice of the browser spec page.
  • Orchestrators' notes, sprint3-integration/PR.md. Libraries under src/builder: the spec format, validator and schema, loaders, the catalog, the command layer and the session.

Roadmap Graph Feature in Graph