{"record":{"id":"08ffe9e7b8e7c929","repo":"paperclipai/paperclip","slug":"execution-workspace-branchinspection-workspacere","errorCode":null,"errorMessage":"Execution workspace ${branchInspection.workspaceRecord.id} expected git worktree branch \"${inspection.expectedBranchName}\" at \"${inspection.worktreePath}\", but ${inspection.reason ?? \"the checked-out branch could not be verified\"}. Record a sanctioned execution-workspace branch transition or restore the workspace branch before completing the run.","messagePattern":"Execution workspace (.+?) expected git worktree branch \"(.+?)\" at \"(.+?)\", but (.+?)\\. Record a sanctioned execution-workspace branch transition or restore the workspace branch before completing the run\\.","errorType":"exception","errorClass":"WorkspaceValidationFailure","httpStatus":null,"severity":"error","filePath":"server/src/services/heartbeat.ts","lineNumber":15759,"sourceCode":"    }\n    return null;\n  }\n\n  function latestDate(...values: unknown[]) {\n    let latest: Date | null = null;\n    for (const value of values) {\n      const parsed = dateValue(value);\n      if (!parsed) continue;\n      if (!latest || parsed.getTime() > latest.getTime()) latest = parsed;\n    }\n    return latest;\n  }\n\n  async function buildRunLivenessInput(\n    run: typeof heartbeatRuns.$inferSelect,\n    resultJson: Record<string, unknown> | null | undefined,\n  ): Promise<RunLivenessClassificationInput> {\n    const context = parseObject(run.contextSnapshot);\n    const contextIssueId = readNonEmptyString(context.issueId);\n    const continuationAttempt = asNumber(\n      context.continuationAttempt,\n      run.continuationAttempt ?? 0,\n    );\n\n    const issue = contextIssueId\n      ? await db\n          .select({\n            status: issues.status,\n            title: issues.title,\n            description: issues.description,\n          })\n          .from(issues)\n          .where(\n            and(\n              eq(issues.companyId, run.companyId),\n              eq(issues.id, contextIssueId),","sourceCodeStart":15741,"sourceCodeEnd":15777,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/heartbeat.ts#L15741-L15777","documentation":"Error \"Execution workspace ${branchInspection.workspaceRecord.id} expected git worktree branch \"${inspection.expectedBranchName}\" at \"${inspection.worktreePath}\", but ${inspection.reason ?? \"the checked-out branch could not be verified\"}. Record a sanctioned execution-workspace branch transition or restore the workspace branch before completing the run.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at server/src/services/heartbeat.ts:15922 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restore the expected branch in the execution workspace, or record a sanctioned execution-workspace branch transition, then complete the run."],"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-14T11:17:12.474Z"}