Graders reference
Reach for this page when you choose a grader, since the grader sets whether an eval needs a provider and what it costs to run.
A grader decides pass or fail for one eval on one page. Verified against src/docevals/graders/registry.ts
and each adapter.
Graders sit in a preference order. Code first, judge second, human last. Cheapest and most explicable wins; see How manni docevals works.
| Kind | Runs | Needs a provider |
|---|---|---|
command | Any CLI check you supply | No |
tool:regex | A pattern match over the page | No |
ai | The judge | Yes |
human | A person | No |
Those four are the registered graders. An eval that names any other grader stops the command before anything runs, with exit 2:
manni: <path>: eval "<name>" names grader "<grader>", which is not registered. Registered graders: ai, command, human, tool:regex.<path> is the file that declared the eval: the config for a config eval, the page for an inline one.
Checks that other domains own run there. Frontmatter against a schema is
manni meta validate, and page structure is manni lint. Any
other CLI check runs as a command eval.
Deterministic evals fail only on error-severity findings. Warnings and notices report and pass.
command
Section titled “command”Runs any executable. {file} in an argument expands to the page’s absolute path, and the command
also receives that path in the MANNI_DOCEVALS_FILE environment variable. The exit code decides the
verdict. Any code outside success-exit-codes fails the eval. The finding message says what
happened and what to do:
| Case | Message |
|---|---|
Exit code outside success-exit-codes | Exit code N. Edit the page until the command passes, or fix the command if it is broken. Output: <tail> |
| Killed by a signal | Killed before exiting. Edit the page until the command passes, or fix the command if it is broken. Output: <tail> |
| Timed out | Command timed out after <ms>ms. Fix the command, or raise the eval's timeout-ms if the check is slow by design. |
| Failed to start | Failed to run command "<cmd>": <error>. Fix the eval's command. |
| No command | No command to run, because the script is not generated. Run manni docevals generate, or manni docevals run with a provider configured. |
Output: and the tail are left out when the command printed nothing. The last three are the
diagnostic findings described below.
| Option | Default | Notes |
|---|---|---|
command (eval field) | none | The argv array. |
success-exit-codes (eval field) | [0] | Exit codes that count as a pass. |
timeout-ms (eval field) | scripts.timeoutMs (30000) |
A command declared in page frontmatter runs from the page’s directory. A command declared in the
config runs from the config file’s directory. A page-declared command runs under the
frontmatter-commands execution grant. A run holds it
unless execution.allow leaves it out or --no-execution is given. Without it the eval is skipped.
A command eval with an assertion and no command is a plain-language deterministic check, and
manni docevals generates the script. See Deterministic checks.
A command finding marked diagnostic fails the eval at any severity. The grader emits one
when it could not reach a verdict. The eval has no command yet, the command failed to start, or it
timed out. There is nothing to be lenient about. The finding still displays at the eval’s
configured severity.
tool:regex
Section titled “tool:regex”A pattern must appear in whatever target selects. It can
instead be required not to appear, or to appear exactly n times. The cheapest grader that can
express an assertion is the one to reach for; this is the rung below the AI judge.
| Option | Default | Notes |
|---|---|---|
pattern | none | Required. A JavaScript regular expression. |
flags | "" | JS RegExp flags (d g i m s u v y). |
match | contains | contains, not-contains, or count:N for exactly n matches. |
Any other option key is a configuration error.
- id: names-the-package assertion: The install command names the current package. grader: tool:regex options: pattern: "npm i -D @hawkeyexl/manni"| Rule id | Meaning | Message |
|---|---|---|
regex/not-found | match: contains, and the pattern does not appear. | Pattern /P/F not found in body. Add the text the eval asks for. |
regex/found | match: not-contains, and the pattern appears. Carries the first match’s line. | Pattern /P/F found in body, expected absent. Remove or reword the matching text. |
regex/count | match: count:N, and the pattern matched some other number of times. | Pattern /P/F matched 3 time(s) in body, expected 1. Edit the page so it matches 1 time(s). |
regex/unreadable-target | The target the eval names could not be read for this page. | target file "x" could not be read (ENOENT). The eval's target is wrong. Fix the eval, or tell its owner. |
/P/F is the pattern and its flags. body names the
target, and reads raw, frontmatter or
file <path> for the other targets.
A pattern that does not compile is a configuration error, not a page failure. Blaming the page for the eval’s own bug is how a corpus learns to ignore its findings.
The judge. Needs assertion, and works far better with evidence and examples. See
Write good assertions. Outcome is pass, fail, or
needs-review; the mechanics are in How judging works.
| Option | Default | Notes |
|---|---|---|
readers | absent: no readers | personas is the one value. Where the page’s personas: names a persona record, the judge reads the page as those readers. See Judge a page as its readers. |
Where persona records exist, any other readers value is an error, exit 1:
Eval "fix-and-rerun": ai options.readers must be one of: personas. Where none exist, the option
does nothing. No other key under an ai eval’s options is read, and none is checked.
Routes to a person. Verdicts persist in .manni/docevals/reviews.yaml and self-invalidate when the page
changes. See Human review.