Loading…
Reference in a new issue
No description provided.
Delete branch "fix/589-selection-and-detector"
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?
Closes #589. Advances #584. Both found by re-running a real session on dev after this morning's merges.
#589 — the summary was opening mid-scene.
select_beats_for_composeranked two kind tiers and took thirty, and on a session with 81 verified events that cut everything typedother— which on an exploration session is the establishing material. The summary opened at 02:38 with a character moving to a lower level; waking up displaced was gone. Selection is now time-stratified: the session's span is divided into as many buckets as the cap allows, each non-empty bucket contributes its best beat (kind tier only as the within-bucket tiebreak), any slack is filled by rank, and the result is re-sorted chronologically. Identity below the cap is unchanged.The honest cost, which is tested rather than hidden: with 81 beats over fifty minutes a bucket is 99 seconds wide, so a session whose first three events land inside 77 seconds gets one of them, not three.
test_the_session_opens_where_the_session_openedpins that the prose now starts where the session started,test_a_dense_opening_still_costs_its_second_and_third_beatpins the cost with the arithmetic, andtest_a_shorter_session_keeps_the_whole_openingshows the case where all three survive. One #568 test asserted the old behaviour and was rewritten; the rest pass untouched.#584 — the detector was looking at the wrong text. It ran against the compacted transcript, where consecutive same-speaker lines merge, so the "short answer" test that gives it its precision could not fire. It now runs against the raw lines behind each merged line. The mapping is built by walking the two line lists in step and matching on second and speaker rather than by stamp arithmetic, because on the golden transcript pure arithmetic yields an empty window for four lines that collide on the same second — a new blind spot inside the fix for a blind spot. The detector still only reports, still logs counts only.
Three things I had wrong, corrected here by measurement:
The golden fixture cannot demonstrate the underlying bug — it is authored as strict turn-taking, so only 9 of its 209 lines merge — which is stated in the docstring and is another reason the detector still reports rather than rejects.
Eval scores identical before and after on both fixture sets. Full backend suite 3,137 passed; formatted with CI's ruff.
🤖 Generated with Claude Code