{"record":{"id":"3edff590dc663669","repo":"deepseek-ai/deepseek-harness","slug":"goal-change-operation-is-invalid","errorCode":null,"errorMessage":"goal change operation is invalid","messagePattern":"goal change operation is invalid","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/goal/goal/src/fold.ts","lineNumber":154,"sourceCode":"  if (value['version'] !== GOAL_CHANGE_VERSION) {\n    throw new Error(`unsupported goal change version ${String(value['version'])}`)\n  }\n  if (value['operation'] === 'clear') {\n    const allowed = ['cleared', 'clearedAt', 'kind', 'operation', 'version']\n    if (Object.keys(value).sort().join(',') !== allowed.sort().join(',')) {\n      throw new Error(`goal clear change must have exactly ${allowed.sort().join(',')} fields`)\n    }\n    return {\n      kind: 'goal/change',\n      version: GOAL_CHANGE_VERSION,\n      operation: 'clear',\n      cleared: decodeRef(value['cleared']),\n      clearedAt: nonNegativeInteger(value['clearedAt'], 'clearedAt'),\n    } satisfies GoalClearChangeMeta\n  }\n  if (typeof value['operation'] !== 'string'\n    || !SNAPSHOT_OPERATIONS.has(value['operation'] as Exclude<GoalOperation, 'clear'>)) {\n    throw new Error('goal change operation is invalid')\n  }\n  const allowed = ['createdAt', 'goal', 'kind', 'operation', 'roundsStarted', 'updatedAt', 'version']\n  if (Object.keys(value).sort().join(',') !== allowed.sort().join(',')) {\n    throw new Error(`goal snapshot change must have exactly ${allowed.sort().join(',')} fields`)\n  }\n  const createdAt = nonNegativeInteger(value['createdAt'], 'createdAt')\n  const updatedAt = nonNegativeInteger(value['updatedAt'], 'updatedAt')\n  if (updatedAt < createdAt) throw new Error('goal change updatedAt cannot precede createdAt')\n  return {\n    kind: 'goal/change',\n    version: GOAL_CHANGE_VERSION,\n    operation: value['operation'] as Exclude<GoalOperation, 'clear'>,\n    goal: decodeSnapshot(value['goal']),\n    roundsStarted: nonNegativeInteger(value['roundsStarted'], 'roundsStarted'),\n    createdAt,\n    updatedAt,\n  } satisfies GoalSnapshotChangeMeta\n}","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/goal/goal/src/fold.ts#L136-L172","documentation":"Error \"goal change operation is invalid\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/goal/goal/src/fold.ts:154 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"}