{"record":{"id":"422909f229d3fe13","repo":"ruvnet/ruflo","slug":"failed-to-get-prioritized-gaps","errorCode":null,"errorMessage":"Failed to get prioritized gaps","messagePattern":"Failed to get prioritized gaps","errorType":"exception","errorClass":"QEMemoryError","httpStatus":null,"severity":"error","filePath":"v3/plugins/agentic-qe/src/bridges/QEMemoryBridge.ts","lineNumber":375,"sourceCode":"        } catch {\n          return null;\n        }\n      }).filter((g): g is CoverageGap => g !== null);\n\n      // Sort by priority (critical > high > medium > low) then by risk score\n      const priorityOrder = { critical: 0, high: 1, medium: 2, low: 3 };\n      gaps.sort((a, b) => {\n        const priorityDiff = priorityOrder[a.priority] - priorityOrder[b.priority];\n        if (priorityDiff !== 0) return priorityDiff;\n        return b.riskScore - a.riskScore;\n      });\n\n      const prioritizedGaps = gaps.slice(0, limit);\n      this.logger.debug(`Returning ${prioritizedGaps.length} prioritized gaps`);\n      return prioritizedGaps;\n    } catch (error) {\n      this.logger.error('Failed to get prioritized gaps', error);\n      throw new QEMemoryError('Failed to get prioritized gaps', error as Error);\n    }\n  }\n\n  /**\n   * Store a learning trajectory for ReasoningBank\n   */\n  async storeTrajectory(trajectory: LearningTrajectory): Promise<string> {\n    this.ensureInitialized();\n\n    try {\n      this.logger.debug(`Storing learning trajectory: ${trajectory.id}`);\n\n      // Generate embedding from trajectory steps\n      const embeddingText = trajectory.steps.map((s) => s.action).join(' ');\n      const { embedding } = await this.embeddings.embed(embeddingText);\n\n      const id = await this.memory.store({\n        namespace: QE_NAMESPACES.learningTrajectories.name,","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/agentic-qe/src/bridges/QEMemoryBridge.ts#L357-L393","documentation":"QEMemoryError raised by getPrioritizedGaps when collecting, parsing, or priority-sorting stored coverage gaps fails — e.g. AgentDB query errors or unparseable gap entries — after which unparseable entries are filtered out or the error is surfaced.","triggerScenarios":"Thrown at v3/plugins/agentic-qe/src/bridges/QEMemoryBridge.ts:375 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify gap data exists and the prioritization function is available.","Inspect the underlying error."],"exampleFix":null,"handlingStrategy":"try-catch","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"}