{"record":{"id":"4884e4265b112e61","repo":"paperclipai/paperclip","slug":"worktree-seed-manifest-does-not-exist-at-markers","errorCode":null,"errorMessage":"Worktree seed manifest does not exist at ${markers.manifest}.","messagePattern":"Worktree seed manifest does not exist at (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":2000,"sourceCode":"  // New manifests are authoritative. Legacy files are removed so no caller can\n  // mistake a stale binary marker for current verified seed state.\n  rmSync(markers.complete, { force: true });\n  rmSync(markers.pending, { force: true });\n}\n\nfunction updateWorktreeSeedManifest(input: {\n  configPath: string;\n  phase: WorktreeSeedPhase;\n  status: \"started\" | \"succeeded\" | \"failed\";\n  state?: WorktreeSeedManifest[\"state\"];\n  message?: string;\n  snapshotAt?: string | null;\n  migrationRevision?: string | null;\n  now?: Date;\n}): WorktreeSeedManifest {\n  const markers = resolveWorktreeSeedMarkerPaths(input.configPath);\n  const current = readWorktreeSeedManifest(input.configPath);\n  if (!current) throw new Error(`Worktree seed manifest does not exist at ${markers.manifest}.`);\n  const at = (input.now ?? new Date()).toISOString();\n  const nextState = input.state ?? current.state;\n  const diagnostic = {\n    phase: input.phase,\n    status: input.status,\n    at,\n    ...(input.message\n      ? { message: input.message.slice(0, WORKTREE_SEED_DIAGNOSTIC_MESSAGE_LIMIT) }\n      : {}),\n  };\n  const next: WorktreeSeedManifest = {\n    ...current,\n    phase: input.phase,\n    state: nextState,\n    snapshotAt: input.snapshotAt === undefined ? current.snapshotAt : input.snapshotAt,\n    migrationRevision:\n      input.migrationRevision === undefined ? current.migrationRevision : input.migrationRevision,\n    startedAt: current.startedAt ?? (input.status === \"started\" ? at : null),","sourceCodeStart":1982,"sourceCodeEnd":2018,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/cli/src/commands/worktree.ts#L1982-L2018","documentation":"updateWorktreeSeedManifest() records each phase transition (started/succeeded/failed) into the existing manifest; it refuses to invent one. readWorktreeSeedManifest returned null, meaning no manifest file exists at the resolved marker path — either it was never created (markWorktreeSeedPending must run first) or it disappeared mid-seed (concurrent cleanup), or the wrong configPath resolved to different marker paths.","triggerScenarios":"Calling updateWorktreeSeedManifest before markWorktreeSeedPending ever created the manifest; another process deleting the marker files while a seed runs; passing a configPath whose resolved marker directory differs from the one the manifest was written under.","commonSituations":"A cleanup command racing an in-flight seed on the same worktree; invoking seed helpers out of order in custom automation; moving/renaming the worktree config so marker paths change.","solutions":["Run the full ensureWorktreeSeeded flow (it creates the pending manifest before updating) instead of calling update directly","Make sure no cleanup/deletion runs against the worktree markers while a seed is in progress","Verify the configPath passed to the seed matches the worktree's actual config location"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\nimport { resolveWorktreeSeedMarkerPaths, markWorktreeSeedPending } from './worktree-lib';\n\nif (!existsSync(resolveWorktreeSeedMarkerPaths(configPath).manifest)) {\n  markWorktreeSeedPending({ configPath, sourceConfigPath, targetInstanceId, seedMode: 'minimal' });\n}\nupdateWorktreeSeedManifest({ configPath, phase, status });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always create the pending manifest before recording phase transitions","Keep cleanup processes away from marker files while a seed runs"],"tags":["worktree","seed","manifest","state-file"],"backgroundTag":"missing-state-file","analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-21T17:58:32.592Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}