fix(pr-attribution): time-bound the working-directory correlation - #961
Merged
Conversation
The cwd evidence rule attributed ANY session sharing a checkout with a PR-linked session, with no time bound - so a repo whose only captured PR link was pasted once became a black hole: 129 of 131 sessions and a month of unrelated work (~$7.4K direct, $11.2K displayed) attributed to one PR, observed live on the desktop Pull requests tab. Cwd anchors now carry the evidence sessions' own activity window (union across evidence for the same PR set), and only sessions overlapping that window plus a 6h pad inherit the PR. The rule's charter is 'a tool session launched around PR work in this checkout', which is inherently a same-working-stretch claim; the design's own philosophy (timestamps narrow, never create) now applies to this rule too. On the real corpus the row corrected to $450.87 / 21 sessions across the PR's actual two-day working stretch. Regression pins both directions: nearby same-cwd session inherits, weeks-later one never does; multiple evidence sessions widen the window.
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.
User-spotted on the desktop Pull requests tab: one PR showing $11,175 / 125 sessions / a full month. Probe on real data: 129 of the 131 attributed sessions came from the working-directory rule, which had no time bound - the repo's only captured PR link turned its checkout into a black hole that swallowed a month of unrelated work.
Cwd anchors now carry their evidence sessions' activity window and only attribute sessions overlapping it (6h pad); multiple evidence sessions for the same PR widen the window. Real-data result: the row corrected to $450.87 / 21 sessions over the PR's actual two-day working stretch. Existing correlation suite untouched and green; two regression tests pin the bound in both directions. Full suite green.