Skip to main content

checks.check_decisions

checks.check_decisions(spec, today=None)

Check every provenance record: evidence resolves, review dates, orphans.

Evidence prefixes: file: must exist in the repository, commit: must be a commit of the repository, KB: and url: entries are recorded and never resolved.

Parameters

Name Type Description Default
spec RegenSpec The loaded spec. required
today date | None Reference date for review deadlines. Defaults to today. None

Returns

Name Type Description
list[Finding] list[Finding]: PROV02 errors for decisions the architecture cites and that do not exist, PROV03 to PROV05 errors for evidence that does not resolve (a missing file, a commit that is not in the repository, an unknown prefix), PROV06 warnings for active records past review_after and COMPACT06 warnings for active records neither a unit nor the architecture cites.

Examples

from datetime import date
from pathlib import Path
from tempfile import TemporaryDirectory

from babregen import check_decisions, load_spec, make_sample_repo

with TemporaryDirectory() as tmp:
    spec = load_spec(make_sample_repo(Path(tmp) / "demo"))
    print(check_decisions(spec, today=date(2026, 10, 1)))
    for finding in check_decisions(spec, today=date(2100, 1, 1)):
        print(finding.format())
[]
regen/decisions/why-add.toml:9: warning PROV06 review was due 2099-01-01: do the assumptions still hold? ['integers only']