ruvnet/ruflo · error · RangeError

unknown scheme "${s}" (use tournament | tournament_nd | gumb

Error message

unknown scheme "${s}" (use tournament | tournament_nd | gumbel)

What it means

normScheme guard: the watermarking scheme argument is not one of the supported set — 'tournament', 'tournament_nd', or 'gumbel' (with 'gumbel' as default when falsy). An unknown scheme string is rejected with a RangeError because the WASM core has no matching algorithm.

Source

Thrown at v3/@claude-flow/watermark/index.js:27

const wasm = require('./wasm/ruflo_watermark.js');

const SCHEMES = new Set(['tournament', 'tournament_nd', 'gumbel']);

function toKeyBytes(key) {
  if (typeof key === 'string') return new TextEncoder().encode(key);
  if (key instanceof Uint8Array) return key;
  throw new TypeError('key must be a string or Uint8Array');
}
function toU32(a) {
  return a instanceof Uint32Array ? a : Uint32Array.from(a);
}
function toF32(a) {
  return a instanceof Float32Array ? a : Float32Array.from(a);
}
function normScheme(scheme) {
  const s = scheme || 'gumbel';
  if (!SCHEMES.has(s)) throw new RangeError(`unknown scheme "${s}" (use tournament | tournament_nd | gumbel)`);
  return s;
}

/** Shape a raw WasmDetection into a plain object with an `isWatermarked` helper. */
function shape(r) {
  const out = {
    zScore: r.z_score,
    pValue: r.p_value,
    log10P: r.log10_p,
    scoredPositions: r.scored_positions,
    /** True if the evidence clears the given false-positive rate (e.g. 1e-6). */
    isWatermarked(alpha = 1e-6) {
      return out.log10P <= Math.log10(alpha);
    },
  };
  r.free();
  return out;
}

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Use one of the supported schemes: tournament, tournament_nd, or gumbel.
  2. Fix the scheme configuration value; it likely contains a typo.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/@claude-flow/watermark/index.js:27 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/287fadb2990e6a37. Report an issue: GitHub.