{"record":{"id":"f011fb5e11d9f0f5","repo":"deepseek-ai/deepseek-harness","slug":"goal-operation-cannot-change-objective-or-maxgo","errorCode":null,"errorMessage":"goal ${operation} cannot change objective or maxGoalRounds","messagePattern":"goal (.+?) cannot change objective or maxGoalRounds","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/goal/goal/src/fold.ts","lineNumber":188,"sourceCode":"    updatedAt,\n  } satisfies GoalSnapshotChangeMeta\n}\n\n/** Narrow model attribution to a valid goal source. */\nfunction goalSource(source: MessageSource): GoalMessageSource | undefined {\n  if (source.kind !== 'goal') return undefined\n  if (typeof source.goalId !== 'string' || source.goalId.length === 0\n    || !Number.isSafeInteger(source.revision) || source.revision < 1\n    || !Number.isSafeInteger(source.round) || source.round < 1) {\n    throw new Error('goal message source is invalid')\n  }\n  return source\n}\n\n/** Require two snapshots to retain fields that only `edit` may replace. */\nfunction requireSameDefinition(current: GoalSnapshot, next: GoalSnapshot, operation: GoalOperation): void {\n  if (next.objective !== current.objective || next.maxGoalRounds !== current.maxGoalRounds) {\n    throw new Error(`goal ${operation} cannot change objective or maxGoalRounds`)\n  }\n}\n\n/** Require one exact next revision of the current goal. */\nfunction requireNextRevision(current: GoalSnapshot, next: GoalRef, operation: GoalOperation): void {\n  if (next.id !== current.id || next.revision !== current.revision + 1) {\n    throw new Error(`goal ${operation} must advance the current goal by one revision`)\n  }\n}\n\n/** Validate one non-create snapshot operation against the preceding projection. */\nfunction validateSnapshotTransition(\n  state: GoalFoldState,\n  change: GoalSnapshotChangeMeta,\n  current: GoalSnapshot,\n): void {\n  const next = change.goal\n  requireNextRevision(current, next, change.operation)","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/goal/goal/src/fold.ts#L170-L206","documentation":"Error \"goal ${operation} cannot change objective or maxGoalRounds\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/goal/goal/src/fold.ts:188 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"}