{"record":{"id":"78d5f93a9a38e991","repo":"ruvnet/ruflo","slug":"sparse-bridge-not-initialized-78d5f9","errorCode":null,"errorMessage":"Sparse bridge not initialized","messagePattern":"Sparse bridge not initialized","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/plugins/perf-optimizer/src/bridges/sparse-bridge.ts","lineNumber":103,"sourceCode":"  async destroy(): Promise<void> {\n    this.featureHashes.clear();\n    this.encodingCache.clear();\n    this.status = 'unloaded';\n  }\n\n  isReady(): boolean {\n    return this.status === 'ready';\n  }\n\n  /**\n   * Encode traces into sparse representation\n   *\n   * Uses feature hashing and sparse encoding to efficiently\n   * represent trace spans for downstream analysis.\n   */\n  async encodeTraces(spans: TraceSpan[]): Promise<Float32Array> {\n    if (!this.isReady()) {\n      throw new Error('Sparse bridge not initialized');\n    }\n\n    // Check cache\n    const cacheKey = this.computeCacheKey(spans);\n    const cached = this.encodingCache.get(cacheKey);\n    if (cached) return cached;\n\n    const encoding = new Float32Array(this.config.maxDimensions);\n    const nonZeroCount = Math.floor(this.config.maxDimensions * this.config.sparsityRatio);\n\n    for (const span of spans) {\n      // Extract features from span\n      const features = this.extractSpanFeatures(span);\n\n      // Hash features to sparse dimensions\n      for (const [feature, value] of Object.entries(features)) {\n        const hash = this.hashFeature(feature);\n        const dim = hash % this.config.maxDimensions;","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/perf-optimizer/src/bridges/sparse-bridge.ts#L85-L121","documentation":"Guard in encodeTraces: the sparse bridge's status must be 'ready' (set during initialization) before traces can be encoded; the error fires when encodeTraces is called before a successful initialize or after destroy() reset the status to 'unloaded'.","triggerScenarios":"Thrown at v3/plugins/perf-optimizer/src/bridges/sparse-bridge.ts:103 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"}