-
Notifications
You must be signed in to change notification settings - Fork 0
Fix stale attribution base when unrelated commits occur during an active agent session #151
Copy link
Copy link
Open
Labels
Description
Description
In long agent sessions where the user also makes unrelated commits between agent turns, the AttributionBaseCommit stored in session state is not updated when those unrelated commits land. When the agent eventually commits, the attribution diff (AttributionBaseCommit → HEAD) spans multiple unrelated human commits, inflating the human line count and deflating the agent percentage.
This was fixed in entireio/cli#792.
What to fix
In the post-commit hook:
- When a commit lands without a
Partio-Checkpoint:trailer (i.e. an unrelated human commit during an active session), update the session'sAttributionBaseCommitto the new HEAD. - This ensures subsequent agent-attributed commits diff only against the most recent baseline — not a stale session-start commit.
- Add an integration test that makes unrelated commits mid-session and verifies the final agent attribution reflects only the agent's own changes.
Acceptance Criteria
- When unrelated commits occur during an active agent session, attribution for subsequent agent commits is scoped to changes since the last unrelated commit
AttributionBaseCommitin session state is updated when the post-commit hook runs without a checkpoint trailer- Attribution percentages are not deflated by including prior unrelated changes in the human-side diff
- Existing attribution tests still pass
make testpassesmake lintpasses
Source
Inspired by entireio/cli#792
Reactions are currently unavailable