diff --git a/backend-compliance/compliance/api/agent_doc_check_routes.py b/backend-compliance/compliance/api/agent_doc_check_routes.py index 85473e2..9e1815b 100644 --- a/backend-compliance/compliance/api/agent_doc_check_routes.py +++ b/backend-compliance/compliance/api/agent_doc_check_routes.py @@ -199,28 +199,10 @@ async def _check_single_document(entry: DocCheckEntry) -> list[DocCheckResult]: # Main document check (full text against primary type) main_result = _run_checklist(doc_text, entry.doc_type, entry.label, entry.url, word_count) - # Control Library deep check — verifies against canonical_controls (SQL) - try: - from compliance.services.rag_document_checker import check_document_with_controls - from classroom_engine.database import SessionLocal - db = SessionLocal() - try: - ctrl_checks = await check_document_with_controls( - doc_text, entry.doc_type, entry.label, db, - ) - logger.info("Control check: %d results for '%s'", len(ctrl_checks) if ctrl_checks else 0, entry.label) - if ctrl_checks: - for rc in ctrl_checks: - main_result.checks.append(CheckItem( - id=rc["id"], label=rc["label"], passed=rc["passed"], - severity=rc["severity"], matched_text=rc.get("matched_text", ""), - )) - if not rc["passed"]: - main_result.findings_count += 1 - finally: - db.close() - except Exception as e: - logger.warning("Control check failed for %s: %s %s", entry.label, type(e).__name__, e) + # Control Library deep check — DISABLED until doc-check-specific + # Master Controls with binary pass/fail criteria are available. + # See: zeroclaw/INSTRUCTION-master-controls-for-doc-check.md + # Code: compliance/services/rag_document_checker.py (ready to re-enable) all_results.append(main_result)