fix(FN-0000): harden sqlite startup validation

This commit is contained in:
gsxdsm
2026-04-29 07:58:58 -07:00
parent 858e24468f
commit 3202e578c2
19 changed files with 648 additions and 292 deletions

View File

@@ -117,6 +117,16 @@ describe("project-context", () => {
expect(found?.path).toBe(resolve(projectPath));
expect(found?.name).toBe("legacy-project");
});
it("should ignore invalid fusion.db files in the cwd", async () => {
const projectPath = join(tempDir, "invalid-project");
mkdirSync(join(projectPath, ".fusion"), { recursive: true });
writeFileSync(join(projectPath, ".fusion", "fusion.db"), "SQLite format 3\x00");
const found = await detectProjectFromCwd(projectPath, central);
expect(found).toBeUndefined();
});
});
describe("formatProjectLine", () => {