fix: read tool calls and prose from the v2 session store (#30) #32
Reference in New Issue
Block a user
Delete Branch "fix/v2-snippet-claims"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #30.
Studies both readers that were left on the v1
parttable after the 2.0.24 migration:SnippetExtractor.ExtractAll(internal/ingest/snippets.go)claims.LoadSession(internal/claims/opencode.go)Both now read
session_message.data$.content[]first and fall back topartonly for messages/sessions v2 does not describe, so a migrated session is never read twice.Shape differences handled
$.tool$.namefilePathpath(both accepted)$.state.output$.state.content[]bashbashandshellpatchpartsPatchHashstays emptyPatchHashis stored as metadata only; supersession already derives from the last fullwrite, so nothing depends on it.Why it matters
partstops at 2026-11-01 20:58 while sessions continue. 1,475 completedwrite/edit/bash/shellcalls exist in v2 that v1 never saw — all currently invisible to snippet curation and to the claim lint.Tests
TestSnippetExtractorReadsSessionV2— a v2writebecomes a candidate with the right language/project/model.TestSnippetExtractorShellV2—shell,state.content,path, heredoc →technique.TestSnippetExtractorDoesNotDoubleCountV1AndV2— a session in both shapes is mined once; a v1-only session still falls back.TestLoadSessionV2— prose from$.content, evidence from$.state.content, and a completed tool backing the figure →Sourced. Running tools contribute nothing.TestLoadSessionFallsBackToLegacyParts— pre-v2 messages still read frompart.go build ./... && go vet ./... && go test ./...pass.