test_pilot_status_bounded.py
python
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1
docs: MuseHub-first before ISR #74 — staging solidify NEXT
Human
13 hours ago
| 1 | """Performance: pilot status + governance-sync dry-run bounded (§K6.10).""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | import json |
| 6 | import time |
| 7 | from pathlib import Path |
| 8 | |
| 9 | from tests.support import PILOT, muse_mirror_status_runner, ok, run_cli, seed_pilot_tree |
| 10 | |
| 11 | |
| 12 | def test_pilot_status_and_dry_run_bounded(tmp_path: Path) -> None: |
| 13 | seed_pilot_tree( |
| 14 | tmp_path, |
| 15 | handover_rel="docs/OVERSEER-HANDOVER.md", |
| 16 | handover_text="# H\n" + ("row\n" * 500), |
| 17 | roadmap_rel="docs/ROADMAP.md", |
| 18 | roadmap_text="# R\n" + ("row\n" * 500), |
| 19 | ) |
| 20 | runner = muse_mirror_status_runner(tmp_path) |
| 21 | root = str(tmp_path.resolve()) |
| 22 | runner.responses.update( |
| 23 | { |
| 24 | f"muse -C {root} rev-parse main": ok("a" * 40), |
| 25 | "git rev-parse origin/main": ok("b" * 40), |
| 26 | "gh pr list --state merged --limit 5 --json number,title,mergeCommit,mergedAt": ok( |
| 27 | json.dumps([]) |
| 28 | ), |
| 29 | } |
| 30 | ) |
| 31 | (tmp_path / ".muse").mkdir(exist_ok=True) |
| 32 | (tmp_path / ".muse" / "git-bridge.toml").write_text( |
| 33 | '[last_export]\n' |
| 34 | 'muse_commit_id = "' + ("a" * 40) + '"\n' |
| 35 | 'git_sha = "' + ("c" * 40) + '"\n' |
| 36 | '[last_import]\ngit_sha = "' + ("c" * 40) + '"\n', |
| 37 | encoding="utf-8", |
| 38 | ) |
| 39 | assert ( |
| 40 | run_cli( |
| 41 | [ |
| 42 | "init", |
| 43 | "--migrate", |
| 44 | "--from-config", |
| 45 | str(PILOT / "config-scooling.yaml"), |
| 46 | "--non-interactive", |
| 47 | ], |
| 48 | cwd=tmp_path, |
| 49 | runner=runner, |
| 50 | ) |
| 51 | == 0 |
| 52 | ) |
| 53 | |
| 54 | start = time.perf_counter() |
| 55 | assert run_cli(["status", "--check-footprint"], cwd=tmp_path, runner=runner) == 0 |
| 56 | run_cli(["governance-sync", "--dry-run"], cwd=tmp_path, runner=runner) |
| 57 | elapsed = time.perf_counter() - start |
| 58 | assert elapsed < 5.0 |
| 59 | # Bounded VCS scans: status + dry-run must not unbounded-loop |
| 60 | assert len(runner.calls) < 40 |
File History
2 commits
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1
docs: MuseHub-first before ISR #74 — staging solidify NEXT
Human
13 hours ago
sha256:4671b7f787ddbe63ced31c895b688c77ab495653b65a730b423329f26b3c1439
feat: K1-P1 complete — agent provenance, build-verification…
Sonnet 4.6
patch
52 days ago