memorix 1.10.1 → 1.10.2

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cli/index.js +416 -167
  3. package/dist/index.js +232 -106
  4. package/dist/maintenance-runner.js +167 -57
  5. package/dist/media-audio-runner.js +139 -29
  6. package/dist/media-video-runner.js +166 -56
  7. package/dist/memcode-runtime/CHANGELOG.md +14 -0
  8. package/dist/sdk.js +283 -106
  9. package/dist/vector-backfill-runner.js +166 -56
  10. package/docs/DEVELOPMENT.md +3 -4
  11. package/docs/PERFORMANCE.md +23 -0
  12. package/docs/README.md +2 -2
  13. package/docs/ROADMAP-1.9.12-2.0.md +2 -2
  14. package/package.json +1 -1
  15. package/plugins/antigravity/memorix/plugin.json +1 -1
  16. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  17. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  18. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  19. package/plugins/copilot/memorix/plugin.json +1 -1
  20. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  21. package/plugins/hermes/memorix/__init__.py +1 -2
  22. package/plugins/hermes/memorix/plugin.yaml +1 -1
  23. package/plugins/omp/memorix/package.json +1 -1
  24. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  25. package/plugins/pi/memorix/package.json +1 -1
  26. package/server.json +2 -2
  27. package/src/cli/commands/repair.ts +17 -3
  28. package/src/compact/index-format.ts +1 -1
  29. package/src/knowledge/context-receipt.ts +6 -3
  30. package/src/memory/observations.ts +7 -5
  31. package/src/search/derived-view-receipt.ts +40 -0
  32. package/src/search/semantic-index.ts +149 -1
  33. package/src/server.ts +18 -3
  34. package/src/store/orama-store.ts +32 -16
@@ -6374,6 +6374,7 @@ var init_obs_store = __esm({
6374
6374
 
6375
6375
  // src/search/semantic-index.ts
6376
6376
  import { createHash as createHash4 } from "crypto";
6377
+ import { existsSync as existsSync8 } from "fs";
6377
6378
  import { createRequire as createRequire3 } from "module";
6378
6379
  import path8 from "path";
6379
6380
  function createSemanticIndexProfile(provider2) {
@@ -6472,17 +6473,80 @@ function queueOperation(key, operation) {
6472
6473
  writeQueues.set(key, run.catch(() => void 0));
6473
6474
  return run;
6474
6475
  }
6476
+ function positiveEnvInt(name, fallback) {
6477
+ const value = Number.parseInt(process.env[name] ?? "", 10);
6478
+ return Number.isSafeInteger(value) && value > 0 ? value : fallback;
6479
+ }
6480
+ function semanticWriteBatchSize() {
6481
+ return positiveEnvInt("MEMORIX_SEMANTIC_WRITE_BATCH_SIZE", DEFAULT_WRITE_BATCH_SIZE);
6482
+ }
6483
+ function semanticWriteFlushMs() {
6484
+ return positiveEnvInt("MEMORIX_SEMANTIC_WRITE_FLUSH_MS", DEFAULT_WRITE_FLUSH_MS);
6485
+ }
6486
+ function semanticOptimizeEvery() {
6487
+ return positiveEnvInt("MEMORIX_SEMANTIC_OPTIMIZE_EVERY", DEFAULT_OPTIMIZE_EVERY);
6488
+ }
6489
+ function semanticVersionRetentionMs() {
6490
+ return positiveEnvInt("MEMORIX_SEMANTIC_VERSION_RETENTION_MS", DEFAULT_VERSION_RETENTION_MS);
6491
+ }
6492
+ async function optimizeState(state) {
6493
+ if (!state.table || typeof state.table.optimize !== "function") return;
6494
+ await state.table.optimize({
6495
+ cleanupOlderThan: new Date(Date.now() - semanticVersionRetentionMs()),
6496
+ deleteUnverified: false
6497
+ });
6498
+ }
6475
6499
  async function mergeVectors(dataDir, profile, records) {
6476
6500
  if (records.length === 0) return;
6477
6501
  const state = await getState(dataDir, profile, records);
6478
6502
  if (!state?.table) return;
6479
6503
  const rows = records.map(toLanceRow);
6480
6504
  await state.table.mergeInsert("observation_id").whenMatchedUpdateAll().whenNotMatchedInsertAll().execute(rows);
6505
+ const key = stateKey(dataDir, profile);
6506
+ const mutationCount = (mutationCounts.get(key) ?? 0) + 1;
6507
+ if (mutationCount >= semanticOptimizeEvery()) {
6508
+ mutationCounts.set(key, 0);
6509
+ await optimizeState(state).catch(() => void 0);
6510
+ } else {
6511
+ mutationCounts.set(key, mutationCount);
6512
+ }
6481
6513
  void ensureSemanticIndex(dataDir, profile);
6482
6514
  }
6515
+ function flushPendingVectorBatch(key) {
6516
+ const pending = pendingVectorBatches.get(key);
6517
+ if (!pending) return Promise.resolve();
6518
+ if (pending.timer) clearTimeout(pending.timer);
6519
+ pendingVectorBatches.delete(key);
6520
+ const records = [...pending.records.values()];
6521
+ const waiters = pending.waiters.splice(0);
6522
+ return queueOperation(key, () => mergeVectors(pending.dataDir, pending.profile, records)).then(() => waiters.forEach((waiter) => waiter.resolve())).catch((error) => {
6523
+ waiters.forEach((waiter) => waiter.reject(error));
6524
+ });
6525
+ }
6526
+ function upsertSemanticVector(dataDir, profile, record80) {
6527
+ const key = stateKey(dataDir, profile);
6528
+ let pending = pendingVectorBatches.get(key);
6529
+ if (!pending) {
6530
+ pending = { dataDir, profile, records: /* @__PURE__ */ new Map(), waiters: [] };
6531
+ pendingVectorBatches.set(key, pending);
6532
+ }
6533
+ pending.records.set(`${record80.projectId}:${record80.observationId}`, record80);
6534
+ const promise = new Promise((resolve2, reject) => pending.waiters.push({ resolve: resolve2, reject }));
6535
+ if (pending.records.size >= semanticWriteBatchSize()) void flushPendingVectorBatch(key);
6536
+ else if (!pending.timer) pending.timer = setTimeout(() => {
6537
+ void flushPendingVectorBatch(key);
6538
+ }, semanticWriteFlushMs());
6539
+ return promise;
6540
+ }
6483
6541
  function upsertSemanticVectors(dataDir, profile, records) {
6484
6542
  return queueOperation(stateKey(dataDir, profile), () => mergeVectors(dataDir, profile, records));
6485
6543
  }
6544
+ async function listSemanticVectorIds(dataDir, profile) {
6545
+ const state = await getState(dataDir, profile);
6546
+ if (!state?.table) return null;
6547
+ const rows = await state.table.query().select(["observation_id"]).toArray();
6548
+ return new Set(rows.map((row) => Number(row.observation_id)).filter(Number.isSafeInteger));
6549
+ }
6486
6550
  function resolveIndexThreshold() {
6487
6551
  const raw = Number.parseInt(process.env.MEMORIX_SEMANTIC_INDEX_THRESHOLD ?? "", 10);
6488
6552
  return Number.isSafeInteger(raw) && raw > 0 ? raw : DEFAULT_INDEX_THRESHOLD;
@@ -6534,7 +6598,7 @@ async function searchSemanticVectors(options) {
6534
6598
  distance: Number(row._distance ?? Number.POSITIVE_INFINITY)
6535
6599
  })).filter((row) => Number.isFinite(row.distance));
6536
6600
  }
6537
- var SEMANTIC_INDEX_DIR, TABLE_PREFIX, DEFAULT_INDEX_THRESHOLD, MAX_INDEX_PARTITIONS, statePromises, writeQueues, indexBuilds, availability, requireFromHere2;
6601
+ var SEMANTIC_INDEX_DIR, TABLE_PREFIX, DEFAULT_INDEX_THRESHOLD, MAX_INDEX_PARTITIONS, DEFAULT_WRITE_BATCH_SIZE, DEFAULT_WRITE_FLUSH_MS, DEFAULT_OPTIMIZE_EVERY, DEFAULT_VERSION_RETENTION_MS, statePromises, writeQueues, indexBuilds, mutationCounts, pendingVectorBatches, availability, requireFromHere2;
6538
6602
  var init_semantic_index = __esm({
6539
6603
  "src/search/semantic-index.ts"() {
6540
6604
  "use strict";
@@ -6543,13 +6607,81 @@ var init_semantic_index = __esm({
6543
6607
  TABLE_PREFIX = "observations_";
6544
6608
  DEFAULT_INDEX_THRESHOLD = 1e4;
6545
6609
  MAX_INDEX_PARTITIONS = 32;
6610
+ DEFAULT_WRITE_BATCH_SIZE = 100;
6611
+ DEFAULT_WRITE_FLUSH_MS = 50;
6612
+ DEFAULT_OPTIMIZE_EVERY = 20;
6613
+ DEFAULT_VERSION_RETENTION_MS = 24 * 60 * 60 * 1e3;
6546
6614
  statePromises = /* @__PURE__ */ new Map();
6547
6615
  writeQueues = /* @__PURE__ */ new Map();
6548
6616
  indexBuilds = /* @__PURE__ */ new Map();
6617
+ mutationCounts = /* @__PURE__ */ new Map();
6618
+ pendingVectorBatches = /* @__PURE__ */ new Map();
6549
6619
  requireFromHere2 = createRequire3(import.meta.url);
6550
6620
  }
6551
6621
  });
6552
6622
 
6623
+ // src/memory/secret-filter.ts
6624
+ function applyRedaction(text2) {
6625
+ if (!text2) return text2;
6626
+ let out = text2;
6627
+ out = out.replace(
6628
+ /((?:password|passwd|pwd|secret|token|api[_-]?key|auth[_-]?key|access[_-]?key|private[_-]?key|client[_-]?secret)\s*[:=]\s*["']?)([^\s"',;\n]{6,})/gi,
6629
+ "$1[REDACTED]"
6630
+ );
6631
+ out = out.replace(
6632
+ /(Bearer\s+)([A-Za-z0-9._\-/+]{20,})/g,
6633
+ "$1[REDACTED]"
6634
+ );
6635
+ out = out.replace(/\b(?:ghp|ghs|gho|github_pat)_[A-Za-z0-9]{36,}\b/g, "[REDACTED]");
6636
+ out = out.replace(/\bsk-[A-Za-z0-9T-]{20,}\b/g, "[REDACTED]");
6637
+ out = out.replace(/\beyJ[A-Za-z0-9._-]{40,}\b/g, "[REDACTED]");
6638
+ return out;
6639
+ }
6640
+ function sanitizeCredentials(text2) {
6641
+ return applyRedaction(text2);
6642
+ }
6643
+ var init_secret_filter = __esm({
6644
+ "src/memory/secret-filter.ts"() {
6645
+ "use strict";
6646
+ init_esm_shims();
6647
+ }
6648
+ });
6649
+
6650
+ // src/search/derived-view-receipt.ts
6651
+ function sanitizeDerivedViewFailureReason(reason) {
6652
+ const safe = sanitizeCredentials(reason).replace(/(?:[A-Za-z]:[\\/]|\\\\[^\\/\s]+[\\/]|\/(?:home|Users|tmp|var|private|mnt|workspace|workspaces)\/)[^\s"'<>|]*/gi, "[path]").replace(/\s+/g, " ").trim();
6653
+ return safe.slice(0, 240) || "derived view failed";
6654
+ }
6655
+ function embeddingHealthReceipt(health, embeddingEnabled2) {
6656
+ if (health?.status === "disabled") {
6657
+ return { freshness: "current", rebuildStatus: "disabled" };
6658
+ }
6659
+ if (health?.status === "ready" || embeddingEnabled2) {
6660
+ return { freshness: "current", rebuildStatus: "idle" };
6661
+ }
6662
+ if (health?.status === "degraded") {
6663
+ return {
6664
+ freshness: "stale",
6665
+ rebuildStatus: "failed",
6666
+ ...health.failure ? {
6667
+ failureReason: `embedding ${health.failure.kind}; retry in ${health.failure.retryAfterMs}ms`
6668
+ } : { failureReason: "embedding provider degraded" }
6669
+ };
6670
+ }
6671
+ return {
6672
+ freshness: "unknown",
6673
+ rebuildStatus: "unavailable",
6674
+ failureReason: "embedding provider is not initialized"
6675
+ };
6676
+ }
6677
+ var init_derived_view_receipt = __esm({
6678
+ "src/search/derived-view-receipt.ts"() {
6679
+ "use strict";
6680
+ init_esm_shims();
6681
+ init_secret_filter();
6682
+ }
6683
+ });
6684
+
6553
6685
  // src/project/aliases.ts
6554
6686
  var aliases_exports = {};
6555
6687
  __export(aliases_exports, {
@@ -7158,6 +7290,7 @@ __export(orama_store_exports, {
7158
7290
  getLastSearchMode: () => getLastSearchMode,
7159
7291
  getObservationCount: () => getObservationCount,
7160
7292
  getObservationsByIds: () => getObservationsByIds,
7293
+ getPersistentSemanticVectorIds: () => getPersistentSemanticVectorIds,
7161
7294
  getSearchDerivedViews: () => getSearchDerivedViews,
7162
7295
  getTimeline: () => getTimeline,
7163
7296
  getVectorDimensions: () => getVectorDimensions,
@@ -7202,14 +7335,16 @@ function getSearchDerivedViews() {
7202
7335
  generation,
7203
7336
  freshness: "unknown",
7204
7337
  rebuildStatus: "unavailable",
7205
- failureReason: store.getBackendReason?.() ?? "persistent lexical index unavailable"
7338
+ failureReason: sanitizeDerivedViewFailureReason(
7339
+ store.getBackendReason?.() ?? "persistent lexical index unavailable"
7340
+ )
7206
7341
  };
7207
7342
  }
7208
7343
  } catch (error) {
7209
7344
  views.fts = {
7210
7345
  freshness: "unknown",
7211
7346
  rebuildStatus: "failed",
7212
- failureReason: error instanceof Error ? error.message.slice(0, 240) : String(error).slice(0, 240)
7347
+ failureReason: sanitizeDerivedViewFailureReason(error instanceof Error ? error.message : String(error))
7213
7348
  };
7214
7349
  }
7215
7350
  } else {
@@ -7225,18 +7360,12 @@ function getSearchDerivedViews() {
7225
7360
  rebuildStatus: "unavailable",
7226
7361
  failureReason: "Orama index is not initialized"
7227
7362
  };
7228
- const configuredEmbeddingMode = process.env.MEMORIX_EMBEDDING?.trim().toLowerCase();
7229
- if (configuredEmbeddingMode === "off") {
7230
- views.embedding = { freshness: "current", rebuildStatus: "disabled" };
7231
- } else if (embeddingEnabled) {
7232
- views.embedding = { freshness: "current", rebuildStatus: "idle" };
7233
- } else {
7234
- views.embedding = {
7235
- freshness: "unknown",
7236
- rebuildStatus: "unavailable",
7237
- failureReason: "embedding provider is not initialized"
7238
- };
7363
+ let embeddingHealth;
7364
+ try {
7365
+ embeddingHealth = getEmbeddingRuntimeHealth?.();
7366
+ } catch {
7239
7367
  }
7368
+ views.embedding = embeddingHealthReceipt(embeddingHealth, embeddingEnabled);
7240
7369
  return views;
7241
7370
  }
7242
7371
  function rememberSearchDiagnostics(key, value) {
@@ -7540,12 +7669,16 @@ function getVectorDimensions() {
7540
7669
  function getActiveSemanticIndexProfile() {
7541
7670
  return indexEmbeddingProvider ? createSemanticIndexProfile(indexEmbeddingProvider) : null;
7542
7671
  }
7672
+ async function getPersistentSemanticVectorIds(dataDir) {
7673
+ if (!indexEmbeddingProvider) return null;
7674
+ return listSemanticVectorIds(dataDir, createSemanticIndexProfile(indexEmbeddingProvider));
7675
+ }
7543
7676
  async function queueSemanticVector(dataDir, record80) {
7544
7677
  const provider2 = indexEmbeddingProvider ?? await getEmbeddingProvider();
7545
7678
  const profile = provider2 ? createSemanticIndexProfile(provider2) : null;
7546
7679
  if (!profile) return;
7547
7680
  try {
7548
- await upsertSemanticVectors(dataDir, profile, [record80]);
7681
+ await upsertSemanticVector(dataDir, profile, record80);
7549
7682
  } catch {
7550
7683
  }
7551
7684
  }
@@ -7607,6 +7740,7 @@ function isCompatibleCachedVector(vector) {
7607
7740
  async function attachCachedVectors(database, observations2) {
7608
7741
  const semanticDataDir = (await Promise.resolve().then(() => (init_observations(), observations_exports))).getObservationDataDir();
7609
7742
  const semanticProfile = getActiveSemanticIndexProfile();
7743
+ const persistedSemanticIds = semanticDataDir && semanticProfile ? await listSemanticVectorIds(semanticDataDir, semanticProfile).catch(() => null) : null;
7610
7744
  const batchSize = 200;
7611
7745
  for (let start = 0; start < observations2.length; start += batchSize) {
7612
7746
  const batch = observations2.slice(start, start + batchSize);
@@ -7617,7 +7751,7 @@ async function attachCachedVectors(database, observations2) {
7617
7751
  const vector = cachedVectors[index];
7618
7752
  if (!isCompatibleCachedVector(vector)) continue;
7619
7753
  const observation = batch[index];
7620
- if (semanticDataDir && semanticProfile) {
7754
+ if (semanticDataDir && semanticProfile && !persistedSemanticIds?.has(observation.id)) {
7621
7755
  semanticRecords.push({
7622
7756
  observationId: observation.id,
7623
7757
  projectId: observation.projectId,
@@ -8390,6 +8524,7 @@ var init_orama_store = __esm({
8390
8524
  init_mini_skills();
8391
8525
  init_visibility();
8392
8526
  init_provider();
8527
+ init_provider();
8393
8528
  init_project_affinity();
8394
8529
  init_intent_detector();
8395
8530
  init_query_expansion();
@@ -8397,6 +8532,7 @@ var init_orama_store = __esm({
8397
8532
  init_timeout();
8398
8533
  init_obs_store();
8399
8534
  init_semantic_index();
8535
+ init_derived_view_receipt();
8400
8536
  db = null;
8401
8537
  dbInitPromise = null;
8402
8538
  dbGeneration = 0;
@@ -8521,33 +8657,6 @@ var init_entity_extractor = __esm({
8521
8657
  }
8522
8658
  });
8523
8659
 
8524
- // src/memory/secret-filter.ts
8525
- function applyRedaction(text2) {
8526
- if (!text2) return text2;
8527
- let out = text2;
8528
- out = out.replace(
8529
- /((?:password|passwd|pwd|secret|token|api[_-]?key|auth[_-]?key|access[_-]?key|private[_-]?key|client[_-]?secret)\s*[:=]\s*["']?)([^\s"',;\n]{6,})/gi,
8530
- "$1[REDACTED]"
8531
- );
8532
- out = out.replace(
8533
- /(Bearer\s+)([A-Za-z0-9._\-/+]{20,})/g,
8534
- "$1[REDACTED]"
8535
- );
8536
- out = out.replace(/\b(?:ghp|ghs|gho|github_pat)_[A-Za-z0-9]{36,}\b/g, "[REDACTED]");
8537
- out = out.replace(/\bsk-[A-Za-z0-9T-]{20,}\b/g, "[REDACTED]");
8538
- out = out.replace(/\beyJ[A-Za-z0-9._-]{40,}\b/g, "[REDACTED]");
8539
- return out;
8540
- }
8541
- function sanitizeCredentials(text2) {
8542
- return applyRedaction(text2);
8543
- }
8544
- var init_secret_filter = __esm({
8545
- "src/memory/secret-filter.ts"() {
8546
- "use strict";
8547
- init_esm_shims();
8548
- }
8549
- });
8550
-
8551
8660
  // src/runtime/maintenance-jobs.ts
8552
8661
  var maintenance_jobs_exports = {};
8553
8662
  __export(maintenance_jobs_exports, {
@@ -144126,7 +144235,7 @@ __export(video_jobs_exports, {
144126
144235
  runMiniMaxVideoGenerationJob: () => runMiniMaxVideoGenerationJob
144127
144236
  });
144128
144237
  import { spawn } from "child_process";
144129
- import { existsSync as existsSync8 } from "fs";
144238
+ import { existsSync as existsSync9 } from "fs";
144130
144239
  import path15 from "path";
144131
144240
  import { fileURLToPath as fileURLToPath2 } from "url";
144132
144241
  function safeError2(error) {
@@ -144374,7 +144483,7 @@ function resolveMediaVideoRunnerPath(moduleUrl = import.meta.url) {
144374
144483
  }
144375
144484
  function launchMediaVideoRunner(request, options = {}) {
144376
144485
  const runnerPath = options.runnerPath ?? resolveMediaVideoRunnerPath();
144377
- if (!existsSync8(runnerPath)) {
144486
+ if (!existsSync9(runnerPath)) {
144378
144487
  return { launched: false, reason: "Media video runner is unavailable until Memorix is built or reinstalled." };
144379
144488
  }
144380
144489
  try {
@@ -144419,7 +144528,7 @@ __export(audio_jobs_exports, {
144419
144528
  transcribeAudio: () => transcribeAudio
144420
144529
  });
144421
144530
  import { spawn as spawn2 } from "child_process";
144422
- import { existsSync as existsSync9 } from "fs";
144531
+ import { existsSync as existsSync10 } from "fs";
144423
144532
  import path16 from "path";
144424
144533
  import { fileURLToPath as fileURLToPath3 } from "url";
144425
144534
  function safeError3(error) {
@@ -144670,7 +144779,7 @@ function resolveMediaAudioRunnerPath(moduleUrl = import.meta.url) {
144670
144779
  }
144671
144780
  function launchMediaAudioRunner(request, options = {}) {
144672
144781
  const runnerPath = options.runnerPath ?? resolveMediaAudioRunnerPath();
144673
- if (!existsSync9(runnerPath)) return { launched: false, reason: "Audio runner is unavailable until Memorix is built or reinstalled." };
144782
+ if (!existsSync10(runnerPath)) return { launched: false, reason: "Audio runner is unavailable until Memorix is built or reinstalled." };
144674
144783
  try {
144675
144784
  const child = spawn2(process.execPath, [runnerPath, JSON.stringify(request)], {
144676
144785
  cwd: request.projectRoot,
@@ -147635,7 +147744,7 @@ __export(lite_provider_exports, {
147635
147744
  refreshProjectLite: () => refreshProjectLite
147636
147745
  });
147637
147746
  import { createHash as createHash11 } from "crypto";
147638
- import { existsSync as existsSync11, readdirSync as readdirSync2, readFileSync as readFileSync8, statSync as statSync3 } from "fs";
147747
+ import { existsSync as existsSync12, readdirSync as readdirSync2, readFileSync as readFileSync8, statSync as statSync3 } from "fs";
147639
147748
  import { join as join4, relative as relative2 } from "path";
147640
147749
  function hashText2(text2) {
147641
147750
  return createHash11("sha256").update(text2).digest("hex");
@@ -147653,7 +147762,7 @@ function resolveMaxFileBytes(value) {
147653
147762
  return Math.max(1, Math.floor(value));
147654
147763
  }
147655
147764
  function isPythonVirtualenvDir(dir) {
147656
- return existsSync11(join4(dir, "pyvenv.cfg"));
147765
+ return existsSync12(join4(dir, "pyvenv.cfg"));
147657
147766
  }
147658
147767
  function walk(root, exclude, maxFiles) {
147659
147768
  const out = [];
@@ -151192,7 +151301,7 @@ __export(vector_backfill_runner_exports, {
151192
151301
  import { spawn as spawn3 } from "child_process";
151193
151302
  import {
151194
151303
  closeSync,
151195
- existsSync as existsSync12,
151304
+ existsSync as existsSync13,
151196
151305
  mkdirSync as mkdirSync2,
151197
151306
  openSync,
151198
151307
  readFileSync as readFileSync9,
@@ -151320,7 +151429,7 @@ function releaseVectorBackfillLock(lockPath = process.env.MEMORIX_VECTOR_BACKFIL
151320
151429
  }
151321
151430
  function launchDetachedVectorBackfill(request, options = {}) {
151322
151431
  const runnerPath = options.runnerPath ?? resolveVectorBackfillRunnerPath();
151323
- const exists = options.exists ?? existsSync12;
151432
+ const exists = options.exists ?? existsSync13;
151324
151433
  if (!exists(runnerPath)) return false;
151325
151434
  const lock = acquireVectorBackfillLock(request.dataDir, request.projectId, options.lockPath);
151326
151435
  if (!lock) return false;
@@ -152339,13 +152448,14 @@ async function prepareSearchIndex(options = {}) {
152339
152448
  return 0;
152340
152449
  }
152341
152450
  const hydratedProjectDir = projectDir;
152342
- const queueMissingVectors = () => {
152343
- if (projectDir !== hydratedProjectDir) return;
152451
+ const queueMissingVectors = async () => {
152452
+ if (!hydratedProjectDir || projectDir !== hydratedProjectDir) return;
152344
152453
  vectorMissingIds.clear();
152345
152454
  if (!isEmbeddingExplicitlyDisabled()) {
152455
+ const persistedSemanticIds = await getPersistentSemanticVectorIds(hydratedProjectDir).catch(() => null);
152346
152456
  const projectsWithMissingVectors = /* @__PURE__ */ new Set();
152347
152457
  for (const obs of observations) {
152348
- if (!hasObservationVector(obs.projectId, obs.id)) {
152458
+ if (!hasObservationVector(obs.projectId, obs.id) && !persistedSemanticIds?.has(obs.id)) {
152349
152459
  vectorMissingIds.add(obs.id);
152350
152460
  projectsWithMissingVectors.add(obs.projectId);
152351
152461
  }
@@ -152355,9 +152465,9 @@ async function prepareSearchIndex(options = {}) {
152355
152465
  };
152356
152466
  const cacheHydration = getDeferredCachedVectorHydration();
152357
152467
  if (cacheHydration) {
152358
- void cacheHydration.finally(queueMissingVectors);
152468
+ void cacheHydration.then(queueMissingVectors, queueMissingVectors).catch(() => void 0);
152359
152469
  } else {
152360
- queueMissingVectors();
152470
+ await queueMissingVectors();
152361
152471
  }
152362
152472
  searchIndexPrepared = true;
152363
152473
  return count2;
@@ -6,6 +6,20 @@ All notable changes to this project will be documented in this file.
6
6
 
7
7
  No unreleased changes.
8
8
 
9
+ ## [1.10.2] - 2026-10-30
10
+
11
+ ### Fixed
12
+ - LanceDB semantic-index writes are batched and periodically optimized, with
13
+ `memorix repair index` available to compact older inflated indexes safely.
14
+ Startup now checks persisted vector IDs before scheduling re-embedding or
15
+ rewriting cached vectors.
16
+ - Derived-view receipts now report degraded embedding health and redact local
17
+ paths and credentials from failure reasons.
18
+ - Hermes now registers bundled skills by file path, matching the current
19
+ plugin API (#366).
20
+ - MCP search results and the session-start card are available in
21
+ `structuredContent` for clients that do not display text blocks (#368).
22
+
9
23
  ## [1.10.1] - 2026-10-23
10
24
 
11
25
  ### Added