{"record":{"id":"111de995e4703ca5","repo":"ruvnet/ruflo","slug":"tunedistillation-source-db-not-found-at-dbpath","errorCode":null,"errorMessage":"tuneDistillation: source db not found at ${dbPath}","messagePattern":"tuneDistillation: source db not found at (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/services/distill-tuning.ts","lineNumber":213,"sourceCode":"/**\n * Grid-search the distillation config against isolated copies of `dbPath`,\n * scored on a held-out split. See module header for the full methodology.\n */\nexport async function tuneDistillation(options: TuneDistillationOptions): Promise<TuningReport> {\n  const {\n    dbPath,\n    grid = {},\n    namespaces,\n    trainFraction = DEFAULT_TRAIN_FRACTION,\n    queryNamespaces = DEFAULT_QUERY_NAMESPACES,\n    topK = DEFAULT_TOP_K,\n    now,\n    tmpDir = os.tmpdir(),\n    verbose = false,\n  } = options;\n\n  if (!dbPath || !fs.existsSync(dbPath)) {\n    throw new Error(`tuneDistillation: source db not found at ${dbPath}`);\n  }\n\n  const Database = await loadBetterSqlite3();\n  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      }","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/services/distill-tuning.ts#L195-L231","documentation":"The grid-search tuning harness requires a source AgentDB file to copy and score against, and it was passed an empty dbPath or a path where fs.existsSync returns false. Nothing can be tuned without source data, so the argument is rejected before any temp copies or checksums are made.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/services/distill-tuning.ts:213 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point --db at an existing SQLite database","Create or locate the source AgentDB database before running tuneDistillation"],"exampleFix":"Pass a valid --db path pointing to an existing AgentDB sqlite file, or create the source database first before running tuneDistillation.","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"}