You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node 26 上删除尾部事件会抛 RangeError。truncateTail 删掉 contentless FTS5 索引的行之后,sqlite3_last_insert_rowid() 会留下一个约 2^53 的值,StatementSync.run() 在 Node 26 上把它当 JS number 读取并抛 Value is too large to be represented as a JavaScript number。写语句(INSERT/UPDATE/DELETE/REPLACE)现在统一 setReadBigInts(true);25 处 .run() 的返回值本来就没有调用方使用,语义零变化。
The storage worker could not start on Node 26. It was spawned with --experimental-transform-types, which Node 26 removed, so the worker was rejected outright (Initiated Worker with invalid execArgv flags) and the plugin was unusable there. Type stripping now relies only on Node's built-in strip and passes no flag; the 28 TypeScript parameter properties in the sources (constructor(private readonly x: T)) became explicit fields assigned in the constructor, because strip-only mode does not support them.
Deleting tail events threw RangeError on Node 26. After truncateTail deleted rows from the contentless FTS5 index, sqlite3_last_insert_rowid() was left at roughly 2^53, and StatementSync.run() reads it as a JS number and throws Value is too large to be represented as a JavaScript number. Write statements (INSERT/UPDATE/DELETE/REPLACE) now set setReadBigInts(true); no caller consumed the return value at any of the 25 .run() sites, so behaviour is unchanged.
Converting, repairing or deleting a session failed with EBUSY/EPERM on Windows. While this process still holds a connection to the store — even a readOnly: true one — Windows refuses to rename or unlink it or its -wal/-shm, and a retry can never outlast a handle of our own. src/store-lease.ts is new: an executor registers a releaser when it is constructed, removeDatabase/moveDatabase (src/transfer.ts) and archiveSource (src/migrate.ts) release before touching files, and worker mode forwards the release through forget.
Background warm-up reopened a store while it was being moved or removed. This was one source of the EBUSY above: warm-up reopened the connection right after releaseStore(), so rm failed. The tail read is now guarded by existsSync, which also fixes something worse — a non-read-only open of an already deleted session recreated it as an empty store.
Three client adapters pinned the host to one exact build string. Session recovery, workspace membership sync and workspace stream recovery passed their check on 0.2.2-rc.1 and were silently switched off by the next builds on the same line (rc.3/rc.4), although the host shapes they depend on had not changed. They now use a floor (>=0.2.2) plus per-object shape probes (client/host-compat.ts): below the floor they refuse and report, at or above it the probe decides.
The initial-history patch recognised only one 0.2.2-rc.1 build. It locates its call site by whole-file SHA-256 and exact line, so the rc.3 build was refused. It now pins a supported-build list, each with its own SHA and line (scripts/patch-initial-history.mjs); a build that is not listed is still refused rather than patched on a guess.
Intermittent CI timeout. The overwrite migration in tests/migrate.spec.ts really moves files, builds a store and reads every event back to verify it, which exceeded vitest's default 5s on a windows-latest runner. vitest.config.ts sets testTimeout: 20s and hookTimeout: 30s: a hang still fails, a slow disk no longer does.
Improved
npm ci failed outright under npm 12 (EALLOWREMOTE): it refuses tarballs whose URL points at a host other than the configured registry, and all 187 resolved entries in the lockfile pointed at registry.npmmirror.com. The lockfile now pins registry.npmjs.org and .npmrc sets replace-registry-host=npmjs, so mirror users still fetch from their own registry. Both cases were verified: factory-default config with no userconfig, and a mirror registry.
Publishing no longer trusts a tag.publish.yml calls ci.yml through workflow_call, so a tree that fails the suite cannot ship — 0.1.30 was published from one that failed on the maintainer's own machine.
CI covers two platforms and two Node lines: ubuntu-latest/windows-latest × Node 24/26. File leases, atomic renames and session directories are exactly where the platforms disagree; running only on Linux makes Windows-only failures invisible.
Tests are steadier under concurrency and slow disks: two assertions in tests/shared-titles.spec.ts that demanded exactly two stat calls now assert on paths instead (the intent is "no unselected artifact is touched", not "the call count"), and temp-tree cleanup retries the ENOTEMPTY/EBUSY/EPERM that Windows reports right after a handle closes.
Three measured constraints are now documented: a held connection blocks renaming or deleting a store on Windows; whole-session reads scale with the session (56,537 events / 84 MB measured 1377ms with a 312MB peak heap, of which about 1.0s is decompression and about 0.3s is JSON.parse per line); and cross-session comparisons must use cost per event, not milliseconds.
Repository hygiene: .gitignore keeps local research notes, session stores, exports and key material out of the repo.
Added
src/store-lease.ts — a store-lease gate: reference-counted holdStore/withStoreHeld, StoreBusyError, and retryWhileHeld with a 5s budget.
tests/store-lease.spec.ts — seven cases covering a refused read while held and a successful one after release, release on throw plus a second release that cannot over-release, and a read that waits rather than fails during a short hold.
A regression case in tests/search.spec.ts: a contentless index stays writable and searchable after repeated deletes.
Node.js: >=24.9.0; the whole suite passes on both 24 and 26 (26 was unusable before this release).
npm: npm ci works under npm 12's default allow-remote=none.
DSH: >=0.2.2-rc.1; the upper bound <0.3.0-0 is gone. Verified end to end on 0.2.2-rc.4 — profile loads, the patch lands on session-persistence-optimizer, a real store is written, console routes answer.
Host capability checks: a version floor plus shape probes, so a new build on the same line no longer turns features off.