{"record":{"id":"63d58198560d114c","repo":"JuliusBrussee/caveman","slug":"cave-build-lock-missing","errorCode":"cave_build_lock_missing","errorMessage":"cave_build_lock_missing: approve required evals, then run npm run build","messagePattern":"cave_build_lock_missing: approve required evals, then run npm run build","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/agent/src/cli.ts","lineNumber":939,"sourceCode":"\nfunction configuredModelCandidates(baseline: string): string[] {\n  const models = new Set<string>([baseline]);\n  if (process.env.ANTHROPIC_API_KEY) models.add(\"anthropic/claude-haiku-4-5\");\n  if (process.env.OPENAI_API_KEY) models.add(\"openai/gpt-5.4-mini\");\n  if (process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY) models.add(\"google/gemini-2.5-flash\");\n  return [...models].sort();\n}\n\nasync function check(args: string[]): Promise<void> {\n  const root = process.cwd();\n  const configPath = args[0] ?? \"caveman.config.ts\";\n  const loaded = await loadBuildInputs(root, configPath);\n  let lock: CaveBuildLock;\n  try {\n    lock = await readLock(root);\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code === \"ENOENT\") {\n      throw new Error(\"cave_build_lock_missing: approve required evals, then run npm run build\");\n    }\n    throw error;\n  }\n  const transformRegistrySha256 = await transformRegistrySHA256();\n  const checked = checkLock(lock, {\n    sourceSha256: loaded.sourceSha256,\n    agentDefinitionSha256: agentDefinitionSHA256(loaded.agent),\n    contextIRSha256: contextIRSHA256(await lowerBuildContext(\n      root,\n      loaded.agent,\n    ).then((value) => value.ir)),\n    evalSuiteSha256: sha256(stableStringify(loaded.evals.filter((item) => item.approved && item.required))),\n    runtimeVersion: FRAMEWORK_VERSION,\n    adapterVersion: PI_ADAPTER_VERSION,\n    upstreamVersion: PI_UPSTREAM_VERSION,\n    transformRegistrySha256,\n    catalogSha256: CATALOG_SHA256,\n  });","sourceCodeStart":921,"sourceCodeEnd":957,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/agent/src/cli.ts#L921-L957","documentation":"The verify/lock-check command loads build inputs and then attempts readLock(root). If the lock file does not exist (ENOENT), the error is replaced with this actionable message: evaluation approval must happen first and then a build run creates the lock. Without a lock there is nothing to verify.","triggerScenarios":"Running the lock-verification command (cli.ts:939) in a project root where no cave build lock file exists yet — i.e. `npm run build` was never run after approving required evals.","commonSituations":"Fresh clone of a repo where the lock file is gitignored; new contributor who skipped the build step; switching branches to one without a lock; cleaning the working tree and deleting the lock.","solutions":["Approve the required evals, then run `npm run build` to generate the lock.","Re-run the verify command after the build succeeds.","If the lock should exist, check .gitignore — commit the lock file if your team intends it to be shared.","Confirm you are in the correct project root (readLock reads process cwd/root)."],"exampleFix":"// before\ncaveman verify   # cave_build_lock_missing\n// after\nnpm run build\ncaveman verify","handlingStrategy":"validation","validationCode":"import { existsSync } from \"node:fs\";\nif (!existsSync(\"cave-build-lock.json\")) {\n  console.error(\"No build lock; run: npm run build\");\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await verify();\n} catch (err) {\n  if (String(err?.message).startsWith(\"cave_build_lock_missing\")) {\n    await run([\"npm\", \"run\", \"build\"]); // create the lock, then re-verify\n    await verify();\n  } else throw err;\n}","preventionTips":["Run npm run build as part of initial repo setup after cloning.","Decide whether the lock is committed; if gitignored, document the build-first step in the README.","Add the build step to CI before any verify/register command.","Never manually delete lock files without rebuilding."],"tags":["cli","lock","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}