fix(FN-XXXX): guard Database against nested .fusion/.fusion paths

Throws if a caller passes a path whose last two segments are both `.fusion` — that pattern only happens when a Store class joins `.fusion` onto a path that already ends in `.fusion`. Surfaces the bug at the call site instead of silently creating a stray nested directory under the project. Complements the recent in-process-runtime PluginStore fix by catching any other call paths still passing the wrong rootDir.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-01 21:56:59 -07:00
parent 03d0fac59c
commit 36d623a16f
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"@runfusion/fusion": patch
---
Add a defensive guard in `Database` constructor that throws when opening a database at a path whose last two segments are both `.fusion`. This catches caller bugs where a `.fusion` directory is passed in place of a project root (causing `.fusion/.fusion/fusion.db` to be silently created). Future regressions of this class of bug now fail loudly at the originating call site instead of leaving stray nested directories.