Skip to content

fix(session): keep open findings when HEAD moves - #17

Merged
fiddur merged 1 commit into
developfrom
session-continuity
Aug 21, 2026
Merged

fix(session): keep open findings when HEAD moves#17
fiddur merged 1 commit into
developfrom
session-continuity

Conversation

@fiddur

@fiddur fiddur commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

The blocker for reviewing your own change, found while wiring #16.

A session is identified by ref and HEAD hash together:

SELECT id FROM review_sessions WHERE ref = ? AND head_hash = ?

So the first commit after a review creates a new session and leaves every thread and walkthrough
behind in the old one — still in the database, invisible in the browser. That breaks the own-PR loop
exactly where it matters, because acting on a finding is what moves HEAD. It is also why the live
session on NCBackend3#14360 showed the walkthrough but none of the five findings: they were stranded
in an earlier session after gh pr checkout fast-forwarded the branch.

Open threads and walkthroughs are now moved into the new session. Moved rather than copied, so ids
stay stable and nothing duplicates. Resolved and dismissed threads stay behind — they belong to the
commit where they were dealt with, and reopening them on every later commit would be noise.

Tested end to end against a real repository: create a session, add an open finding, a resolved one
and a walkthrough, commit, and assert the open finding and the walkthrough follow while the resolved
one stays. vitest wired for the diffity CLI package, which had no tests.

Not done yet: line numbers are not re-anchored, so a thread whose code moved still points at the
line it was written against. anchor_content is already stored for exactly that, so re-anchoring is
the natural follow-up — and it matters more once findings survive commits.

Stacked on #16.

🤖 Generated with Claude Code

https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs

A session is identified by ref and HEAD hash together, so the first commit after a review
created a new one and left every thread and walkthrough behind in the old session -
present in the database, invisible in the browser. That breaks reviewing your own change
exactly where it matters: acting on a finding is what moves HEAD.

Open threads and walkthroughs are now moved into the new session. Resolved and dismissed
threads stay behind, since they belong to the commit where they were dealt with and
reopening them on every later commit would be noise.

Line numbers are not re-anchored yet, so a thread whose code moved still points at the line
it was written against; anchor_content is already stored for that.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
@fiddur
fiddur changed the base branch from project-data-dir to develop August 21, 2026 13:35
@fiddur
fiddur marked this pull request as ready for review August 21, 2026 13:35
@fiddur
fiddur merged commit b134bea into develop Aug 21, 2026
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