From 21c01d64054c172051f10ebd4c7649c326a75530 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Fri, 8 May 2026 00:16:36 +0200 Subject: [PATCH] fix: Heading detection allows digit-start (e.g. "5. Soziale Medien") Headings starting with numbers (numbered sections like "5. Soziale Medien", "6. Analyse-Tools") were not detected because the check required stripped[0].isupper(). Now also accepts stripped[0].isdigit(). Co-Authored-By: Claude Opus 4.6 (1M context) --- backend-compliance/compliance/api/agent_doc_check_routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend-compliance/compliance/api/agent_doc_check_routes.py b/backend-compliance/compliance/api/agent_doc_check_routes.py index 2569628..c66a612 100644 --- a/backend-compliance/compliance/api/agent_doc_check_routes.py +++ b/backend-compliance/compliance/api/agent_doc_check_routes.py @@ -377,7 +377,7 @@ def _split_into_sections(text: str, parent_label: str, url: str) -> list[dict]: 5 < len(stripped) < 80 and not stripped.endswith(".") and not stripped.endswith(",") - and stripped[0].isupper() + and (stripped[0].isupper() or stripped[0].isdigit()) ) classified = _classify_section(stripped) if is_heading else None is_real_heading = is_heading and classified is not None