{"record":{"id":"8f0e8684bebcaff1","repo":"deepseek-ai/deepseek-harness","slug":"goal-complete-has-an-invalid-phase-transition","errorCode":null,"errorMessage":"goal complete has an invalid phase transition","messagePattern":"goal complete has an invalid phase transition","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/goal/goal/src/fold.ts","lineNumber":239,"sourceCode":"    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':\n      requireSameDefinition(current, next, change.operation)\n      if (current.phase !== 'active' || next.phase !== 'blocked') throw new Error('goal block has an invalid phase transition')\n      break\n    /* v8 ignore start -- the caller excludes create and GoalOperation is closed; these arms retain fail-loud exhaustiveness */\n    case 'create':\n      throw new Error('goal create cannot be validated as a current-goal transition')\n    default:\n      change.operation satisfies never\n      throw new Error('unknown goal snapshot operation')\n    /* v8 ignore stop */\n  }\n}\n\n/**\n * Return the revision identity carried by a snapshot or tombstone.\n * @param change - decoded goal mutation.","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/goal/goal/src/fold.ts#L221-L257","documentation":"Error \"goal complete has an invalid phase transition\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/goal/goal/src/fold.ts:239 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"}