{"record":{"id":"cfc0c74d51e4f5b9","repo":"paperclipai/paperclip","slug":"unsupported-seed-mode-seedmode-expected-one","errorCode":null,"errorMessage":"Unsupported seed mode \"${seedMode}\". Expected one of: minimal, full.","messagePattern":"Unsupported seed mode \"(.+?)\"\\. Expected one of: minimal, full\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":1627,"sourceCode":"    await releaseLock();\n  }\n}\n\nexport function resolveWorktreeSeedBackupEngine(seedPlan: WorktreeSeedPlan): \"auto\" | \"javascript\" {\n  return seedPlan.excludedTables.length === 0 && Object.keys(seedPlan.nullifyColumns).length === 0\n    ? \"auto\"\n    : \"javascript\";\n}\n\nasync function runWorktreeInit(opts: WorktreeInitOptions): Promise<void> {\n  const cwd = process.cwd();\n  const worktreeName = resolveSuggestedWorktreeName(\n    cwd,\n    opts.name ?? detectGitBranchName(cwd) ?? undefined,\n  );\n  const seedMode = opts.seedMode ?? \"minimal\";\n  if (!isWorktreeSeedMode(seedMode)) {\n    throw new Error(`Unsupported seed mode \"${seedMode}\". Expected one of: minimal, full.`);\n  }\n  const instanceId = sanitizeWorktreeInstanceId(opts.instance ?? worktreeName);\n  const paths = resolveWorktreeLocalPaths({\n    cwd,\n    homeDir: resolveWorktreeHome(opts.home),\n    instanceId,\n  });\n  const branding = {\n    name: opts.name ?? worktreeName,\n    color: opts.color ?? generateWorktreeColor(),\n  };\n  const sourceConfigPath = resolveSourceConfigPath(opts);\n  const sourceConfig = existsSync(sourceConfigPath) ? readConfig(sourceConfigPath) : null;\n\n  if ((existsSync(paths.configPath) || existsSync(paths.instanceRoot)) && !opts.force) {\n    throw new Error(\n      `Worktree config already exists at ${paths.configPath} or instance data exists at ${paths.instanceRoot}. Re-run with --force to replace it.`,\n    );","sourceCodeStart":1609,"sourceCodeEnd":1645,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/worktree.ts#L1609-L1645","documentation":"Thrown at the top of runWorktreeInit when opts.seedMode fails the isWorktreeSeedMode() type guard. Only two seed modes are supported: \"minimal\" (schema + minimal reference data) and \"full\" (complete database clone). The guard rejects any other string before any filesystem or DB work begins, so it is a pure input-validation failure.","triggerScenarios":"Passing `--seed-mode` with a typo or unsupported value (e.g. \"minimum\", \"all\", \"complete\", \"partial\"); a wrapper script or programmatic caller passing an arbitrary seedMode string; CLI flag value sourced from an env var with an unexpected value.","commonSituations":"Misremembered flag value; copied an outdated command from docs; tab-completion or shell history inserted a wrong word.","solutions":["Use exactly one of the supported values: `--seed-mode minimal` or `--seed-mode full`.","Omit the flag entirely — the default is `minimal` (opts.seedMode ?? \"minimal\").","If calling runWorktreeInit programmatically, type the option as `type SeedMode = \"minimal\" | \"full\"` and validate before the call."],"exampleFix":"// before\npaperclipai worktree:init --seed-mode minimum\n// after\npaperclipai worktree:init --seed-mode minimal","handlingStrategy":"type-guard","validationCode":"const SEED_MODES = [\"minimal\", \"full\"] as const;\ntype SeedMode = (typeof SEED_MODES)[number];\nfunction isSeedMode(v: unknown): v is SeedMode {\n  return typeof v === \"string\" && (SEED_MODES as readonly string[]).includes(v);\n}\nif (opts.seedMode != null && !isSeedMode(opts.seedMode)) {\n  throw new Error(`Bad seed mode; expected ${SEED_MODES.join(\", \")}`);\n}","typeGuard":"function isWorktreeSeedMode(v: string): v is \"minimal\" | \"full\" {\n  return v === \"minimal\" || v === \"full\";\n}","tryCatchPattern":null,"preventionTips":["Type the option as the literal union \"minimal\" | \"full\" at the API boundary.","Validate CLI input against the allowed set before forwarding to runWorktreeInit.","Omit --seed-mode to accept the safe 'minimal' default."],"tags":["worktree","validation","cli","seeding"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}