Commit Graph

8 Commits

Author SHA1 Message Date
Steve Yegge
6f7e7fa930 Fix lint errors: handle error return values 2025-11-15 12:52:34 -08:00
Steve Yegge
f862071c7e Refactor snapshot management into dedicated module (bd-urob)
- Created SnapshotManager type in snapshot_manager.go
- Encapsulates all snapshot operations with clean API
- Added SnapshotStats for observability
- Reduced deletion_tracking.go from 557 to 153 lines (72% reduction)
- Enhanced merge output with statistics
- All tests passing

Amp-Thread-ID: https://ampcode.com/threads/T-d82acce9-170d-4e58-b227-fd33d48b8598
Co-authored-by: Amp <amp@ampcode.com>
2025-11-08 02:20:33 -08:00
Steve Yegge
5c1f441c2a Fix bd-ng56: add raw string equality short-circuit before jsonEquals
Optimization to avoid JSON unmarshalling when strings match exactly (common case).
Simple 1-line change instead of complex streaming rewrite for P3 issue.
2025-11-06 19:41:27 -08:00
Steve Yegge
a891ebe79e Add snapshot versioning and timestamp validation (bd-2997)
- Add snapshotMetadata struct with version, timestamp, commit SHA
- Validate snapshots are <1 hour old, from compatible version
- Auto-cleanup stale snapshots from interrupted syncs
- All snapshot functions now write/validate metadata files
- Fixes issue where crash/kill -9 left stale snapshots
2025-11-06 19:36:13 -08:00
Steve Yegge
47185830bb Fix bd-4oob: Add multi-repo deletion tracking support
- Added getMultiRepoJSONLPaths() helper to enumerate all JSONL files
- Updated daemon_sync.go to capture/update snapshots for each repo
- Added TestMultiRepoDeletionTracking to verify fix
- Added TestMultiRepoSnapshotIsolation for isolation guarantees

Previously, deletion tracking only worked for single-repo mode because
snapshot operations were hardcoded to the primary JSONL path. This fix
ensures snapshots are managed per-repository in multi-repo mode.
2025-11-06 19:21:11 -08:00
Steve Yegge
e291ee078e Fix storage backend extensibility by adding DeleteIssue to Storage interface
- Added DeleteIssue to Storage interface
- Implemented DeleteIssue in MemoryStorage backend
- Removed brittle type assertion from deletion_tracking.go
- Closes bd-1fkr
2025-11-06 19:17:06 -08:00
Steve Yegge
e5a6c05e38 Fix P1 deletion tracking bugs (bd-rbxi)
- bd-nqes: Made snapshot capture mandatory with fail-fast
- bd-mn9p: Added semantic JSON comparison (jsonEquals)
- bd-2ifg: Collect deletion errors and fail operation
- bd-8ayj: Atomic file ops with PID-specific temp files
- bd-aewm: Added defer cleanup for .merged temp file

All tests pass.

Amp-Thread-ID: https://ampcode.com/threads/T-5e744954-8a08-4697-960e-5f2a88d50c54
Co-authored-by: Amp <amp@ampcode.com>
2025-11-06 18:47:06 -08:00
Steve Yegge
708a81c491 Fix bd-hv01: Implement deletion tracking for multi-workspace sync
- Add 3-way merge deletion tracking using snapshot files
- Create .beads/beads.base.jsonl and .beads/beads.left.jsonl snapshots
- Integrate into both sync.go and daemon_sync.go
- Add comprehensive test suite in deletion_tracking_test.go
- Update .gitignore to exclude snapshot files

This fixes the resurrection bug where deleted issues come back after
multi-workspace git sync. Uses the beads-merge 3-way merge logic to
detect and apply deletions correctly.
2025-11-06 17:52:37 -08:00