{"record":{"id":"fd8d7cd5e97669a6","repo":"paperclipai/paperclip","slug":"invalid-worktree-seed-manifest-at-manifestpath-fd8d7c","errorCode":null,"errorMessage":"Invalid worktree seed manifest at ${manifestPath}.","messagePattern":"Invalid worktree seed manifest at (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":1943,"sourceCode":"  );\n  if (\n    !value\n    || typeof value !== \"object\"\n    || value.version !== 2\n    || !value.source\n    || typeof value.source.instanceId !== \"string\"\n    || typeof value.source.configPath !== \"string\"\n    || typeof value.targetInstanceId !== \"string\"\n    || value.targetInstanceId.length === 0\n    || !isWorktreeSeedMode(String(value.seedMode ?? \"\"))\n    || !WORKTREE_SEED_PHASES.includes(value.phase as WorktreeSeedPhase)\n    || ![\"pending\", \"running\", \"verified\", \"failed\"].includes(String(value.state ?? \"\"))\n    || typeof value.attemptId !== \"string\"\n    || value.attemptId.length === 0\n    || !diagnosticsValid\n    || !verifiedTerminalValid\n  ) {\n    throw new Error(`Invalid worktree seed manifest at ${manifestPath}.`);\n  }\n  return value as WorktreeSeedManifest;\n}\n\nexport function markWorktreeSeedPending(input: {\n  configPath: string;\n  sourceConfigPath: string;\n  targetInstanceId?: string;\n  seedMode?: WorktreeSeedMode;\n  now?: Date;\n  diagnosticMessage?: string;\n}): void {\n  const markers = resolveWorktreeSeedMarkerPaths(input.configPath);\n  const at = (input.now ?? new Date()).toISOString();\n  writeWorktreeSeedManifest(markers.manifest, {\n    version: 2,\n    source: {\n      instanceId: resolveSeedInstanceId(input.sourceConfigPath),","sourceCodeStart":1925,"sourceCodeEnd":1961,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/cli/src/commands/worktree.ts#L1925-L1961","documentation":"The second stage of readWorktreeSeedManifest(): the file parsed as JSON but failed shape validation — source.instanceId / source.configPath must be strings, targetInstanceId non-empty, seedMode and phase must be known values, state in pending/running/verified/failed, attemptId non-empty, every diagnostics entry must have a known phase, status in started/succeeded/failed, string timestamp, and the verified-terminal block must be valid. This guards the loader against a manifest from an incompatible schema.","triggerScenarios":"Reading a manifest written by an older or newer CLI version with a different schema, a hand-edited manifest with a typo, or a partially written file that still parses as JSON but misses required fields.","commonSituations":"Downgrading/upgrading the CLI across a manifest schema change; editing markers to reset a stuck seed; merging worktree dirs with tools that mangled field values.","solutions":["Remove the invalid manifest (and its lock marker if stale) and re-run the seed so a fresh valid manifest is written","Use the CLI version that matches the worktree/registration, or upgrade both together","Do not hand-edit seed manifest files; use the seed commands to change state"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"try {\n  manifest = readWorktreeSeedManifest(configPath);\n} catch {\n  // schema mismatch (e.g. CLI version change): discard and reseed\n  removeSeedMarkers(configPath);\n  return ensureWorktreeSeeded({ configPath, ...opts });\n}","typeGuard":null,"tryCatchPattern":"Distinguish parse failure (error 9) from shape failure (this one) only for logging; both remediate the same way — remove markers and reseed.","preventionTips":["Upgrade the CLI and worktree registrations together so manifest schemas stay in sync","Use seed commands to change state; never edit marker JSON"],"tags":["worktree","seed","manifest","schema-validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-21T17:58:32.592Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}