You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(storage): purge stale lbug/DuckDB refs after ADR 0019; fix 2 latent bugs (#247)
## Summary
The single-file SQLite migration (ADR 0019, #245) left stale references
to the removed `graph.lbug` + `temporal.duckdb` backends across source
comments, docs, agent-facing MCP tool descriptions, and user-facing
error strings. This sweeps and corrects them, and fixes **two real
bugs** the migration left behind that its own tests did not catch.
## Bugs fixed (behavioral)
**1. `describeArtifacts()` pointed at a file that no longer exists.**
`paths.ts` still returned `graphFile="graph.lbug"` /
`temporalFile="temporal.duckdb"`, but `openStore()` writes
`store.sqlite`. That value is not cosmetic: it feeds the `is-indexed`
existence probe (`cli/src/lib/is-indexed.ts`) and the user-facing path
in the MCP "store unreadable" error (`mcp/src/tools/shared.ts`). So the
error told users to check a `.codehub/graph.lbug` that is gone. Now
returns `store.sqlite` for both views. `paths.test.ts` had pinned the
wrong values, so it was green while asserting broken behavior — updated.
**2. `bm25CorpusHasSummaries()` queried `information_schema.tables`.**
That is a DuckDB/Postgres catalog `node:sqlite` does not expose. The
query threw, was swallowed by the surrounding `try/catch`, and the probe
was silently always-false in production. Switched to `sqlite_master`;
updated the test mock that pinned the old string.
## Also: the `sql` MCP tool contract
The `sql` tool now advertises `nodes`/`edges`/`embeddings` as directly
SQL-queryable (they are real tables in `store.sqlite`) instead of
claiming the graph is "NOT SQL-queryable, reachable only through
Cypher". The `cypher:` arg returns a clear "use `sql:` instead" envelope
against the default SQLite backend (`execCypher` is unimplemented per
ADR 0019, reserved for community forks). `sql.test.ts` updated to assert
the inverted contract.
## Scope
47 files. Most are comment/doc corrections; the 4 above are behavioral.
The DuckDB→SQLite comment pass was context-aware (historical-fact
mentions like "replaced the lbug + **DuckDB** pair" intentionally kept).
## Verification
- typecheck clean: core-types, storage, mcp, cli
- storage suite: 81 pass / 0 fail
- mcp suite: 234 pass / 0 fail
- cli suite: 346 pass / 0 fail
- banned-strings + commitlint pre-commit gates pass
- pre-push test hook passed on push
0 commit comments