{"record":{"id":"df496692ee0136d5","repo":"ruvnet/ruflo","slug":"economy-bridge-not-initialized","errorCode":null,"errorMessage":"Economy bridge not initialized","messagePattern":"Economy bridge not initialized","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/plugins/financial-risk/src/bridges/economy-bridge.ts","lineNumber":305,"sourceCode":"      } else {\n        this.logger.warn('WASM module not available, using JavaScript fallback');\n      }\n\n      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;\n    }\n  }\n\n  /**\n   * Calculate Value at Risk\n   */\n  async calculateVar(returns: Float32Array, confidence: number): Promise<number> {\n    if (!this.initialized) {\n      throw new Error('Economy bridge not initialized');\n    }\n\n    if (this.wasmModule) {\n      return this.wasmModule.calculate_var(returns, confidence);\n    }\n\n    return this.calculator.calculateVaR(Array.from(returns), confidence);\n  }\n\n  /**\n   * Calculate Conditional VaR\n   */\n  async calculateCvar(returns: Float32Array, confidence: number): Promise<number> {\n    if (!this.initialized) {\n      throw new Error('Economy bridge not initialized');\n    }\n\n    if (this.wasmModule) {","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/financial-risk/src/bridges/economy-bridge.ts#L287-L323","documentation":"EconomyBridge.calculateVar() found this.initialized still false — initialize() has not completed (WASM load or its fallback path). The VaR computation is refused until the bridge is ready; calculateRiskMetrics reaches this through calculateVar.","triggerScenarios":"Thrown at v3/plugins/financial-risk/src/bridges/economy-bridge.ts:305 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-14T05:17:10.506Z"}