{"record":{"id":"2ee47fdece568872","repo":"can1357/oh-my-pi","slug":"terminal-bench-dataset-source-does-not-exist-so","errorCode":null,"errorMessage":"Terminal-Bench dataset source does not exist: ${source}","messagePattern":"Terminal-Bench dataset source does not exist: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/metaharness/src/tb/dataset.ts","lineNumber":58,"sourceCode":"}\n\nfunction gitError(action: string, source: string, stderr: Uint8Array): Error {\n\tconst detail = new TextDecoder().decode(stderr).trim();\n\treturn new Error(`${action} ${source} failed${detail ? `: ${detail}` : \"\"}`);\n}\n\nexport async function resolveDataset(source: string, cacheDir: string): Promise<string> {\n\tconst sourceKind = await directoryStat(source);\n\tif (sourceKind === \"directory\") {\n\t\tconst absoluteSource = path.resolve(source);\n\t\tconst nestedTasks = path.join(absoluteSource, \"tasks\");\n\t\tconst tasksDir = (await directoryStat(nestedTasks)) === \"directory\" ? nestedTasks : absoluteSource;\n\t\treturn validateTasksDir(tasksDir);\n\t}\n\tif (sourceKind === \"other\") throw new Error(`Terminal-Bench dataset source is not a directory: ${source}`);\n\n\tconst isGitUrl = source.startsWith(\"http://\") || source.startsWith(\"https://\") || source.startsWith(\"git@\");\n\tif (!isGitUrl) throw new Error(`Terminal-Bench dataset source does not exist: ${source}`);\n\n\tconst absoluteCache = path.resolve(cacheDir);\n\tawait fs.mkdir(absoluteCache, { recursive: true });\n\tconst checkoutDir = path.join(absoluteCache, repositoryName(source));\n\tconst gitDir = path.join(checkoutDir, \".git\");\n\tif ((await directoryStat(gitDir)) === \"directory\") {\n\t\tconst result = await $`git pull --ff-only`.cwd(checkoutDir).quiet().nothrow();\n\t\tif (result.exitCode !== 0) throw gitError(\"Updating\", source, result.stderr);\n\t} else {\n\t\tconst result = await $`git clone --depth 1 ${source} ${checkoutDir}`.quiet().nothrow();\n\t\tif (result.exitCode !== 0) throw gitError(\"Cloning\", source, result.stderr);\n\t}\n\n\treturn validateTasksDir(path.join(checkoutDir, \"tasks\"));\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return {};","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/metaharness/src/tb/dataset.ts#L40-L76","documentation":"When the dataset source is neither a directory nor another existing filesystem entry, resolveDataset checks whether it looks like a git URL (http://, https://, git@). If it does not, there is nothing to resolve from, so it throws this error.","triggerScenarios":"Calling resolveDataset with a non-existent path that is not a git URL — e.g. a typo'd local path, ssh-style 'user@host:path' (not matched), or a git:// scheme URL.","commonSituations":"Typos in a local dataset path; using scp-style SSH remotes or git:// scheme which the URL check doesn't recognize; deleted cache with a relative path resolved from the wrong cwd.","solutions":["Use an existing local directory, or a git URL starting with http://, https://, or git@","Convert ssh remotes to https or git@ form, e.g. git@github.com:owner/repo.git","Fix path typos or run from the intended working directory"],"exampleFix":"// before\ntb run --dataset gitssh:owner/repo.git   # not recognized, doesn't exist\n// after\ntb run --dataset git@github.com:owner/repo.git","handlingStrategy":"validation","validationCode":"import { existsSync } from \"node:fs\";\nconst isGitUrl = /^(https?:\\/\\/|git@)/.test(source);\nif (!existsSync(source) && !isGitUrl) throw new Error(`Dataset source not found and not a git URL: ${source}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use http(s):// or git@ git URLs for remote datasets","Double-check local paths for typos before runs","Prefer absolute paths to avoid cwd-dependent resolution"],"tags":["filesystem","dataset","argument-parsing"],"backgroundTag":"dataset-source-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}