{"record":{"id":"ba2756aec317e8be","repo":"deepseek-ai/deepseek-harness","slug":"ralph-workflow-returned-an-invalid-first-round-fai","errorCode":null,"errorMessage":"Ralph workflow returned an invalid first-round failure","messagePattern":"Ralph workflow returned an invalid first-round failure","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflow/tool-ralph/src/index.ts","lineNumber":317,"sourceCode":"      if (Object.keys(value).sort().join(',') !== 'report,roundsStarted,status') {\n        throw new Error('Ralph workflow returned a malformed terminal result')\n      }\n      return { status: 'blocked', roundsStarted, report: readReport(value['report'], 'blocked', maxHandoffChars) }\n    case 'budget-limited':\n      if (Object.keys(value).sort().join(',') !== 'report,roundsStarted,status') {\n        throw new Error('Ralph workflow returned a malformed terminal result')\n      }\n      if (roundsStarted !== maxRounds) {\n        throw new Error('Ralph workflow returned budget-limited before the round limit')\n      }\n      return { status: 'budget-limited', roundsStarted, report: readReport(value['report'], 'continue', maxHandoffChars) }\n    case 'round-failed': {\n      if (Object.keys(value).sort().join(',') !== 'lastReport,roundsStarted,status') {\n        throw new Error('Ralph workflow returned a malformed terminal result')\n      }\n      if (roundsStarted === 1) {\n        if (value['lastReport'] !== null) {\n          throw new Error('Ralph workflow returned an invalid first-round failure')\n        }\n        return { status: 'round-failed', roundsStarted }\n      }\n      if (value['lastReport'] === null) {\n        throw new Error('Ralph workflow returned a round failure without its last handoff')\n      }\n      return {\n        status: 'round-failed',\n        roundsStarted,\n        lastReport: readReport(value['lastReport'], 'continue', maxHandoffChars),\n      }\n    }\n    default:\n      throw new Error('Ralph workflow returned an unknown terminal status')\n  }\n}\n\n/** A non-clean workflow finish is an error, never a partial Ralph success. */","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workflow/tool-ralph/src/index.ts#L299-L335","documentation":"Cross-boundary validation in the Ralph tool: the worker returned a terminal result whose first round failed, but the payload's shape did not match the expected first-round-failure structure (missing/extra keys).","triggerScenarios":"Thrown at packages/workflow/tool-ralph/src/index.ts:317 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make the first round return a valid report or a well-formed failure; check the child provider and report schema."],"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"}