Compose selection by kind drops the start of a session: the summary now opens mid-scene #589
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?
Regression from #568/#587, seen on the first real run. Re-summarised the 2026-09-09 session on dev with Gemma 4 26B: 81 verified events, so
select_beats_for_composecapped at 30 and rankedreveal/decision/combat/travelabovesocial/other. The resulting summary opens:That is the event at 02:38. The session's premise is gone. Here are the first verified events in time order, with their kinds:
Everything establishing the session is typed
other, so the kind ranking cut all of it and kept the firsttravel. On this runotherwas 35 of 81 verified events andsocialanother 15, i.e. 62% of the session sits in the two demoted tiers. The same shape appeared on the previous run (other27 of 59).The rule is wrong, not the cap. A summary must span the session; "most significant" is not the same as "representative", and a two-tier kind sort optimises the wrong one. It also compounds #588 (duplicate beats) and the observation that the extractor's type list fits exploration sessions badly.
Proposed replacement: time-stratified selection. Sort verified beats chronologically, divide the session's span into as many buckets as the cap allows, take the best beat from each non-empty bucket (kind priority as the tiebreak within a bucket, earliest first on a tie), then fill any slack from the remaining beats by kind priority and time, and re-sort chronologically. That guarantees the opening and the ending are both represented, keeps the preference for reveals and decisions where a moment offers a choice, stays pure and deterministic, and keeps the identity property below the cap.
Test it against this run's data, where the answer is known: the three opening
otherbeats must survive, and the selection must contain at least one beat from each fifth of the session.Fixed in the PR opened alongside this comment, with one correction to the acceptance test I specified above.
"The three opening
otherbeats must survive" cannot hold on this session's shape, and was not made to hold. With 81 verified events over about fifty minutes and a cap of 30, a bucket is 99 seconds wide; the establishing events are at 00:04, 00:50 and 01:17, all inside bucket zero, which is entitled to one slot. Every other bucket on that run is occupied, so there is no slack to rescue the other two. Forcing it would need either a fill that round-robins buckets or a special case for "the first N events", and both are a different rule than the one specified.What is asserted instead:
Coverage across every fifth of the session, a floor on how many demoted-kind events survive, determinism under reversed input, and both the one-minute and true zero-length spans are also tested. One test from #568 asserted the behaviour this issue removes and was rewritten into three smaller ones; the rest of #568's tests pass unmodified.