Skip to main content
Every Hatchmark command that checks files reports problems as diagnostics in one format. People read the human form in a terminal; agents and tools read the JSON form, which is a versioned contract described here.

Human form

The layout may change between releases. Do not parse it; use the JSON form.

Default notes (HM4040)

Some choices differ between companies, such as where a week starts or whether a time series starts at the start of the bucket that holds the range start. Each one has a documented default and an option that changes it. When a project relies on such a default, check reports an HM4040 note per definition, naming the default and the option. The human form folds them into one line per file:
hatchmark check --explain-defaults prints every note in full. The JSON form always lists every note. Notes don’t change ok, the counts or the exit code, --strict included, and check leaves them out while the project has errors. Setting an option explicitly, even to its default value, silences its note. The edges note names the first bucket’s start and the range start when the page’s first period is fixed (a date as asOf), using the period filter’s and grain filter’s defaults when the dashboard has them. A date outside the as-of year includes its year.

JSON form, format_version “1”

A report is one line of JSON on stdout:
Each diagnostic: Code ranges: HM1xxx files and YAML syntax, HM2xxx references between files and to data, HM3xxx spec shape, HM4xxx data rules, HM5xxx design rules, HM9xxx internal errors.

Fixes

A fix is {"range", "text", "applicability", "description"}: replace the source range with text, verbatim. An empty range inserts text at that point. The range follows the same rules as a diagnostic’s range, except that it may be empty. applicability is "safe" when applying the fix cannot change what the file means beyond the repair itself (fixing letter case, quoting a value YAML reads as a number, adding a documented default). "unsafe" fixes are likely but must be read first; for example, replacing a misspelled metric name with the closest existing one could pick the wrong metric. hatchmark check --fix applies only safe fixes.

Diagnostics describe the checked text

Every range, frame and fix range refers to the exact text that was checked, and is never updated afterwards. After applying one fix, the other ranges may no longer match the file: apply fixes from the end of the file backwards, or run check again for fresh diagnostics after each edit.

Chart width

Line, area and bar charts need at least 3 of the 12 grid columns for their axis labels, readout and plot. A smaller span is a warning, HM2024: the chart is drawn 3 columns wide anyway, and the grid row reflows around it. The safe fix sets span: 3. check and build both report it. A table with overflow: page grows with its rows. In a grid row shared with other blocks, that stretches the other cards to the table’s height, so it is a warning, HM2026. Remove overflow (a table in a shared row scrolls inside its card by default), or give the table span: 12.

Card height

height takes a preset name: compact, default or tall. A pixel value such as 320 or "320px" is HM3004 with a help line that lists each preset’s chart height, and an unsafe fix to the nearest one. Any other string is HM3004 that lists the presets, with a fix when one is close (tal to tall). text and bar_list blocks are as tall as their content: height on them is HM3002, and the safe fix removes it. A table with overflow: page grows with its rows, so height on it has no effect: warning HM2031, and the safe fix removes height. Cards side by side end level. On wide screens, charts in one grid row are drawn at the tallest preset among them, and the KPIs of one strip at the tallest among the strip’s KPIs. A card set lower is a warning, HM2028, labelled with the height it is drawn at. Below 1024 px cards stack, and every card, each KPI included, keeps its own preset. The fix sets the card to the height it is drawn at; it is unsafe because it also changes how the card looks on phones.

YAML syntax

Spec files are YAML 1.2, read with the core schema, one document per file, with the .yaml extension. Only the first syntax error in a file is reported (HM1002), at the line and column where the parser stopped. The core schema has no implicit surprises: yes, no, on and off are strings, and so are dates such as 2026-01-01. Unquoted 2026, 1.5, true and null are a number, a boolean and null; where the spec expects a string, HM3003 says so and its safe fix quotes the value as written ("0012", not "12"). A few YAML features are errors so that every tool reads a file the same way: duplicate keys (HM1003), and anchors, aliases, merge keys (<<), tags other than the core ones, a core tag that does not fit its value, keys that are not strings, a %YAML directive other than 1.2 and a second document after --- (HM1006). A number must be written as JSON writes it: 0123, +1, 0x10, .5 and .inf are HM1006, and the safe fix quotes them as written. SQL must be a literal block (sql: |): a folded or multi-line plain value joins its lines with spaces, so a -- comment would hide the lines after it. A .json or .yml file where a spec file belongs is not read; HM1007 names the .yaml file Hatchmark expects. A # after a space or tab starts a comment, so value: Store #12 reads as Store. A filter value, a select default or a one-line sql followed by a comment on the same line is a warning (HM1008); quote the value to keep the #, or write SQL as a literal block.