Skip to content

fix(storage): purge stale lbug/DuckDB refs after ADR 0019; fix 2 latent bugs#247

Merged
theagenticguy merged 1 commit into
mainfrom
fix/adr0019-stale-storage-refs
Jun 22, 2026
Merged

fix(storage): purge stale lbug/DuckDB refs after ADR 0019; fix 2 latent bugs#247
theagenticguy merged 1 commit into
mainfrom
fix/adr0019-stale-storage-refs

Conversation

@theagenticguy

Copy link
Copy Markdown
Owner

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

…nt bugs

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.
Sweep and correct them, and fix two real bugs the migration left behind:

1. describeArtifacts() still returned graphFile="graph.lbug" /
   temporalFile="temporal.duckdb" (paths.ts). That value is a live
   existence probe (is-indexed.ts) and the user-facing path in the MCP
   "store unreadable" error (tools/shared.ts). openStore() writes
   store.sqlite, so both pointed at a file that never exists. Now returns
   store.sqlite for both views. paths.test.ts updated (it pinned the wrong
   values, so it was green while asserting broken behavior).

2. bm25CorpusHasSummaries() probed `information_schema.tables`
   (tools/query.ts) — 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. Switched to sqlite_master; updated
   the test mock that pinned the old string.

Also: the `sql` MCP 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.

Verified: core-types/storage/mcp/cli typecheck clean; storage (81),
mcp (234), cli (346) suites pass; banned-strings gate passes.
@theagenticguy theagenticguy merged commit 90f40a2 into main Jun 22, 2026
38 checks passed
@theagenticguy theagenticguy deleted the fix/adr0019-stale-storage-refs branch June 22, 2026 17:25
@github-actions github-actions Bot mentioned this pull request Jun 22, 2026
theagenticguy pushed a commit that referenced this pull request Jun 25, 2026
🤖 Automated release via release-please
---


<details><summary>root: 0.9.2</summary>

##
[0.9.2](root-v0.9.1...root-v0.9.2)
(2026-06-24)


### Features

* **analysis:** plumbing sieve + candidate_business tag (deterministic,
advisory)
([#248](#248))
([383b719](383b719))
* **ingestion:** business-logic analyze phase — populate likely_plumbing
+ candidate_business
([#249](#249))
([a3d44ad](a3d44ad))
* **storage:** single-file SQLite + WASM embedder — zero native
dependencies
([#245](#245))
([c72c84f](c72c84f))


### Bug Fixes

* **storage:** purge stale lbug/DuckDB refs after ADR 0019; fix 2 latent
bugs ([#247](#247))
([90f40a2](90f40a2))
</details>

<details><summary>cli: 0.9.2</summary>

##
[0.9.2](cli-v0.9.1...cli-v0.9.2)
(2026-06-24)


### Features

* **storage:** single-file SQLite + WASM embedder — zero native
dependencies
([#245](#245))
([c72c84f](c72c84f))


### Bug Fixes

* **storage:** purge stale lbug/DuckDB refs after ADR 0019; fix 2 latent
bugs ([#247](#247))
([90f40a2](90f40a2))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant