nexus-agents - v2.80.0
    Preparing search index...

    Interface IConsensusEngine

    Interface for the consensus engine.

    interface IConsensusEngine {
        propose(
            proposal: {
                id?: string;
                title: string;
                description: string;
                algorithm:
                    | "simple_majority"
                    | "supermajority"
                    | "unanimous"
                    | "proof_of_learning"
                    | "opinion_wise"
                    | "higher_order";
                timeout?: number;
                requiredVoters?: string[];
                metadata?: Record<string, unknown>;
                createdAt?: string;
            },
        ): Promise<Result<string, ConsensusError>>;
        vote(
            proposalId: string,
            agentId: string,
            vote: {
                decision: "approve" | "reject" | "abstain";
                reasoning: string;
                confidence: number;
                conditions?: string[];
                rejectionCategories?: (
                    | "YAGNI"
                    | "DRY_VIOLATION"
                    | "OVER_ENGINEERING"
                    | "SCOPE_CREEP"
                    | "SECURITY_RISK"
                    | "MISALIGNED"
                    | "INSUFFICIENT_EVIDENCE"
                )[];
                findings?: {
                    summary: string;
                    location: string;
                    severity: "low"
                    | "medium"
                    | "high"
                    | "critical";
                    gate: {
                        reread_cited_line: "failed" | "skipped" | "passed";
                        traced_call_path: "failed" | "skipped" | "passed";
                        named_assertion: string;
                        ruled_out_language_non_issue: "failed" | "skipped" | "passed";
                    };
                    claim: string;
                }[];
                timestamp?: string;
            },
        ): Promise<Result<void, ConsensusError>>;
        getResult(
            proposalId: string,
        ): Promise<Result<ConsensusResult, ConsensusError>>;
        close(proposalId: string): Promise<Result<ConsensusResult, ConsensusError>>;
        getMetrics(): ConsensusMetrics;
    }

    Implemented by

    Index

    Methods

    • Parameters

      • proposal: {
            id?: string;
            title: string;
            description: string;
            algorithm:
                | "simple_majority"
                | "supermajority"
                | "unanimous"
                | "proof_of_learning"
                | "opinion_wise"
                | "higher_order";
            timeout?: number;
            requiredVoters?: string[];
            metadata?: Record<string, unknown>;
            createdAt?: string;
        }

      Returns Promise<Result<string, ConsensusError>>

    • Parameters

      • proposalId: string
      • agentId: string
      • vote: {
            decision: "approve" | "reject" | "abstain";
            reasoning: string;
            confidence: number;
            conditions?: string[];
            rejectionCategories?: (
                | "YAGNI"
                | "DRY_VIOLATION"
                | "OVER_ENGINEERING"
                | "SCOPE_CREEP"
                | "SECURITY_RISK"
                | "MISALIGNED"
                | "INSUFFICIENT_EVIDENCE"
            )[];
            findings?: {
                summary: string;
                location: string;
                severity: "low"
                | "medium"
                | "high"
                | "critical";
                gate: {
                    reread_cited_line: "failed" | "skipped" | "passed";
                    traced_call_path: "failed" | "skipped" | "passed";
                    named_assertion: string;
                    ruled_out_language_non_issue: "failed" | "skipped" | "passed";
                };
                claim: string;
            }[];
            timestamp?: string;
        }
        • decision: "approve" | "reject" | "abstain"
        • reasoning: string
        • confidence: number
        • Optionalconditions?: string[]
        • OptionalrejectionCategories?: (
              | "YAGNI"
              | "DRY_VIOLATION"
              | "OVER_ENGINEERING"
              | "SCOPE_CREEP"
              | "SECURITY_RISK"
              | "MISALIGNED"
              | "INSUFFICIENT_EVIDENCE"
          )[]

          Structured rejection categories for reject→refine→re-vote loops (Issue #1213).

        • Optionalfindings?: {
              summary: string;
              location: string;
              severity: "low" | "medium" | "high" | "critical";
              gate: {
                  reread_cited_line: "failed" | "skipped" | "passed";
                  traced_call_path: "failed" | "skipped" | "passed";
                  named_assertion: string;
                  ruled_out_language_non_issue: "failed" | "skipped" | "passed";
              };
              claim: string;
          }[]

          Pre-verified PR-review findings (#2245 v4 follow-up). Optional; populated only when the voter emits the structured top-level array.

        • Optionaltimestamp?: string

      Returns Promise<Result<void, ConsensusError>>