Files
beads/cmd/bd
Steve Yegge 5fabb5fdcc Fix bd-c6cf: Force full export when export_hashes is cleared
When validateJSONLIntegrity() clears export_hashes due to hash mismatch
or missing JSONL, the subsequent export now correctly exports ALL issues
instead of only dirty ones, preventing permanent database divergence.

Changes:
- validateJSONLIntegrity() returns (needsFullExport, error) to signal when
  export_hashes was cleared
- flushToJSONL() moved integrity check BEFORE isDirty gate so integrity
  issues trigger export even when nothing is dirty
- Missing JSONL treated as non-fatal force-full-export case
- Increased scanner buffer from 64KB to 2MB to handle large JSON lines
- Added scanner.Err() check to catch buffer overflow errors
- Updated all tests to verify needsFullExport flag

Fixes database divergence issue where clearing export_hashes didn't
trigger re-export, causing 5 issues to disappear from JSONL in fred clone.

Amp-Thread-ID: https://ampcode.com/threads/T-bf2fdcd6-7bbd-4c30-b1db-746b928c93b8
Co-authored-by: Amp <amp@ampcode.com>
2025-11-01 20:29:13 -07:00
..
2025-10-27 20:08:50 -07:00
2025-10-31 22:39:53 -07:00
2025-10-27 20:08:50 -07:00
2025-10-31 22:38:39 -07:00
2025-10-31 22:39:53 -07:00
2025-10-31 22:39:53 -07:00
2025-10-27 20:08:50 -07:00
2025-10-27 20:08:50 -07:00
2025-10-31 22:39:53 -07:00
2025-10-27 20:08:50 -07:00
2025-10-31 22:39:53 -07:00
2025-10-31 22:39:53 -07:00
2025-10-31 22:39:53 -07:00
2025-10-27 20:08:50 -07:00
2025-11-01 10:43:38 -07:00