Overview
What Lattice is
Lattice is a specification, not a running product. The deliverable is:
- A JSON document format for dashboards (
schemas/dashboard.schema.json). - A catalog of typed schemas for item types and connection types
(
schemas/items/,schemas/connections/). - A resolver, shipped as the
latticebinary, that validates a document against the catalog and emits a resolved tree.
A dashboard is a tree of items. The only structurally special item is the
container, which arranges its children on a relative-weight grid. Every
other item type (today: table and the variable widgets such as select) is a
leaf. Items can declare
variables, reference document-scoped connections for their data, and
interpolate variable values into their configuration.
The resolution pipeline
lattice resolve runs a fail-fast, two-pass pipeline. The first error
stops the run and is reported as a coded error (see Error Codes);
errors are never aggregated.
- Pass 1 — structural. The whole document is validated against the
dashboard JSON Schema. A document that is not well-formed JSON, or that
violates the top-level shape, fails here (
RESOLVE_DOCUMENT_INVALID). - Reference linking. Every instance
$refis resolved to an item-type schema in the catalog (SCHEMA_*on failure). - Variable model. The tree-scoped variable environment is built: document
and per-container declarations are layered with inner-shadows-outer
semantics, computed
exprvariables are evaluated, and any runtime overrides are applied. - Pass 2 — per-instance. For each node, in one walk: layer its variable scope, interpolate variable references into its config, validate the interpolated config against its item-type schema, and enforce the container-only-children rule.
- Connections. Each document-scoped connection’s
$refis resolved and its config validated against the connection-type schema;$secretreferences are resolved from the environment for validation and then discarded. Duplicate connection ids fail fast. - Bindings & contracts. Items that declare a
connectionIdare wired to their connection, their query (already interpolated) is lifted onto the node, and the item↔connection result-shape contract is validated.
The output is the resolved tree: the manifest passed through verbatim, the recursively resolved root, and the resolved connections. Its shape is a stable, documented contract — see Document Structure.
The two commands
| Command | Purpose |
|---|---|
lattice resolve <document> | Validate a document and print the resolved-tree JSON to stdout. |
lattice serve <document> | Serve the document over HTTP: an HTML structural sketch plus a JSON resolved-tree endpoint, re-resolved per request with runtime inputs. |
Both are covered in Building & Running.