Fix auto-import collision detection and enforce status/closed_at invariant (bd-226)

Code review and fixes:
- Increased scanner buffer to 2MB for large JSON lines
- Added line numbers and snippets to parse error messages
- Made non-SQLite fallback conservative (skip import to prevent data loss)
- Improved collision warnings (concise, show first 10 IDs)
- Removed unused autoImportWithoutCollisionDetection function

Status/closed_at invariant enforcement:
- Auto-import now enforces invariant on all creates/updates
- Fixed CreateIssue to respect closed_at field (was ignoring it)
- Closed issues without closed_at get timestamp set automatically

Integration tests:
- TestAutoImportWithCollision: verifies local changes preserved
- TestAutoImportNoCollision: happy path with new issues
- TestAutoImportClosedAtInvariant: enforces invariant

Closes bd-226, bd-230, bd-231
This commit is contained in:
Steve Yegge
2025-10-15 13:47:46 -07:00
parent ff2ca503db
commit 619ce51250
4 changed files with 383 additions and 174 deletions

File diff suppressed because one or more lines are too long