gitnexus 1.6.9-rc.36 → 1.6.9-rc.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -834,6 +834,11 @@ export async function writeBridge(groupDir, input) {
834
834
  * 33 ("The process cannot access the file because another process has
835
835
  * locked a portion of the file"). Retrying with a small back-off lets the
836
836
  * background thread settle and the OS release the handle.
837
+ *
838
+ * As of v0.18.0 the "Could not set lock" file-lock error text gained an
839
+ * appended detail suffix upstream (see `lbug-config.ts`'s
840
+ * `OPEN_LOCK_RETRY_ATTEMPTS` comment), but the substrings matched here are
841
+ * unaffected by that change.
837
842
  */
838
843
  const LBUG_OPEN_RETRY_PATTERNS = [
839
844
  'process cannot access the file',
@@ -15,6 +15,12 @@
15
15
  * embedding writeback, and the PDG edge deletes are mutually exclusive — the
16
16
  * property that makes a strictly-serial workload stable.
17
17
  *
18
+ * As of v0.18.0, none of LadybugDB's upstream fixes touch this specific risk
19
+ * (concurrent queries on ONE connection) — the closest are a deadlock fix
20
+ * between concurrent *connections* (LadybugDB/ladybug#605) and a narrow
21
+ * database close/destroy-vs-GC race fix (#623), both different scenarios
22
+ * from the one above. This lock's justification is unchanged.
23
+ *
18
24
  * Implementation: a promise chain. Each caller installs a fresh unresolved tail,
19
25
  * awaits the previous holder's tail, runs, then releases its own in `finally`
20
26
  * (so a thrown op never wedges the connection). FIFO and non-reentrant: a wrapped
@@ -547,7 +547,7 @@ const runSchemaCreationQueries = async (dbPath) => {
547
547
  const msg = err instanceof Error ? err.message : String(err);
548
548
  // Suppression list:
549
549
  // - "already exists": expected idempotent re-create on existing DBs
550
- // - "could not set lock on file": LadybugDB v0.16.1 emits this on
550
+ // - "could not set lock on file": LadybugDB v0.18.0 emits this on
551
551
  // Windows when CREATE NODE TABLE runs against a path that was
552
552
  // just opened (the WAL handle from a fresh Database briefly
553
553
  // contests the table's first-write lock). The table is created
@@ -297,7 +297,7 @@ export function isWalCorruptionError(err) {
297
297
  }
298
298
  // ─── Ladybug WAL checkpoint IO error matchers ───────────────────────────────
299
299
  //
300
- // Matched against LadybugDB v0.16.1 (see `gitnexus/package.json`
300
+ // Matched against LadybugDB v0.18.0 (see `gitnexus/package.json`
301
301
  // @ladybugdb/core). Strict regexes encode local_file_system.cpp wording
302
302
  // verified at that version. Two-tier strategy: strict matchers first so we
303
303
  // only fire on real checkpoint-rotation shapes; a permissive fallback
@@ -387,7 +387,10 @@ export function createLbugDatabase(lbugModule, databasePath, options = {}) {
387
387
  // of 10–50ms each = ~1.0–1.2s worst case) clears the typical
388
388
  // AV-scanner hold without masking real cross-process conflicts.
389
389
  //
390
- // Source: https://github.com/LadybugDB/ladybug/blob/v0.16.1/src/common/file_system/local_file_system.cpp#L126
390
+ // Source: https://github.com/LadybugDB/ladybug/blob/v0.18.0/src/common/file_system/local_file_system.cpp#L127
391
+ // (v0.18.0 appends " (Error: <code>)" / " (Lock is held by PID X)" on POSIX,
392
+ // but the "Could not set lock on file : " prefix `isDbBusyError` substring-
393
+ // matches on is unchanged.)
391
394
  const OPEN_LOCK_RETRY_ATTEMPTS = 5;
392
395
  const OPEN_LOCK_RETRY_DELAY_MS = 100;
393
396
  const HANDLE_RELEASE_PROBE_ATTEMPTS = 5;
@@ -86,16 +86,24 @@ const warnOnce = (logger, key, message) => {
86
86
  }
87
87
  logger.warn(`${message} (${ordinal(next)} occurrence of this condition)`);
88
88
  };
89
- // LADYBUGDB-CONTRACT: matches @ladybugdb/core ^0.16.1 native error text.
89
+ // LADYBUGDB-CONTRACT: matches @ladybugdb/core ^0.18.0 native error text.
90
90
  // When bumping LadybugDB, re-validate this regex against the new error format
91
91
  // — `git grep "LADYBUGDB-CONTRACT"` enumerates every version-coupled spot.
92
+ // Verified by upstream source/changelog diff only — forcing a genuine
93
+ // `.shadow`-missing state via a live crash to trigger this error is not
94
+ // reliably reproducible (a SIGKILL at the exact moment `.shadow` exists on
95
+ // disk still recovers via `.wal.checkpoint` alone), so this matcher does not
96
+ // have live-trigger test coverage.
92
97
  export const isMissingShadowSidecarError = (err) => {
93
98
  const msg = err instanceof Error ? err.message : String(err);
94
99
  return /Cannot open file .*\.shadow: No such file or directory/i.test(msg);
95
100
  };
96
- // LADYBUGDB-CONTRACT: matches @ladybugdb/core ^0.16.1 native error text.
101
+ // LADYBUGDB-CONTRACT: matches @ladybugdb/core ^0.18.0 native error text.
97
102
  // When bumping LadybugDB, re-validate this regex against the new error format
98
103
  // — `git grep "LADYBUGDB-CONTRACT"` enumerates every version-coupled spot.
104
+ // Verified by upstream source/changelog diff only — a reliable cross-platform
105
+ // live trigger for a read-only shadow-replay state isn't practical to
106
+ // construct, so this matcher does not have live-trigger test coverage.
99
107
  export const isReadOnlyShadowReplayError = (err) => {
100
108
  const msg = err instanceof Error ? err.message : String(err);
101
109
  return /replay shadow pages under read-only mode/i.test(msg);
@@ -1,3 +1,4 @@
1
+ export declare const SUPPORTED_FTS_STEMMERS: ReadonlySet<string>;
1
2
  export interface CreateSearchFTSIndexesOptions {
2
3
  onIndexStart?: (table: string, indexName: string) => void;
3
4
  onIndexReady?: (table: string, indexName: string) => void;
@@ -1,10 +1,12 @@
1
1
  import { createFTSIndex, dropFTSIndex, DEFAULT_FTS_STEMMER } from '../lbug/lbug-adapter.js';
2
2
  import { FTS_INDEXES } from './fts-schema.js';
3
3
  // Stemmers shipped by the LadybugDB FTS extension. Mirrors the lowercase token
4
- // set in the extension bundled with @ladybugdb/core 0.17.x (see package.json).
4
+ // set in the extension bundled with @ladybugdb/core 0.18.x (see package.json).
5
5
  // Keep in sync on a LadybugDB minor bump — a value here that the installed
6
6
  // extension rejects would pass validation but fail at CREATE_FTS_INDEX.
7
- const SUPPORTED_FTS_STEMMERS = new Set([
7
+ // Exported so the re-validation sweep in fts-stemmer-sweep.test.ts iterates the
8
+ // canonical list rather than a copy that could silently drift from it.
9
+ export const SUPPORTED_FTS_STEMMERS = new Set([
8
10
  'arabic',
9
11
  'basque',
10
12
  'catalan',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.9-rc.36",
3
+ "version": "1.6.9-rc.37",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@huggingface/transformers": "^4.1.0",
59
- "@ladybugdb/core": "^0.17.0",
59
+ "@ladybugdb/core": "^0.18.0",
60
60
  "@modelcontextprotocol/sdk": "^1.0.0",
61
61
  "@scarf/scarf": "^1.4.0",
62
62
  "busboy": "^1.6.0",
@@ -74,6 +74,8 @@ const LBUG_NATIVE = [
74
74
  'test/integration/fts-description-search.test.ts',
75
75
  'test/integration/staleness-and-stability.test.ts',
76
76
  'test/integration/analyze-wal-checkpoint-failure.test.ts',
77
+ 'test/integration/fts-stemmer-sweep.test.ts',
78
+ 'test/integration/lbug-multiwriter-deadlock.test.ts',
77
79
  ];
78
80
 
79
81
  // Process spawning and CLI tests — exercise child_process with real