Skip to content

Validations

Validation records are immutable (frozen Pydantic models) attached to an AcceptanceCriterion. They come in two forms, distinguished by a kind discriminator field.

ValidationEntry is the type alias used by AcceptanceCriterion.validations:

ValidationEntry = Annotated[
    ManualValidation | AutomatedValidation,
    Field(discriminator="kind"),
]

Both types require a timezone-aware timestamp. Naive datetimes are rejected at instantiation time.

ManualValidation

A human-authored validation record. Use this when a reviewer has manually verified that a criterion is met.

ManualValidation

Bases: AcceptanceCriterionValidation

A human-authored validation record.

Parameters:

Name Type Description Default
verdict

Description of why the criterion passed or failed.

required
kind

Discriminator field, always "manual".

required

AutomatedValidation

A test-linked validation record. Use this when an automated test or check provides the evidence.

When two AutomatedValidation records for the same criterion share the same source and name, the one with the most recent timestamp wins during a merge. See Merging for details.

AutomatedValidation

Bases: AcceptanceCriterionValidation

A test-linked validation record.

When two automated validations share the same source and name for a given criterion, the one with the most recent timestamp prevails on merge.

Parameters:

Name Type Description Default
source

The file, class, or module where the validation procedure lives.

required
name

The test or check name within that source.

required
kind

Discriminator field, always "automated".

required