Spaces:
Sleeping
Sleeping
fix: Only validate SWOT section for uncited numbers
Browse filesThe uncited number detection was scanning the entire draft_report
including the Data Report tables (raw MCP metrics). This caused
18+ false positives since Data Report tables don't have [M##] citations.
Now extracts just the "## SWOT Analysis" section before validation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- src/nodes/critic.py +5 -1
src/nodes/critic.py
CHANGED
|
@@ -410,7 +410,11 @@ def critic_node(state, workflow_id=None, progress_store=None):
|
|
| 410 |
# ============================================================
|
| 411 |
# LAYER 3: Uncited Number Detection
|
| 412 |
# ============================================================
|
| 413 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 414 |
if uncited_warnings:
|
| 415 |
_add_activity_log(workflow_id, progress_store, "critic",
|
| 416 |
f"Uncited numbers: {len(uncited_warnings)} suspicious value(s) found")
|
|
|
|
| 410 |
# ============================================================
|
| 411 |
# LAYER 3: Uncited Number Detection
|
| 412 |
# ============================================================
|
| 413 |
+
# Only validate SWOT section (not Data Report tables which have raw metrics)
|
| 414 |
+
swot_section = report
|
| 415 |
+
if "## SWOT Analysis" in report:
|
| 416 |
+
swot_section = report[report.index("## SWOT Analysis"):]
|
| 417 |
+
uncited_warnings = validate_uncited_numbers(swot_section, metric_ref)
|
| 418 |
if uncited_warnings:
|
| 419 |
_add_activity_log(workflow_id, progress_store, "critic",
|
| 420 |
f"Uncited numbers: {len(uncited_warnings)} suspicious value(s) found")
|