Skip to main content

Module judge

Module judge 

Source
Expand description

LLM judges written as ordinary graphrt workflows.

{type: judge, workflow: judges/faithfulness.yaml} runs the judge workflow on what the test produced and reads a verdict from its outputs. A judge is versioned by its workflow fingerprint (recorded with every result), runs on any provider (including replay cassettes), and is calibrated like any other workflow: an eval whose target is the judge and whose expected values are human labels (see calibration in the eval file).

Inputs. The judge’s start node receives, by name (only the variables it declares):

InputValue
outputThe value under test (the run output, or the transform path).
varsThe test’s vars (an object).
expectedThe test’s expected value (absent when there is none).
contextsThe text of every chunk the run’s knowledge-retrieval nodes returned, in rank order.
trajectoryThe run’s agent tool calls: [{node_id, name, provider?, tool?, arguments, is_error?}].
anything in inputsExtra inputs from the assertion, e.g. inputs: { question: "{{question}}" }.

Text inputs (paragraph, text-input, string…) get text: strings as is, a list of strings joined by blank lines, anything else as JSON. json, object and array inputs get the value itself.

Outputs. The judge’s outputs (or its single object output, e.g. an llm node’s structured_output) carry verdict: pass | fail | unknown and/or a numeric score in 0..=1, plus an optional reasoning. A verdict decides; a score alone passes at threshold (default 0.5). unknown fails the assertion unless unknown: exclude, which reports it without scoring or gating it.

Structs§

JudgeRecord
What a judge decided, recorded with the assertion result.
Judgement
A verdict and/or score read from a judge’s outputs.

Enums§

UnknownPolicy
What to do with a judge’s unknown verdict.
Verdict
A judge’s binary verdict, with an explicit way out.

Traits§

JudgeLoader
Compiles judge workflows for judge assertions. Called once per distinct workflow file; the result is shared by every test.

Functions§

register
Register the judge assertion type. Judge workflow paths are resolved against base (the eval file’s directory); each judge is compiled once by loader and reused by every test.