Incremental aggregation only sees the 100 most recently updated aggregates, so ongoing stories spawn duplicates #85
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
marvin8/yunjin#85
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?
Each incremental aggregation run shows the LLM only the 100 most-recently-updated aggregates (the _max_prompt_topics slice in LlmAggregationService._aggregate_user, src/yunjin/services/llm_aggregator.py). With the current aggregate population (2,010 in the prod DB) that slice spans roughly 9 hours — the remaining ~1,910 aggregates are invisible to every run.
Consequence: when a story keeps developing more than a few hours after first coverage, the new article cannot be matched to its existing aggregate and a duplicate aggregate is created. The prod DB contains 111 near-duplicate aggregate-name pairs (>=60% title-token overlap, a floor estimate). Examples:
The cap exists to bound prompt size (#74), which is a real constraint — 2,010 topics will not fit in a prompt. The problem is that recency is a poor relevance filter: ~95% of the haystack is excluded, and the slice is partly arbitrary because daily consolidation bumps hundreds of aggregates to the same updated_at timestamp, making the top-100 tie-break arbitrary.
Findings from the prod DB probe (2026-10-17):
Plan of attack: