ruvnet/ruflo · error

Need at least one point

Error message

Need at least one point

What it means

hyperbolicCentroid() was called with an empty points array. A Fréchet mean over zero points is undefined, so the function refuses immediately rather than entering the iterative optimization with no data.

Source

Thrown at v3/@claude-flow/embeddings/src/hyperbolic.ts:288

}

/**
 * Compute hyperbolic centroid (Fréchet mean) of multiple points
 *
 * Uses iterative optimization to find the centroid in Poincaré ball.
 *
 * @param points - Array of Poincaré embeddings
 * @param config - Configuration
 * @param maxIter - Maximum iterations (default: 100)
 * @returns Hyperbolic centroid
 */
export function hyperbolicCentroid(
  points: Array<Float32Array | number[]>,
  config: HyperbolicConfig = {},
  maxIter = 100
): Float32Array {
  if (points.length === 0) {
    throw new Error('Need at least one point');
  }
  if (points.length === 1) {
    const arr = new Float32Array(points[0].length);
    for (let i = 0; i < points[0].length; i++) {
      arr[i] = points[0][i];
    }
    return arr;
  }

  const { epsilon } = { ...DEFAULT_CONFIG, ...config };
  const dim = points[0].length;

  // Initialize centroid at Euclidean mean projected to ball
  const centroidInit = new Float32Array(dim);
  for (const p of points) {
    for (let i = 0; i < dim; i++) {
      centroidInit[i] += p[i];
    }

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Pass at least one point to the operation.
  2. Guard the call site so empty batches are skipped instead of submitted.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/@claude-flow/embeddings/src/hyperbolic.ts:288 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/e8bffee6ba5d622b. Report an issue: GitHub.