test_track_o_harness.py
python
sha256:0e9549ec7b463911bc08b7d586dc320b1ac9b1f5c943ee7e3865dcc6cb0f6f83
chore(governance): sync handover+roadmap to 84db8c8 (drift:…
Human
1 day ago
| 1 | """Integration tests — Track O harness on fixture contract docs (§O0.8 integration).""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | from tools.track_o.validate import MINIMAL_VALID_CONTRACT, validate_contract_fixture |
| 6 | |
| 7 | |
| 8 | def test_valid_fixture_ok() -> None: |
| 9 | result = validate_contract_fixture(MINIMAL_VALID_CONTRACT) |
| 10 | assert result.ok, result.errors |
| 11 | |
| 12 | |
| 13 | def test_missing_stage3_heading_fails_closed() -> None: |
| 14 | bad = MINIMAL_VALID_CONTRACT.replace( |
| 15 | "### Stage 3 — Optional GitHub backup", |
| 16 | "### Stage Three — Backup later", |
| 17 | ) |
| 18 | result = validate_contract_fixture(bad) |
| 19 | assert not result.ok |
| 20 | assert any("missing_stage" in e for e in result.errors) |
| 21 | |
| 22 | |
| 23 | def test_missing_stage4_heading_fails_closed() -> None: |
| 24 | bad = MINIMAL_VALID_CONTRACT.replace( |
| 25 | "### Stage 4 — Optional Knowtation bind", |
| 26 | "### Optional vault", |
| 27 | ) |
| 28 | result = validate_contract_fixture(bad) |
| 29 | assert not result.ok |
| 30 | assert any("missing_stage" in e for e in result.errors) |
| 31 | |
| 32 | |
| 33 | def test_mutated_boundary_missing_kit_owns_fails_closed() -> None: |
| 34 | bad = MINIMAL_VALID_CONTRACT.replace( |
| 35 | "`ok init` / regimes / adapters | **Owns**", |
| 36 | "regimes | Consumes", |
| 37 | ) |
| 38 | result = validate_contract_fixture(bad) |
| 39 | assert not result.ok |
| 40 | assert any("missing_boundary" in e for e in result.errors) |
| 41 | |
| 42 | |
| 43 | def test_stage3_one_click_shipped_claim_fails_closed() -> None: |
| 44 | bad = ( |
| 45 | MINIMAL_VALID_CONTRACT |
| 46 | + "\n\nStage 3 one-click backup is shipped and available without O2.\n" |
| 47 | ) |
| 48 | result = validate_contract_fixture(bad) |
| 49 | assert not result.ok |
| 50 | assert any("one_click_shipped" in e for e in result.errors) |
File History
1 commit
sha256:6abcf1fa82a7a621ccbc945f19acdba5bc0db54569599404a1452fb4a096a199
fix(ISR): default require_independent_second_reviewer to require
Human
minor
⚠
1 day ago