ruvnet/ruflo · error · Error

tuneDistillation: source db not found at

Error message

tuneDistillation: source db not found at ${dbPath}

What it means

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.

Solutions

  1. Point --db at an existing SQLite database
  2. Create or locate the source AgentDB database before running tuneDistillation

Example fix

Pass a valid --db path pointing to an existing AgentDB sqlite file, or create the source database first before running tuneDistillation.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/@claude-flow/cli/src/services/distill-tuning.ts:213 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/111de995e4703ca5. Report an issue: GitHub.

Appendix: source

Thrown at v3/@claude-flow/cli/src/services/distill-tuning.ts:213

/**
 * Grid-search the distillation config against isolated copies of `dbPath`,
 * scored on a held-out split. See module header for the full methodology.
 */
export async function tuneDistillation(options: TuneDistillationOptions): Promise<TuningReport> {
  const {
    dbPath,
    grid = {},
    namespaces,
    trainFraction = DEFAULT_TRAIN_FRACTION,
    queryNamespaces = DEFAULT_QUERY_NAMESPACES,
    topK = DEFAULT_TOP_K,
    now,
    tmpDir = os.tmpdir(),
    verbose = false,
  } = options;

  if (!dbPath || !fs.existsSync(dbPath)) {
    throw new Error(`tuneDistillation: source db not found at ${dbPath}`);
  }

  const Database = await loadBetterSqlite3();
  if (!Database) {
    throw new Error('tuneDistillation: better-sqlite3 unavailable — cannot run the tuning harness');
  }

  const sourceChecksumBefore = sha256File(dbPath);

  const batchSizes = grid.batchSize ?? DEFAULT_GRID_BATCH_SIZE;
  const dedupDistances = grid.dedupDistance ?? DEFAULT_GRID_DEDUP_DISTANCE;
  const promoteThresholds = grid.promoteThreshold ?? DEFAULT_GRID_PROMOTE_THRESHOLD;
  const configs: TuningConfig[] = [];
  for (const batchSize of batchSizes) {
    for (const dedupDistance of dedupDistances) {
      for (const promoteThreshold of promoteThresholds) {
        configs.push({ batchSize, dedupDistance, promoteThreshold });
      }

View on GitHub (pinned to fa13ee4ad6)