{"record":{"id":"e59cf4b9812b70c6","repo":"deepseek-ai/deepseek-harness","slug":"goal-pause-has-an-invalid-phase-transition","errorCode":null,"errorMessage":"goal pause has an invalid phase transition","messagePattern":"goal pause has an invalid phase transition","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/goal/goal/src/fold.ts","lineNumber":223,"sourceCode":"  const next = change.goal\n  requireNextRevision(current, next, change.operation)\n  /* v8 ignore next -- a current goal established by this fold always has an updatedAt */\n  if (state.updatedAt === undefined) throw new Error('current goal fold lacks updatedAt')\n  if (change.createdAt !== state.createdAt\n    || change.updatedAt < state.updatedAt\n    || change.roundsStarted !== state.roundsStarted) {\n    throw new Error(`goal ${change.operation} does not preserve the current counters and timestamps`)\n  }\n  switch (change.operation) {\n    case 'edit':\n      if (next.phase !== current.phase\n        || JSON.stringify(next.blockedReason) !== JSON.stringify(current.blockedReason)) {\n        throw new Error('goal edit cannot change phase or blocked reason')\n      }\n      break\n    case 'pause':\n      requireSameDefinition(current, next, change.operation)\n      if (current.phase !== 'active' || next.phase !== 'paused') throw new Error('goal pause has an invalid phase transition')\n      break\n    case 'resume': {\n      requireSameDefinition(current, next, change.operation)\n      const resumable: ReadonlySet<GoalPhase> = new Set([\n        'active',\n        'paused',\n        'blocked',\n      ])\n      if (!resumable.has(current.phase) || next.phase !== 'active' || state.roundsStarted >= next.maxGoalRounds) {\n        throw new Error('goal resume has an invalid phase transition or exhausted round budget')\n      }\n      break\n    }\n    case 'complete':\n      requireSameDefinition(current, next, change.operation)\n      if (current.phase === 'complete' || next.phase !== 'complete') throw new Error('goal complete has an invalid phase transition')\n      break\n    case 'block':","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/goal/goal/src/fold.ts#L205-L241","documentation":"Error \"goal pause has an invalid phase transition\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/goal/goal/src/fold.ts:223 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}