fix(cross-doc): suppress false positives when regex checks already pass
Cross-search "not in text" findings are only shown when regex L1 completeness < 50%. This prevents false positives where the text IS the right doc_type but doesn't contain the specific cross-search keywords (e.g. Impressum passes 9/13 checks but lacks "§5 TMG"). Also: cross-search now checks entries with wrong text, not just empty. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -237,7 +237,10 @@ async def _run_compliance_check(check_id: str, req: ComplianceCheckRequest):
|
|||||||
# Apply profile context filter
|
# Apply profile context filter
|
||||||
result = _apply_profile_filter(result, profile, doc_type)
|
result = _apply_profile_filter(result, profile, doc_type)
|
||||||
|
|
||||||
# Add placement findings (doc found in wrong location)
|
# Add placement findings — but only if the regex checks confirm
|
||||||
|
# the text doesn't match. If completeness >= 50%, the text IS the
|
||||||
|
# right doc_type despite missing cross-search keywords.
|
||||||
|
if result.completeness_pct < 50:
|
||||||
for pf in placement_findings:
|
for pf in placement_findings:
|
||||||
if pf.get("doc_type") == doc_type:
|
if pf.get("doc_type") == doc_type:
|
||||||
result.checks.insert(0, CheckItem(**{
|
result.checks.insert(0, CheckItem(**{
|
||||||
|
|||||||
Reference in New Issue
Block a user