mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-19 16:27:37 +00:00
Found by exercising pulse_summarize in a real chat session. The
chat-tool response surfaced:
"observations": [{"Text": "...", "Severity": "info"}]
The AI narrator's system prompt (report_narrator.go) tells the
model to emit lowercase keys:
{"text": "...", "severity": "..."}
The model was being taught one schema and shown a different one
in the tool response for the same shape. NarrativeBullet,
FleetOutlier, Narrative, and FleetNarrative had no JSON tags, so
embedded struct fields serialised with their Go names.
Add struct tags so the wire shape matches the prompt schema. Pure
marshaling change — JSON tags don't affect Go field access, so
PDF rendering (which reads fields directly) is unchanged. Tests
in narrative_json_test.go pin the shape so the inconsistency
can't reappear silently.
Process note: this is a class of bug that only appears when an
LLM actually consumes the output. No unit test caught it; no
review of the code showed it; the model running through the chat
path is what surfaced it. Another argument for "exercise the
artifact" — even the tool surface that looks correct in
isolation has hidden inconsistencies you only see when something
external reads it.
|
||
|---|---|---|
| .. | ||
| catalog.go | ||
| catalog_test.go | ||
| csv.go | ||
| csv_additional_test.go | ||
| engine.go | ||
| engine_additional2_test.go | ||
| engine_additional3_test.go | ||
| engine_additional_test.go | ||
| engine_integration_test.go | ||
| engine_narrative_test.go | ||
| engine_test.go | ||
| fleet_narrative.go | ||
| fleet_narrative_test.go | ||
| multi_report_visual_test.go | ||
| narrative.go | ||
| narrative_json_test.go | ||
| narrative_test.go | ||
| pdf.go | ||
| pdf_additional2_test.go | ||
| pdf_additional_test.go | ||
| pdf_insights_test.go | ||
| pdf_ux_test.go | ||
| reporting.go | ||
| reporting_test.go | ||
| vm_inventory.go | ||
| vm_inventory_test.go | ||