{"record":{"id":"195ad441265979c9","repo":"deepseek-ai/deepseek-harness","slug":"goal-change-goal-must-be-a-record","errorCode":null,"errorMessage":"goal change goal must be a record","messagePattern":"goal change goal must be a record","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/goal/goal/src/fold.ts","lineNumber":89,"sourceCode":"\n/** Decode one canonical blocker explanation. */\nfunction decodeBlockReason(value: unknown): GoalBlockReason {\n  if (!isRecord(value) || Object.keys(value).sort().join(',') !== 'code,message') {\n    throw new Error('goal change goal.blockedReason must have exactly code and message fields')\n  }\n  if (typeof value['code'] !== 'string' || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(value['code'])) {\n    throw new Error('goal change goal.blockedReason.code must be lower-kebab-case')\n  }\n  if (typeof value['message'] !== 'string' || value['message'].trim().length === 0\n    || value['message'] !== value['message'].trim()) {\n    throw new Error('goal change goal.blockedReason.message must be non-empty and normalized')\n  }\n  return { code: value['code'], message: value['message'] }\n}\n\n/** Decode and validate one snapshot. */\nfunction decodeSnapshot(value: unknown): GoalSnapshot {\n  if (!isRecord(value)) throw new Error('goal change goal must be a record')\n  if (typeof value['id'] !== 'string' || value['id'].length === 0) {\n    throw new Error('goal change goal.id must be a non-empty string')\n  }\n  if (typeof value['objective'] !== 'string' || value['objective'].trim().length === 0\n    || value['objective'] !== value['objective'].trim()) {\n    throw new Error('goal change goal.objective must be non-empty and normalized')\n  }\n  if (typeof value['phase'] !== 'string' || !PHASES.has(value['phase'] as GoalPhase)) {\n    throw new Error('goal change goal.phase is invalid')\n  }\n  const phase = value['phase'] as GoalPhase\n  const expectedKeys = phase === 'blocked'\n    ? 'blockedReason,id,maxGoalRounds,objective,phase,revision'\n    : 'id,maxGoalRounds,objective,phase,revision'\n  if (Object.keys(value).sort().join(',') !== expectedKeys) {\n    throw new Error(`goal change goal for phase ${phase} must have exactly ${expectedKeys} fields`)\n  }\n  return {","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/goal/goal/src/fold.ts#L71-L107","documentation":"Error \"goal change goal must be a record\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/goal/goal/src/fold.ts:89 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"}