test_cost_awareness_performance.py
python
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1
docs: MuseHub-first before ISR #74 — staging solidify NEXT
Human
4 days ago
| 1 | """Performance tests for Track P / P-cost (§PC.9).""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | import time |
| 6 | from pathlib import Path |
| 7 | |
| 8 | from adapters.config import load_config |
| 9 | from cli.kit_root import kit_root |
| 10 | from tests.fixtures.cost_awareness import seed_cost_e2e_repo |
| 11 | from tests.support import git_status_runner, run_cli |
| 12 | from tools.cost_awareness.surface import build_cost_awareness_report |
| 13 | |
| 14 | |
| 15 | def test_route_annotation_bounded(tmp_path: Path) -> None: |
| 16 | seed_cost_e2e_repo(tmp_path) |
| 17 | start = time.perf_counter() |
| 18 | code = run_cli( |
| 19 | ["route", "--phase-tier", "auto", "--json"], |
| 20 | cwd=tmp_path, |
| 21 | runner=git_status_runner(), |
| 22 | kit=kit_root(), |
| 23 | json_mode=True, |
| 24 | ) |
| 25 | elapsed = time.perf_counter() - start |
| 26 | assert code == 0 |
| 27 | assert elapsed < 2.0 |
| 28 | |
| 29 | |
| 30 | def test_active_slice_surface_bounded(tmp_path: Path) -> None: |
| 31 | seed_cost_e2e_repo(tmp_path) |
| 32 | config = load_config(tmp_path / ".overseer" / "config.yaml") |
| 33 | handover = (tmp_path / "docs" / "OVERSEER-HANDOVER.md").read_text(encoding="utf-8") |
| 34 | roadmap = (tmp_path / "docs" / "ROADMAP.md").read_text(encoding="utf-8") |
| 35 | start = time.perf_counter() |
| 36 | report = build_cost_awareness_report( |
| 37 | config, tmp_path, kit_root=kit_root(), handover_text=handover, roadmap_text=roadmap |
| 38 | ) |
| 39 | elapsed = time.perf_counter() - start |
| 40 | assert report.enabled is True |
| 41 | assert elapsed < 2.0 |
File History
1 commit
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1
docs: MuseHub-first before ISR #74 — staging solidify NEXT
Human
4 days ago