{"record":{"id":"14c14fc7ce6a5a8c","repo":"ruvnet/ruflo","slug":"hnsw-bridge-not-initialized","errorCode":null,"errorMessage":"HNSW bridge not initialized","messagePattern":"HNSW bridge not initialized","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/plugins/healthcare-clinical/src/bridges/hnsw-bridge.ts","lineNumber":277,"sourceCode":"      this.initialized = true;\n    } catch (error) {\n      this.logger.warn('Failed to initialize WASM, using fallback', {\n        error: error instanceof Error ? error.message : String(error),\n      });\n      this.initialized = true; // Still mark as initialized with fallback\n    }\n  }\n\n  /**\n   * Add a patient vector to the index\n   */\n  async addVector(\n    id: string,\n    vector: Float32Array,\n    metadata?: Record<string, unknown>\n  ): Promise<void> {\n    if (!this.initialized) {\n      throw new Error('HNSW bridge not initialized');\n    }\n\n    const index = this.nextIndex++;\n    this.idToIndex.set(id, index);\n    this.indexToId.set(index, id);\n\n    if (metadata) {\n      this.metadata.set(id, metadata);\n    }\n\n    if (this.wasmModule && this.indexPtr) {\n      this.wasmModule.add_vector(this.indexPtr, index, vector);\n    } else {\n      // Fallback: store in memory\n      this.metadata.set(`${id}_vector`, { vector: Array.from(vector) });\n    }\n\n    this.logger.debug('Added vector', { id, index });","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/healthcare-clinical/src/bridges/hnsw-bridge.ts#L259-L295","documentation":"HNSWBridge.addVector() found this.initialized false — the bridge never finished initialization (WASM load or its JS fallback). The vector is not inserted; callers should initialize the bridge before indexing patient vectors (addPatient routes through this).","triggerScenarios":"Thrown at v3/plugins/healthcare-clinical/src/bridges/hnsw-bridge.ts:277 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the module/bridge/plugin initialize() method has been called and awaited before invoking this operation.","Guard against calls made during startup: await the initialization promise or check the initialized flag and fail fast with a clear setup hint."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}