🏗️ refactor(kebab-store-sqlite): harden open_existing against silent create (fb-27)

Replace `path.exists()` + `Connection::open` (which silently CREATEs on
race) with `Connection::open_with_flags` using READ_WRITE|URI but NOT
CREATE. SQLite surfaces `SQLITE_CANTOPEN` for missing files; we wrap as
NotIndexed { found: None } as before.

Adds open_existing_does_not_create_missing_db regression test pinning
the no-side-effect invariant.

Also documents read-only intent on open_existing, the format contract
on NotIndexed.found, and removes scaffolding comments from kebab-app
error_signal that are no longer load-bearing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
th-kim0823
2026-05-07 11:40:42 +09:00
parent d7bfd01ef5
commit 1c4d554bf4
3 changed files with 30 additions and 12 deletions

View File

@@ -11,5 +11,5 @@
pub use crate::doctor_signal::{DoctorUnhealthy, NoHitSignal, RefusalSignal};
pub use kebab_llm_local::LlmError;
pub use kebab_config::ConfigInvalid; // wired in Task 2
pub use kebab_store_sqlite::NotIndexed; // wired in Task 3
pub use kebab_config::ConfigInvalid;
pub use kebab_store_sqlite::NotIndexed;