Repository navigation
fix(sqlite): attribute unknown column selections to columns - #2774
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Every worker "selection" rejection was projected onto the table argument, including an exact column name that does not exist in an existing table. Give column rejections their own worker reason and map each input reason to the caller argument it requires correcting. Table rejections keep the table path. Fixes morluto#2613 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0380880 to
b543e14
Compare
|
Appreciate this precise SQLite error fix, @yasshmittal. Mapping an unknown column to |
Summary
Fixes #2613.
Requesting a column that does not exist in an existing table returned an input issue on
["table"]. The message named the missing column correctly, but a client that repairs the argument inissues[].pathwould change the wrong one.Problem and expected behavior
SqliteDatabaseInspectionraised every selection rejection with the worker reasonselection, andSqliteDatabaseWorkerExecutionmapped everyselectionreply totable. The column check therefore inherited the table attribution. An unknown column should identifycolumns; an unknown table should still identifytable.Change and scope
Column rejections now use their own worker reason,
column-selection. The reply projection maps each input reason through one explicit table (format/unsupported→path,selection→table,column-selection→columns), so the TypeScript checker requires every reason to name its argument. Table, view, virtual-table and schema-scope rejections keeptable. The message text is unchanged.Not included: the index of the rejected element in the path (
["columns", 1]). The issue marks it optional, and adding it would widen the worker reply protocol.Contribution scope: an ordinary fix within existing boundaries; no maintainer scope decision applies.
Contract and boundary impact
Semantic owner and earliest changed stage: the inspection failure reason in
src/sqlite/SqliteDatabaseInspection.ts, then the reply projection inSqliteDatabaseWorkerExecution.ts.Contribution scope fit and linked maintainer decision: not applicable (bug fix).
CLI and MCP/tool-catalog contract: schema unchanged;
issues[0].pathfor an unknown column changes from["table"]to["columns"].Provider, bridge, target-format, or platform compatibility: the worker reply enum gains an internal reason; the worker and its parent ship together.
Evidence, artifact, provenance, or reconstruction contract: unchanged.
Target selection, authority, upstream behavior, and cleanup details: unchanged; read-only snapshot inspection.
Generated metadata, package, or installation impact: none.
Read existing files or captured data.
Evidence and regression coverage
Tests added or updated:
tests/boundary/sqlite/sqliteDatabaseProvider.test.tschecks the unknown-column issue (path, reason, message), keeps the unknown-table control ontable, and confirms a validcolumns: ["id"]selection still returns rows.Base reproduction or other evidence: on the base revision the unknown-column request returns
{"path":["table"],"reason":"invalid_format",…}, as in the issue.User-visible CLI/MCP output:
{"path":["columns"],"reason":"invalid_format","message":"Selected column does not exist with that exact name in table records: nope"}Remaining proof gaps: the committed boundary test needs the private runtime root, which on Windows requires the Linux/MinGW-built native addon, so it did not run on this host. See Validation.
Observed, derived, and inferred claims remain distinguishable.
Artifact identity, source provenance, and failed attempts remain preserved.
Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
Host: Windows 11, Node.js 24.21.0. The native Windows addon (
native/windows/build) can only be built on Linux with MinGW, so the SQLite provider boundary file cannot complete on this host. That includes 17 existing tests that fail identically on the base revision.SqliteDatabaseProviderand the real compileddist/sqlite/SqliteDatabaseWorker.js, with a plain temporary root and plain child-process launcher (not committed): unknown column →["columns"], unknown table →["table"], valid["id"]selection → 1 row.npm run check: passed.npm run verify:test-discovery: passed.Compatibility, safety, and release
reasonare unaffected; clients readingpathnow receive the correct argument.Before merge
type(scope): outcome.🤖 Generated with Claude Code