From ca5e32e5f2e9095488253218d2f7cd2c570ebb19 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Thu, 6 Nov 2025 20:15:17 -0800 Subject: [PATCH] Remove commented-out code Cleaned up old bd-160 export hash tracking code that was disabled. Removed unnecessary test comments. Amp-Thread-ID: https://ampcode.com/threads/T-de38a626-a425-414f-92d8-102bc1519c8b Co-authored-by: Amp --- cmd/bd/autoflush.go | 27 +------------------- cmd/bd/export.go | 26 ++----------------- internal/beads/beads_hash_multiclone_test.go | 2 -- 3 files changed, 3 insertions(+), 52 deletions(-) diff --git a/cmd/bd/autoflush.go b/cmd/bd/autoflush.go index 91b8fc16..d0f83db6 100644 --- a/cmd/bd/autoflush.go +++ b/cmd/bd/autoflush.go @@ -458,35 +458,10 @@ func writeJSONLAtomic(jsonlPath string, issues []*types.Issue) ([]string, error) exportedIDs := make([]string, 0, len(issues)) for _, issue := range issues { - // DISABLED: timestamp-only deduplication causes data loss (bd-160) - // skip, err := shouldSkipExport(ctx, issue) - // if err != nil { - // if os.Getenv("BD_DEBUG") != "" { - // fmt.Fprintf(os.Stderr, "Debug: failed to check if %s should skip: %v\n", issue.ID, err) - // } - // skip = false - // } - // if skip { - // skippedCount++ - // continue - // } - if err := encoder.Encode(issue); err != nil { - return nil, fmt.Errorf("failed to encode issue %s: %w", issue.ID, err) + return nil, fmt.Errorf("failed to encode issue %s: %w", issue.ID, err) } - // DISABLED: export hash tracking (bd-160) - // contentHash, err := computeIssueContentHash(issue) - // if err != nil { - // if os.Getenv("BD_DEBUG") != "" { - // fmt.Fprintf(os.Stderr, "Debug: failed to compute hash for %s: %v\n", issue.ID, err) - // } - // } else if err := store.SetExportHash(ctx, issue.ID, contentHash); err != nil { - // if os.Getenv("BD_DEBUG") != "" { - // fmt.Fprintf(os.Stderr, "Debug: failed to save export hash for %s: %v\n", issue.ID, err) - // } - // } - exportedIDs = append(exportedIDs, issue.ID) } diff --git a/cmd/bd/export.go b/cmd/bd/export.go index 7a014909..3967994b 100644 --- a/cmd/bd/export.go +++ b/cmd/bd/export.go @@ -236,33 +236,11 @@ Output to stdout by default, or use -o flag for file output.`, exportedIDs := make([]string, 0, len(issues)) skippedCount := 0 for _, issue := range issues { - // DISABLED: timestamp-only deduplication causes data loss (bd-160) - // The export_hashes table gets out of sync with JSONL after git operations, - // causing exports to skip issues that aren't actually in the file. - // - // skip, err := shouldSkipExport(ctx, issue) - // if err != nil { - // fmt.Fprintf(os.Stderr, "Warning: failed to check if %s should skip: %v\n", issue.ID, err) - // skip = false - // } - // if skip { - // skippedCount++ - // continue - // } - if err := encoder.Encode(issue); err != nil { - fmt.Fprintf(os.Stderr, "Error encoding issue %s: %v\n", issue.ID, err) - os.Exit(1) + fmt.Fprintf(os.Stderr, "Error encoding issue %s: %v\n", issue.ID, err) + os.Exit(1) } - // DISABLED: export hash tracking (bd-160) - // contentHash, err := computeIssueContentHash(issue) - // if err != nil { - // fmt.Fprintf(os.Stderr, "Warning: failed to compute hash for %s: %v\n", issue.ID, err) - // } else if err := store.SetExportHash(ctx, issue.ID, contentHash); err != nil { - // fmt.Fprintf(os.Stderr, "Warning: failed to save export hash for %s: %v\n", issue.ID, err) - // } - exportedIDs = append(exportedIDs, issue.ID) } diff --git a/internal/beads/beads_hash_multiclone_test.go b/internal/beads/beads_hash_multiclone_test.go index 9fa7f4e7..01bc1441 100644 --- a/internal/beads/beads_hash_multiclone_test.go +++ b/internal/beads/beads_hash_multiclone_test.go @@ -207,8 +207,6 @@ func setupClone(t *testing.T, tmpDir, remoteDir, name, bdPath string) string { runCmd(t, cloneDir, bdCmd, "init", "--quiet", "--prefix", "test") } - // Skip git hooks installation in tests - not needed and slows things down - // installGitHooks(t, cloneDir) return cloneDir }