@zuvia-software-solutions/code-mapper 2.2.0 → 2.2.1

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.
@@ -3,6 +3,8 @@ export declare const EMBEDDABLE_LABELS: readonly ["Function", "Class", "Method",
3
3
  export type EmbeddableLabel = typeof EMBEDDABLE_LABELS[number];
4
4
  /** Check if a label is embeddable */
5
5
  export declare const isEmbeddableLabel: (label: string) => label is EmbeddableLabel;
6
+ /** Check if a file path is a test/fixture file (skip embedding, BM25 covers it) */
7
+ export declare const isTestFile: (filePath: string) => boolean;
6
8
  /** Embedding pipeline lifecycle phases */
7
9
  export type EmbeddingPhase = 'idle' | 'loading-model' | 'embedding' | 'indexing' | 'ready' | 'error';
8
10
  /** Progress state emitted during embedding pipeline execution */
@@ -11,6 +11,10 @@ export const EMBEDDABLE_LABELS = [
11
11
  ];
12
12
  /** Check if a label is embeddable */
13
13
  export const isEmbeddableLabel = (label) => EMBEDDABLE_LABELS.includes(label);
14
+ /** Test file patterns — these are searched via BM25, not semantic embeddings */
15
+ const TEST_PATH_PATTERNS = ['/test/', '/tests/', '/spec/', '/fixtures/', '/__tests__/', '/__mocks__/', '.test.', '.spec.', '_test.', '_spec.'];
16
+ /** Check if a file path is a test/fixture file (skip embedding, BM25 covers it) */
17
+ export const isTestFile = (filePath) => TEST_PATH_PATTERNS.some(p => filePath.includes(p));
14
18
  // Jina Code 1.5B MLX — 1.54B params on Apple Silicon Metal
15
19
  // Matryoshka truncation to 256 dims (trained at this dim, <1% quality loss vs 1536)
16
20
  // Task-specific prefixes: nl2code queries, code passages
@@ -428,9 +428,12 @@ export async function refreshEmbeddings(db, dirtyFiles, hasEmbeddings) {
428
428
  deleteEmbeddingsByFile(db, entry.relativePath);
429
429
  }
430
430
  // Step 2: Query new embeddable nodes for modified/created files
431
+ // Skip test/fixture files — BM25 handles them
432
+ const { isTestFile } = await import('../embeddings/types.js');
431
433
  const embeddableSet = new Set(EMBEDDABLE_LABELS);
432
434
  const modifiedPaths = dirtyFiles
433
435
  .filter(f => f.changeKind === 'modified' || f.changeKind === 'created')
436
+ .filter(f => !isTestFile(f.relativePath))
434
437
  .map(f => f.relativePath);
435
438
  if (modifiedPaths.length === 0)
436
439
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuvia-software-solutions/code-mapper",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
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",