Loading evidence…
Governance & defences · Executable mechanisms
What happens when a governance rule becomes a software constraint? Trace an attempted breach through the actual Python that rejects it, then inspect the test that verifies the behaviour, and understand where each guarantee stops.
01 Governance requirement → 02 Deterministic enforcement → 03 Tested consequence
EIGHT TECHNICAL MECHANISMS. The Test view shows pytest source; it does not execute Python in the browser.
What must never be allowed?
Where does the code reject it?
What can be observed when it is attempted?
Input integrity
Only declared, validated supplier data may enter the workflow.
Technical mechanism: Pydantic frozen schemas, strict versions, bounded identifiers and extra='forbid'.
Attempt / input
A submission includes approval_override=true, an unexpected field.
Enforcing gate
Submission.model_validate() rejects the unknown field before any invoice checks run.
Observable consequence
The malformed input is rejected, not silently accepted or converted into an approval.
Unmodified, contiguous lines extracted from the reference runner during the static build. Not pseudocode.
class Frozen(BaseModel): model_config = ConfigDict(frozen=True, extra="forbid", str_strip_whitespace=True) class Line(Frozen): service_code: Identifier quantity: Annotated[Decimal, Field(gt=0, allow_inf_nan=False)] unit_rate: Money amount: Money class Submission(Frozen): case_id: Identifier invoice_id: Identifier version: Annotated[int, Field(ge=1, strict=True)] supplier_id: Identifier contract_id: Identifier purchase_order: Identifier currency: Annotated[str, Field(pattern=r"^[A-Z]{3}$")] period_start: date period_end: date invoice_date: date lines: Annotated[tuple[Line, ...], Field(min_length=1)] total: Money documents: tuple[Identifier, ...] = () supplier_note: Annotated[str, Field(max_length=4000)] = ""This is a read-only inspection of the deterministic supplier-review reference. File paths identify private source locations and are not public links. If an excerpt anchor disappears, the site build fails rather than continuing to show a stale code sample. See control obligations and executed control probes for the corresponding assurance argument and failure cases.