LLM refresh() silently produces an empty grouping when the model hallucinates aggregate ids #34
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Findings
Reproduced during the grouping A/B experiment (2026-09-13):
refresh()clears all aggregates, but the model's response can still carry hallucinated aggregate ids in its topics._apply_topicsthen:add_article_to_aggregate, whose foreign-key violations are swallowed byexcept sqlite3.IntegrityError: pass.Net effect: an entirely empty grouping with a success log — observed live (0 aggregates, 0 mappings after "Aggregation complete: 66 topic(s)").
Plan of attack
_apply_topics, when a topic references an aggregate id, verify it exists; if it does not, log a warning and create a new aggregate instead (degrade gracefully, never drop the articles).IntegrityErrorlink failures instead of passing silently.Stacked on PR #32 (touches
llm_aggregatorcode introduced there). Branch:fix/issue-34-refresh-robustness. Commit::bug: Degrade gracefully when the LLM invents aggregate ids.Implemented in PR #35 (merged as
e471b34):_apply_topicsnow verifies referenced aggregate ids exist — invented ids degrade to creating a new aggregate (articles never dropped), and skipped article links are logged instead of silently passing. Grouping input reverted to feed teasers per the A/B on issue #23 (full text stays in the summarizer and article display).