Functions | |
| dict | load_registry () |
| Load the invariant-contract registry. | |
| list[str] | validate_records (list contracts, dict registry) |
| Verify each contract record is complete, uses the closed vocabularies, and points at things that exist. | |
| tuple | run_checkers (list contracts) |
| Execute each enforced contract's checker, honouring declared prerequisites. | |
| int | main () |
| Verify enforced invariant contracts and report the tracked ones. | |
Variables | |
| REPO_ROOT = Path(__file__).resolve().parents[2] | |
| str | REGISTRY_PATH = REPO_ROOT / "tests" / "tooling" / "contract_registry.json" |
| str | PAGES_DIR = REPO_ROOT / "docs" / "pages" |
Run the invariant-contract registry: verify enforced contracts and report tracked ones.
| dict audit_contracts.load_registry | ( | ) |
Load the invariant-contract registry.
Definition at line 18 of file audit_contracts.py.
Verify each contract record is complete, uses the closed vocabularies, and points at things that exist.
This fails closed on purpose. A misspelled status such as "enfroced" previously dropped a contract out of enforcement and out of every report, so the registry silently shrank while still looking healthy.
| [in] | contracts | Contract records. |
| [in] | registry | Full registry, carrying the vocabularies and required fields. |
Definition at line 26 of file audit_contracts.py.
| tuple audit_contracts.run_checkers | ( | list | contracts | ) |
Execute each enforced contract's checker, honouring declared prerequisites.
A checker that reads the generated HTML cannot run on a clean checkout. Skipping it with an explicit note is honest; running it and passing because a stale build happens to exist is not.
| [in] | contracts | Contract records. |
Definition at line 90 of file audit_contracts.py.
| int audit_contracts.main | ( | ) |
Verify enforced invariant contracts and report the tracked ones.
Definition at line 123 of file audit_contracts.py.
| audit_contracts.REPO_ROOT = Path(__file__).resolve().parents[2] |
Definition at line 13 of file audit_contracts.py.
| str audit_contracts.REGISTRY_PATH = REPO_ROOT / "tests" / "tooling" / "contract_registry.json" |
Definition at line 14 of file audit_contracts.py.
| str audit_contracts.PAGES_DIR = REPO_ROOT / "docs" / "pages" |
Definition at line 15 of file audit_contracts.py.