Repository navigation
Detector: fire BACKTRACK and SCROLL_OVERSHOOT on a burst, not the session span - #55
Open
Orpheus-agent wants to merge 1 commit into
Open
Orpheus-agent wants to merge 1 commit into
Orpheus-agent wants to merge 1 commit into
Conversation
…sion span Both rules counted their signal across the whole session bucket and then gated on the bucket's TOTAL span (first event to last). That only fires when every event the session ever produced happens to fit in one window, so a real burst was missed the moment the user also did something related earlier or later in the session - which is the normal case for a field a user is fighting or a page they are hunting through. Record when each cycle / reversal actually happened and measure the densest burst inside one window via a shared `densestWindow` helper, then report the detection at the burst. This is the same fix shape already applied to RAGE_CLICK / THRASH / RAPID_SCROLL / the other windowed count rules; these are the two remaining rules with the whole-bucket-span bug, and no other open PR touches them. Rebuild public/demo/demo.js, which bundles the detector (CI checks it for staleness alongside the SDK bundles). Regression tests: a late burst of write/erase cycles and a late burst of scroll reversals now fire (both fail on the previous code); signals spread beyond the window still do not.
Orpheus-agent
force-pushed
the
orpheus/daily-improve-20261010-94
branch
from
October 10, 2026 06:34
c21b145 to
6199fa5
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
detectBacktrackanddetectScrollOvershootwere the last two detection rules that counted their signal across a whole session bucket and then gated on the bucket's total span (first event to last).That shape only fires when every event the session ever produced happens to fit in one window. A user who edits a field calmly and then hits a flurry of write/erase cycles - or scrolls normally and then overshoots back and forth - never gets a detection, because the earlier activity alone pushes the span past the window. Those are exactly the sessions the rules exist to catch.
Change
BACKTRACK) and each scroll-direction reversal (SCROLL_OVERSHOOT) actually happened, measure the densest burst of them inside one window via a shareddensestWindowhelper, and report the detection at the burst.RAGE_CLICK,THRASH,RAPID_SCROLLand the other windowed count rules (Detector: report the window burst, not the session total, for THRASH and RAPID_SCROLL #53, Detector: fire the remaining windowed count rules on any burst #54). These two rules are the remainder; no other open PR touches them.Evidence
tests/struggle.test.ts: a late burst of cycles / reversals now fires; signals spread beyond the window still do not.detect.tsand re-running) - they pin the bug, not the fix.pnpm test278 passed (22 files) ·pnpm typecheckclean ·pnpm lintclean · SDK bundles unchanged (sdk:build/sdk:build:minproduce no diff).Scope
Two rules, one shared helper, tests. No behavior change for sessions whose signal already fit in one window.
Opened by Orpheus-agent for Cade's review; not merged autonomously.