test_governance_gates_integrity.py
python
sha256:0e9549ec7b463911bc08b7d586dc320b1ac9b1f5c943ee7e3865dcc6cb0f6f83
chore(governance): sync handover+roadmap to 84db8c8 (drift:…
Human
1 day ago
| 1 | """Data-integrity tests for governance gate scan idempotency.""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | from pathlib import Path |
| 6 | |
| 7 | from adapters.config import load_config |
| 8 | from tests.support import FIXTURES |
| 9 | from tools.governance_gates import scan_governance_gates |
| 10 | |
| 11 | |
| 12 | def _seed(tmp_path: Path) -> None: |
| 13 | config = load_config(FIXTURES / "config-governance-gates.yaml") |
| 14 | docs = tmp_path / "docs" |
| 15 | docs.mkdir(parents=True) |
| 16 | (docs / "ROADMAP.md").write_text( |
| 17 | (FIXTURES / "governance-gates-roadmap.md").read_text(encoding="utf-8"), |
| 18 | encoding="utf-8", |
| 19 | ) |
| 20 | (docs / "OVERSEER-HANDOVER.md").write_text( |
| 21 | (FIXTURES / "governance-gates-handover.md").read_text(encoding="utf-8"), |
| 22 | encoding="utf-8", |
| 23 | ) |
| 24 | (docs / "PHASE-DEMO-THINKING.md").write_text( |
| 25 | (FIXTURES / "governance-gates-phase-thinking.md").read_text(encoding="utf-8"), |
| 26 | encoding="utf-8", |
| 27 | ) |
| 28 | return config |
| 29 | |
| 30 | |
| 31 | def test_scan_is_deterministic(tmp_path: Path) -> None: |
| 32 | config = _seed(tmp_path) |
| 33 | first = scan_governance_gates(config, tmp_path) |
| 34 | second = scan_governance_gates(config, tmp_path) |
| 35 | assert first.pending == second.pending |
| 36 | assert first.active_phases == second.active_phases |
File History
1 commit
sha256:6abcf1fa82a7a621ccbc945f19acdba5bc0db54569599404a1452fb4a096a199
fix(ISR): default require_independent_second_reviewer to require
Human
minor
⚠
1 day ago