{"record":{"id":"b6d8eb0af1fe7df0","repo":"ruvnet/ruflo","slug":"learning-bridge-not-initialized","errorCode":null,"errorMessage":"Learning bridge not initialized","messagePattern":"Learning bridge not initialized","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/plugins/test-intelligence/src/bridges/learning-bridge.ts","lineNumber":115,"sourceCode":"    this.status = 'unloaded';\n  }\n\n  isReady(): boolean {\n    return this.status === 'ready';\n  }\n\n  /**\n   * Train on test execution history\n   *\n   * Uses temporal difference learning to update the test selection policy\n   * based on historical outcomes.\n   */\n  async trainOnHistory(\n    history: TestHistoryEntry[],\n    config?: LearningConfig\n  ): Promise<number> {\n    if (!this.isReady()) {\n      throw new Error('Learning bridge not initialized');\n    }\n\n    const mergedConfig = { ...this.config, ...config };\n    let totalLoss = 0;\n\n    // Build file-to-test mapping\n    for (const entry of history) {\n      this.testEmbeddings.set(entry.testId, this.computeTestEmbedding(entry));\n\n      for (const file of entry.affectedFiles) {\n        if (!this.fileTestMapping.has(file)) {\n          this.fileTestMapping.set(file, new Set());\n        }\n        this.fileTestMapping.get(file)!.add(entry.testId);\n      }\n    }\n\n    // Create experiences from history","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/test-intelligence/src/bridges/learning-bridge.ts#L97-L133","documentation":"trainOnHistory() checked isReady() and found status is not 'ready' — the learning bridge was never initialized or was unloaded. Sentinel lifecycle guard: TD-learning over test execution history cannot run without the learning engine loaded.","triggerScenarios":"Thrown at v3/plugins/test-intelligence/src/bridges/learning-bridge.ts:115 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":"validation","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"}