test_track_o_performance.py python
29 lines 871 B
Raw
sha256:c07f2f34a0db9f43fe866f157d1935322008545ff8940c06c7c921eb219c55ab NXP-b DONE: independent BV-r2 pass + ISR (SD-17) Human minor ⚠ breaking 20 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:c07f2f34a0db9f43fe866f157d1935322008545ff8940c06c7c921eb219c55ab NXP-b DONE: independent BV-r2 pass + ISR (SD-17) Human minor 20 hours ago