mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-29 19:01:39 +00:00
fetchCountRows and detectDeadPrefixes in src/core/schema-pack/stats.ts swallowed EVERY engine error into empty results, so any real failure printed 'Total pages: 0' + a vacuous 100% coverage on a populated brain. Both catches now swallow only isUndefinedTableError (pre-init brain, missing pages table) and rethrow everything else. Four regression tests: real non-zero count on a populated PGLite brain, rethrow on non-missing- table errors in both catch sites, and the missing-table degrade path. Takeover of #2493. Co-authored-by: javieraldape <javieraldape@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>