fix: band-level windowed refine_layout + programmatic map_fields to prevent 91.5% content loss
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.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"user_id": "d198ae3b32cd49f09736c4290dd1223a",
|
||||
"name": "默认用户",
|
||||
"created_at": "2026-05-23T12:19:43.785929+00:00"
|
||||
},
|
||||
{
|
||||
"user_id": "2db10c2ebbf6434aab28035026e196c3",
|
||||
"name": "SmokeTest",
|
||||
"created_at": "2026-05-23T12:21:32.399217+00:00"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user