{"record":{"id":"0f978d488f627b37","repo":"ruvnet/ruflo","slug":"invalid-number-of-nodes-graph-nodes-must-be-1","errorCode":null,"errorMessage":"Invalid number of nodes: ${graph.nodes} (must be 1-1000)","messagePattern":"Invalid number of nodes: (.+?) \\(must be 1-1000\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/plugins/quantum-optimizer/src/bridges/exotic-bridge.ts","lineNumber":346,"sourceCode":"\n  private validateQuboProblem(problem: QUBOProblem): void {\n    if (problem.variables < 1 || problem.variables > 10000) {\n      throw new Error(`Invalid number of variables: ${problem.variables} (must be 1-10000)`);\n    }\n\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","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/quantum-optimizer/src/bridges/exotic-bridge.ts#L328-L364","documentation":"The problem-graph validator rejected the number of nodes for the QAOA graph run: it must lie in [1, 1000] for the exotic solver backend. Out-of-range graph sizes are refused before the QUBO/problem is built; shrink the graph or choose a different backend.","triggerScenarios":"Thrown at v3/plugins/quantum-optimizer/src/bridges/exotic-bridge.ts:346 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"}