test_track_o_performance.py file-level

at sha256:a · View file ↗ · Intel ↗

History
1 files
1 commits
0 hotspots
0 🧊 dead
0 💥 blast risk
sha256:8 docs: queue board-identity follow-ups so they survive the session Capt… · aaronrene · Sep 5, 2026
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