Beat dedupe misses same-moment duplicates and split moments, inflating the event log #588
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?
Evidence, from the Gemma 4 26B run on the 2026-09-09 session (59 verified events):
The first pair is the same sentence at the same timestamp and should never have survived
dedupe_beats. The second is one moment reported twice a minute apart. There are also four separate events for waking up and realising the caverns moved them ("complete a long rest in the caverns", "complete a long rest", "wake up to find they have been moved", "realize they were in the shifting caverns").dedupe_beatscompares beats structurally (_same_eventon ranges and actors), so two extraction passes that phrase the same moment slightly differently, or stamp it a minute apart, both survive. That inflates the event log #568 introduced, wastes compose budget, and makes the adaptive pass loop think a pass found something new when it found the same thing again.Suggested approach. Extend
_same_eventwith a content comparison for beats whose ranges are close: normalised token overlap on the summary above a threshold, plus the same actor set, collapses to one — preferring the verified beat, then the one with more evidence citations, which is the preferencededupe_beatsalready encodes. Keep it conservative: two genuinely different events at the same second do happen (simultaneous speech is why ranged timestamps exist).Measure it on the replay, where the answer is known: 59 events with at least 6 collapsible, and the four waking-up rows should become one or two. The kind distribution is also worth recording while in here:
otherwas 27 of 59, which suggests the extraction prompt's type list does not fit exploration sessions well — possibly a separate issue.Related: #423 (why passes repeat), #568 (the log this inflates), #566 (ordering).
More evidence from run 3 (Gemma 4 26B on the dev replay, 2026-09-11 03:28 UTC, run
a0784433, at6533fa1with #591). 83 verified events, and the same-moment duplicates are still there:That's at least 10 surplus rows out of 83. Since #589 they matter for the prose too: the summary is written from 30 events stratified by time, so a triple costs the section it sits in two slots. The calliope triple and the detect magic triple sit in the 00:43 to 00:54 stretch, which is also where the summary lost the Thieves' Cant detail run 2 had kept.
The two identical-time cases are the cheapest win: same
t_startand the same normalised summary text is safe to collapse with no judgement at all.Picking up the judgement-free part only (2026-09-11), in one branch with #595.
beats_collapsedcount onsummarisation_runs. NULL means not measured, following the convention ofhallucination_dropsandname_snaps.The exact-duplicate rule is merged (PR #598, main
0935b7a) and deployed to dev. It was measured on run6d3e6f54(Gemma 4 26B, 2026-09-11 05:45 UTC).This run produced no exact duplicates, so the rule collapsed none. The log says: "Dedupe removed 126 beat(s) across the passes: 126 by shared citation and actor, 0 exact duplicate(s)". A normalised same-second, same-text query over the stored events agrees: 0 groups in run 4, against 3 in run 3. That's run-to-run variance in the model's output, not the rule at work. The rule is covered by 21 unit tests, but this run couldn't demonstrate it.
beats_collapsed= 126 is that total.What's left is rewordings, and there are more of them. Nine same-second pairs survived in run 4, each two phrasings of one moment:
Most of the pairs are one moment told from the GM's side and from the player's. That's the next thing to collapse: same second, overlapping citation window, one GM-only actor list and one player actor list. It needs a judgement rule, measured on this replay. It's also where #596's
table_adminlabel will change the picture, since several of the GM-side copies are description rather than events. So the judgement half here is best done after #596 is measured.