fix(sessions): distinguish produced and observed commits#369
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 92515d5383
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let mut sql = "SELECT provider, session_id, branch, worktree, | ||
| commit_sha, committed_at, span_overlap_kind | ||
| commit_sha, committed_at, span_overlap_kind, | ||
| relation, evidence, confidence, evidence_message_id |
There was a problem hiding this comment.
Guard commit reads against pre-v3 read-only stores
When tracedecay_sessions_for runs through MCP it opens sessions.db read-only, so an existing v2 store is not migrated before this query runs. In that case commit_sessions exists but does not have the newly added relation/evidence columns, and commit lookups fail with no such column instead of returning a graceful empty/legacy result until the next writable sync migrates the DB. Please detect the v3 schema/columns on the read path (or avoid selecting these columns unless present).
Useful? React with 👍 / 👎.
| } | ||
| matches!( | ||
| subcommand, | ||
| Some("commit" | "cherry-pick" | "revert" | "merge") |
There was a problem hiding this comment.
Avoid treating fast-forward merges as produced commits
For successful commands such as git merge --ff-only origin/main && git rev-parse HEAD, this classifies the segment as commit-producing and then records the reported HEAD as direct produced evidence, even though a fast-forward merge only moves the branch to an existing commit made elsewhere. That reintroduces false authorship for merge/abort/no-op merge flows that report HEAD after the command; only merge commands that actually create a merge commit should feed produced candidates.
Useful? React with 👍 / 👎.
Adds transactional git-correlation schema migration, explicit produced versus observed commit evidence, direct host commit attribution, and truthful MCP/session filtering. Root cause: overlap-based correlation was presented as authorship. Validated with focused correlation, host-event, MCP, and backfill tests plus formatting and structured diagnostics.