Diagnostics
Read the stable code, location, and fix on every compile and fixture finding, and tell errors that block a save from warnings that ride along.
A diagnostic is written for whoever will fix it, person or agent. Every finding carries a stable
code, the exact file:line:column, a one-sentence message, and a fix. Errors block save and
publish. Warnings ride along with the render.
templates/order-shipped.tsx:12:3 error fixture-invalid (fixture "no-tracking")
`items[0].qty` must be a number; got "2".
templates/order-shipped.tsx:33:9 warning button-outlook-fallback
Outlook needs a fixed height and a plain-text label for the button fallback.
Fix: give the Button a height and a string label.The same checker runs in the local editor, samva templates check, the hosted assistant, and the
MCP templates_check_workspace tool, so a finding reads the same everywhere. --json output
carries the code, range, severity, and fix text.
Profile and binding codes
| Code | Meaning and fix |
|---|---|
dynamic-expression | A call other than fmt.* and .map, or another expression the profile cannot read. Compute the value in the caller and send it in the payload. |
statement-in-body | A const, if, or loop in a body. A body is one expression. |
non-project-import | An import other than @samva/markup or a project file. |
hook-call, event-handler, dangerous-html | Hooks, event handlers, and dangerouslySetInnerHTML are not allowed. |
dynamic-class | A class name built at run time. Use literal classes. |
recursive-partial | A partial that renders itself. |
unknown-field | A binding to a field the schema does not declare. The message names the nearest field. |
unguarded-optional | An optional field read outside a && or ?: guard. |
unknown-formatter | A call to a fmt function that does not exist. |
fixture-invalid | A fixture that no longer matches the schema. The message names the fixture and the field. |
invalid-schema, schema-not-static | A schema the compiler cannot read. Write it as a literal jsonSchema<Input>({ ... }) with supported keywords. |
missing-subject, missing-body, missing-fixtures | The definition lacks a required part. |
invalid-template-id, invalid-fixture-name | An id or fixture name that is not a plain path segment. |
preheader-without-shell | A preheader with no <Email> to carry it. |
Markup and styling codes
| Code | Meaning and fix |
|---|---|
unsupported-element, unsupported-attribute | An element or attribute outside the supported HTML. |
button-outlook-fallback | A Button without a height or string label. Warning. |
email-font-fallback | A font stack that names a project font without ending in a generic family. |
css-parse-error, css-unsupported-at-rule, css-import-unresolved | A stylesheet the compiler cannot apply. |
brand-unavailable | The imported brand could not be resolved. Run samva login or samva brands pull. |
caniemail/... | A CSS property a target client ignores, with the affected clients. Warning. |
Compatibility findings carry an assessment so tools can separate a risk in your source from an
observation about a client: risk is a construct with a concrete rendering problem, unverified
is a support difference whose effect on this template is unknown, degradation is an expected
visual difference such as a substituted font, and not-applicable means the emitted values avoid
the limitation. An empty findings list does not prove the email renders correctly in every client;
test the affected fixtures in the listed clients.
Repairing findings
- In the hosted editor, choose Fix with Assistant on a finding group. The assistant receives the findings and the draft revision, inspects the project, edits, and checks its edits against the fixtures. Review the resulting diff and previews before publishing.
- Some findings offer a deterministic repair. Applying it is a source edit that supports Undo and Redo in the local editor.
- From the CLI or MCP, fix the location the finding names and run the check again. See The agent loop.
A template that fails to compile stays visible with its findings and no render. Actual send payloads are validated and rendered before the message is accepted, and fixtures cannot cover every input, so a clean check does not prove every branch.