fix(storage)+feat(cli): lbug truncate SIGBUS + scip-go/python/typescript distribution#177
Merged
theagenticguy merged 2 commits intoJun 2, 2026
Merged
Conversation
@ladybugdb/core 0.16.1 crashes with SIGBUS when `MATCH (n:CodeNode) DELETE n` runs while the och_fts full-text index is live on CodeNode. The crash is an un-catchable native signal, so the bulk-load retry wrapper cannot recover it, and it only manifests at scale on an mmap'd on-disk graph. truncateAll() now drops och_fts (CodeNode) and och_vec (Embedding) before any delete via a new dropSearchIndexes() helper, swallowing the catchable no-such-index / extension-not-loaded errors, and resets the *IndexBuilt flags so the post-insert ensureFtsIndex/ensureVectorIndex rebuild them. Verified 6/6 A/B against a real ~11k-node graph: crash every run without the drop, clean every run with it. Adds a regression test asserting the FTS index is dropped and rebuilt across a replace-truncate.
The pinned downloader covered clang/ruby/dotnet/kotlin but not the npm/Go-distributed indexers, so scip-python/typescript/go had to be installed by hand (and `mise use scip-python` fails — it is an npm package, not a mise tool). This wires all three into codehub's own distribution. - scip-go: new SCIP_GO_PIN (v0.2.7, SHA256-verified release tarballs; darwin-x64 marked unavailable). The downloader gains node:zlib gunzip + a minimal tar reader to extract the scip-go binary from the .tar.gz; the pin still hashes the tarball bytes, and archive-tool idempotency uses an extracted-binary presence check. - scip-python (@sourcegraph/scip-python@0.6.6) and scip-typescript (@sourcegraph/scip-typescript@0.4.0): added as hard dependencies of @opencodehub/scip-ingest. withCodehubBinOnPath now resolves their bin shims via hostedScipBinDirs(), which walks up from both the resolved package and this module to cover npm-global and pnpm layouts, and prepends the .bin dirs to the spawn PATH so the runner finds them by bare name. - doctor: reports scip-typescript/python as bundled (resolved via the same hostedScipBinDirs the runner uses) and adds a setup --scip=go hint. Verified end-to-end: scip-go downloads + extracts + runs; scip-python/typescript spawn by bare name; a full analyze on a Python project runs scip-python and emits python.scip. Adds tarball-extraction, SHA-mismatch, idempotency, and PATH-resolution tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two independent fixes. The first is what actually killed
codehub analyze; the second is the requested distribution work.1.
fix(storage): lbug truncate SIGBUS@ladybugdb/core@0.16.1crashes with SIGBUS whenMATCH (n:CodeNode) DELETE nruns during truncate while theoch_ftsfull-text index is live on CodeNode. SIGBUS is an un-catchable native signal, so the bulk-load retry wrapper can't recover it. It only fires at scale on an mmap'd on-disk graph (a real ~11k-node graph crashes every run; a 2-node store never faults). The.lbugfile is not corrupt — it opens and replays its WAL fine.truncateAll()now dropsoch_fts/och_vecbefore any delete and resets the rebuild flags so the post-insertensureFtsIndex/ensureVectorIndexrebuild them.2.
feat(cli): scip-go / scip-python / scip-typescript distributionThe pinned downloader covered clang/ruby/dotnet/kotlin but not the npm/Go indexers (
mise use scip-pythonfails — it's an npm package).node:zlibgunzip + minimal tar extraction.@opencodehub/scip-ingest, resolved onto the spawn PATH via a newhostedScipBinDirs()that handles npm-global and pnpm layouts.setup --scip=gohint.Verification
analyzeon a real graph exits 0.analyzeon a Python project runs scip-python and emitspython.scip.Note
An older
scip-go 0.2.3on a dev PATH shadows the pinned 0.2.7 indoctoroutput. Harmless: at analyze time~/.codehub/binis prepended, so asetup --scip=goinstall of 0.2.7 wins.