{"record":{"id":"85eb9eb581674f11","repo":"deepseek-ai/deepseek-harness","slug":"goal-change-goal-blockedreason-must-have-exactly-c","errorCode":null,"errorMessage":"goal change goal.blockedReason must have exactly code and message fields","messagePattern":"goal change goal\\.blockedReason must have exactly code and message fields","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/goal/goal/src/fold.ts","lineNumber":75,"sourceCode":"function positiveInteger(value: unknown, field: string): number {\n  if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < 1) {\n    throw new Error(`goal change ${field} must be a positive safe integer`)\n  }\n  return value\n}\n\n/** Require one non-negative safe integer. */\nfunction nonNegativeInteger(value: unknown, field: string): number {\n  if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < 0) {\n    throw new Error(`goal change ${field} must be a non-negative safe integer`)\n  }\n  return value\n}\n\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","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/goal/goal/src/fold.ts#L57-L93","documentation":"Canonical-form guard in decodeBlockReason: the logged blockedReason object does not have exactly the keys code and message. Extra or missing keys mean the goal change was not written by the canonical encoder, so replay refuses it.","triggerScenarios":"Thrown at packages/goal/goal/src/fold.ts:75 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the writer to emit blockedReason with exactly code and message","Report as a serialization bug if produced by the harness itself"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}