chore(localdb): adopt LocalDb 0.1.1 and drop the directory shim

LocalDb 0.1.1 creates the parent directory of LocalDb:Path itself, so the
SiteLocalDbDirectory shim this repo carried through Phase 2 is deleted along
with its call site. The gap was found here but was never ScadaBridge's alone —
every LocalDb consumer had it — so the fix moved to the library.

SiteLocalDbDirectoryTests is RETAINED and retargeted rather than deleted with
the shim. It was already written against the site registration path, not the
mechanism, so it needed only its Ensure() call removed: what a site node
requires is that resolving ILocalDb not fail on a fresh machine, regardless of
who provides that. Verified it still earns its place — pinned back to LocalDb
0.1.0 it fails inside SqliteLocalDb..ctor -> SqliteConnection.Open(), so it
genuinely depends on the library behaviour and not on a coincidence.

Also corrects the coverage-split note in StoreAndForwardStorageTests, which
asserted that directory creation is "NOT LocalDb's" — true when written, wrong
as of 0.1.1.

Build 0 warnings; Host 330, StoreAndForward 130, LocalDb integration 20 pass.

Claude-Session: https://claude.ai/code/session_01BL2Vu1ESDQ9SCN4gVKkdts
This commit is contained in:
Joseph Doherty
2026-07-20 04:58:20 -04:00
parent 9ec7966dac
commit 166f07fa68
5 changed files with 26 additions and 87 deletions
@@ -642,12 +642,12 @@ public class StoreAndForwardStorageTests : IAsyncLifetime, IDisposable
// * WAL is genuinely LocalDb's — it sets the journal mode on the database it owns.
// The test below still asserts it, now against the LocalDb-backed store.
//
// * Directory creation is NOT LocalDb's. The library does not create the parent
// directory and opens the file eagerly, so a missing directory is a hard boot
// failure. The guarantee had to be re-established explicitly in the Host
// (SiteServiceRegistration.EnsureLocalDbDirectoryExists), and it is pinned there
// by SiteLocalDbDirectoryTests — the layer that now owns it. Asserting it here
// would be asserting a guarantee this class no longer provides.
// * Directory creation was NOT LocalDb's when Phase 2 landed: the library did not
// create the parent directory yet opened the file eagerly, so a missing directory
// was a hard boot failure, and the Host re-established the guarantee with a
// SiteLocalDbDirectory shim. LocalDb 0.1.1 took the guarantee back into the
// library, so the shim is gone — but either way it is not this class's to assert,
// and SiteLocalDbDirectoryTests pins the outcome for the site host.
[Fact]
public async Task Initialize_LeavesTheDatabaseInWalJournalMode()