๐Ÿšš Why SQLite migrations didn't run in the shipped plugin

The M168 session registry reads its NNN-*.sql migrations from disk at runtime โ€” from the bundle's own directory (dist/). But rsync excludes src/ where the .sql live, and esbuild doesn't inline them. So in the distributed plugin the runner found zero files and created no tables โ€” silently. Tests stayed green because vitest runs the source tree. Toggle the build step and trace it. (#2012)

build pipeline

At runtime MIGRATIONS_DIR = dirname(import.meta.url) = dist/, and run-hook.mjs imports bundles from dist/. So the .sql must exist in dist/ โ€” by being inlined, shipped via src/, or copied in.

does the installed plugin create tables?

src/lib/sqlite-migrations/001-initial.sql๐Ÿ“„ source
โ”‚ build
src/hooks/dist/ (bundles + assets)
โ”‚ rsync โ†’ plugin
plugins/ork/hooks/dist/
โ”‚ runtime readdirSync(__dirname)
runMigrations() applies