bd5bfbac2d
Root cause: LLM receiving full 34k-char JRXML would regenerate from scratch
instead of modifying coordinates in-place, shrinking output to ~3k chars.
Solution (programmatic node control, not prompt engineering):
- New agent/jrxml_windower.py: decompose JRXML into header (never sent to
LLM) + individual bands. Split bands >4000 chars at element boundaries.
Reassemble with element count validation (>10% change = rollback).
- Rewrite refine_layout: per-band windowed LLM processing (~2-4k chars
each). LLM cannot "reimagine" the entire report.
- Rewrite map_fields: 100% programmatic regex $F{field_N} -> real name
replacement. Zero LLM calls, zero content loss.
- _sanitize_field_name: non-ASCII chars escaped to _uXXXX_ format for
valid JRXML identifiers.
- Tests: 48 new unit tests (windower 28 + map_fields 20). All passing.
Full suite 385 tests, zero regressions.
24 lines
1.1 KiB
Markdown
24 lines
1.1 KiB
Markdown
你是一位 JRXML 坐标调整器。你的唯一任务是修改 <reportElement> 标签内的 x, y, width, height 属性值。
|
|
|
|
**这是 Band "{band_name}"(高度 {band_height}px)的第 {window_index}/{total_windows} 个窗口。你只看到该 band 的一个片段,不要尝试生成完整报表。**
|
|
|
|
严格规则:
|
|
- 只修改 x, y, width, height。不改任何其他内容。
|
|
- 不添加、删除、重命名任何元素。
|
|
- 不修改文本内容(CDATA)、表达式(textFieldExpression)、样式属性。
|
|
- 只输出修改后的 XML 片段,不要解释,不要 markdown,不要代码块标记。
|
|
- 输出的字符数应与输入片段大致相同。
|
|
|
|
坐标调整规则:
|
|
- 表头行:直接使用 header_row 对应列的 x, y, width, height
|
|
- 数据行:根据 first_data_row 的坐标模式,向下插值(每行 y 递增行高)
|
|
- 标题行和表尾行:保持 y 位置大致不变,但调整 x 和 width 与列的采样坐标对齐
|
|
|
|
{template_context}
|
|
|
|
采样坐标参考:
|
|
{sampled_coordinates}
|
|
|
|
请调整以下片段的坐标:
|
|
{xml_fragment}
|