This fixes the atomicity gap where exportToJSONL would update SQLite metadata (clear dirty flags, update content hash, last_import_time) BEFORE the git commit. If git commit failed, SQLite would incorrectly indicate the sync succeeded. Changes: - Add ExportResult struct to capture export metadata for deferred finalization - Add exportToJSONLDeferred() that exports without updating metadata - Add finalizeExport() to update metadata after git commit succeeds - Update daemon_sync.go sync flows to defer metadata updates Now the sync flow is truly atomic: metadata only updates after git commit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Executed-By: beads/crew/dave Rig: beads Role: crew
10 KiB
10 KiB