{"record":{"id":"ea1e4c61423af638","repo":"ruvnet/ruflo","slug":"tunedistillation-every-grid-candidate-was-skipped","errorCode":null,"errorMessage":"tuneDistillation: every grid candidate was skipped — see candidates[].skipped","messagePattern":"tuneDistillation: every grid candidate was skipped — see candidates\\[\\]\\.skipped","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/services/distill-tuning.ts","lineNumber":306,"sourceCode":"      namespaces,\n      querySet: trainQuerySet,\n      topK,\n    });\n    candidates.push({\n      config,\n      trainScore: result.mrrAtK,\n      trainRecallAt10: result.recallAtK,\n      trainQueryCount: result.queryCount,\n      patternCount: result.patternCount,\n      promotedCount: result.promotedCount,\n      distillMs: result.distillMs,\n      ...(result.skipped ? { skipped: result.skipped } : {}),\n    });\n  }\n\n  const scored = candidates.filter((c) => !c.skipped);\n  if (scored.length === 0) {\n    throw new Error('tuneDistillation: every grid candidate was skipped — see candidates[].skipped');\n  }\n  const winner = scored.reduce((best, c) => (c.trainScore > best.trainScore ? c : best), scored[0]);\n\n  // ── Held-out: score the winner ONCE, refit on the FULL outer train partition ──\n  const winnerFull = await evaluateCandidate({\n    Database,\n    sourceDbPath: dbPath,\n    tmpDir,\n    config: winner.config,\n    fitBoundaryRowid: outerSplit.trainBoundaryRowid,\n    namespaces,\n    querySet: heldOutQuerySet,\n    topK,\n  });\n  const baseline = scoreQuerySet(heldOutBaselineIndex, heldOutQuerySet, topK);\n\n  const heldOut: HeldOutScore = {\n    mrrAt10: winnerFull.mrrAtK,","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/services/distill-tuning.ts#L288-L324","documentation":"After evaluating every grid config, tuneDistillation filters out candidates whose result.skipped is set; if all of them were skipped, none remain to select a winner and the harness throws, telling the caller to inspect candidates[].skipped for per-config skip reasons.","triggerScenarios":"Every config in the grid was skipped during evaluateCandidate — e.g. dedupDistance too aggressive leaving zero patterns, promoteThreshold excluding everything, batch sizes that error the distill step, or namespaces filters matching no rows.","commonSituations":"A db too small for the requested split (no training rows past the boundary); namespaces option narrowed to namespaces with no entries; grid values pushed to degenerate extremes; promoteThreshold ranges that admit nothing.","solutions":["Inspect the returned/caught candidates[].skipped reasons to find the common skip cause.","Widen the grid (smaller dedupDistance, more permissive promoteThreshold) so at least one config survives.","Ensure the db has enough rows in the chosen namespaces for a non-trivial train/held-out split.","Relax the namespaces filter or pass namespaces: undefined to use defaults."],"exampleFix":"// before\nconst result = await tuneDistillation({ dbPath, grid: { dedupDistance: [0.9] } }); // all skipped\n\n// after — catch and inspect, then widen\ntry {\n  const result = await tuneDistillation({ dbPath, grid });\n} catch (e) {\n  // re-run with a wider grid that lets at least one candidate through\n  await tuneDistillation({ dbPath, grid: { dedupDistance: [0.05, 0.1, 0.2] } });\n}","handlingStrategy":"try-catch","validationCode":"// Cannot fully pre-validate; the skips are determined at eval time.\n// Ensure the db has rows and the grid is non-degenerate before calling:\nconst rowCount = countRows(db, namespaces);\nif (rowCount < minRowsForSplit) {\n  throw new Error(`db has only ${rowCount} rows; widen namespaces or grow memory first`);\n}","typeGuard":null,"tryCatchPattern":"let result;\ntry {\n  result = await tuneDistillation({ dbPath, grid });\n} catch (e) {\n  if ((e as Error).message.includes('every grid candidate was skipped')) {\n    // widen the grid and retry once\n    result = await tuneDistillation({ dbPath, grid: { dedupDistance: [0.05, 0.1, 0.2] } });\n  } else throw e;\n}","preventionTips":["Inspect candidates[].skipped reasons when this fires.","Keep grid axes within non-degenerate ranges (avoid 0.9 dedupDistance on small corpora).","Ensure the source db has enough rows in the target namespaces for a real split.","Prefer default grids unless you have reason to narrow them."],"tags":["distillation","tuning","typescript"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}