{"record":{"id":"2ff6a8989c6ad67f","repo":"stablyai/orca","slug":"skip-build-requested-but-mainpath-does-not-e-2ff6a8","errorCode":null,"errorMessage":"--skip-build requested, but ${mainPath} does not exist","messagePattern":"--skip-build requested, but (.+?) does not exist","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-idle-cpu-benchmark.mjs","lineNumber":159,"sourceCode":"  }\n  return options\n}\nfunction printUsage() {\n  console.log(\n    `Usage: node config/scripts/run-idle-cpu-benchmark.mjs [options]\\n\\nOptions:\\n  --warmup-ms <n>    Time to wait after app readiness before sampling (default ${DEFAULT_WARMUP_MS})\\n  --sample-ms <n>    Sampling window duration (default ${DEFAULT_SAMPLE_MS})\\n  --interval-ms <n>  Sampling cadence (default ${DEFAULT_INTERVAL_MS})\\n  --worktrees <n>    Seed repo worktree count, including primary (default ${DEFAULT_WORKTREE_COUNT})\\n  --lineage-depth <n>  Nest all worktrees under one expanded lineage, up to this depth\\n  --agents-per-worktree <n>  Seed this many visible inline agent rows per worktree\\n  --zustand-publications <n>  Publish exactly this many store updates during sampling\\n  --zustand-publication-interval-ms <n>  Publication cadence (default ${DEFAULT_ZUSTAND_PUBLICATION_INTERVAL_MS})\\n  --headful          Show the Electron window while measuring\\n  --skip-build       Reuse out/main/index.js instead of building first\\n  --output <path>    Write JSON report to this path\\n  --disable-renderer-animations  Inject measurement-only CSS that disables animations/transitions\\n  --synthetic-visible-spinners <n>  Measurement-only: add visible working spinners\\n  --synthetic-spinner-animation <smooth|steps>  Spinner animation style (default smooth)\\n  --synthetic-spinner-steps <n>  Step count for --synthetic-spinner-animation steps (default 12)\\n`\n  )\n}\nfunction run(command, args, options = {}) {\n  execFileSync(command, args, { stdio: options.stdio ?? 'pipe', encoding: 'utf8', ...options })\n}\n\nfunction buildAppIfNeeded(root, skipBuild) {\n  const mainPath = path.join(root, 'out', 'main', 'index.js')\n  if (skipBuild && existsSync(mainPath)) {\n    return mainPath\n  }\n  if (skipBuild) {\n    throw new Error(`--skip-build requested, but ${mainPath} does not exist`)\n  }\n  console.log('[idle-cpu] building Electron app with electron-vite --mode e2e')\n  run('npx', ['electron-vite', 'build', '--mode', 'e2e'], {\n    cwd: root,\n    stdio: 'inherit',\n    env: { ...process.env, VITE_EXPOSE_STORE: 'true' }\n  })\n  return mainPath\n}\n\nfunction makeCompletedOnboardingProfile() {\n  return {\n    settings: {\n      telemetry: {\n        optedIn: true,\n        installId: '00000000-0000-4000-8000-000000000000',\n        existedBeforeTelemetryRelease: false\n      }","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-idle-cpu-benchmark.mjs#L141-L177","documentation":"Thrown by buildAppIfNeeded in run-idle-cpu-benchmark.mjs when --skip-build is set but out/main/index.js does not exist. The benchmark's skip path reuses a prebuilt Electron main bundle; if it is absent, there is nothing to measure against.","triggerScenarios":"Running the benchmark with --skip-build in a tree where electron-vite build --mode e2e has never produced out/main/index.js, or after out/ was removed.","commonSituations":"Local run after git clean, CI skipping build without caching the artifact, switching branches that don't share the build output.","solutions":["Drop --skip-build for the first run to build out/main/index.js.","Run npx electron-vite build --mode e2e (with VITE_EXPOSE_STORE=true) then reuse --skip-build.","Restore out/main/index.js from your build cache."],"exampleFix":"# before\nnode config/scripts/run-idle-cpu-benchmark.mjs --skip-build\n# after\nVITE_EXPOSE_STORE=true npx electron-vite build --mode e2e\nnode config/scripts/run-idle-cpu-benchmark.mjs --skip-build","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs'\nimport path from 'node:path'\nconst mainPath = path.join(root, 'out', 'main', 'index.js')\nif (skipBuild && !existsSync(mainPath)) {\n  throw new Error(`Build first (electron-vite build --mode e2e); missing ${mainPath}`)\n}","typeGuard":"function hasPrebuiltMain(root) { return existsSync(path.join(root, 'out', 'main', 'index.js')) }","tryCatchPattern":"try {\n  mainPath = buildAppIfNeeded(root, options.skipBuild)\n} catch (err) {\n  if (/--skip-build requested/.test(err.message)) {\n    // drop --skip-build and let it build, or restore the artifact\n  }\n  throw err\n}","preventionTips":["Preflight out/main/index.js before --skip-build.","Cache out/ in CI when reusing builds.","Build with VITE_EXPOSE_STORE=true so the store probe fixtures are included."],"tags":["build","electron","benchmark","cli-flags"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}