test_lt_stress.py python
50 lines 1.9 KB
Raw
sha256:0e9549ec7b463911bc08b7d586dc320b1ac9b1f5c943ee7e3865dcc6cb0f6f83 chore(governance): sync handover+roadmap to 84db8c8 (drift:… Human 1 day ago
1 """Stress tests for LT loop tightening (§LT.10)."""
2
3 from __future__ import annotations
4
5 from pathlib import Path
6
7 from tests.support import FIXTURES, KIT_ROOT, git_status_runner, load_fixture_config, run_cli
8 from tools.footprint_coverage import check_footprint_coverage
9 from tools.handover_compact import compact_handover_change_log
10
11
12 def test_compact_200_bullets_keep_15(tmp_path: Path) -> None:
13 config = load_fixture_config(tmp_path, "config-git-only.yaml")
14 handover = tmp_path / "docs" / "OVERSEER-HANDOVER.md"
15 handover.parent.mkdir(parents=True, exist_ok=True)
16 bullets = "\n\n".join(f"- **2026-01-01** — entry {i}" for i in range(200))
17 handover.write_text(
18 f"<!-- overseer:anchor:change-log -->\n{bullets}\n"
19 "<!-- /overseer:anchor:change-log -->\n",
20 encoding="utf-8",
21 )
22 report = compact_handover_change_log(config, tmp_path, keep=15, write=True)
23 assert report.ok
24 assert report.compacted == 185
25 living = handover.read_text(encoding="utf-8")
26 assert living.count("- **2026-01-01**") == 15
27 archive = tmp_path / report.archive
28 assert archive.is_file()
29 assert archive.read_text(encoding="utf-8").count("- **2026-01-01**") == 185
30
31
32 def test_coverage_many_dests(tmp_path: Path) -> None:
33 config = load_fixture_config(tmp_path, "config-git-only.yaml")
34 from cli.footprint import resolve_footprint
35 from cli.version_lock import ORIGIN_KIT, FootprintEntry, build_version_lock_from_entries
36
37 files = resolve_footprint(config, kit=KIT_ROOT)
38 assert len(files) >= 20
39 entries = [
40 FootprintEntry(path=f.destination, source=f.source, sha256="0" * 64, origin=ORIGIN_KIT)
41 for f in files
42 ]
43 lock = build_version_lock_from_entries(
44 kit_version="0.1.0",
45 config_version=1,
46 entries=entries,
47 installed_at="2026-01-01T00:00:00Z",
48 )
49 report = check_footprint_coverage(tmp_path, config, lock=lock, rendered=files, kit=KIT_ROOT)
50 assert report.ok
File History 1 commit
sha256:6abcf1fa82a7a621ccbc945f19acdba5bc0db54569599404a1452fb4a096a199 fix(ISR): default require_independent_second_reviewer to require Human minor 1 day ago