{"record":{"id":"1fcbb8a5c1ab600f","repo":"ruvnet/ruflo","slug":"darwin-archive-incomplete","errorCode":null,"errorMessage":"Darwin archive incomplete","messagePattern":"Darwin archive incomplete","errorType":"exception","errorClass":"DarwinUnavailableError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/services/flywheel-proposer.ts","lineNumber":221,"sourceCode":"    const result = await Promise.race([\n      input.darwinInvoker({\n        baselinePolicy: input.baselinePolicy,\n        seed: input.seed,\n        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,","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/services/flywheel-proposer.ts#L203-L239","documentation":"When mode is 'darwin', the darwinInvoker ran but returned a result with completed: false (and an optional reason). Because the caller demanded Darwin, an incomplete archive is a hard DarwinUnavailableError rather than a silent fallback to the local proposer (which only happens for non-darwin modes).","triggerScenarios":"The Darwin backend signals it could not finish: internal error, resource exhaustion, partial failure, or it hit a limit and returned completed:false with result.reason set.","commonSituations":"Darwin's own budget/quota exhausted; the baseline policy or seed produced no viable candidates; Darwin service degraded or throttled; an upstream dependency of Darwin failed.","solutions":["Inspect result.reason (surfaced in the message when present) to find the underlying cause.","Retry with a fresh seed or a less constrained safetyEnvelope if reason indicates budget exhaustion.","Fall back explicitly: if you can tolerate substitution, use mode 'auto' so an incomplete Darwin run falls back to local instead of throwing.","Increase Darwin-side budgets/quotas if the reason is a Darwin-internal limit."],"exampleFix":"// before\nconst archive = await proposeFlywheelCandidates({ mode: 'darwin', darwinInvoker, ... }); // throws if Darwin incomplete\n\n// after — tolerate Darwin incompleteness via auto mode\nconst archive = await proposeFlywheelCandidates({ mode: 'auto', darwinInvoker, ... });\n// archive.effective === 'local' with substitution 'darwin-incomplete:...' when Darwin fails","handlingStrategy":"try-catch","validationCode":"// Cannot pre-validate Darwin's completion; choose a tolerant mode if substitution is acceptable:\nawait proposeFlywheelCandidates({ mode: 'auto', darwinInvoker, ... });","typeGuard":null,"tryCatchPattern":"try {\n  return await proposeFlywheelCandidates({ mode: 'darwin', darwinInvoker, ... });\n} catch (e) {\n  if (e instanceof DarwinUnavailableError) {\n    // fall back to local explicitly\n    return await proposeFlywheelCandidates({ mode: 'local', ... });\n  }\n  throw e;\n}","preventionTips":["Prefer mode 'auto' when you can tolerate Darwin incompleteness.","Read result.reason (surfaced in the message) to diagnose Darwin-side failures.","Retry with a different seed if reason suggests a degenerate baseline.","Ensure Darwin's own budgets can complete a run for your policy."],"tags":["darwin","flywheel","typescript"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}