46 lines
1.9 KiB
Python
46 lines
1.9 KiB
Python
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
START = ROOT / "scripts" / "start_qa_v1_1_73_7920.sh"
|
|
SERVER = ROOT / "scripts" / "qa_v1_1_73_server.py"
|
|
PACKAGE = ROOT / "services" / "qa_v1_1_73" / "src" / "rag" / "qa_v1_1_73"
|
|
PLANTAI_MAIN = ROOT / "apps" / "web" / "vue3" / "main.py"
|
|
|
|
|
|
def test_formal_qa_sources_are_versioned_in_plantai():
|
|
assert SERVER.is_file()
|
|
assert (PACKAGE / "api.py").is_file()
|
|
assert (PACKAGE / "assertion_anchored_graph_retriever.py").is_file()
|
|
assert (PACKAGE / "agentic_hop_gate.py").is_file()
|
|
assert "sandbox" not in (PACKAGE / "__init__.py").read_text(encoding="utf-8").lower()
|
|
assert "Sandbox" not in (PACKAGE / "api.py").read_text(encoding="utf-8")
|
|
|
|
|
|
def test_7920_startup_has_no_sandbox_dependency():
|
|
text = START.read_text(encoding="utf-8")
|
|
|
|
assert "/sandboxes/" not in text
|
|
assert 'APP_MODULE="scripts.qa_v1_1_73_server:app"' in text
|
|
assert 'QA_V1_BOUNDED_NEO4J_TIMEOUT="8"' in text
|
|
assert 'export NEO4J_URI="bolt://127.0.0.1:18788"' in text
|
|
assert 'export V15_QDRANT_URL="http://127.0.0.1:26333"' in text
|
|
assert 'export V15_QDRANT_COLLECTION="plant_srt_direct_v1_bge_m3_20260702"' in text
|
|
assert "--host 127.0.0.1" in text
|
|
|
|
|
|
def test_sidecar_validation_has_a_fixed_admin_endpoint():
|
|
text = PLANTAI_MAIN.read_text(encoding="utf-8")
|
|
|
|
assert '@app.post("/api/admin/validate-qa-sidecar")' in text
|
|
assert '_validate_admin_ops_request(request, payload, "validate-qa-sidecar")' in text
|
|
assert 'PROJECT_ROOT / "scripts" / "validate_qa_v1_1_73_sidecar.sh"' in text
|
|
assert '@app.post("/api/admin/stop-qa-sidecar")' in text
|
|
assert '_validate_admin_ops_request(request, payload, "stop-qa-sidecar")' in text
|
|
|
|
|
|
def test_sidecar_status_has_a_fixed_admin_endpoint():
|
|
text = PLANTAI_MAIN.read_text(encoding="utf-8")
|
|
assert '@app.post("/api/admin/qa-sidecar-status")' in text
|
|
assert '_validate_admin_ops_request(request, payload, "qa-sidecar-status")' in text
|