test_governance_gates_cycle.py
python
sha256:0e9549ec7b463911bc08b7d586dc320b1ac9b1f5c943ee7e3865dcc6cb0f6f83
chore(governance): sync handover+roadmap to 84db8c8 (drift:…
Human
2 days ago
| 1 | """E2E cycle for governance gate reminders.""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | from pathlib import Path |
| 6 | |
| 7 | from tests.support import FIXTURES, git_status_runner, make_runner, ok, run_cli, write_config |
| 8 | |
| 9 | |
| 10 | def _seed(tmp_path: Path) -> None: |
| 11 | write_config(tmp_path, "config-governance-gates.yaml") |
| 12 | overseer = tmp_path / ".overseer" |
| 13 | (overseer / "version.lock").write_text( |
| 14 | "lock_version: 1\nkit_version: 0.1.0\nconfig_version: 1\n" |
| 15 | "footprint_digest: sha256:0\ninstalled_at: '2026-01-01'\n" |
| 16 | "synced_at: '2026-01-01'\nfootprint: []\n", |
| 17 | encoding="utf-8", |
| 18 | ) |
| 19 | docs = tmp_path / "docs" |
| 20 | docs.mkdir(parents=True) |
| 21 | for name in ( |
| 22 | "governance-gates-roadmap.md", |
| 23 | "governance-gates-handover.md", |
| 24 | "governance-gates-phase-thinking.md", |
| 25 | ): |
| 26 | dest = name.replace("governance-gates-", "").replace("phase-thinking", "PHASE-DEMO-THINKING") |
| 27 | if dest == "roadmap.md": |
| 28 | dest = "ROADMAP.md" |
| 29 | elif dest == "handover.md": |
| 30 | dest = "OVERSEER-HANDOVER.md" |
| 31 | (docs / dest).write_text((FIXTURES / name).read_text(encoding="utf-8"), encoding="utf-8") |
| 32 | |
| 33 | |
| 34 | def test_gate_reminder_cycle_status_then_governance_sync(tmp_path: Path) -> None: |
| 35 | _seed(tmp_path) |
| 36 | status_code = run_cli(["status", "--json"], cwd=tmp_path, runner=git_status_runner(), json_mode=True) |
| 37 | assert status_code == 0 |
| 38 | runner = make_runner( |
| 39 | { |
| 40 | "git rev-parse --abbrev-ref HEAD": ok("main"), |
| 41 | "git status --porcelain": ok(""), |
| 42 | "git rev-parse origin/main": ok("cafebabe"), |
| 43 | "gh pr list --state merged --limit 5 --json number,title,mergeCommit,mergedAt": ok("[]"), |
| 44 | "git remote get-url origin": ok("[email protected]:owner/repo.git"), |
| 45 | } |
| 46 | ) |
| 47 | sync_code = run_cli(["governance-sync"], cwd=tmp_path, runner=runner) |
| 48 | assert sync_code == 0 |
File History
1 commit
sha256:6abcf1fa82a7a621ccbc945f19acdba5bc0db54569599404a1452fb4a096a199
fix(ISR): default require_independent_second_reviewer to require
Human
minor
⚠
2 days ago