diff --git a/internal/utils/path.go b/internal/utils/path.go index 58590bbf..f9ab54ce 100644 --- a/internal/utils/path.go +++ b/internal/utils/path.go @@ -39,11 +39,12 @@ func FindJSONLInDir(dbDir string) string { } } - // Last resort: use first match (but skip deletions.jsonl and merge artifacts) + // Last resort: use first match (but skip deletions.jsonl, interactions.jsonl, and merge artifacts) for _, match := range matches { base := filepath.Base(match) - // Skip deletions manifest and merge artifacts + // Skip deletions manifest, interactions (audit trail), and merge artifacts if base == "deletions.jsonl" || + base == "interactions.jsonl" || base == "beads.base.jsonl" || base == "beads.left.jsonl" || base == "beads.right.jsonl" { diff --git a/internal/utils/path_test.go b/internal/utils/path_test.go index 165c7529..328e439a 100644 --- a/internal/utils/path_test.go +++ b/internal/utils/path_test.go @@ -110,6 +110,16 @@ func TestFindJSONLInDir(t *testing.T) { files: []string{"deletions.jsonl"}, expected: "issues.jsonl", }, + { + name: "only interactions.jsonl - returns default issues.jsonl", + files: []string{"interactions.jsonl"}, + expected: "issues.jsonl", + }, + { + name: "interactions.jsonl with issues.jsonl - prefers issues", + files: []string{"interactions.jsonl", "issues.jsonl"}, + expected: "issues.jsonl", + }, { name: "only merge artifacts - returns default issues.jsonl", files: []string{"beads.base.jsonl", "beads.left.jsonl", "beads.right.jsonl"},