test_gfg_d2_healthy_bridge.py
python
sha256:0e9549ec7b463911bc08b7d586dc320b1ac9b1f5c943ee7e3865dcc6cb0f6f83
chore(governance): sync handover+roadmap to 84db8c8 (drift:…
Human
9 hours ago
| 1 | """E2E: healthy muse+git-mirror bridge does not plan git-import (§D2F.9 e2e).""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | import json |
| 6 | from pathlib import Path |
| 7 | |
| 8 | from tests.support import ( |
| 9 | FIXTURES, |
| 10 | muse_mirror_status_runner, |
| 11 | ok, |
| 12 | run_cli, |
| 13 | seed_muse_substrate, |
| 14 | ) |
| 15 | |
| 16 | |
| 17 | def test_healthy_bridge_status_ok_without_git_import(tmp_path: Path) -> None: |
| 18 | tip = "sha256:" + ("6" * 64) |
| 19 | git_sha = "1e734a922a8de5dcac248007b8dfb706c4a0f84e" |
| 20 | github_main = "cafebabe00cafebabe00cafebabe00cafebabe00" |
| 21 | assert tip != git_sha |
| 22 | |
| 23 | runner = muse_mirror_status_runner(tmp_path) |
| 24 | root = str(tmp_path.resolve()) |
| 25 | runner.responses.update( |
| 26 | { |
| 27 | f"muse -C {root} rev-parse main": ok(tip), |
| 28 | "git rev-parse origin/main": ok(github_main), |
| 29 | "git rev-parse origin/muse-mirror": ok(git_sha), |
| 30 | "gh pr list --state merged --limit 5 --json number,title,mergeCommit,mergedAt": ok( |
| 31 | json.dumps([]) |
| 32 | ), |
| 33 | } |
| 34 | ) |
| 35 | seed_muse_substrate(tmp_path) |
| 36 | (tmp_path / ".muse" / "git-bridge.toml").write_text( |
| 37 | f"[last_export]\n" |
| 38 | f'muse_commit_id = "{tip}"\n' |
| 39 | f'git_sha = "{git_sha}"\n' |
| 40 | f'[last_import]\ngit_sha = "{git_sha}"\n', |
| 41 | encoding="utf-8", |
| 42 | ) |
| 43 | |
| 44 | assert ( |
| 45 | run_cli( |
| 46 | [ |
| 47 | "init", |
| 48 | "--from-config", |
| 49 | str(FIXTURES / "config-muse-git-mirror.yaml"), |
| 50 | "--non-interactive", |
| 51 | ], |
| 52 | cwd=tmp_path, |
| 53 | runner=runner, |
| 54 | ) |
| 55 | == 0 |
| 56 | ) |
| 57 | |
| 58 | handover = tmp_path / "docs" / "OVERSEER-HANDOVER.md" |
| 59 | handover.parent.mkdir(parents=True, exist_ok=True) |
| 60 | base = handover.read_text(encoding="utf-8") if handover.is_file() else "" |
| 61 | handover.write_text( |
| 62 | base.rstrip() |
| 63 | + f"\n\n| Item | Value |\n| --- | --- |\n| GitHub `main` | `{github_main}` |\n", |
| 64 | encoding="utf-8", |
| 65 | ) |
| 66 | (tmp_path / ".overseer" / "last_governance_sync").write_text( |
| 67 | f"2026-07-28T00:00:00Z\nr1={github_main}\nr3={tip}\n", |
| 68 | encoding="utf-8", |
| 69 | ) |
| 70 | # Preserve healthy bridge after any helper writes |
| 71 | (tmp_path / ".muse" / "git-bridge.toml").write_text( |
| 72 | f"[last_export]\n" |
| 73 | f'muse_commit_id = "{tip}"\n' |
| 74 | f'git_sha = "{git_sha}"\n' |
| 75 | f'[last_import]\ngit_sha = "{git_sha}"\n', |
| 76 | encoding="utf-8", |
| 77 | ) |
| 78 | |
| 79 | assert run_cli(["governance-sync", "--dry-run"], cwd=tmp_path, runner=runner) == 0 |
| 80 | assert ( |
| 81 | run_cli( |
| 82 | ["status", "--json", "--exit-code"], |
| 83 | cwd=tmp_path, |
| 84 | runner=runner, |
| 85 | json_mode=True, |
| 86 | ) |
| 87 | == 0 |
| 88 | ) |
| 89 | assert [c for c in runner.calls if "merge-base" in c[0]] == [] |
| 90 | assert [c for c in runner.calls if "git-import" in c[0]] == [] |
File History
1 commit
sha256:6abcf1fa82a7a621ccbc945f19acdba5bc0db54569599404a1452fb4a096a199
fix(ISR): default require_independent_second_reviewer to require
Human
minor
⚠
8 hours ago