Skip to content

fix(db): run integrity checks on startup and workspace open (#439) - #1240

Open
harshitethic wants to merge 1 commit into
useconcord:mainfrom
harshitethic:fix/439-db-startup-integrity
Open

harshitethic wants to merge 1 commit into
useconcord:mainfrom
harshitethic:fix/439-db-startup-integrity

Conversation

@harshitethic

Copy link
Copy Markdown
Contributor

Fixes #439. Db.check runs quick_check and foreign_key_check and reports the database filename on failure. The control DB is checked at startup; CONCORD_CHECK_ON_OPEN=1 optionally checks each workspace on first open and closes its handle on failure. Wrap database initialization failures with the path for corrupted-file diagnostics, document the setting and recognize it in environment validation. Two regression tests cover a deliberately corrupted DB, foreign-key violations and healthy workspace files. Focused Vitest, API typecheck and ESLint passed on Linux. AI-assisted; review welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offer a startup integrity check (PRAGMA quick_check) for control.db and workspace databases

1 participant