Skip to content

fix(sqlite): attribute unknown column selections to columns - #2774

Merged
morluto merged 1 commit into
morluto:mainfrom
yasshmittal:fix/sqlite-column-selection-path
Oct 13, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
yasshmittal:fix/sqlite-column-selection-path

Conversation

@yasshmittal

Copy link
Copy Markdown
Contributor

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 in issues[].path would change the wrong one.

Problem and expected behavior

SqliteDatabaseInspection raised every selection rejection with the worker reason selection, and SqliteDatabaseWorkerExecution mapped every selection reply to table. The column check therefore inherited the table attribution. An unknown column should identify columns; an unknown table should still identify table.

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 keep table. 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 in SqliteDatabaseWorkerExecution.ts.

  • Contribution scope fit and linked maintainer decision: not applicable (bug fix).

  • CLI and MCP/tool-catalog contract: schema unchanged; issues[0].path for 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.ts checks the unknown-column issue (path, reason, message), keeps the unknown-table control on table, and confirms a valid columns: ["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.

  • Ran an end-to-end check through SqliteDatabaseProvider and the real compiled dist/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.
  • Browser, Ghidra and SQLite test directories run with and without the change: the only differences are the new boundary tests, which hit the same Windows native-addon limitation.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Clients matching only reason are unaffected; clients reading path now receive the correct argument.
  • Real Hopper/Ghidra, browser, or OS coverage: Windows only; the committed boundary test runs on Linux/macOS CI.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no new I/O, process, or network behavior.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T12:11:42.987551Z b543e14 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Unknown column selections now point to columns; table selections still point to table.

  • Unknown SQLite columns point to the columns argument.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Selection rejected] --> B{Missing selection}
  B -->|Column| C[column-selection]
  B -->|Table| D[selection]
  C --> E[Issue path: columns]
  D --> F[Issue path: table]
Loading

Reviews (2) · Last reviewed commit: "fix(sqlite): attribute unknown column se..." · Reviewed by Greptile

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>
@yasshmittal
yasshmittal force-pushed the fix/sqlite-column-selection-path branch from 0380880 to b543e14 Compare October 13, 2026 12:09
@morluto
morluto merged commit d2e16b2 into morluto:main Oct 13, 2026
1 check passed
@morluto morluto added the bug Something isn't working label Oct 14, 2026
@morluto

morluto commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Appreciate this precise SQLite error fix, @yasshmittal. Mapping an unknown column to columns while retaining table for unknown tables means clients can point users to the argument that actually needs correction.

@morluto morluto added the provider: sqlite Analysis provider / engine: sqlite label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working provider: sqlite Analysis provider / engine: sqlite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(sqlite): identify columns in rejected column-selection metadata

2 participants