test_gs_paste_performance.py
python
sha256:8461d44b77376fbf06fa7c3e085d309e3010fd8d5886d63c63e69ce118811ad4
docs: record AFF-b feature-tip SHAs after AFF-b-ISR commit.
Human
5 days ago
| 1 | """Performance: GS-PASTE regen path stays within governance-sync budget (§GSP.10 / §FRV.6.5.1).""" |
| 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 tests.support import FIXTURES |
| 10 | from tools.governance_hygiene.patch import build_handover_patches |
| 11 | from tools.governance_hygiene.types import DriftReport, VerifiedReads |
| 12 | |
| 13 | |
| 14 | def test_regen_path_bounded_on_kit_sized_docs(tmp_path: Path) -> None: |
| 15 | config = load_config(FIXTURES / "config-git-only.yaml") |
| 16 | kit_docs = Path(__file__).resolve().parents[2] / "docs" |
| 17 | handover = (kit_docs / "OVERSEER-HANDOVER.md").read_text(encoding="utf-8") |
| 18 | roadmap = (FIXTURES / "gs-paste-roadmap-one-open.md").read_text(encoding="utf-8") |
| 19 | # Seed freeze candidate so discovery stays basename-capped under docs/. |
| 20 | # Under FRV, a plain Auto row with a mechanical-only stamp is held as |
| 21 | # freeze_not_substantive — still exercises discovery + authorization. |
| 22 | docs = tmp_path / "docs" |
| 23 | docs.mkdir() |
| 24 | (docs / "PHASE-GS-PASTE-READY-REGEN.md").write_text( |
| 25 | "# x\n```yaml\nreview_stamp:\n verdict: pass\n```\n", |
| 26 | encoding="utf-8", |
| 27 | ) |
| 28 | reads = VerifiedReads( |
| 29 | regime="git-only", |
| 30 | r1_github_main_sha="cafebabe", |
| 31 | r1_command="git", |
| 32 | r2_anchor_sha="cafebabe", |
| 33 | r2_source="origin/main", |
| 34 | r3_canonical_main_sha=None, |
| 35 | r3_command=None, |
| 36 | r4_merged_prs=(), |
| 37 | r5_branch="feat/gs-paste-ready-regen", |
| 38 | r5_dirty=False, |
| 39 | r5_regime="git-only", |
| 40 | ) |
| 41 | drift = DriftReport( |
| 42 | d1_handover_vs_git="drifted", |
| 43 | d2_anchor_vs_canonical="aligned", |
| 44 | d3_queue_vs_merged="aligned", |
| 45 | ) |
| 46 | start = time.perf_counter() |
| 47 | patched, sections, token = build_handover_patches( |
| 48 | handover, |
| 49 | reads, |
| 50 | drift, |
| 51 | realign_summary=None, |
| 52 | sync_date="2026-07-30", |
| 53 | config=config, |
| 54 | roadmap_text=roadmap, |
| 55 | repo_root=tmp_path, |
| 56 | ) |
| 57 | elapsed = time.perf_counter() - start |
| 58 | assert elapsed < 2.0 |
| 59 | assert "freeze_not_substantive" in token |
| 60 | assert "next-session" not in sections |
| 61 | assert "### Paste-ready prompt" in patched |
File History
1 commit
sha256:8461d44b77376fbf06fa7c3e085d309e3010fd8d5886d63c63e69ce118811ad4
docs: record AFF-b feature-tip SHAs after AFF-b-ISR commit.
Human
5 days ago