Remove snapshot/restore functionality from compaction
Snapshots defeated the entire purpose of compaction - if we're keeping the original content, we're not actually saving any space. Compaction is about graceful memory decay for agentic databases, not reversible compression. Removed: - CreateSnapshot/GetSnapshots/RestoreFromSnapshot from storage - --restore flag and functionality from bd compact command - All snapshot-related tests - Snapshot struct and related code The database is ephemeral and meant to decay over time. Compaction actually reduces database size now. Closes bd-260 (won't fix - conceptually wrong) Closes bd-261 (already done in bd-259)
This commit is contained in:
@@ -110,69 +110,7 @@ func BenchmarkCheckEligibility(b *testing.B) {
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkCreateSnapshot(b *testing.B) {
|
||||
store, cleanup := setupBenchDB(b)
|
||||
defer cleanup()
|
||||
ctx := context.Background()
|
||||
|
||||
issue := &types.Issue{
|
||||
ID: "bd-1",
|
||||
Title: "Test Issue",
|
||||
Description: "Original description with substantial content",
|
||||
Design: "Design notes with additional context",
|
||||
Notes: "Additional notes for the issue",
|
||||
AcceptanceCriteria: "Must meet all requirements",
|
||||
Status: "closed",
|
||||
Priority: 2,
|
||||
IssueType: "task",
|
||||
ClosedAt: timePtr(time.Now()),
|
||||
}
|
||||
if err := store.CreateIssue(ctx, issue, "test"); err != nil {
|
||||
b.Fatalf("Failed to create issue: %v", err)
|
||||
}
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
if err := store.CreateSnapshot(ctx, issue, i%5+1); err != nil {
|
||||
b.Fatalf("CreateSnapshot failed: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkGetSnapshots(b *testing.B) {
|
||||
store, cleanup := setupBenchDB(b)
|
||||
defer cleanup()
|
||||
ctx := context.Background()
|
||||
|
||||
issue := &types.Issue{
|
||||
ID: "bd-1",
|
||||
Title: "Test",
|
||||
Description: "Test description",
|
||||
Status: "closed",
|
||||
Priority: 2,
|
||||
IssueType: "task",
|
||||
ClosedAt: timePtr(time.Now()),
|
||||
}
|
||||
if err := store.CreateIssue(ctx, issue, "test"); err != nil {
|
||||
b.Fatalf("Failed to create issue: %v", err)
|
||||
}
|
||||
|
||||
for i := 1; i <= 5; i++ {
|
||||
if err := store.CreateSnapshot(ctx, issue, i); err != nil {
|
||||
b.Fatalf("CreateSnapshot failed: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, err := store.GetSnapshots(ctx, issue.ID)
|
||||
if err != nil {
|
||||
b.Fatalf("GetSnapshots failed: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func generateID(b testing.TB, prefix string, n int) string {
|
||||
func generateID(b testing.TB, prefix string, n int) string{
|
||||
b.Helper()
|
||||
return prefix + string(rune('0'+n/10)) + string(rune('0'+n%10))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user