Checks and the spec
A check is one thing Zyonix tests every document for: a required field, a value range, an
error message your application writes. Zyonix runs its automatic checks on every document; the
reliability spec (a YAML file describing your output format and rules) adds checks of values.
Your own checks, added with zyonix checks add, become rules in a new spec version.
Checks and the spec apply to new documents. Documents already processed are re-checked only
when an administrator runs zyonix spec redetect.
zyonix checks list
Everything Zyonix checks each document for, with what each check found in the last 14 days.
zyonix checks on its own is the same command.
zyonix checks
zyonix checks list --json
Who may run it: any reader.
How to read it: the spec version and schema, then these sections, each with FAILED (documents
it failed), TO REVIEW (questions waiting for a person), PROBLEMS (open problem numbers) and
COUNTS (how it counts: as Zyonix decides, a person reviews it, or off):
- Your checks: the ones added with
zyonix checks add, with theirID. - Checks your agent reports: what your code reports with
zyonix.check(...)/zyonix.flag(...). - Checked automatically: Zyonix's built-in checks.
- From your spec: the spec's rules, and check families (shown with
*). - Fields a check can read: every output field and its type. Use these names in
--field. - Causes: the root-cause labels you can give a check with
--cause.
Without an active spec, value checks are not available; error-text checks and automatic checks still work.
zyonix checks test
What a check would have found on past documents. Nothing is stored or changed.
zyonix checks test --title "Invoice number missing" --field invoice_no --kind filled
zyonix checks test --title "Total too large" --field total --kind at_most --value 500000
It takes exactly the same options as zyonix checks add (below).
Who may run it: administrator.
Output: It watches: <the rule in words>, then N of M past documents would have failed it; K did not have the value., and example run ids with their document names.
zyonix checks add
Watch every new document for this. The check is added to a new spec version and applies from the next document on.
zyonix checks add --title "Invoice number missing" --field invoice_no --kind filled --severity high
zyonix checks add --title "Total too large" --field total --kind at_most --value 500000 --review
zyonix checks add --title "Tax above total" --field tax_amount --kind at_most_field --other total
zyonix checks add --title "Currency not supported" --field currency --kind one_of --value "EUR,USD,INR"
zyonix checks add --title "Every line has an amount" --field "items[].amount" --kind filled
zyonix checks add --title "Totals add up" --kind expression --expression "abs(subtotal + tax_amount - total) <= 1"
zyonix checks add --title "Provider quota" --kind error_text --value "quota exceeded" --cause INFRA_PROVIDER
zyonix checks add --title "GST number format" --field gstin --kind length --value 15 \
--when-field country --when-value IN --fix "Ask the model to copy the GSTIN exactly"
| Option | What it does |
|---|---|
--title TEXT | what to call this problem (required) |
--kind KIND | the condition (required; see the table below) |
--field FIELD | the output field to check (from Fields a check can read). items[].amount checks every item of a list |
--value VALUE | the value to compare with, or the error text |
--other FIELD | the second field, for the *_field kinds (top-level fields only) |
--expression RULE | a rule in the spec's rule language, for --kind expression |
--when-field FIELD | check only documents where this field ... |
--when-value VALUE | ... has this value (left empty: is filled in) |
--severity | low, medium (default) or high |
--review | ask a person to review it instead of failing the document |
--cause LABEL | the root cause to report (a label from Causes in zyonix checks) |
--fix TEXT | what someone should do when this happens |
--kind | The field ... | --value |
|---|---|---|
filled | must be filled in | none |
at_least | must be at least the value (numbers and dates) | a number, or a date as YYYY-MM-DD |
at_most | must be at most the value (numbers and dates) | a number, or a date as YYYY-MM-DD |
equals | must be the value | the value |
not_equals | must not be the value | the value |
one_of | must be one of the values | values separated by commas |
contains | must contain the text (text fields) | the text |
not_contains | must not contain the text (text fields) | the text |
starts_with | must start with the text (text fields) | the text |
length | must be exactly this many characters long (text fields) | a whole number |
at_most_field | must not be more than --other | none |
at_least_field | must not be less than --other | none |
same_as_field | must be the same as --other | none |
expression | (no field) the rule in --expression must hold | none |
error_text | (no field) your application wrote an error containing this text | the error text |
contains, not_contains and starts_with ignore case. A value check needs an active spec; an error_text check also works
without one.
Who may run it: administrator.
Output: Check <id> added (spec version N): <the rule in words> and It applies to new documents.
Run zyonix checks test with the same options first: it shows what the check would have caught
without changing anything.
zyonix checks remove
Stop checking for one of your checks. This makes a new spec version without it.
zyonix checks remove custom_invoice_number_missing
| Option | What it does |
|---|---|
ID | the check id from Your checks in zyonix checks |
Who may run it: administrator.
zyonix checks mode
How a check counts on new documents: as Zyonix decides, a person reviews what it finds, or off. This works for any check, including the automatic ones and the ones your code reports.
zyonix checks mode check:saved review
zyonix checks mode exec:llm_error off
zyonix checks mode grounding: review
zyonix checks mode grounding: default
| Option | What it does |
|---|---|
CHECK | a check key (for example check:saved, exec:llm_error, a rule id), or a whole family ending in : (for example grounding:) |
MODE | default (as Zyonix decides), review (what it finds goes to the review queue instead of the problem list) or off (ignored) |
Who may run it: administrator.
Output: check:saved: a person reviews it. It applies to new documents.
Use review for a check that is right most of the time but not always, and off for a check that
does not fit your documents.
zyonix spec show
The active spec: its version and hash, then the YAML. zyonix spec on its own is the same
command.
zyonix spec
zyonix spec show > reliability_spec.yaml
Who may run it: any reader.
zyonix spec versions
Every spec version: VERSION, ACTIVE, ACTIVATED (when), BY (who) and HASH.
zyonix spec versions
Who may run it: any reader.
zyonix spec push
Validate a spec file and make it the active version. It applies to new runs.
zyonix spec push reliability_spec.yaml
| Option | What it does |
|---|---|
FILE | the spec YAML file |
Who may run it: administrator.
Output: spec version N is active; it applies to new runs, then a pointer to
zyonix spec redetect. An invalid file is refused with the reason and nothing changes.
zyonix spec push replaces the whole spec, including checks added with zyonix checks add. Start
from zyonix spec show so you keep them.
zyonix spec redetect
Re-run detection with the active spec on documents that were checked under another version.
zyonix spec redetect
zyonix spec redetect --all
| Option | What it does |
|---|---|
--all | every complete run, not only runs detected under another version |
Who may run it: administrator.
Output: N run(s) queued for re-detection. The work runs in the background; watch it with
zyonix jobs and the results with zyonix status. Only documents still within the retention
period have content to re-check.