{"record":{"id":"633770e8435c9cb7","repo":"ruvnet/ruflo","slug":"tunedistillation-empty-grid-supply-at-least-one","errorCode":null,"errorMessage":"tuneDistillation: empty grid — supply at least one value per grid axis","messagePattern":"tuneDistillation: empty grid — supply at least one value per grid axis","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/services/distill-tuning.ts","lineNumber":235,"sourceCode":"  if (!Database) {\n    throw new Error('tuneDistillation: better-sqlite3 unavailable — cannot run the tuning harness');\n  }\n\n  const sourceChecksumBefore = sha256File(dbPath);\n\n  const batchSizes = grid.batchSize ?? DEFAULT_GRID_BATCH_SIZE;\n  const dedupDistances = grid.dedupDistance ?? DEFAULT_GRID_DEDUP_DISTANCE;\n  const promoteThresholds = grid.promoteThreshold ?? DEFAULT_GRID_PROMOTE_THRESHOLD;\n  const configs: TuningConfig[] = [];\n  for (const batchSize of batchSizes) {\n    for (const dedupDistance of dedupDistances) {\n      for (const promoteThreshold of promoteThresholds) {\n        configs.push({ batchSize, dedupDistance, promoteThreshold });\n      }\n    }\n  }\n  if (configs.length === 0) {\n    throw new Error('tuneDistillation: empty grid — supply at least one value per grid axis');\n  }\n\n  // ── Splits + query sets: a dedicated read-only copy, never the source itself ──\n  const readCopy = copyToTemp(dbPath, tmpDir, 'split-read');\n  let outerSplit: TimeSplit;\n  let innerSplit: TimeSplit;\n  let trainQuerySet: QueryEntry[];\n  let heldOutQuerySet: QueryEntry[];\n  let heldOutBaselineIndex: PatternIndexEntry[];\n  try {\n    const readDb = new Database(readCopy, { readonly: true });\n    try {\n      outerSplit = computeTimeSplit(readDb, trainFraction);\n      assertDisjoint(outerSplit.trainRowids, outerSplit.heldOutRowids);\n\n      innerSplit = computeTimeSplit(readDb, trainFraction, {\n        extraWhere: `rowid <= ${outerSplit.trainBoundaryRowid}`,\n      });","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/services/distill-tuning.ts#L217-L253","documentation":"After substituting defaults for every grid axis, the cartesian-product loop would produce zero candidate configs — i.e. the caller supplied only empty arrays for the grid axes. The harness refuses to run a grid search with no points to evaluate.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/services/distill-tuning.ts:235 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide at least one candidate value for every grid axis","Remove axes that have no values from the grid definition"],"exampleFix":"Provide at least one value for every grid axis in the tuning configuration; empty axes produce an empty candidate grid.","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-23T08:17:48.524Z"}