fix(fts): Don't cache failed FTS index ensure; invalidate on pool teardown#1006
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/425d41bd-2cc1-49f6-8cc5-57368f0f238e Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com>
|
Claude finished @magyargergo's task in 4m 32s —— View job PR Review — Don't cache failed FTS index ensure; invalidate on pool teardownTasks:
Production-ready bar for this PRBased on repo docs and the affected area (MCP pool path → BM25/FTS search):
Findings1. Correctness & functional completenessThe core fix is verified correct. In the original code, The pool-close listener machinery is wired correctly:
No missing wiring, no dead branches, no MCP contract changes. 2. Code clarity & clean code## NIT — Parameter shadow:
## NIT — Disposer silently discarded
No drive-by refactors, no barrel regressions, no 3. Test coverage & change safetyFour new cases in
## NON-BLOCKING —
## NON-BLOCKING —
TypeScript compile ( 4. Performance
No performance concerns. 5. Operational risk## NON-BLOCKING —
Rollback safety: Reverting this PR restores the poisoned-cache behavior but does not require re-analyze. The MCP contracts: No changes to tool schemas, resource URIs, or response shapes. LadybugDB single-writer invariant: Preserved. No new write paths introduced. Embeddings, staleness, Windows paths: Untouched by this PR. 6. MaintainabilityThe close-listener pattern is clean and discoverable: Non-negotiables verification
What I could not fully verify
Final verdict✅ Ready to merge — no blocking issues. The core bug fix is correct and directly addresses the root cause. The pool-close listener wiring is sound. The four regression tests are meaningful and guard the critical behaviors. Non-blocking items (test isolation hygiene, disposer comment, pre-existing read-only/CREATE gap) do not affect production correctness. The PR title format violation is flagged for cleanup before or after merge. |
Key upstream changes merged: - feat(cli): gitnexus remove <target> command (abhigyanpatwari#1003) - feat(python): scope-based call resolution pipeline RFC abhigyanpatwari#909 Ring 3 (abhigyanpatwari#980) - feat(cli): repo fingerprinting via remote URL for sibling-clone detection (abhigyanpatwari#982) - fix(group): friendly error on missing group name (abhigyanpatwari#989) - fix(group): bubble local-impact errors in groupImpact (abhigyanpatwari#1007) - fix(fts): don't cache failed FTS index (abhigyanpatwari#1006) - fix(ci): docker alpine → debian (abhigyanpatwari#1014) - deps: graphology 0.26.0, uuid 14, @types/node 25, @types/uuid 11 Conflict resolutions: - AGENTS.md: kept our NEVER-format rules, added upstream language-specific hook rule, Tools Quick Reference table, Impact Risk Levels, gRPC guide link - package.json: kept @types/multer, took upstream node/uuid type bumps - package-lock.json: regenerated via npm install Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rdown (abhigyanpatwari#1006) * Initial plan * Don't cache failed FTS index ensure; invalidate on pool teardown Agent-Logs-Url: https://github.com/abhigyanpatwari/GitNexus/sessions/425d41bd-2cc1-49f6-8cc5-57368f0f238e Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: magyargergo <11230420+magyargergo@users.noreply.github.com>
ensureFTSIndexViaExecutorrecorded the(repoId, table)ensure-key on every code path, including the catch-all branch. A single transientCREATE_FTS_INDEXfailure (e.g. lock contention on first query after MCP server start) therefore disabled BM25 for that repo for the lifetime of the process — silently, since the query path turns FTS errors into[].Changes
gitnexus/src/core/search/bm25-index.ts— MoveensuredPoolFTS.add(key)into the two success branches:CREATE_FTS_INDEXsucceeded, or it failed with'already exists'. All other errors leave the key unset and emit aconsole.warnwithrepoId/ table / index / message so the failure is no longer invisible.gitnexus/src/core/lbug/pool-adapter.ts— Add anaddPoolCloseListener(listener) → disposerregistry and fire registered listeners fromcloseOneafterpool.delete(repoId). Listener exceptions are isolated so teardown always completes.gitnexus/src/core/search/bm25-index.ts— Lazily register a pool-close listener (idempotent, on first MCP-pool-backed query) that calls a new exportedinvalidateEnsuredFTSForRepo(repoId)so LRU eviction / idle close / explicitcloseLbugdrop the matching ensure-state instead of letting it outlive the pool that produced it.gitnexus/test/unit/bm25-search.test.tsadds four regression cases: transient CREATE failure → second call retries (5 CREATEs again);'already exists'is cached (0 CREATEs on retry); explicitinvalidateEnsuredFTSForRepoclears entries; pool-close listener invalidates only the closed repo, leaving siblings intact.Before / after
Notes
lbug-adapter.ts) is untouched; this only affects the MCP-pool path.[]and re-warn.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
extension.ladybugdb.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/GitNexus/GitNexus/gitnexus/node_modules/.bin/vitest run test/unit/bm25-search.test.ts(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/GitNexus/GitNexus/gitnexus/node_modules/.bin/vitest run test/unit/stdout-silence.test.ts test/unit/calltool-dispatch.test.ts test/unit/impact-batching-grouping.test.ts Release/obj.target/tree_sitter_dart_binding/bindings/node/bindin/home/REDACTED/.cache/node-gyp/24./home/REDACTED/work/GitNexus/GitNexus/gitnexus/node_modules/.bin/tsc xus/gitnexus/vendor/tree-sitter-proto/node_modules/.bin/as e --global(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/GitNexus/GitNexus/gitnexus/node_modules/.bin/vitest run test/unit modu�� st line and append a colon to the remaining line-I l/openssl/include modules/@npmcli/run-script/lib/node-gyp-bin/sh lude --global(dns block)If you need me to access, download, or install something from one of these locations, you can either: