Skip to content

fix(pr-attribution): time-bound the working-directory correlation - #961

Merged
iamtoruk merged 1 commit into
mainfrom
fix/pr-cwd-time-bound
Aug 10, 2026
Merged

fix(pr-attribution): time-bound the working-directory correlation#961
iamtoruk merged 1 commit into
mainfrom
fix/pr-cwd-time-bound

Conversation

@iamtoruk

Copy link
Copy Markdown
Member

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.

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.
@iamtoruk
iamtoruk merged commit 9703e35 into main Aug 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant