fix(sqlite): classify a missing database path as an invalid value (#2775)

* fix(sqlite): classify a missing database path as an invalid value

The snapshot reported an absent selected database as an artifact path
failure, which the adapter projects as invalid_format alongside malformed
paths and content. The snapshot owns the absence observation, so it now
returns an invalid_value input issue on path directly, matching the
adapter's existing ENOENT/ENOTDIR classification.

Fixes #2614

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(sqlite): classify a missing database path as an invalid value

The snapshot reported an absent selected database as an artifact path
failure, which the adapter projects as invalid_format alongside malformed
paths and content. The snapshot owns the absence observation, so it now
returns an invalid_value input issue on path directly, matching the
adapter's existing ENOENT/ENOTDIR classification.

Fixes #2614

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
yasshmittal
2026-10-13 21:48:39 +08:00
committed by GitHub
co-authored by Claude Opus 5.5 morluto
parent c8e85b962a
commit 4c79127fcb
2 changed files with 36 additions and 5 deletions
@@ -357,6 +357,30 @@ it("does not execute views when selecting rows", async () => {
});
});
nativeTest.each(["absent.db", "absent-parent/absent.db"])(
"classifies a missing %s as an invalid value",
async (name) => {
const workspace = await createTestWorkspace("rea-sqlite-missing-");
onTestFinished(() => removeTestWorkspace(workspace.root));
const path = workspace.path(name);
const provider = createProvider();
onTestFinished(() => provider.close());
const result = await provider.inspect({ path });
if (result.ok) throw new Error("Expected a missing database rejection");
expect(projectAnalysisError(result.error)).toMatchObject({
details: {
issues: [
{
path: ["path"],
reason: "invalid_value",
message: `Selected SQLite database does not exist: ${path}`,
},
],
},
});
},
);
it("attributes table and column selection failures to their own arguments", async () => {
const { database } = await createFixture();
const provider = createProvider();