jab log exhausts file descriptors (EMFILE) on a many-pack store — probable fd/mmap leak on the pager path
On a restored ~130-pack ~/.be store (project beagle, 1581-commit DAG), a TTY jab log dies with Error: No file descriptors available from _mmap via load@_openPager@_cli before rendering; ulimit -n is 1024. A PIPED jab log in the same worktree completes, and jab status is fine, so the exhaustion needs the pager path and scales with store reads (jab list is also very slow on this store — the JS-056 rebuild-not-mmap index gap multiplies opens). Suspects: be/shared/store.js packAt mmaps each .keeper lazily and never unmaps, per-row store re-opens (submount probes) repeat that per pack, and the C++ io.mmap binding may hold the fd after mapping. Scope: be/ JS first (store.js, views/log), jabc C++ only if the binding provably holds fds. Method: Issues.
jab log in ~/src/journal/beagle → JS exception: Error: No file descriptors available, stack _mmap@[native code] / load@ / _openPager@ / _cli@ / cli@; same command piped (no TTY → no pager) prints all 1581 rows.~/.be holds 5 project shards (beagle, beagle-ext, beagle-ext-tests, beagle-journal, beagle.new), 130 .keeper pack-logs total; ulimit -n 1024.jab status works in the same tree; jab list works but is VERY slow with heavy store reads (JS-056: the JS store rebuilds the object index per run instead of mmapping keeper.idx; JS-099: unindexed packs force scans).be/shared/store.js packAt() caches git.pack.mmap(path,"r") per pack and has no close/unmap; open() is called per repo AND per submount probe, so mapped packs multiply across opens.jab log completes on a 130-pack store within ulimit -n 1024; no fd growth proportional to commits rendered.io.mmap/git.pack.mmap binding keeping fds) with evidence, not guesses.$HOME/todo/LOG-004, store-backed jab get file:/$HOME/.be?/beagle); do NOT touch ~/src/journal/* or ~/src/beagle.shared/store.js, views/log/, shared/submount.js); no jabc C++ edits without evidence the binding itself leaks. No other tests edited.jab list/status/diff on the same store; the JS unit suites (be/test/*.js) stay green.ulimit -n (or fd-count probe) demonstrating the leak; identify the holder.jab log on the 130-pack store renders.shared/store.js packAt (:169) caches
git.pack.mmap per pack with no close/unmap anywhere in store.js; no fixing commit in the be log (JS-100 7974323b covered an error-path leak only).