{"record":{"id":"5800fac23bfe1d95","repo":"ruvnet/ruflo","slug":"bft-consensus-failed-only-results-length-rep","errorCode":null,"errorMessage":"BFT consensus failed: only ${results.length}/${replicaCount} replicas succeeded","messagePattern":"BFT consensus failed: only (.+?)/(.+?) replicas succeeded","errorType":"exception","errorClass":"QEHiveError","httpStatus":null,"severity":"error","filePath":"v3/plugins/agentic-qe/src/bridges/QEHiveBridge.ts","lineNumber":333,"sourceCode":"    const outcomes = await Promise.all(promises);\n\n    for (const outcome of outcomes) {\n      if (outcome.success) {\n        results.push(outcome.result as T);\n      } else {\n        errors.push(outcome.error as Error);\n      }\n    }\n\n    // BFT requires 2f+1 agreeing results (f = max faults tolerated)\n    // For 3 replicas: f=1, need 2 agreeing\n    // For 5 replicas: f=2, need 3 agreeing\n    const maxFaults = Math.floor((replicaCount - 1) / 3);\n    const requiredAgreement = 2 * maxFaults + 1;\n\n    if (results.length < requiredAgreement) {\n      this.logger.error(`BFT consensus failed: ${results.length}/${replicaCount} replicas succeeded`);\n      throw new QEHiveError(\n        `BFT consensus failed: only ${results.length}/${replicaCount} replicas succeeded`,\n        errors[0]\n      );\n    }\n\n    // Return first successful result (in production, would compare for consensus)\n    this.logger.debug(`BFT consensus achieved: ${results.length}/${replicaCount} replicas agreed`);\n    return results[0];\n  }\n\n  /**\n   * Propose task allocation via consensus\n   */\n  async proposeTaskAllocation(\n    task: QESwarmTask,\n    requiredAgents: string[]\n  ): Promise<ConsensusResult> {\n    this.ensureInitialized();","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/agentic-qe/src/bridges/QEHiveBridge.ts#L315-L351","documentation":"executeWithBFT() gathered all replica outcomes and too few succeeded to meet the 2f+1 agreement bound for the replica count (f = floor((n-1)/3)). The BFT quorum is not met, so the operation is reported as failed rather than acting on an unquorumed result; the counts in the message show succeeded/total.","triggerScenarios":"Thrown at v3/plugins/agentic-qe/src/bridges/QEHiveBridge.ts:333 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Investigate the failed replicas and restore them before rerunning consensus.","Reduce replica count or fix the fault causing replica failures."],"exampleFix":null,"handlingStrategy":"retry","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-14T00:17:10.932Z"}