{"record":{"id":"bdd39b0383002fc7","repo":"ruvnet/ruflo","slug":"cannot-compute-distance-between-points-with-differ","errorCode":null,"errorMessage":"Cannot compute distance between points with different curvatures","messagePattern":"Cannot compute distance between points with different curvatures","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/plugins/hyperbolic-reasoning/src/bridges/hyperbolic-bridge.ts","lineNumber":280,"sourceCode":"\n    // Compute quality metrics\n    const metrics = this.computeEmbeddingMetrics(hierarchy, embeddings);\n\n    return {\n      embeddings,\n      model: 'poincare_ball',\n      curvature,\n      dimension: mergedConfig.dimensions,\n      metrics,\n    };\n  }\n\n  /**\n   * Compute hyperbolic distance between two points\n   */\n  distance(a: HyperbolicPoint, b: HyperbolicPoint): number {\n    if (a.curvature !== b.curvature) {\n      throw new Error('Cannot compute distance between points with different curvatures');\n    }\n    return poincareDistance(a.coordinates, b.coordinates, a.curvature);\n  }\n\n  /**\n   * Check if one point is ancestor of another (closer to origin)\n   */\n  isAncestor(parent: HyperbolicPoint, child: HyperbolicPoint, threshold = 0.1): boolean {\n    const parentNorm = Math.sqrt(parent.coordinates.reduce((s, v) => s + v * v, 0));\n    const childNorm = Math.sqrt(child.coordinates.reduce((s, v) => s + v * v, 0));\n    return parentNorm < childNorm - threshold;\n  }\n\n  /**\n   * Get hierarchy depth from hyperbolic point\n   */\n  hierarchyDepth(point: HyperbolicPoint): number {\n    const norm = Math.sqrt(point.coordinates.reduce((s, v) => s + v * v, 0));","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/hyperbolic-reasoning/src/bridges/hyperbolic-bridge.ts#L262-L298","documentation":"HyperbolicBridge.distance() was given two points whose curvature values differ. The Poincaré geodesic distance is only defined within one ball (one curvature), so mixing points from differently-curved embeddings is rejected before poincareDistance runs.","triggerScenarios":"Thrown at v3/plugins/hyperbolic-reasoning/src/bridges/hyperbolic-bridge.ts:280 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure both points use the same curvature value; project or convert one point to the other's curvature before computing distance.","Validate curvature equality at the API boundary and fail fast with both values in the message."],"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-14T05:17:10.506Z"}