spec.Decision(
id,
title,
date,
status,
driver,
decision,
invariant,
approved_by,
origin,
alternatives,
evidence,
assumes,
review_after,
source,
)
A provenance record: why the system has a particular shape.
Attributes
| id |
str |
File stem in regen/decisions/. |
| title |
str |
One line. |
| date |
date |
When the decision was taken. |
| status |
str |
active, superseded or expired. |
| driver |
str |
What forced the decision (incident, requirement, measurement). |
| decision |
str |
What was decided. |
| invariant |
str |
What the decision protects. |
| approved_by |
str |
Who stands behind it. |
| origin |
str |
human for an asserted rationale, machine for a captured fact. |
| alternatives |
tuple[Alternative, …] |
Rejected options. |
| evidence |
tuple[str, …] |
References, each KB:<entry>, commit:<sha>, file:<path> or url:<url>. |
| assumes |
tuple[str, …] |
Conditions the decision rests on. When one of them changes the record is suspect. |
| review_after |
date | None |
Date after which check reports the record as due for review. |
| source |
Path |
Path of the TOML file. |
Examples
from pathlib import Path
from tempfile import TemporaryDirectory
from spotregen import load_spec, make_sample_repo
with TemporaryDirectory() as tmp:
spec = load_spec(make_sample_repo(Path(tmp) / "demo"))
decision = spec.decisions["why-add"]
print(decision.id, decision.status, decision.date)
why-add active 2026-01-01