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:
Steve Yegge
2025-10-16 00:26:22 -07:00
parent 7fe6bf3e1d
commit da5493bac0
7 changed files with 291 additions and 510 deletions

View File

@@ -88,10 +88,6 @@ func (c *Compactor) CompactTier1(ctx context.Context, issueID string) error {
return fmt.Errorf("dry-run: would compact %s (original size: %d bytes)", issueID, originalSize)
}
if err := c.store.CreateSnapshot(ctx, issue, 1); err != nil {
return fmt.Errorf("failed to create snapshot: %w", err)
}
summary, err := c.haiku.SummarizeTier1(ctx, issue)
if err != nil {
return fmt.Errorf("failed to summarize with Haiku: %w", err)
@@ -235,10 +231,6 @@ func (c *Compactor) compactSingleWithResult(ctx context.Context, issueID string,
result.OriginalSize = len(issue.Description) + len(issue.Design) + len(issue.Notes) + len(issue.AcceptanceCriteria)
if err := c.store.CreateSnapshot(ctx, issue, 1); err != nil {
return fmt.Errorf("failed to create snapshot: %w", err)
}
summary, err := c.haiku.SummarizeTier1(ctx, issue)
if err != nil {
return fmt.Errorf("failed to summarize with Haiku: %w", err)

View File

@@ -224,18 +224,6 @@ func TestCompactTier1_WithAPI(t *testing.T) {
if afterIssue.AcceptanceCriteria != "" {
t.Error("acceptance criteria should be cleared")
}
snapshots, err := store.GetSnapshots(ctx, issue.ID)
if err != nil {
t.Fatalf("failed to get snapshots: %v", err)
}
if len(snapshots) == 0 {
t.Fatal("snapshot should exist")
}
snapshot := snapshots[0]
if snapshot.Description != issue.Description {
t.Error("snapshot should preserve original description")
}
}
func TestCompactTier1Batch_DryRun(t *testing.T) {