{"record":{"id":"56b9237afb740cf4","repo":"ruvnet/ruflo","slug":"claude-flow-watermark-web-call-await-init-be","errorCode":null,"errorMessage":"@claude-flow/watermark/web: call `await init()` before use","messagePattern":"@claude-flow/watermark/web: call `await init\\(\\)` before use","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/watermark/web/index.mjs","lineNumber":33,"sourceCode":"} from './ruflo_watermark.js';\n\nlet _ready = false;\n\n/** Instantiate the WASM module. Await once before any other call. */\nexport async function init(input) {\n  if (_ready) return;\n  // Non-deprecated wasm-bindgen call shape; no arg => browser auto-fetch.\n  await initWasm(input === undefined ? undefined : { module_or_path: input });\n  _ready = true;\n}\n\n/** True once `init()` has completed. */\nexport function isReady() {\n  return _ready;\n}\n\nfunction assertReady() {\n  if (!_ready) throw new Error('@claude-flow/watermark/web: call `await init()` before use');\n}\n\nconst SCHEMES = new Set(['tournament', 'tournament_nd', 'gumbel']);\nconst enc = new TextEncoder();\nconst toKeyBytes = (k) => (typeof k === 'string' ? enc.encode(k) : k);\nconst toU32 = (a) => (a instanceof Uint32Array ? a : Uint32Array.from(a));\nconst toF32 = (a) => (a instanceof Float32Array ? a : Float32Array.from(a));\nfunction normScheme(s) {\n  const v = s || 'gumbel';\n  if (!SCHEMES.has(v)) throw new RangeError(`unknown scheme \"${v}\" (tournament | tournament_nd | gumbel)`);\n  return v;\n}\nfunction shape(r) {\n  const out = {\n    zScore: r.z_score,\n    pValue: r.p_value,\n    log10P: r.log10_p,\n    scoredPositions: r.scored_positions,","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/watermark/web/index.mjs#L15-L51","documentation":"assertReady() in the wasm-bindgen web wrapper found _ready false: init() was never awaited (or failed) before calling a watermark API. Sentinel guard — the WASM module instance is missing, so any tournament/gumbel scheme call would dereference uninitialized exports.","triggerScenarios":"Thrown at v3/@claude-flow/watermark/web/index.mjs:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the module/bridge/plugin initialize() method has been called and awaited before invoking this operation.","Guard against calls made during startup: await the initialization promise or check the initialized flag and fail fast with a clear setup hint."],"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"}