gitnexus 1.6.12-rc.34 → 1.6.12-rc.35

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.
@@ -1189,7 +1189,7 @@ const analyzeCommandImpl = async (inputPath, cliOptions, runnerIdentityAtBootstr
1189
1189
  console.error = origError;
1190
1190
  bar.stop();
1191
1191
  console.log(' Already up to date\n');
1192
- if (result.ftsSkipped)
1192
+ if (isExplicitFtsDisablement(result.ftsSkipReason))
1193
1193
  console.log(` ${FTS_DISABLED_MESSAGE}\n`);
1194
1194
  if (runOptions.registryName) {
1195
1195
  console.log(` Registry name: ${result.repoName}\n`);
@@ -9,7 +9,7 @@
9
9
  * wrapper or server worker) is responsible for process lifecycle.
10
10
  */
11
11
  import { detectGraphWriteCollapse } from './index-freshness.js';
12
- import { resolveFtsDisableReason, getFtsDisabledReason, withExplicitFtsDisablement, FTS_DISABLED_MESSAGE, } from './search/fts-policy.js';
12
+ import { resolveFtsDisableReason, getFtsDisabledReason, withExplicitFtsDisablement, FTS_DISABLED_MESSAGE, DEFAULT_GRAPH_CAPABILITY, DEFAULT_VECTOR_SEARCH_CAPABILITY, } from './search/fts-policy.js';
13
13
  import { PDG_EDGE_TYPES } from './lbug/pdg-emit-sink.js';
14
14
  import path from 'path';
15
15
  import fs from 'fs/promises';
@@ -157,6 +157,11 @@ function recordLiveIndexMutationRisk(error) {
157
157
  liveIndexMutationRisks.add(error);
158
158
  }
159
159
  }
160
+ function formatMetaWriteFailureReason(err) {
161
+ return isReadOnlyFilesystemError(err)
162
+ ? `${err.message} — storage may be read-only (#1549)`
163
+ : err.message;
164
+ }
160
165
  /** Whether a failed analyze may already have changed the live DB. */
161
166
  export function analyzeFailureMayHaveMutatedLiveIndex(error) {
162
167
  return (((typeof error === 'object' && error !== null) || typeof error === 'function') &&
@@ -811,16 +816,9 @@ async function runFullAnalysisInner(repoPath, options, callbacks, writeTarget, r
811
816
  await saveMeta(metaDir, {
812
817
  ...latestMeta,
813
818
  capabilities: {
814
- graph: latestMeta.capabilities?.graph ?? {
815
- provider: 'ladybugdb',
816
- status: 'available',
817
- },
819
+ graph: latestMeta.capabilities?.graph ?? DEFAULT_GRAPH_CAPABILITY,
818
820
  fts: { provider: 'ladybugdb-fts', status: 'available' },
819
- vectorSearch: latestMeta.capabilities?.vectorSearch ?? {
820
- provider: 'exact-scan',
821
- status: 'unavailable',
822
- exactScanLimit: 0,
823
- },
821
+ vectorSearch: latestMeta.capabilities?.vectorSearch ?? DEFAULT_VECTOR_SEARCH_CAPABILITY,
824
822
  },
825
823
  });
826
824
  }
@@ -1306,10 +1304,7 @@ async function runFullAnalysisInner(repoPath, options, callbacks, writeTarget, r
1306
1304
  // EACCES/EPERM also arise from ownership problems and transient
1307
1305
  // Windows locks, so keep the real error visible alongside the
1308
1306
  // #1549 read-only hint instead of replacing it.
1309
- const reason = isReadOnlyFilesystemError(err)
1310
- ? `${err.message} — storage may be read-only (#1549)`
1311
- : err.message;
1312
- log(`Warning: could not restamp the workspace branch label (${reason}); will retry on the next run.`);
1307
+ log(`Warning: could not restamp the workspace branch label (${formatMetaWriteFailureReason(err)}); will retry on the next run.`);
1313
1308
  }
1314
1309
  }
1315
1310
  else if (ftsDisabledReason && ftsDisabledReason !== previousFtsDisabledReason) {
@@ -1319,10 +1314,7 @@ async function runFullAnalysisInner(repoPath, options, callbacks, writeTarget, r
1319
1314
  await saveMeta(metaDir, existingMeta);
1320
1315
  }
1321
1316
  catch (err) {
1322
- const reason = isReadOnlyFilesystemError(err)
1323
- ? `${err.message} — storage may be read-only (#1549)`
1324
- : err.message;
1325
- log(`Warning: could not restamp the FTS skip reason (${reason}); will retry on the next run.`);
1317
+ log(`Warning: could not restamp the FTS skip reason (${formatMetaWriteFailureReason(err)}); will retry on the next run.`);
1326
1318
  }
1327
1319
  }
1328
1320
  await ensureGitNexusIgnored(repoPath);
@@ -2023,9 +2015,9 @@ async function runFullAnalysisInner(repoPath, options, callbacks, writeTarget, r
2023
2015
  // creates or drops an index.
2024
2016
  const indexCatalogRows = await readIndexCatalogSnapshot();
2025
2017
  const embeddingRowDmlSafe = await ensureEmbeddingRowDmlSafe(indexCatalogRows);
2026
- const ftsRowDmlSafe = ftsDisabledReason
2027
- ? await ensureFtsRowDmlSafe(indexCatalogRows, { skipFts: true })
2028
- : await ensureFtsRowDmlSafe(indexCatalogRows);
2018
+ const ftsRowDmlSafe = await ensureFtsRowDmlSafe(indexCatalogRows, {
2019
+ skipFts: Boolean(ftsDisabledReason),
2020
+ });
2029
2021
  const extensionForcedRebuild = !embeddingRowDmlSafe || !ftsRowDmlSafe;
2030
2022
  // `!options.dropEmbeddings` (H1): this rescue reads the rows back OUT of
2031
2023
  // the DB, so it must never fire on the one path whose entire purpose is to
@@ -2,6 +2,8 @@ import type { RepoMeta } from '../../storage/repo-meta.js';
2
2
  export type FtsDisabledReason = 'disabled-by-flag' | 'disabled-by-env';
3
3
  export type FtsSkipReason = FtsDisabledReason | 'extension-unavailable' | 'build-failed';
4
4
  type RepoCapabilities = NonNullable<RepoMeta['capabilities']>;
5
+ export declare const DEFAULT_GRAPH_CAPABILITY: RepoCapabilities['graph'];
6
+ export declare const DEFAULT_VECTOR_SEARCH_CAPABILITY: RepoCapabilities['vectorSearch'];
5
7
  export declare function resolveFtsDisableReason(skipFts?: boolean, envValue?: string): FtsDisabledReason | undefined;
6
8
  export declare function isExplicitFtsDisablement(reason: string | undefined): reason is FtsDisabledReason;
7
9
  export declare function getFtsDisabledReason(capability: RepoCapabilities['fts'] | undefined): FtsDisabledReason | undefined;
@@ -1,8 +1,8 @@
1
- const DEFAULT_GRAPH_CAPABILITY = {
1
+ export const DEFAULT_GRAPH_CAPABILITY = {
2
2
  provider: 'ladybugdb',
3
3
  status: 'available',
4
4
  };
5
- const DEFAULT_VECTOR_SEARCH_CAPABILITY = {
5
+ export const DEFAULT_VECTOR_SEARCH_CAPABILITY = {
6
6
  provider: 'exact-scan',
7
7
  status: 'unavailable',
8
8
  exactScanLimit: 0,
@@ -581,9 +581,12 @@ async function loadFtsSession(storagePath) {
581
581
  return {
582
582
  meta,
583
583
  ftsDisabledReason,
584
- ...(ftsDisabledReason ? { skipFts: true } : {}),
584
+ ...skipFtsOption(Boolean(ftsDisabledReason)),
585
585
  };
586
586
  }
587
+ function skipFtsOption(skipFts) {
588
+ return skipFts ? { skipFts: true } : {};
589
+ }
587
590
  function readOnlyFtsOptions(skipFts) {
588
591
  return skipFts ? { readOnly: true, skipFts: true } : { readOnly: true };
589
592
  }
@@ -1670,7 +1673,7 @@ export const createServer = async (port, host = '127.0.0.1') => {
1670
1673
  partialRunDetail = outcome.partial;
1671
1674
  embeddingMeta = withMeasuredEmbeddingCount({ ...finalMeta, embeddingCheckpoint: outcome.checkpoint }, measuredEmbeddings);
1672
1675
  await saveMeta(entry.storagePath, embeddingMeta);
1673
- }, { ...(ftsSession.skipFts ? { skipFts: true } : {}) });
1676
+ }, skipFtsOption(ftsSession.skipFts));
1674
1677
  // Don't overwrite 'failed' if the job was cancelled while the pipeline was running
1675
1678
  const current = embedJobManager.getJob(job.id);
1676
1679
  if (!current || current.status !== 'failed') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.12-rc.34",
3
+ "version": "1.6.12-rc.35",
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",