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>
8.9 KiB
8.9 KiB