{"record":{"id":"6d6a6a7d4ebc12fc","repo":"ruvnet/ruflo","slug":"darwin-failed-closed-error-as-error-message","errorCode":null,"errorMessage":"Darwin failed closed: ${(error as Error).message}","messagePattern":"Darwin failed closed: (.+?)","errorType":"exception","errorClass":"DarwinUnavailableError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/services/flywheel-proposer.ts","lineNumber":247,"sourceCode":"      0,\n    );\n    if (evaluationCost > input.safetyEnvelope.maxEvaluationCostMicros) {\n      throw new DarwinUnavailableError('Darwin archive exceeded evaluation-cost budget');\n    }\n    return finalizeArchive({\n      requested: input.mode,\n      effective: 'darwin',\n      promotionAllowed: true,\n      baselineRef,\n      safetyEnvelope: input.safetyEnvelope,\n      seed: input.seed,\n      candidates: result.candidates,\n      completed: true,\n    });\n  } catch (error) {\n    if (input.mode === 'darwin') {\n      if (error instanceof DarwinUnavailableError) throw error;\n      throw new DarwinUnavailableError(`Darwin failed closed: ${(error as Error).message}`);\n    }\n    return runLocal(`darwin-error:${(error as Error).message}`);\n  }\n}\n","sourceCodeStart":229,"sourceCodeEnd":252,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/services/flywheel-proposer.ts#L229-L252","documentation":"An unexpected (non-DarwinUnavailableError) exception escaped while invoking Darwin in darwin mode. The catch re-raises it as a DarwinUnavailableError wrapping the original message so callers see a single, typed 'Darwin failed closed' error rather than an arbitrary crash leaking from the invoker.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/services/flywheel-proposer.ts:247 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped error message for the root cause and fix it","Re-run with the Darwin step disabled if it is optional"],"exampleFix":"Read the wrapped error message for the underlying Darwin failure, fix that root cause, and retry; Darwin fails closed so no partial result is used.","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}