{"record":{"id":"bf04c94b1aaa4d2f","repo":"ruvnet/ruflo","slug":"bootstrap-iterations-must-be-100","errorCode":null,"errorMessage":"bootstrap iterations must be >= 100","messagePattern":"bootstrap iterations must be >= 100","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/services/flywheel-receipt.ts","lineNumber":412,"sourceCode":"    else return values[k];\n  }\n  return values[k] ?? 0;\n}\n\nexport function computePromotionStatistics(input: {\n  baselineScore: number;\n  candidateScore: number;\n  heldOutDeltas: number[];\n  frozenAnchorRegression: number;\n  corpusHash: string;\n  candidateId: string;\n  baselineRef: string;\n  evaluationRunId: string;\n  iterations?: number;\n  metricEpsilon?: number;\n}): PromotionStatistics {\n  const iterations = input.iterations ?? 10_000;\n  if (!Number.isInteger(iterations) || iterations < 100) throw new Error('bootstrap iterations must be >= 100');\n  const n = input.heldOutDeltas.length;\n  const metricEpsilon = input.metricEpsilon ?? 1e-12;\n  const relativeLift = (input.candidateScore - input.baselineScore) / Math.max(Math.abs(input.baselineScore), metricEpsilon);\n  const seeded = seedFrom([\n    'ruflo/bootstrap/v1',\n    input.corpusHash,\n    input.candidateId,\n    input.baselineRef,\n    input.evaluationRunId,\n  ]);\n  let state = seeded.seed >>> 0;\n  const rnd = () => {\n    state = (1664525 * state + 1013904223) >>> 0;\n    return state / 4294967296;\n  };\n  const means = new Array<number>(iterations);\n  let positiveMeans = 0;\n  if (n === 0) {","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/ruvnet/ruflo/blob/2602b642d92234c710ffbe96bfb33007d481ceab/v3/@claude-flow/cli/src/services/flywheel-receipt.ts#L394-L430","documentation":"Input validation in computePromotionStatistics(): the bootstrap iterations argument is not an integer or is below 100, which would make percentile estimates statistically meaningless. Unlike the default of 10,000, an explicitly invalid value throws and aborts receipt computation.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/services/flywheel-receipt.ts:263 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set bootstrap iterations to 100 or higher for statistical validity"],"exampleFix":"Set bootstrap iterations to a value >= 100 in the flywheel receipt configuration.","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2602b642d92234c710ffbe96bfb33007d481ceab","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}