When 'bd sync --import-only' completes, it imports JSONL changes into the database but doesn't update the database file's modification time. This causes 'bd doctor' to incorrectly warn that 'JSONL is newer than database' even when they're in sync. Root cause: SQLite in WAL mode writes to beads.db-wal; the main beads.db mtime often doesn't change until a checkpoint. bd doctor compares JSONL mtime to beads.db mtime, so it can misfire without an mtime bump. The fix adds touchDatabaseFile() that: - Only runs when import actually made changes (not dry-run, not unchanged) - Sets DB mtime to max(JSONL mtime, now) + 1ns to handle clock skew - Is best-effort (logs warning on failure, doesn't fail import) - Includes tests for basic touch and clock skew scenarios Fixes: bd-g3ey
21 lines
258 B
Plaintext
21 lines
258 B
Plaintext
# SQLite databases
|
|
*.db
|
|
*.db-journal
|
|
*.db-wal
|
|
*.db-shm
|
|
|
|
# Daemon runtime files
|
|
daemon.lock
|
|
daemon.log
|
|
daemon.pid
|
|
bd.sock
|
|
|
|
# Legacy database files
|
|
db.sqlite
|
|
bd.db
|
|
|
|
# Keep JSONL exports and config (source of truth for git)
|
|
!*.jsonl
|
|
!metadata.json
|
|
!config.json
|