{"record":{"id":"beaa6b8bccb0ed36","repo":"deepseek-ai/deepseek-harness","slug":"goal-invalid-objective","errorCode":"GOAL_INVALID_OBJECTIVE","errorMessage":"goal objective must be a non-empty string","messagePattern":"goal objective must be a non-empty string","errorType":"exception","errorClass":"GoalError","httpStatus":null,"severity":"error","filePath":"packages/goal/goal/src/index.ts","lineNumber":152,"sourceCode":"\n/** Validated create input with every deployment default materialized. */\ninterface ResolvedCreateGoal {\n  readonly objective: string\n  readonly maxGoalRounds: number\n}\n\n/** Validate a caller-visible positive safe-integer round cap. */\nfunction resolveMaxGoalRounds(value: number): number {\n  if (!Number.isSafeInteger(value) || value < 1) {\n    throw new GoalError('maxGoalRounds must be a positive safe integer', 'GOAL_INVALID_MAX_ROUNDS')\n  }\n  return value\n}\n\n/** Validate and normalize an objective at the domain boundary. */\nfunction resolveObjective(value: string): string {\n  if (typeof value !== 'string' || value.trim().length === 0) {\n    throw new GoalError('goal objective must be a non-empty string', 'GOAL_INVALID_OBJECTIVE')\n  }\n  return value.trim()\n}\n\n/** Materialize deployment defaults and validate one create request. */\nfunction resolveCreateGoal(request: CreateGoalRequest, defaultMaxGoalRounds: number): ResolvedCreateGoal {\n  return {\n    objective: resolveObjective(request.objective),\n    maxGoalRounds: resolveMaxGoalRounds(request.maxGoalRounds ?? defaultMaxGoalRounds),\n  }\n}\n\n/** Validate and detach one policy-owned blocker explanation. */\nfunction resolveBlockReason(reason: unknown): GoalBlockReason {\n  const record = typeof reason === 'object' && reason !== null && !Array.isArray(reason)\n    ? reason as Record<string, unknown>\n    : undefined\n  const code = record?.['code']","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/goal/goal/src/index.ts#L134-L170","documentation":"Domain-boundary validation in the goal service: the objective is missing, not a string, or empty/whitespace after normalization. resolveObjective raises this before the create commit, so no goal is ever materialized without a real objective.","triggerScenarios":"Thrown at packages/goal/goal/src/index.ts:152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-empty objective string","Trim the input before sending"],"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"}