Files
beads/cmd/bd
Steve Yegge 92b10b0806 Implement bd-zbq2: Export JSONL line count verification
After atomic rename during export, verify that the JSONL file contains
exactly the same number of lines as issues exported. This catches silent
export failures where the operation appears to succeed but doesn't
actually write all issues.

Real-world scenario that motivated this:
- SQL DELETE removed 240 issues
- 'bd export' appeared to succeed
- But JSONL was never updated
- Later session found all 240 deleted issues 'came back'

Changes:
- Add verification after os.Rename in exportCmd
- Reuse existing countIssuesInJSONL() helper
- Exit with clear error if mismatch detected
- Add test case that verifies detection works

Error message shown on mismatch:
  Error: Export verification failed
    Expected: 276 issues
    JSONL file: 516 lines
    Mismatch indicates export failed to write all issues

Tests:
✓ All existing export tests pass
✓ New test verifies line counting works correctly
✓ Test simulates corruption by truncating file

Performance: Verification is fast (just counts lines), minimal overhead
2025-11-05 14:31:41 -08:00
..
2025-10-31 22:39:53 -07:00
2025-11-05 14:25:48 -08:00
2025-11-05 14:25:48 -08:00
2025-11-05 13:56:12 -08:00
2025-11-05 13:56:12 -08:00
2025-10-31 22:39:53 -07:00
2025-11-05 13:56:12 -08:00
2025-11-02 21:25:40 -08:00
2025-11-02 17:09:39 -08:00
2025-11-02 17:09:39 -08:00
2025-11-05 01:16:45 -08:00