From 939ade731f0cd729fbf76dffb13fdffa707fe38e Mon Sep 17 00:00:00 2001 From: Dirceu Pereira Tiegs Date: Fri, 26 Dec 2025 02:52:43 +0700 Subject: [PATCH] fix: doctor check skips interactions.jsonl and molecules.jsonl (GH#709) (#739) The fix for GH#709 updated FindJSONLInDir to skip interactions.jsonl, but the doctor check in CheckLegacyJSONLFilename was not updated. This caused `bd doctor` to warn about multiple JSONL files when both issues.jsonl and interactions.jsonl exist (which is normal after `bd init`). Also skip molecules.jsonl which is another system file that shouldn't be counted as a duplicate issue database. --- cmd/bd/doctor/legacy.go | 2 ++ cmd/bd/doctor/legacy_test.go | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/cmd/bd/doctor/legacy.go b/cmd/bd/doctor/legacy.go index 3f5112b9..589d3b9b 100644 --- a/cmd/bd/doctor/legacy.go +++ b/cmd/bd/doctor/legacy.go @@ -154,6 +154,8 @@ func CheckLegacyJSONLFilename(repoPath string) DoctorCheck { strings.Contains(lowerName, "~") || strings.HasPrefix(lowerName, "backup_") || name == "deletions.jsonl" || + name == "interactions.jsonl" || + name == "molecules.jsonl" || // Git merge conflict artifacts (e.g., issues.base.jsonl, issues.left.jsonl) strings.Contains(lowerName, ".base.jsonl") || strings.Contains(lowerName, ".left.jsonl") || diff --git a/cmd/bd/doctor/legacy_test.go b/cmd/bd/doctor/legacy_test.go index bcd0bafd..241c9d75 100644 --- a/cmd/bd/doctor/legacy_test.go +++ b/cmd/bd/doctor/legacy_test.go @@ -278,6 +278,24 @@ func TestCheckLegacyJSONLFilename(t *testing.T) { expectedStatus: "ok", expectWarning: false, }, + { + name: "interactions.jsonl ignored as system file (GH#709)", + files: []string{"issues.jsonl", "interactions.jsonl"}, + expectedStatus: "ok", + expectWarning: false, + }, + { + name: "molecules.jsonl ignored as system file", + files: []string{"issues.jsonl", "molecules.jsonl"}, + expectedStatus: "ok", + expectWarning: false, + }, + { + name: "all system files ignored together", + files: []string{"issues.jsonl", "deletions.jsonl", "interactions.jsonl", "molecules.jsonl"}, + expectedStatus: "ok", + expectWarning: false, + }, } for _, tt := range tests {