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.

Attributes:

Name Type Description
verdict str

Description of why the criterion passed or failed.

kind Literal['manual']

Discriminator field, always "manual".

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.

Attributes:

Name Type Description
source str

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

name str

The test or check name within that source.

kind Literal['automated']

Discriminator field, always "automated".