{"record":{"id":"e21897db523bb2d9","repo":"ruvnet/ruflo","slug":"darwin-archive-exceeded-candidate-count-budget","errorCode":null,"errorMessage":"Darwin archive exceeded candidate-count budget","messagePattern":"Darwin archive exceeded candidate-count budget","errorType":"exception","errorClass":"DarwinUnavailableError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/services/flywheel-proposer.ts","lineNumber":225,"sourceCode":"        budget: {\n          maxEvaluationCostMicros: input.safetyEnvelope.maxEvaluationCostMicros,\n          maxConcurrency: input.maxConcurrency ?? 2,\n          maxWallTimeMs,\n        },\n      }),\n      new Promise<never>((_, reject) => {\n        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    });","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/services/flywheel-proposer.ts#L207-L243","documentation":"The Darwin archive run completed but returned more candidates than the maxCandidates cap (default 256), violating the declared candidate-count budget. Excess is treated as a budget breach rather than silently truncating: the proposal fails closed with DarwinUnavailableError instead of forwarding an over-budget batch.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/services/flywheel-proposer.ts:225 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the number of candidates in the archive","Raise the candidate-count budget explicitly if the evaluation is intentional"],"exampleFix":"Reduce the number of Darwin archive candidates or raise the candidate-count 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"}