Spec validation
Spec validation is the step that checks a dashboard spec against a formal schema before it is saved, so a malformed panel, an unknown property, or an invalid value is rejected with a clear error instead of reaching a viewer.
Validation is what makes a dashboard document trustworthy as code. A text format with no schema is only a convention; a format with a schema is a contract that every author, human or agent, is held to.
How it works in dvt
Every write to a dvt dashboard spec is validated against a published JSON Schema before it saves, whether it comes from the browser editor, the REST API, or the MCP server. Agents can also call the validate tool on a draft at any point. The schema covers structure (required fields, known panel types) and values (for example, a theme preset must be a named, built-in preset, and a font stack must come from an allowed list). Unknown properties in the panel, layout, and theme structure are rejected rather than silently ignored, so a misspelled setting never looks like it worked. Chart options pass through to Apache ECharts, where an advisory lint warns on keys it does not recognize.
A validation error points at the failing field, which gives an agent something concrete to fix before it tries again. Validation runs first in the validate, preview, apply loop, so every change that reaches a live dashboard has already passed the schema.