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

@@ -12,15 +12,14 @@ import (
)
var (
compactDryRun bool
compactTier int
compactAll bool
compactID string
compactForce bool
compactBatch int
compactWorkers int
compactStats bool
compactRestore string
compactDryRun bool
compactTier int
compactAll bool
compactID string
compactForce bool
compactBatch int
compactWorkers int
compactStats bool
)
var compactCmd = &cobra.Command{
@@ -41,7 +40,6 @@ Examples:
bd compact --id bd-42 # Compact specific issue
bd compact --id bd-42 --force # Force compact (bypass checks)
bd compact --stats # Show statistics
bd compact --restore bd-42 # Restore from snapshot
`,
Run: func(cmd *cobra.Command, args []string) {
ctx := context.Background()
@@ -57,11 +55,6 @@ Examples:
return
}
if compactRestore != "" {
runCompactRestore(ctx, sqliteStore, compactRestore)
return
}
if compactID != "" && compactAll {
fmt.Fprintf(os.Stderr, "Error: cannot use --id and --all together\n")
os.Exit(1)
@@ -367,11 +360,6 @@ func runCompactStats(ctx context.Context, store *sqlite.SQLiteStorage) {
}
}
func runCompactRestore(ctx context.Context, store *sqlite.SQLiteStorage, issueID string) {
fmt.Fprintf(os.Stderr, "Error: --restore not yet implemented\n")
os.Exit(1)
}
func progressBar(current, total int) string {
const width = 40
if total == 0 {
@@ -398,7 +386,6 @@ func init() {
compactCmd.Flags().IntVar(&compactBatch, "batch-size", 10, "Issues per batch")
compactCmd.Flags().IntVar(&compactWorkers, "workers", 5, "Parallel workers")
compactCmd.Flags().BoolVar(&compactStats, "stats", false, "Show compaction statistics")
compactCmd.Flags().StringVar(&compactRestore, "restore", "", "Restore issue from snapshot")
rootCmd.AddCommand(compactCmd)
}