mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-09-14 14:01:28 +08:00
3e8781bd2c
The bug shipped to npm because no test exercised the user-visible failure
mode: "native better-sqlite3 build failed, package still has to load."
Existing CI ran on Node 20 where prebuilds exist, so the static
`import 'better-sqlite3'` in sqlite-backend.ts evaluated cleanly and the
fallback path in database-provider.ts was never proven.
This job reproduces the failure mode by `npm install --omit=optional`
(equivalent to "native build failed") on Node 22 + 24, then asserts:
1. @claude-flow/memory loads without better-sqlite3 resolvable
2. createDatabase('auto') selects a working fallback backend
3. Round-trip store/get works on the fallback
4. SQLiteBackend.initialize() throws an actionable error
Any future regression (re-adding a static import of an optional dep,
removing the fallback, etc.) fails this job at PR time.
The smoke script is also runnable standalone for manual repro:
cd v3/@claude-flow/memory && npm install && npm run build && npm pack
cd /tmp && mkdir s && cd s && npm init -y && npm pkg set type=module
npm install /path/to/tarball.tgz --omit=optional
node /path/to/scripts/smoke-no-bsqlite.mjs
Refs #1867
Co-Authored-By: RuFlo <ruv@ruv.net>