Schema Reference
Every field in mview.json, with valid and invalid examples.
Schema Reference
Every mview.json manifest must validate against:
https://schemas.carmenlabs.com/mview/v1/schema.jsonField table
| Field | Type | Required | Description |
|---|---|---|---|
$schema | string (const) | yes | Must be exactly https://schemas.carmenlabs.com/mview/v1/schema.json. |
id | string | yes | Unique identifier. Pattern: ^[a-z0-9][a-z0-9._-]*$. |
name | string | yes | Human-readable display name. |
description | string | no | Human-readable summary of what the view shows. |
version | string | yes | Semantic version of the MView itself: MAJOR.MINOR.PATCH. |
prompt | string | yes | Prompt used to generate this mutation. |
runtime | object | yes | Rendering runtime required by the MView. |
runtime.environment | string | yes | Execution environment. V1 allows "web", "desktop", "terminal", or "other". |
runtime.renderer | string | yes | Required renderer/adapter. This is an open implementation-defined identifier, for example "html", "html+js", "react", "solid", or "pdf". |
runtime.version | string | no | Compatible semver range for the renderer, for example "^19.0.0". |
author | string | no | Author name or identifier. |
license | string | no | SPDX license identifier. |
icon | string | no | Relative path to an icon asset. |
accepts | string[] | no | Capabilities this MView needs from the runtime. See Capabilities. |
source | object | no | The source file or directory this MView is derived from. |
source.kind | "file" | "directory" | no | Source type. Defaults to "file" when omitted. |
source.path | string | yes, if source present | Relative path to the source file or directory. |
source.adapters | string[] | no | Source Adapter identifiers, in preference order, used to transform the original file. |
source.files | object[] | yes, if source.kind is "directory" | Non-empty selection of files within the source directory. Files are not discovered implicitly. |
source.files[].path | string | yes | File path relative to source.path. Must be unique within the selection. |
source.files[].accepts | string[] | yes | Capabilities the runtime must try when normalizing this file, in order. |
source.files[].adapters | string[] | no | Source Adapter identifiers, in preference order, used for this original file. |
source.files[].contentHash | string | no | SHA-256 hash of the file bytes. |
source.contentHash | string | no | Hash of the source file or, for a directory, aggregate hash of the selection and its contents. |
entry | object | yes | Executable entry points. |
entry.parser | string | yes | Relative path to the parser module. |
entry.component | string | yes | Relative path to the view component. |
resources | object | no | Location of static assets. |
resources.path | string | no | Relative path to the resources directory. Default ./resources. |
settings | object | no | Default settings exposed to parser and component. |
metadata | object | no | Free-form implementation metadata. Must not drive runtime behavior. |
additionalProperties: false applies at every level — manifests with unknown fields are invalid.
id
Lowercase letters, digits, dots, underscores, and hyphens only.
Valid: sales-dashboard, invoice.tax-view, logs_timeline
Invalid: Sales Dashboard, dashboard final, ventas/2026
prompt
The manifest must preserve the original prompt used to generate the mutation. This lets the user see how the view was created and provides an editable starting point if the source changes and the mutation is no longer compatible.
"prompt": "Create an executive view for monthly sales, top clients, and totals."The prompt is re-executable provenance, not runtime configuration: it must not replace settings for values that directly affect rendering.
runtime
V1 defines multiple execution environments ("web", "desktop", "terminal", "other") with an explicit renderer. runtime.renderer is not a closed list of renderers supported by the specification: it is the identifier for the rendering path the manifest requires.
Recommended renderers for web
For environment: "web", we recommend this priority order:
"html"— Pure HTML (+ inline CSS/JS or<style>/<script>tags). Simplest option, zero dependencies, works in any browser."html+js"— HTML with separate JavaScript files for interactivity."react"— For complex UIs that justify a framework."solid"— Alternative to React with fine-grained reactivity.
Example with HTML (recommended for simple views):
"runtime": {
"environment": "web",
"renderer": "html"
}This is the lightest option. The parser can be a simple .js file, and the component is a plain .html file. No build step, no transpilation, no framework overhead.
Example with React (for complex interactive views):
"runtime": {
"environment": "web",
"renderer": "react",
"version": "^19.0.0"
}Example with Solid:
"runtime": {
"environment": "web",
"renderer": "solid",
"version": "^1.9.0"
}runtime.version is optional and is interpreted as a compatible semver range for the renderer,
not as an exact version. The specification does not require any runtime to implement a specific
renderer; each implementation must document which runtime.renderer values it accepts and how to
execute or produce that kind of view. Implementations must reject manifests whose environment,
renderer, or version range they don't support, rather than guessing.
accepts
Declares what kind of normalized input the parser expects — a capability, not a file extension. Full list and normalizer shapes: Capabilities.
accepts describes the normalized output expected by the parser; it does not by itself select the
code that reads the source. Use source.adapters or source.files[].adapters for that.
source
Optional pointer to the file or file selection this MView was derived from.
File source
source.kind is optional and defaults to "file". Therefore, the following two manifests have the same meaning:
"source": {
"path": "../sales.csv",
"adapters": ["csv-table"],
"contentHash": "sha256:8d969eef6ecad3c29a3a629280e686cff8ca58e3f3f2d4d0c7d7f9f2e2f0f4ab"
}"source": {
"kind": "file",
"path": "../sales.csv",
"adapters": ["csv-table"],
"contentHash": "sha256:8d969eef6ecad3c29a3a629280e686cff8ca58e3f3f2d4d0c7d7f9f2e2f0f4ab"
}path is always relative to the MView directory. contentHash lets a runtime detect drift between the file and the last time the MView was created or validated, and prompt for regeneration. files MUST NOT appear in a file source.
Directory source
A directory source must declare kind: "directory" and explicitly enumerate the files that form the input:
"accepts": ["filesystem"],
"source": {
"kind": "directory",
"path": "../reports",
"files": [
{
"path": "january.csv",
"accepts": ["table"],
"adapters": ["csv-table"],
"contentHash": "sha256:111..."
},
{
"path": "notes/summary.md",
"accepts": ["markdown", "document"],
"adapters": ["markdown-document"],
"contentHash": "sha256:222..."
}
],
"contentHash": "sha256:333..."
}files must contain at least one item. Its paths are relative to source.path, use / as the separator, and must be unique. They cannot be absolute, empty, contain . or .. segments, or resolve outside the directory through symbolic links. The runtime reads only the enumerated files: there is no recursive traversal or implicit inclusion of new files.
Each files[].accepts must contain at least one capability, without duplicates, and declares in preference order the capabilities the runtime will try when normalizing that file. The MView's accepts must include "filesystem", because the parser receives the full normalized collection rather than each file as a separate execution.
Canonical directory hash
Each files[].contentHash, when present, is sha256: followed by the SHA-256 of the original file bytes before normalization. source.contentHash, when present on a directory source, is calculated as follows:
- For each file, construct an object containing its normalized
pathand actualcontentHash. - Sort the objects lexicographically by the UTF-8 bytes of
path. Comparison is case-sensitive. - Serialize the array with JSON Canonicalization Scheme (RFC 8785).
- Calculate SHA-256 over the UTF-8 bytes of that serialization and prepend
sha256:.
The logical representation before hashing is:
[
{ "path": "january.csv", "contentHash": "sha256:111..." },
{ "path": "notes/summary.md", "contentHash": "sha256:222..." }
]The aggregate hash changes when the content, path, or membership of the selection changes, but not when only the order of source.files in the manifest changes.
entry
"entry": {
"parser": "./parser.js",
"component": "./view.html"
}Both paths are relative to the MView's own directory, never absolute. For HTML-based views, the parser is typically a simple .js file and the component is a .html file whose script reads the props from the window.mview global injected by the runtime. For framework-based views (React, Solid), you would use .tsx or .jsx files that receive the props as their argument.
The parser and component contracts are specified separately: Parser Contract, Component Contract.
settings
Initial, editable configuration surfaced to the parser and/or component.
"settings": {
"currency": "USD",
"showTopClients": true,
"maxRows": 10
}Unlike metadata, settings is allowed to affect rendering.
metadata
Free-form provenance information — who/what generated the MView, when, with which model.
"metadata": {
"createdBy": "llm",
"model": "gpt-5.5",
"createdAt": "2026-07-11T05:00:00Z"
}metadata must never gate or change runtime behavior. If a value needs to affect rendering, it
belongs in settings.
Full example (HTML)
{
"$schema": "https://schemas.carmenlabs.com/mview/v1/schema.json",
"id": "sales-summary",
"name": "Sales Summary",
"description": "Simple sales summary from sales.csv.",
"version": "1.0.0",
"prompt": "Show total sales and top 3 clients in a simple view.",
"runtime": {
"environment": "web",
"renderer": "html"
},
"author": "Victor Avila",
"license": "MIT",
"accepts": ["table"],
"source": {
"path": "../sales.csv",
"adapters": ["csv-table"],
"contentHash": "sha256:8d969eef6ecad3c29a3a629280e686cff8ca58e3f3f2d4d0c7d7f9f2e2f0f4ab"
},
"entry": {
"parser": "./parser.js",
"component": "./view.html"
},
"settings": {
"currency": "USD",
"topClientsLimit": 3
},
"metadata": {
"createdBy": "llm",
"model": "gpt-5.5",
"createdAt": "2026-07-16T21:26:00Z"
}
}Full example (React)
For more complex interactive dashboards:
{
"$schema": "https://schemas.carmenlabs.com/mview/v1/schema.json",
"id": "sales-dashboard",
"name": "Sales Dashboard",
"description": "Interactive dashboard with charts and filters.",
"version": "1.0.0",
"prompt": "Create an interactive dashboard from sales.csv with charts, filters, and drill-down.",
"runtime": {
"environment": "web",
"renderer": "react",
"version": "^19.0.0"
},
"author": "Victor Avila",
"license": "MIT",
"icon": "./resources/icon.svg",
"accepts": ["table"],
"source": {
"path": "../sales.csv",
"contentHash": "sha256:8d969eef6ecad3c29a3a629280e686cff8ca58e3f3f2d4d0c7d7f9f2e2f0f4ab"
},
"entry": {
"parser": "./parser.ts",
"component": "./Dashboard.tsx"
},
"resources": {
"path": "./resources"
},
"settings": {
"currency": "USD",
"topClientsLimit": 10
},
"metadata": {
"createdBy": "llm",
"model": "gpt-5.5",
"createdAt": "2026-07-16T21:26:00Z"
}
}Raw schema
The canonical machine-readable schema is served at
schemas.carmenlabs.com/mview/v1/schema.json.
Validate manifests against that URL directly — do not hardcode a copy where it can drift.
