{"record":{"id":"c3706310070b00a4","repo":"paperclipai/paperclip","slug":"invalid-worktree-seed-pending-marker-at-filepath","errorCode":null,"errorMessage":"Invalid worktree seed-pending marker at ${filePath}: ${error instanceof Error ? error.message : String(error)}","messagePattern":"Invalid worktree seed-pending marker at (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":1992,"sourceCode":"    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),\n    finishedAt: nextState === \"verified\" || nextState === \"failed\" ? at : null,\n    diagnostics: [...current.diagnostics, diagnostic].slice(-WORKTREE_SEED_DIAGNOSTIC_LIMIT),\n  };\n  writeWorktreeSeedManifest(markers.manifest, next);\n  return next;\n}\n\nfunction readLegacyWorktreeSeedPendingMarker(filePath: string): LegacyWorktreeSeedPendingMarker {\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(readFileSync(filePath, \"utf8\"));\n  } catch (error) {\n    throw new Error(\n      `Invalid worktree seed-pending marker at ${filePath}: ${error instanceof Error ? error.message : String(error)}`,\n    );\n  }\n\n  if (\n    !parsed\n    || typeof parsed !== \"object\"\n    || (parsed as { version?: unknown }).version !== 1\n    || (parsed as { state?: unknown }).state !== \"pending\"\n    || typeof (parsed as { sourceConfigPath?: unknown }).sourceConfigPath !== \"string\"\n    || !(parsed as { sourceConfigPath: string }).sourceConfigPath.trim()\n  ) {\n    throw new Error(`Invalid worktree seed-pending marker at ${filePath}.`);\n  }\n\n  return parsed as LegacyWorktreeSeedPendingMarker;\n}\n","sourceCodeStart":1974,"sourceCodeEnd":2010,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/worktree.ts#L1974-L2010","documentation":"Corruption guard when reading a worktree seed-pending marker: the marker file exists but failed to parse (invalid JSON or unexpected shape), so the seed state machine cannot resume and surfaces the underlying parse error.","triggerScenarios":"Thrown at cli/src/commands/worktree.ts:1439 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the JSON syntax in the seed-pending marker file at ${filePath}.","Delete the marker file at ${filePath} and re-run the seed so a valid marker is written."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}