Skip to main content

Module assertion

Module assertion 

Source
Expand description

Assertions: the Assertion trait, the registry of assertion types and the built-in deterministic types.

An assertion type is a factory turning an AssertionSpec (one assert entry, with {{var}} references already rendered) into an Assertion. Evaluation is asynchronous so types that call models or run workflows (an LLM judge) fit the same interface as the string checks.

Every type can be negated with a not- prefix (not-contains, not-trajectory:tool-used): the pass flag flips and the score becomes 1 - score.

Structs§

AssertionContext
What an assertion sees: the test case and the run it produced.
AssertionRegistry
Assertion types by name.
AssertionResult
The result of one assertion, as reported.
Outcome
The verdict of one assertion.
PreparedAssertion
An assertion ready to evaluate, with its reporting settings.

Traits§

Assertion
A check of one aspect of a run.

Functions§

only_keys
Reject config keys other than allowed (typos would otherwise be ignored).
transform_of
The parsed transform path of a spec.

Type Aliases§

AssertionFactory
Builds an assertion from its spec (the not- prefix already removed).