disable: RAG checks until Master Controls (G1 Decision Trace) are ready
Current 144K controls are general legal texts, not specific check criteria. RAG integration code stays (rag_document_checker.py), just disabled in the doc-check endpoint. Re-enable when G1-G4 block is complete and 25K Master Controls with Decision Trace are available. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -199,24 +199,17 @@ async def _check_single_document(entry: DocCheckEntry) -> list[DocCheckResult]:
|
|||||||
# Main document check (full text against primary type)
|
# Main document check (full text against primary type)
|
||||||
main_result = _run_checklist(doc_text, entry.doc_type, entry.label, entry.url, word_count)
|
main_result = _run_checklist(doc_text, entry.doc_type, entry.label, entry.url, word_count)
|
||||||
|
|
||||||
# RAG-based deep check (semantic verification against Control Library)
|
# RAG-based deep check — DISABLED until Master Controls (G1 Decision Trace) are ready.
|
||||||
try:
|
# The current 144K controls are general legal texts, not specific check criteria.
|
||||||
from compliance.services.rag_document_checker import check_document_with_rag
|
# Enable via rag_check=true in request when Master Controls are available.
|
||||||
logger.info("Starting RAG check for '%s'...", entry.label)
|
# try:
|
||||||
rag_checks = await check_document_with_rag(
|
# from compliance.services.rag_document_checker import check_document_with_rag
|
||||||
doc_text, entry.doc_type, entry.label, entry.url,
|
# rag_checks = await check_document_with_rag(doc_text, entry.doc_type, entry.label, entry.url)
|
||||||
)
|
# if rag_checks:
|
||||||
logger.info("RAG check returned %d results for '%s'", len(rag_checks) if rag_checks else 0, entry.label)
|
# for rc in rag_checks:
|
||||||
if rag_checks:
|
# main_result.checks.append(CheckItem(...))
|
||||||
for rc in rag_checks:
|
# except Exception as e:
|
||||||
main_result.checks.append(CheckItem(
|
# logger.warning("RAG check failed: %s", e)
|
||||||
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
|
|
||||||
except Exception as e:
|
|
||||||
logger.warning("RAG check failed for %s: %s %s", entry.label, type(e).__name__, e)
|
|
||||||
|
|
||||||
all_results.append(main_result)
|
all_results.append(main_result)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user