test_aff_perf.py python
73 lines 2.3 KB
Raw
sha256:8461d44b77376fbf06fa7c3e085d309e3010fd8d5886d63c63e69ce118811ad4 docs: record AFF-b feature-tip SHAs after AFF-b-ISR commit. Human 5 days ago
1 """Performance bounds for Mode E + ok next AFF probe (§AFF.14)."""
2
3 from __future__ import annotations
4
5 import time
6
7 from tests.fixtures.aff import (
8 AFF_FREEZE_REL,
9 aff_body,
10 seed_aff_repo,
11 write_mechanical_stamp,
12 )
13 from tools.adversarial_freeze import build_adversarial_freeze_gate
14 from tools.governance_hygiene.next_regen import plan_next_regen
15 from tools.honesty.ledger import append_entry
16 from tools.honesty.status import HonestyStatusOptions, run_honesty_status
17 from tools.honesty.types import LedgerAppendOptions
18
19 _BUDGET_S = 2.0
20
21
22 def test_mode_e_and_next_aff_probe_within_bound(repo_root) -> None:
23 config = seed_aff_repo(repo_root, adversarial_freeze="suggest")
24 digest = write_mechanical_stamp(repo_root)
25 body = aff_body(artifact_digest=digest)
26 started = time.perf_counter()
27 assert (
28 append_entry(
29 config=config,
30 repo_root=repo_root,
31 options=LedgerAppendOptions(kind="adversarial_freeze", body=body),
32 ).exit_code
33 == 0
34 )
35 result = run_honesty_status(
36 config=config,
37 repo_root=repo_root,
38 options=HonestyStatusOptions(
39 hook=None,
40 artifact=None,
41 adversarial_freeze="AFF",
42 frozen_spec=AFF_FREEZE_REL,
43 ),
44 )
45 assert result.exit_code == 0
46 roadmap = (
47 "# Roadmap\n\n## Build queue\n\n"
48 "| Phase | Model | Status | Deliverable |\n"
49 "| --- | --- | --- | --- |\n"
50 f"| **AFF-a** | Thinking | **NEXT** | `{AFF_FREEZE_REL}` |\n"
51 )
52 handover = "## NEXT SESSION — AFF-a\n\n| | |\n| **ID** | **AFF-a** |\n\n"
53 decision = plan_next_regen(
54 roadmap_text=roadmap,
55 handover_text=handover,
56 config=config,
57 repo_root=repo_root,
58 )
59 assert decision.emit_model == "Thinking"
60 report = build_adversarial_freeze_gate(
61 config,
62 repo_root,
63 handover_text=handover,
64 roadmap_text=(
65 "# Roadmap\n\n## Build queue\n\n"
66 "| Phase | Model | Status | Deliverable |\n"
67 "| --- | --- | --- | --- |\n"
68 f"| **AFF-b** | Auto | **WIP** | `{AFF_FREEZE_REL}` |\n"
69 ),
70 )
71 assert report.skipped is True or report.ok is True
72 elapsed = time.perf_counter() - started
73 assert elapsed < _BUDGET_S
File History 1 commit
sha256:8461d44b77376fbf06fa7c3e085d309e3010fd8d5886d63c63e69ce118811ad4 docs: record AFF-b feature-tip SHAs after AFF-b-ISR commit. Human 5 days ago