fix(yield): group attribution by canonical repo root, not path string#714
fix(yield): group attribution by canonical repo root, not path string#714ozymandiashh wants to merge 1 commit into
Conversation
The single-owner attribution from #692 keyed repo groups by the raw project.projectPath string while getCommitsInRange runs git log --all repo-wide, so a monorepo (sessions launched from different subdirectories) or linked worktrees formed multiple groups that each pulled the identical history and the same commit was credited once per group. - repo groups are keyed by git rev-parse --show-toplevel, resolved once per path and cached - linked worktrees unify through --git-common-dir, with both sides realpath- canonicalized before comparison (symlinks, platform case); when git or realpath fails the session degrades to the existing cwd fallback, and a comment documents the accepted residual for repos moved after worktree add - regression tests: two sessions from two subdirectories of one repo, and a linked-worktree pair - both mutation-checked to fail if the grouping or the common-dir merge is removed; exactly one productive owner and commitCount 1 in each Closes #713
|
Apologies — this collided with a maintainer-side fix (#719) that was developed in parallel straight off your issue writeup, before we saw this PR; entirely our process miss for not checking the issue's linked PRs first. #719 landed on the same design you proposed (canonical grouping, worktrees unified via realpath'd common-dir, separate repos guarded), so the bug itself is fixed on main. Two details in yours look potentially additive over #719: the explicit platform case-insensitivity handling in the canonical comparison, and the documented residual for a main repo moved after |
Closes #713.
Problem
The single-owner attribution from #692 enforces "one commit, one owner" per launch-directory string: repo groups are keyed by the raw
projectPathwhilegetCommitsInRangerunsgit log --allwith no pathspec. Sessions launched from two subdirectories of one monorepo (or from linked worktrees) form independent groups that each pull the identical repo-wide history, and the same commit is credited once per group - one commit, two productive sessions,commitCount2. Repro details in the issue; every pre-existing test stayed green because each used a single path per repo.Fix
git rev-parse --show-toplevel), resolved once per path and cached.--git-common-dir, both sides realpath-canonicalized before comparison (symlinks, platform case-insensitivity). If git or realpath fails, the session degrades to the existing cwd fallback; a comment documents the accepted residual for a main repo moved aftergit worktree add(git's own metadata is stale in that state).Verification
commitCount1. Pre-fix run on the base recorded both sessions productive.npx tsc --noEmitclean; yield suites 8/8.