{"record":{"id":"3fe3e61011254f85","repo":"paperclipai/paperclip","slug":"workspace-reseed-returned-without-a-verified-termi","errorCode":null,"errorMessage":"Workspace reseed returned without a verified terminal manifest.","messagePattern":"Workspace reseed returned without a verified terminal manifest\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/src/routes/execution-workspaces.ts","lineNumber":786,"sourceCode":"              }\n              await reportProgress({\n                metadata: { seedFailurePhase },\n                system: seedFailurePhase ? `Workspace seed failed during ${seedFailurePhase}.\\n` : null,\n              });\n              throw new Error(\n                repairCommandTimedOut\n                  ? `Workspace database repair command timed out during ${repairPhase}.`\n                  : `Workspace database repair command failed during ${repairPhase}.`,\n              );\n            }\n            if (!reseedObserved) {\n              await reportRepairPhase(\"target_backup\", \"succeeded\");\n              await reportRepairPhase(\"full_reseed\", \"started\");\n            }\n\n            const manifest = JSON.parse(readFileSync(manifestPath, \"utf8\")) as Record<string, unknown>;\n            if (!isVerifiedWorktreeSeedManifest(manifest)) {\n              throw new Error(\"Workspace reseed returned without a verified terminal manifest.\");\n            }\n            const expectedInstanceId = resolveManagedWorkspaceInstanceId(workspaceCwd);\n            if (manifest.targetInstanceId !== expectedInstanceId) {\n              throw repairPreconditionError(\n                422,\n                \"seed_manifest_instance_mismatch\",\n                \"Verified seed manifest belongs to a different workspace instance.\",\n              );\n            }\n            resolveCanonicalWorktreeSeedSource({\n              registeredBaseWorkspaceCwd: baseWorkspaceCwd,\n              explicitSourceConfigPath: resolveFallbackSeedSourceConfigPath(baseWorkspaceCwd),\n              targetConfigPath: path.join(workspaceCwd, \".paperclip\", \"config.json\"),\n              expectedTargetInstanceId: repairSeedSource.targetInstanceId,\n              manifestSource: manifest.source as { configPath?: unknown; instanceId?: unknown } | undefined,\n              manifestTargetInstanceId: manifest.targetInstanceId,\n            });\n            await reportRepairPhase(\"full_reseed\", \"succeeded\");","sourceCodeStart":768,"sourceCodeEnd":804,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/routes/execution-workspaces.ts#L768-L804","documentation":"Thrown after the reseed CLI exits 0 but the seed manifest on disk is not a verified terminal manifest (isVerifiedWorktreeSeedManifest returns false at server/src/routes/execution-workspaces.ts:785). A successful repair must end with a manifest in the verified terminal state; exit code 0 without it means the CLI never completed verification — typically a stale manifest from a previous attempt, an older CLI that does not write the verified state, or the manifest being rewritten concurrently. The worktree is preserved and the operation is marked failed.","triggerScenarios":"POST repair where the child exits 0 but seed-manifest.json is stale (attemptId unchanged from repairPreviousAttemptId, state not verified), was deleted between exit and read, or was written by an older/newer CLI with a different manifest shape that fails the verified-manifest type check.","commonSituations":"Version skew between the server and the base workspace CLI (cli/dist or tsx entry from an older checkout that exits 0 without writing the verified terminal manifest); a no-op reseed that saw nothing to do and skipped verification; leftover manifest from an earlier failed repair that the child never replaced; antivirus/editor temporarily locking the file on read.","solutions":["Confirm the base workspace CLI version matches the server's expectation — update the base checkout (git pull + pnpm install + build) so the CLI writes the verified terminal manifest.","Inspect <worktree>/.paperclip/seed-manifest.json: check state and attemptId — if it is the pre-repair attempt, the child did no work; investigate its stdout in the operation record.","Delete the stale seed-manifest.json (the worktree files and backup are preserved) and re-run repair so a fresh attempt writes a new manifest.","If it recurs, capture the exact manifest JSON and check isVerifiedWorktreeSeedSource's required fields against it."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import { readFileSync, unlinkSync } from \"node:fs\";\nconst manifestPath = path.join(ws.cwd, \".paperclip\", \"seed-manifest.json\");\nconst m = JSON.parse(readFileSync(manifestPath, \"utf8\"));\nif (m?.state !== \"verified\") { unlinkSync(manifestPath); } // force a fresh attempt manifest before repair","typeGuard":"function isVerifiedManifest(m: unknown): boolean {\n  const x = m as { state?: unknown; attemptId?: unknown; targetInstanceId?: unknown };\n  return x?.state === \"verified\" && typeof x?.attemptId === \"string\" && typeof x?.targetInstanceId === \"string\";\n}","tryCatchPattern":"try { await repair(id); } catch (err) { if (/verified terminal manifest/.test(String(err?.body?.error ?? \"\"))) { await removeFile(path.join(cwd, \".paperclip\", \"seed-manifest.json\")); await repair(id); } else throw err; }","preventionTips":["Keep the base workspace CLI and the server on matching versions so manifest states stay compatible.","After any repair failure, clear a stale seed-manifest.json before re-running.","Treat exit-0-without-verified-manifest as a red flag for version skew — check CLI version first."],"tags":["workspace","repair","manifest","verification","version-skew","paperclip"],"backgroundTag":"schema-validation-failed","analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-21T17:58:32.592Z","contentChangedAt":"2026-08-21T17:58:32.592Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}