Files
Reuven 3e8781bd2c ci: add no-better-sqlite3 install smoke for #1867 regression guard
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>
2026-05-08 19:41:03 -04:00
..