test_k7_dogfood_cycle.py file-level

at main · View file ↗ · Intel ↗

History
1 files
1 commits
0 hotspots
0 🧊 dead
0 💥 blast risk
sha256:6 fix(ISR): default require_independent_second_reviewer to require Opera… · aaronrene · Sep 2, 2026
1 """E2E fixture dogfood cycle for K7 bridge footprint (§K7.8 e2e tier)."""
2
3 from __future__ import annotations
4
5 import json
6 from pathlib import Path
7
8 from cli.footprint import MUSE_BRIDGE_DEPLOY_DEST, MUSE_BRIDGE_WORKFLOW_DEST
9 from tests.support import FIXTURES, muse_mirror_status_runner, ok, run_cli, seed_muse_substrate
10
11
12 def test_k7_fixture_dogfood_cycle_no_live_muse(tmp_path: Path) -> None:
13 runner = muse_mirror_status_runner(tmp_path)
14 root = str(tmp_path.resolve())
15 runner.responses.update(
16 {
17 f"muse -C {root} rev-parse main": ok("a" * 40),
18 "git rev-parse origin/main": ok("b" * 40),
19 "git rev-parse origin/muse-mirror": ok("c" * 40),
20 "gh pr list --state merged --limit 5 --json number,title,mergeCommit,mergedAt": ok(
21 json.dumps([])
22 ),
23 }
24 )
25 seed_muse_substrate(tmp_path)
26 (tmp_path / ".muse" / "git-bridge.toml").write_text(
27 '[last_export]\n'
28 'muse_commit_id = "' + ("a" * 40) + '"\n'
29 'git_sha = "' + ("d" * 40) + '"\n'
30 '[last_import]\ngit_sha = "' + ("d" * 40) + '"\n',
31 encoding="utf-8",
32 )
33 assert (
34 run_cli(
35 [
36 "init",
37 "--from-config",
38 str(FIXTURES / "config-overseer-kit-dogfood.yaml"),
39 "--non-interactive",
40 ],
41 cwd=tmp_path,
42 runner=runner,
43 )
44 == 0
45 )
46 assert (tmp_path / MUSE_BRIDGE_WORKFLOW_DEST).is_file()
47 assert (tmp_path / MUSE_BRIDGE_DEPLOY_DEST).is_file()
48 assert run_cli(["status", "--check-footprint"], cwd=tmp_path, runner=runner) == 0
49 assert run_cli(["governance-sync", "--dry-run"], cwd=tmp_path, runner=runner) == 0
50 assert run_cli(["sync", "-y"], cwd=tmp_path, runner=runner) == 0
51 muse_calls = [c for c in runner.calls if "bridge git-export" in c[0]]
52 assert muse_calls == []