{"record":{"id":"21f11173bcc60a5b","repo":"ruvnet/ruflo","slug":"darwin-archive-exceeded-evaluation-cost-budget","errorCode":null,"errorMessage":"Darwin archive exceeded evaluation-cost budget","messagePattern":"Darwin archive exceeded evaluation-cost budget","errorType":"exception","errorClass":"DarwinUnavailableError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/services/flywheel-proposer.ts","lineNumber":232,"sourceCode":"        timeout = setTimeout(() => reject(new DarwinUnavailableError('Darwin exceeded wall-time budget')), maxWallTimeMs);\n        timeout.unref?.();\n      }),\n    ]).finally(() => {\n      if (timeout) clearTimeout(timeout);\n    });\n    if (!result.completed) {\n      if (input.mode === 'darwin') throw new DarwinUnavailableError(result.reason ?? 'Darwin archive incomplete');\n      return runLocal(`darwin-incomplete:${result.reason ?? 'unknown'}`);\n    }\n    if (result.candidates.length > (input.maxCandidates ?? 256)) {\n      throw new DarwinUnavailableError('Darwin archive exceeded candidate-count budget');\n    }\n    const evaluationCost = result.candidates.reduce(\n      (sum, candidate) => sum + candidate.resources.evaluationCostMicros,\n      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  }","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/services/flywheel-proposer.ts#L214-L250","documentation":"After the Darwin archive returned, the proposer recomputed the total evaluation cost from the archive's own accounting and found it exceeded safetyEnvelope.maxEvaluationCostMicros. The archive claims more spend than the envelope authorizes, so the run fails closed instead of accepting the over-budget result.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/services/flywheel-proposer.ts:232 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Prune candidates to lower total evaluation cost","Raise the evaluation-cost budget for this run"],"exampleFix":"Reduce the evaluation cost of archived candidates or raise the evaluation-cost budget in the flywheel proposer configuration.","handlingStrategy":"validation","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"}