{"record":{"id":"01bcb6c887270cac","repo":"ruvnet/ruflo","slug":"invalid-edge-u-v-for-graph-nodes-node","errorCode":null,"errorMessage":"Invalid edge: [${u}, ${v}] for ${graph.nodes} nodes","messagePattern":"Invalid edge: \\[(.+?), (.+?)\\] for (.+?) nodes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/plugins/quantum-optimizer/src/bridges/exotic-bridge.ts","lineNumber":351,"sourceCode":"\n    if (problem.linear.length !== problem.variables) {\n      throw new Error(`Linear coefficients length mismatch: ${problem.linear.length} vs ${problem.variables}`);\n    }\n\n    const expectedQuadratic = (problem.variables * (problem.variables - 1)) / 2;\n    if (problem.quadratic.length !== expectedQuadratic && problem.quadratic.length !== 0) {\n      throw new Error(`Quadratic coefficients length mismatch: ${problem.quadratic.length} vs ${expectedQuadratic}`);\n    }\n  }\n\n  private validateProblemGraph(graph: ProblemGraph): void {\n    if (graph.nodes < 1 || graph.nodes > 1000) {\n      throw new Error(`Invalid number of nodes: ${graph.nodes} (must be 1-1000)`);\n    }\n\n    for (const [u, v] of graph.edges) {\n      if (u < 0 || u >= graph.nodes || v < 0 || v >= graph.nodes) {\n        throw new Error(`Invalid edge: [${u}, ${v}] for ${graph.nodes} nodes`);\n      }\n    }\n  }\n\n  private simulatedAnnealing(problem: QUBOProblem, config: AnnealingConfig): QUBOSolution {\n    const n = problem.variables;\n    const assignment = new Uint8Array(n);\n\n    // Random initial assignment\n    for (let i = 0; i < n; i++) {\n      assignment[i] = Math.random() < 0.5 ? 0 : 1;\n    }\n\n    let energy = this.computeEnergy(problem, assignment);\n    let bestEnergy = energy;\n    const bestAssignment = new Uint8Array(assignment);\n\n    let temperature = config.temperature.initial;","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/quantum-optimizer/src/bridges/exotic-bridge.ts#L333-L369","documentation":"validateProblemGraph() found an edge [u,v] referencing a node index outside [0, graph.nodes). The edge list contains an out-of-range endpoint, which would index past allocated WASM memory during QAOA execution.","triggerScenarios":"Thrown at v3/plugins/quantum-optimizer/src/bridges/exotic-bridge.ts:351 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the invalid input element reported in the message; validate the full input against the documented schema before submitting.","Add boundary validation so malformed input is rejected with a per-element diagnostic."],"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"}