fix: MAX_RETRY 5 + rolling continuation + namespace-aware JRXML extraction

- MAX_RETRY: 3→5 (graph.py:35, nodes.py:25) with env override
- Rolling continuation: _generate_with_continuation() auto-detects
  truncated JRXML and sends anchor-based continuation, max 3 rounds
- JRXML extraction: regex/end-tag now namespace-prefix aware
  (ns0:jasperReport, ns:jasperReport, etc.)
- All 5 generation nodes refactored to use continuation helper
- Tests updated: scenario1 accepts ns-prefixed root, max_retry
  verifies graph termination
- stop_reason capture + WARNING log on max_tokens truncation
- Correction prompt now injects OCR context + layout schema
This commit is contained in:
2026-05-23 10:58:46 +08:00
parent 83e801a0b8
commit 1210b926c3
5 changed files with 187 additions and 50 deletions
+5
View File
@@ -4,6 +4,7 @@
- 只输出完整修复后的 JRXML 代码,不要解释,不要 markdown 标记。
- JRXML 必须与 JasperReports 7.0.6 兼容。
- 解决下面列出的特定错误。
- 如果当前 JRXML 内容为空或过短(<200 字符),请根据下方提供的 OCR 识别数据和布局 schema 重新生成完整的 JRXML,而非输出一个占位桩。
当前 JRXML(带错误):
{current_jrxml}
@@ -14,4 +15,8 @@
错误的自然语言解释:
{explanation}
{ocr_context}
{layout_schema_text}
立即生成修正后的 JRXML