test_k7_large_bridge_workflow.py python
50 lines 1.8 KB
Raw
sha256:0e9549ec7b463911bc08b7d586dc320b1ac9b1f5c943ee7e3865dcc6cb0f6f83 chore(governance): sync handover+roadmap to 84db8c8 (drift:… Human 1 day ago
1 """Stress tests for K7 bridge footprint resolution (§K7.8 stress tier)."""
2
3 from __future__ import annotations
4
5 import time
6 from pathlib import Path
7
8 from cli.footprint import MUSE_BRIDGE_DEPLOY_DEST, MUSE_BRIDGE_WORKFLOW_DEST, resolve_footprint
9 from cli.kit_root import kit_root
10 from tests.support import FIXTURES, write_config
11
12
13 def test_large_workflow_with_many_policy_files_bounded(tmp_path: Path) -> None:
14 kit = tmp_path / "kit"
15 kit.mkdir()
16 for sub in ("templates/scripts", "policy", "cursor/rules"):
17 (kit / sub).mkdir(parents=True)
18 (kit / "VERSION").write_text("0.1.0\n", encoding="utf-8")
19 for name in (
20 "OVERSEER-HANDOVER.template.md",
21 "ROADMAP.template.md",
22 "STANDING-DECISIONS.template.md",
23 "MUSE-BRIDGE-WORKFLOW.template.md",
24 ):
25 (kit / "templates" / name).write_text("# {{repo.name}}\n" + ("x\n" * 5000), encoding="utf-8")
26 (kit / "templates" / "scripts" / "muse-bridge-deploy.sh.template").write_text(
27 "#!/usr/bin/env bash\n# {{vcs.git.remote}}\n" + "echo line\n" * 200,
28 encoding="utf-8",
29 )
30 for index in range(150):
31 (kit / "policy" / f"p{index}.yaml").write_text(f"k: {index}\n", encoding="utf-8")
32 (kit / "cursor" / "rules" / f"r{index}.mdc").write_text(f"rule {index}\n", encoding="utf-8")
33
34 repo = tmp_path / "repo"
35 repo.mkdir()
36 from tests.support import write_config
37
38 write_config(repo, "config-overseer-kit-dogfood.yaml")
39 from adapters.config import load_config
40
41 config = load_config(repo / ".overseer" / "config.yaml")
42
43 start = time.perf_counter()
44 files = resolve_footprint(config, kit=kit)
45 elapsed = time.perf_counter() - start
46 dests = {f.destination for f in files}
47 assert MUSE_BRIDGE_WORKFLOW_DEST in dests
48 assert MUSE_BRIDGE_DEPLOY_DEST in dests
49 assert elapsed < 3.0
50 assert len(files) >= 150
File History 1 commit
sha256:6abcf1fa82a7a621ccbc945f19acdba5bc0db54569599404a1452fb4a096a199 fix(ISR): default require_independent_second_reviewer to require Human minor 1 day ago