File size: 1,911 Bytes
ed1d39f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def read(path: str) -> str:
return (ROOT / path).read_text(encoding="utf-8")
def test_active_run_has_agent_recovery_panel():
html = read("web/index.html")
assert 'id="agentRecoveryCard"' in html
assert 'Agent recovery' in html
assert 'id="agentRecoveryBadge"' in html
assert 'id="agentRecoveryBody"' in html
def test_frontend_renders_agent_recovery_from_decision_artifacts():
runs = read("web/static/runs.js")
assert "function renderAgentRecovery" in runs
assert "REPAIR_DECISION.json" in runs
assert "factory_rebuild_same_code" in runs
assert "Wait for logs" in runs
assert "Patch code" in runs
progress = read("web/static/progress.js")
assert "renderAgentRecovery(p)" in progress
def test_backend_exposes_recovery_decision_and_blockage():
bucket = read("src/bucket.py")
app = read("app.py")
assert '"repair_decision"' in bucket
assert '"blockage"' in bucket
assert "repair/REPAIR_DECISION.json" in bucket
assert "repair/BLOCKAGE.json" in bucket
assert '"repair_decision": bundle.get("repair_decision")' in app
assert '"blockage": bundle.get("blockage")' in app
def test_run_documents_include_decision_and_blockage_links():
bucket = read("src/bucket.py")
runs = read("web/static/runs.js")
assert '"id": "repair_decision"' in bucket
assert '"id": "blockage"' in bucket
assert "label:'Decision'" in runs
assert "label:'Blockage'" in runs
assert "repair/REPAIR_DECISION.json" in runs
assert "repair/BLOCKAGE.json" in runs
def test_docs_mention_agent_recovery_ui():
readme = read("README.md")
arch = read("docs/ARCHITECTURE.md")
changelog = read("CHANGELOG.md")
assert "Agent recovery" in readme
assert "Agent recovery" in arch
assert "v120" in changelog and "Agent recovery" in changelog
|