test_track_o_performance.py
python
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1
docs: MuseHub-first before ISR #74 — staging solidify NEXT
Human
9 hours ago
| 1 | """Performance — Track O harness bounded on real pack (§O0.8 performance).""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | import time |
| 6 | from pathlib import Path |
| 7 | |
| 8 | from tools.track_o.validate import PACK_RELS, validate_track_o_pack |
| 9 | |
| 10 | KIT_ROOT = Path(__file__).resolve().parents[2] |
| 11 | |
| 12 | # Documented bound: single harness pass over the declared three-path pack. |
| 13 | MAX_SECONDS = 0.5 |
| 14 | |
| 15 | |
| 16 | def test_validate_track_o_pack_bounded() -> None: |
| 17 | start = time.monotonic() |
| 18 | result = validate_track_o_pack(KIT_ROOT) |
| 19 | elapsed = time.monotonic() - start |
| 20 | assert result.ok, result.errors |
| 21 | assert elapsed < MAX_SECONDS |
| 22 | |
| 23 | |
| 24 | def test_harness_only_declared_pack_paths() -> None: |
| 25 | """Harness surface declares exactly three relative paths (no unbounded walk).""" |
| 26 | assert len(PACK_RELS) == 3 |
| 27 | for rel in PACK_RELS: |
| 28 | assert not rel.is_absolute() |
| 29 | assert ".." not in rel.parts |
File History
1 commit
sha256:a78e7e5a8740e03315f325d19edeb3aa1b306b3337d04abbaa9a9e0f3bbeb7a1
docs: MuseHub-first before ISR #74 — staging solidify NEXT
Human
9 hours ago