consensus

Classes

ConsensusEngine

Defined in: packages/nexus-agents/src/consensus/engine.ts:142

Consensus engine for multi-agent decision making.

Example

const engine = new ConsensusEngine({ defaultTimeout: 30000 });
const proposalResult = await engine.propose({
  title: 'Use microservices architecture',
  description: 'Proposal to adopt microservices',
  algorithm: 'supermajority',
});
if (proposalResult.ok) {
  await engine.vote(proposalResult.value, 'agent-1', {
    decision: 'approve',
    confidence: 0.9,
    reasoning: 'Good for scalability',
  });
}

Implements

Constructors

Constructor
new ConsensusEngine(config?, logger?): ConsensusEngine;

Defined in: packages/nexus-agents/src/consensus/engine.ts:155

Parameters
config?

Partial<ConsensusEngineConfig>

logger?

ILogger

Returns

ConsensusEngine

Methods

clearCache()
clearCache(): void;

Defined in: packages/nexus-agents/src/consensus/engine.ts:704

Clears the proposal content cache (for testing/reset).

Returns

void

close()
close(proposalId): Promise<Result<ConsensusResult, ConsensusError>>;

Defined in: packages/nexus-agents/src/consensus/engine.ts:277

Parameters
proposalId

string

Returns

Promise<Result<ConsensusResult, ConsensusError>>

Implementation of

IConsensusEngine.close

getActiveProposalCount()
getActiveProposalCount(): number;

Defined in: packages/nexus-agents/src/consensus/engine.ts:326

Returns

number

getAgentPerformance()
getAgentPerformance(agentId): AgentPerformance | undefined;

Defined in: packages/nexus-agents/src/consensus/engine.ts:322

Parameters
agentId

string

Returns

AgentPerformance | undefined

getCacheSize()
getCacheSize(): number;

Defined in: packages/nexus-agents/src/consensus/engine.ts:697

Gets the current cache size (for testing/monitoring).

Returns

number

getMetrics()
getMetrics(): ConsensusMetrics;

Defined in: packages/nexus-agents/src/consensus/engine.ts:281

Returns

ConsensusMetrics

Implementation of

IConsensusEngine.getMetrics

getResult()
getResult(proposalId): Promise<Result<ConsensusResult, ConsensusError>>;

Defined in: packages/nexus-agents/src/consensus/engine.ts:264

Parameters
proposalId

string

Returns

Promise<Result<ConsensusResult, ConsensusError>>

Implementation of

IConsensusEngine.getResult

propose()
propose(proposal): Promise<Result<string, ConsensusError>>;

Defined in: packages/nexus-agents/src/consensus/engine.ts:172

Parameters
proposal
algorithm

| "simple_majority" | "supermajority" | "unanimous" | "higher_order" | "opinion_wise" | "proof_of_learning" = ConsensusAlgorithmSchema

createdAt?

string = ...

description

string = ...

id?

string = ...

metadata?

Record<string, unknown> = ...

requiredVoters?

string[] = ...

timeout?

number = ...

title

string = ...

Returns

Promise<Result<string, ConsensusError>>

Implementation of

IConsensusEngine.propose

setVoterExpansionCallback()
setVoterExpansionCallback(callback): void;

Defined in: packages/nexus-agents/src/consensus/engine.ts:168

Sets the callback for incremental quorum voter expansion (Issue #1408). When ambiguous votes are detected, this callback requests additional voters.

Parameters
callback

VoterExpansionCallback

Returns

void

updateAgentPerformance()
updateAgentPerformance(agentId, wasCorrect): void;

Defined in: packages/nexus-agents/src/consensus/engine.ts:297

Parameters
agentId

string

wasCorrect

boolean

Returns

void

vote()
vote(
   proposalId, 
   agentId, 
   vote
): Promise<Result<void, ConsensusError>>;

Defined in: packages/nexus-agents/src/consensus/engine.ts:213

Parameters
proposalId

string

agentId

string

vote
conditions?

string[] = ...

confidence

number = ...

decision

"approve" | "reject" | "abstain" = VoteDecisionSchema

findings?

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

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

reasoning

string = ...

rejectionCategories?

( | "YAGNI" | "DRY_VIOLATION" | "OVER_ENGINEERING" | "SCOPE_CREEP" | "SECURITY_RISK" | "MISALIGNED" | "INSUFFICIENT_EVIDENCE")[] = ...

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

selectedOption?

string = ...

Which declared option this voter chose, when the proposal declared options (#4472). Absent when the proposal declared none, or when the voter’s selection matched no declared option — an unmatched selection is recorded as absent, never coerced onto a default.

timestamp?

string = ...

Returns

Promise<Result<void, ConsensusError>>

Implementation of

IConsensusEngine.vote


ConsensusError

Defined in: packages/nexus-agents/src/consensus/engine.ts:57

Error class for consensus-related failures.

Extends

Constructors

Constructor
new ConsensusError(message, context?): ConsensusError;

Defined in: packages/nexus-agents/src/consensus/engine.ts:58

Parameters
message

string

context?

Record<string, unknown>

Returns

ConsensusError

Overrides

AgentError.constructor

Properties

cause
readonly cause: Error | undefined;

Defined in: packages/nexus-agents/src/core/errors.ts:105

Inherited from

AgentError.cause

code
readonly code: ErrorCode;

Defined in: packages/nexus-agents/src/core/errors.ts:103

Inherited from

AgentError.code

context
readonly context: Record<string, unknown> | undefined;

Defined in: packages/nexus-agents/src/core/errors.ts:104

Inherited from

AgentError.context

message
message: string;

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075

Inherited from

AgentError.message

name
name: string;

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074

Inherited from

AgentError.name

stack?
optional stack?: string;

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

AgentError.stack

stackTraceLimit
static stackTraceLimit: number;

Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

AgentError.stackTraceLimit

Methods

toJSON()
toJSON(): SerializedError;

Defined in: packages/nexus-agents/src/core/errors.ts:121

Serializes the error to a JSON-safe object.

Returns

SerializedError

Inherited from

AgentError.toJSON

captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;

Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

AgentError.captureStackTrace

prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:55

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

AgentError.prepareStackTrace


CorrelationTracker

Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:56

Correlation tracker implementation. Records voting history and computes pairwise agent correlations.

Memory bounded: uses FIFO eviction when maxObservationsPerAgent or maxProposals limits reached.

Implements

Constructors

Constructor
new CorrelationTracker(config?): CorrelationTracker;

Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:65

Parameters
config?

Partial<HigherOrderVotingConfig>

Returns

CorrelationTracker

Methods

clear()
clear(): void;

Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:257

Clear all recorded data.

Returns

void

Implementation of

ICorrelationTracker.clear

computeCorrelationMatrix()
computeCorrelationMatrix(): CorrelationMatrix;

Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:147

Compute the full correlation matrix for all tracked agents.

Returns

CorrelationMatrix

Implementation of

ICorrelationTracker.computeCorrelationMatrix

getCorrelation()
getCorrelation(agentA, agentB): number | undefined;

Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:159

Get correlation between two specific agents. Returns undefined if insufficient data.

Parameters
agentA

string

agentB

string

Returns

number | undefined

Implementation of

ICorrelationTracker.getCorrelation

getStats()
getStats(): CorrelationTrackerStats;

Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:224

Get statistics about the correlation tracker.

Returns

CorrelationTrackerStats

Implementation of

ICorrelationTracker.getStats

hasSufficientData()
hasSufficientData(agentIds): boolean;

Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:196

Check if there is sufficient correlation data for a set of agents.

Parameters
agentIds

readonly string[]

Returns

boolean

Implementation of

ICorrelationTracker.hasSufficientData

identifyIndependentSubsets()
identifyIndependentSubsets(): readonly IndependentSubset[];

Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:169

Identify groups of agents that vote independently.

Returns

readonly IndependentSubset[]

Implementation of

ICorrelationTracker.identifyIndependentSubsets

recordProposalVotes()
recordProposalVotes(
   proposalId, 
   votes, 
   outcome, 
   context?
): void;

Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:103

Record votes from multiple agents for the same proposal.

Parameters
proposalId

string

votes

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

outcome

"rejected" | "approved"

context?

CorrelationRecordContext

Returns

void

Implementation of

ICorrelationTracker.recordProposalVotes

recordVote()
recordVote(
   agentId, 
   vote, 
   outcome, 
   context?
): void;

Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:79

Record a vote and its outcome for correlation tracking.

Parameters
agentId

string

vote
conditions?

string[] = ...

confidence

number = ...

decision

"approve" | "reject" | "abstain" = VoteDecisionSchema

findings?

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

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

reasoning

string = ...

rejectionCategories?

( | "YAGNI" | "DRY_VIOLATION" | "OVER_ENGINEERING" | "SCOPE_CREEP" | "SECURITY_RISK" | "MISALIGNED" | "INSUFFICIENT_EVIDENCE")[] = ...

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

selectedOption?

string = ...

Which declared option this voter chose, when the proposal declared options (#4472). Absent when the proposal declared none, or when the voter’s selection matched no declared option — an unmatched selection is recorded as absent, never coerced onto a default.

timestamp?

string = ...

outcome

"rejected" | "approved"

context?

CorrelationRecordContext

Returns

void

Implementation of

ICorrelationTracker.recordVote

setCurrentModelPins()
setCurrentModelPins(modelPins): void;

Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:74

Select the active model partition for each pinned role.

Parameters
modelPins

ReadonlyMap<string, string>

Returns

void

Implementation of

ICorrelationTracker.setCurrentModelPins


HigherOrderVotingStrategy

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:311

Higher-order voting strategy for integration with VotingStrategyFactory. Wraps OWVoting to provide IVotingStrategy interface.

Extends

Implements

Constructors

Constructor
new HigherOrderVotingStrategy(options?): HigherOrderVotingStrategy;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:312

Parameters
options?

OWVotingOptions = {}

Returns

HigherOrderVotingStrategy

Overrides

OWVoting.constructor

Properties

algorithm
readonly algorithm: 
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "higher_order"
  | "opinion_wise"
  | "proof_of_learning";

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:72

Implementation of

IVotingStrategy.algorithm

Inherited from

OWVoting.algorithm

Methods

aggregate()
aggregate(votes, tracker?): HigherOrderVotingResult;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:199

Full pipeline: estimate correlation, compute result.

tracker is OPTIONAL (#3173): when omitted, the instance uses the tracker injected at construction (OWVotingOptions.tracker), letting higher-order voting be reused as a building block without threading the tracker through every call. A per-call tracker still wins. Throws if neither is available.

Parameters
votes

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

tracker?

ICorrelationTracker

Returns

HigherOrderVotingResult

Inherited from

OWVoting.aggregate

aggregateWithCorrelation()
aggregateWithCorrelation(votes, correlationMatrix): HigherOrderVotingResult;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:92

Aggregate votes using Bayesian correlation-aware method.

Parameters
votes

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

correlationMatrix

CorrelationMatrix

Returns

HigherOrderVotingResult

Inherited from

OWVoting.aggregateWithCorrelation

calculateOutcome()
calculateOutcome(votes, _weights?): VotingOutcome;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:87

IVotingStrategy implementation for integration with ConsensusEngine.

Parameters
votes

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

_weights?

Map<string, number>

Returns

VotingOutcome

Implementation of

IVotingStrategy.calculateOutcome

Inherited from

OWVoting.calculateOutcome

computeISP()
computeISP(votes, independentSubsets): HigherOrderVotingResult;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:152

Compute result using Independent Subset Partition method.

Parameters
votes

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

independentSubsets

readonly IndependentSubset[]

Returns

HigherOrderVotingResult

Inherited from

OWVoting.computeISP

estimateCorrelation()
estimateCorrelation(tracker): CorrelationMatrix;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:148

Estimate correlation matrix from voting history.

Parameters
tracker

ICorrelationTracker

Returns

CorrelationMatrix

Inherited from

OWVoting.estimateCorrelation

getConfig()
getConfig(): HigherOrderVotingConfig;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:251

Get the current configuration.

Returns

HigherOrderVotingConfig

Inherited from

OWVoting.getConfig


NoAdapterError

Defined in: packages/nexus-agents/src/cli/voter-adapter-resolve.ts:25

Error thrown when no adapter is available and simulation is disabled.

Extends

  • Error

Constructors

Constructor
new NoAdapterError(message): NoAdapterError;

Defined in: packages/nexus-agents/src/cli/voter-adapter-resolve.ts:26

Parameters
message

string

Returns

NoAdapterError

Overrides
Error.constructor

Properties

cause?
optional cause?: unknown;

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24

Inherited from
Error.cause
message
message: string;

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075

Inherited from
Error.message
name
name: string;

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074

Inherited from
Error.name
stack?
optional stack?: string;

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from
Error.stack
stackTraceLimit
static stackTraceLimit: number;

Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from
Error.stackTraceLimit

Methods

captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;

Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from
Error.captureStackTrace
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@25.9.8/node_modules/@types/node/globals.d.ts:55

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from
Error.prepareStackTrace

OWVoting

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:71

Opinion-Wise higher-order voting implementation. Uses Bayesian aggregation with correlation awareness.

Extended by

Implements

Constructors

Constructor
new OWVoting(options?): OWVoting;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:77

Parameters
options?

OWVotingOptions = {}

Returns

OWVoting

Properties

algorithm
readonly algorithm: 
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "higher_order"
  | "opinion_wise"
  | "proof_of_learning";

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:72

Implementation of

IVotingStrategy.algorithm

Methods

aggregate()
aggregate(votes, tracker?): HigherOrderVotingResult;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:199

Full pipeline: estimate correlation, compute result.

tracker is OPTIONAL (#3173): when omitted, the instance uses the tracker injected at construction (OWVotingOptions.tracker), letting higher-order voting be reused as a building block without threading the tracker through every call. A per-call tracker still wins. Throws if neither is available.

Parameters
votes

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

tracker?

ICorrelationTracker

Returns

HigherOrderVotingResult

Implementation of

IHigherOrderVoting.aggregate

aggregateWithCorrelation()
aggregateWithCorrelation(votes, correlationMatrix): HigherOrderVotingResult;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:92

Aggregate votes using Bayesian correlation-aware method.

Parameters
votes

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

correlationMatrix

CorrelationMatrix

Returns

HigherOrderVotingResult

Implementation of

IHigherOrderVoting.aggregateWithCorrelation

calculateOutcome()
calculateOutcome(votes, _weights?): VotingOutcome;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:87

IVotingStrategy implementation for integration with ConsensusEngine.

Parameters
votes

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

_weights?

Map<string, number>

Returns

VotingOutcome

Implementation of

IVotingStrategy.calculateOutcome

computeISP()
computeISP(votes, independentSubsets): HigherOrderVotingResult;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:152

Compute result using Independent Subset Partition method.

Parameters
votes

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

independentSubsets

readonly IndependentSubset[]

Returns

HigherOrderVotingResult

Implementation of

IHigherOrderVoting.computeISP

estimateCorrelation()
estimateCorrelation(tracker): CorrelationMatrix;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:148

Estimate correlation matrix from voting history.

Parameters
tracker

ICorrelationTracker

Returns

CorrelationMatrix

Implementation of

IHigherOrderVoting.estimateCorrelation

getConfig()
getConfig(): HigherOrderVotingConfig;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:251

Get the current configuration.

Returns

HigherOrderVotingConfig

Implementation of

IHigherOrderVoting.getConfig


ProofOfLearningStrategy

Defined in: packages/nexus-agents/src/consensus/strategies.ts:265

Proof-of-learning weighted voting strategy. Agents with better track records have more voting power.

Extends

  • BaseVotingStrategy

Constructors

Constructor
new ProofOfLearningStrategy(): ProofOfLearningStrategy;
Returns

ProofOfLearningStrategy

Inherited from
BaseVotingStrategy.constructor

Properties

algorithm
readonly algorithm: 
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "higher_order"
  | "opinion_wise"
  | "proof_of_learning" = 'proof_of_learning';

Defined in: packages/nexus-agents/src/consensus/strategies.ts:266

Overrides
BaseVotingStrategy.algorithm

Methods

calculateOutcome()
calculateOutcome(votes, weights?): VotingOutcome;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:268

Parameters
votes

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

weights?

Map<string, number>

Returns

VotingOutcome

Overrides
BaseVotingStrategy.calculateOutcome
countVotes()
protected countVotes(votes): VoteCounts;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:80

Count votes by decision type.

Parameters
votes

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

Returns

VoteCounts

Inherited from
BaseVotingStrategy.countVotes
countWeightedVotes()
protected countWeightedVotes(votes, weights): WeightedVoteCounts;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:105

Calculate weighted vote counts using agent performance weights.

Parameters
votes

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

weights

Map<string, number>

Returns

WeightedVoteCounts

Inherited from
BaseVotingStrategy.countWeightedVotes

SimpleMajorityStrategy

Defined in: packages/nexus-agents/src/consensus/strategies.ts:138

Simple majority voting strategy (>50% approval).

Extends

  • BaseVotingStrategy

Constructors

Constructor
new SimpleMajorityStrategy(): SimpleMajorityStrategy;
Returns

SimpleMajorityStrategy

Inherited from
BaseVotingStrategy.constructor

Properties

algorithm
readonly algorithm: 
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "higher_order"
  | "opinion_wise"
  | "proof_of_learning" = 'simple_majority';

Defined in: packages/nexus-agents/src/consensus/strategies.ts:139

Overrides
BaseVotingStrategy.algorithm

Methods

calculateOutcome()
calculateOutcome(votes): VotingOutcome;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:141

Parameters
votes

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

Returns

VotingOutcome

Overrides
BaseVotingStrategy.calculateOutcome
countVotes()
protected countVotes(votes): VoteCounts;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:80

Count votes by decision type.

Parameters
votes

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

Returns

VoteCounts

Inherited from
BaseVotingStrategy.countVotes
countWeightedVotes()
protected countWeightedVotes(votes, weights): WeightedVoteCounts;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:105

Calculate weighted vote counts using agent performance weights.

Parameters
votes

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

weights

Map<string, number>

Returns

WeightedVoteCounts

Inherited from
BaseVotingStrategy.countWeightedVotes

SupermajorityStrategy

Defined in: packages/nexus-agents/src/consensus/strategies.ts:176

Supermajority voting strategy (at least 2/3 approval).

Extends

  • BaseVotingStrategy

Constructors

Constructor
new SupermajorityStrategy(): SupermajorityStrategy;
Returns

SupermajorityStrategy

Inherited from
BaseVotingStrategy.constructor

Properties

algorithm
readonly algorithm: 
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "higher_order"
  | "opinion_wise"
  | "proof_of_learning" = 'supermajority';

Defined in: packages/nexus-agents/src/consensus/strategies.ts:177

Overrides
BaseVotingStrategy.algorithm

Methods

calculateOutcome()
calculateOutcome(votes): VotingOutcome;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:179

Parameters
votes

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

Returns

VotingOutcome

Overrides
BaseVotingStrategy.calculateOutcome
countVotes()
protected countVotes(votes): VoteCounts;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:80

Count votes by decision type.

Parameters
votes

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

Returns

VoteCounts

Inherited from
BaseVotingStrategy.countVotes
countWeightedVotes()
protected countWeightedVotes(votes, weights): WeightedVoteCounts;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:105

Calculate weighted vote counts using agent performance weights.

Parameters
votes

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

weights

Map<string, number>

Returns

WeightedVoteCounts

Inherited from
BaseVotingStrategy.countWeightedVotes

UnanimousStrategy

Defined in: packages/nexus-agents/src/consensus/strategies.ts:215

Unanimous voting strategy (100% approval required).

Extends

  • BaseVotingStrategy

Constructors

Constructor
new UnanimousStrategy(): UnanimousStrategy;
Returns

UnanimousStrategy

Inherited from
BaseVotingStrategy.constructor

Properties

algorithm
readonly algorithm: 
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "higher_order"
  | "opinion_wise"
  | "proof_of_learning" = 'unanimous';

Defined in: packages/nexus-agents/src/consensus/strategies.ts:216

Overrides
BaseVotingStrategy.algorithm

Methods

calculateOutcome()
calculateOutcome(votes): VotingOutcome;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:218

Parameters
votes

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

Returns

VotingOutcome

Overrides
BaseVotingStrategy.calculateOutcome
countVotes()
protected countVotes(votes): VoteCounts;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:80

Count votes by decision type.

Parameters
votes

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

Returns

VoteCounts

Inherited from
BaseVotingStrategy.countVotes
countWeightedVotes()
protected countWeightedVotes(votes, weights): WeightedVoteCounts;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:105

Calculate weighted vote counts using agent performance weights.

Parameters
votes

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

weights

Map<string, number>

Returns

WeightedVoteCounts

Inherited from
BaseVotingStrategy.countWeightedVotes

VotingProtocol

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:49

Multi-round voting protocol for code review.

Implements

Constructors

Constructor
new VotingProtocol(customLogger?): VotingProtocol;

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:53

Parameters
customLogger?

ILogger

Returns

VotingProtocol

Methods

createSession()
createSession(
   topic, 
   committee, 
   config?
): VotingSession;

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:60

Create a new voting session with a committee.

Parameters
topic

string

committee

string[]

config?

Partial<VotingProtocolConfig>

Returns

VotingSession

Implementation of

IVotingProtocol.createSession

detectSycophancy()
detectSycophancy(sessionId): SycophancyReport;

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:345

Detect sycophancy patterns.

Parameters
sessionId

string

Returns

SycophancyReport

Implementation of

IVotingProtocol.detectSycophancy

getResult()
getResult(sessionId): Promise<VotingProtocolResult | null>;

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:298

Get the final result.

Parameters
sessionId

string

Returns

Promise<VotingProtocolResult | null>

Implementation of

IVotingProtocol.getResult

getSession()
getSession(sessionId): VotingSession | undefined;

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:353

Get the current session state.

Parameters
sessionId

string

Returns

VotingSession | undefined

Implementation of

IVotingProtocol.getSession

startAnalysisRound()
startAnalysisRound(sessionId): Promise<VotingRound>;

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:99

Start the analysis round (Round 1).

Parameters
sessionId

string

Returns

Promise<VotingRound>

Implementation of

IVotingProtocol.startAnalysisRound

startConsensusRound()
startConsensusRound(sessionId): Promise<VotingRound>;

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:238

Start the consensus round (Round 3).

Parameters
sessionId

string

Returns

Promise<VotingRound>

Implementation of

IVotingProtocol.startConsensusRound

startDeliberationRound()
startDeliberationRound(sessionId): Promise<VotingRound>;

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:153

Start the deliberation round (Round 2).

Parameters
sessionId

string

Returns

Promise<VotingRound>

Implementation of

IVotingProtocol.startDeliberationRound

submitFinalVote()
submitFinalVote(
   sessionId, 
   agentId, 
   vote
): Promise<void>;

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:263

Submit final vote during consensus.

Parameters
sessionId

string

agentId

string

vote
conditions?

string[] = ...

confidence

number = ...

decision

"approve" | "reject" | "abstain" = VoteDecisionSchema

findings?

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

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

reasoning

string = ...

rejectionCategories?

( | "YAGNI" | "DRY_VIOLATION" | "OVER_ENGINEERING" | "SCOPE_CREEP" | "SECURITY_RISK" | "MISALIGNED" | "INSUFFICIENT_EVIDENCE")[] = ...

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

selectedOption?

string = ...

Which declared option this voter chose, when the proposal declared options (#4472). Absent when the proposal declared none, or when the voter’s selection matched no declared option — an unmatched selection is recorded as absent, never coerced onto a default.

timestamp?

string = ...

Returns

Promise<void>

Implementation of

IVotingProtocol.submitFinalVote

submitFindings()
submitFindings(
   sessionId, 
   agentId, 
   findings
): Promise<void>;

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:118

Submit findings from an agent during analysis.

Parameters
sessionId

string

agentId

string

findings

{ agentId: string; category: | "security" | "documentation" | "performance" | "design" | "other" | "bug" | "style"; confidence: number; description: string; location?: string; severity: "critical" | "major" | "minor" | "suggestion"; suggestion?: string; timestamp?: string; }[]

Returns

Promise<void>

Implementation of

IVotingProtocol.submitFindings

voteOnFinding()
voteOnFinding(sessionId, vote): Promise<void>;

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:199

Vote on findings during deliberation.

Parameters
sessionId

string

vote
agentId

string = ...

agree

boolean = ...

amendedSeverity?

"critical" | "major" | "minor" | "suggestion" = ...

findingId

string = ...

reasoning?

string = ...

Returns

Promise<void>

Implementation of

IVotingProtocol.voteOnFinding


VotingStrategyFactory

Defined in: packages/nexus-agents/src/consensus/strategies.ts:352

Factory for creating voting strategies.

Constructors

Constructor
new VotingStrategyFactory(): VotingStrategyFactory;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:355

Returns

VotingStrategyFactory

Methods

getAvailableAlgorithms()
getAvailableAlgorithms(): (
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "higher_order"
  | "opinion_wise"
  | "proof_of_learning")[];

Defined in: packages/nexus-agents/src/consensus/strategies.ts:387

Get all available algorithm types.

Returns

( | "simple_majority" | "supermajority" | "unanimous" | "higher_order" | "opinion_wise" | "proof_of_learning")[]

getStrategy()
getStrategy(algorithm): IVotingStrategy;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:369

Get a voting strategy by algorithm type.

Parameters
algorithm

| "simple_majority" | "supermajority" | "unanimous" | "higher_order" | "opinion_wise" | "proof_of_learning"

Returns

IVotingStrategy

registerStrategy()
registerStrategy(strategy): void;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:380

Register a custom voting strategy.

Parameters
strategy

IVotingStrategy

Returns

void


WeightedVoting

Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:52

Weighted Byzantine voting implementation. Implements CP-WBFT pattern for fault-tolerant multi-agent consensus.

Implements

Constructors

Constructor
new WeightedVoting(options?): WeightedVoting;

Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:58

Parameters
options?

WeightedVotingOptions = {}

Returns

WeightedVoting

Methods

calculateWeight()
calculateWeight(agentId): number;

Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:68

Calculate vote weight for an agent

Parameters
agentId

string

Returns

number

Implementation of

IWeightedVoting.calculateWeight

canVote()
canVote(agentId): boolean;

Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:185

Check if agent can vote

Parameters
agentId

string

Returns

boolean

Implementation of

IWeightedVoting.canVote

flagByzantine()
flagByzantine(agentId, reason): void;

Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:152

Flag agent for Byzantine behavior

Parameters
agentId

string

reason

string

Returns

void

Implementation of

IWeightedVoting.flagByzantine

getAgentRecord()
getAgentRecord(agentId): WeightedAgentRecord | undefined;

Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:146

Get agent performance record

Parameters
agentId

string

Returns

WeightedAgentRecord | undefined

Implementation of

IWeightedVoting.getAgentRecord

getAllRecords()
getAllRecords(): readonly WeightedAgentRecord[];

Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:181

Get all agent records

Returns

readonly WeightedAgentRecord[]

Implementation of

IWeightedVoting.getAllRecords

recalibrateWeights()
recalibrateWeights(): void;

Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:191

Recalibrate all weights based on global performance

Returns

void

Implementation of

IWeightedVoting.recalibrateWeights

registerAgent()
registerAgent(agentId): void;

Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:136

Register a new agent

Parameters
agentId

string

Returns

void

Implementation of

IWeightedVoting.registerAgent

updatePerformance()
updatePerformance(agentId, outcome): void;

Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:74

Update agent performance based on task outcome

Parameters
agentId

string

outcome

"unknown" | "success" | "failure" | "partial"

Returns

void

Implementation of

IWeightedVoting.updatePerformance

weightedConsensus()
weightedConsensus(votes): WeightedConsensusResult;

Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:109

Run weighted consensus on votes

Parameters
votes

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

Returns

WeightedConsensusResult

Implementation of

IWeightedVoting.weightedConsensus

Interfaces

AgentPerformance

Defined in: packages/nexus-agents/src/consensus/types-core.ts:235

Agent performance record for proof-of-learning.

Properties

agentId
agentId: string;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:236

correctVotes
correctVotes: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:238

lastUpdated
lastUpdated: string;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:240

successRate
successRate: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:239

totalVotes
totalVotes: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:237


AgentVoteResult

Defined in: packages/nexus-agents/src/cli/vote-types.ts:178

Individual agent vote with metadata.

Properties

assignedCli?
readonly optional assignedCli?: string;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:262

The CLI the round-robin or NEXUS_VOTER_MODEL_<ROLE> pin chose for this seat (#6115), as a bare name (claude, not cli-claude). Unlike pinnedModel it is known BEFORE detection, so it survives the pending-detection placeholder and says where a seat was meant to answer. Compare with cli to see where it did. Absent on results built outside the panel launcher (simulation, direct executeAgentVote calls).

cacheCreationInputTokens?
readonly optional cacheCreationInputTokens?: number;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:316

Input tokens spent writing the cache, when reported (#4435). Bills at roughly 1.25x the uncached rate — the opposite end from a cache read.

cachedInputTokens?
readonly optional cachedInputTokens?: number;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:311

Input tokens read from an existing prompt cache, when the adapter reported them (#4435). Separate from inputTokens because cache reads bill at roughly a tenth of the uncached rate.

cli?
readonly optional cli?: string;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:201

CLI that executed this vote (for adaptive routing feedback).

error?
readonly optional error?: string;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:318

Error message if vote fell back to simulation or encountered an error

fallback?
readonly optional fallback?: SeatFallback;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:281

Present only when the seat answered on a different CLI or model than assigned (#6115). Three consecutive 7-seat panels ran every seat on one model because claude was out of credits and codex could not spawn, and nothing in the result said so — a single-model panel is a weaker independence claim than the assignment, and the tally read identically.

gatewayArm?
readonly optional gatewayArm?: `api:${string}`;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:273

The api:<endpoint> gateway arm this seat answered through, when it answered through an in-process gateway adapter (#4392 increment 2, step 4). Absent on a CLI-subprocess seat and on results built outside the panel launcher. The decision-cost rollup keys on it: a gateway seat is priced by the arm’s NEXUS_GATEWAY_COST declaration — UNKNOWN when undeclared — never by the model id’s vendor list price, which is what a claude-* id served by a gateway used to record. cli stays the adapter’s providerId (openai), which cannot say this.

inputTokens?
readonly optional inputTokens?: number;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:300

Input tokens the adapter reported for this voter’s LLM call, when known (#3910). Propagated from CompletionResponse.usage so per-decision cost aggregation resolves from unmeasured to MEASURED. Absent for error/simulation votes that never reached a model, or for adapters that do not report usage (CLI subscriptions) — those stay honestly unmeasured.

model?
readonly optional model?: string;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:238

Model id that executed this vote, when known (e.g. ‘claude-sonnet’). Carried so per-decision cost aggregation can attribute spend per model (#3855). Absent for error/simulation votes that never reached a model.

outputTokens?
readonly optional outputTokens?: number;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:305

Output tokens the adapter reported for this voter’s LLM call, when known (#3910). See AgentVoteResult.inputTokens.

pinnedModel?
readonly optional pinnedModel?: string;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:253

Model assigned to this role before execution. Unlike model, this stays on the primary assignment when router failover serves the vote elsewhere.

processingTimeMs
readonly processingTimeMs: number;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:181

retried?
readonly optional retried?: boolean;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:223

True when this vote came from the per-role retry of an errored seat (#5578). A first-attempt vote never carries it.

The panel launches once; a voter that errors is dropped, so under reduce_denominator its seat silently leaves the denominator and under absolute_quorum the whole vote voids and the caller replays all N voters for a single failure. Retrying just the errored roles recovers the seat for one extra call — and this flag is what makes the recovery visible instead of indistinguishable from a clean first attempt.

retriedFrom?
readonly optional retriedFrom?: RetriedFrom;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:232

What this seat was retried from (#6246): the first pass’s source and, when it had one, its error string. Present only on a seat the per-role retry REPLACED — never on a first-attempt result, and never on a seat whose retry failed again (that seat keeps its first attempt, unmarked). Orthogonal to retried: that flag says a recovery happened; this says what it recovered from.

role
readonly role: VoterRole;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:179

selectedOption?
readonly optional selectedOption?: string;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:211

Which named option this voter chose, when the proposal declared options (#4452). Absent on an ordinary yes/no vote.

The approve/reject/abstain tally cannot express option choice: on a multi-option proposal every engaged voter returns approve, so a real 6-1 split records as unanimous. This is what makes the split recoverable without parsing free-text reasoning.

servedModel?
readonly optional servedModel?: string;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:248

Model id the adapter REPORTED serving this vote (CompletionResponse.model), when it reported one (#6660). Differs from model — the adapter’s construction-time id, i.e. the model REQUESTED — when the transport answered on another model: the claude adapter’s in-family substitution after an out-of-credits envelope (#6120) is the known case. The outcome row’s servedModel and its price are taken from this field, never from model. Absent for error/simulation votes and when the adapter reported no model.

source
readonly source: "error" | "llm" | "unverifiable" | "simulation";

Defined in: packages/nexus-agents/src/cli/vote-types.ts:193

Source of the vote:

  • ‘llm’: Real LLM execution
  • ‘simulation’: Fallback simulation (opt-in only)
  • ‘error’: Error during execution (Issue #523)
  • ‘unverifiable’: the seat answered but could not read the artifact (#6094). A DISTINCT value, not a flag on abstain, so no aggregation over vote.decision can fold it back into the abstain bucket. The vote.decision is always abstain — an unverifiable seat never carries approve/reject, whatever the model returned.
timing?
readonly optional timing?: {
  attempts: readonly SeatAttemptTiming[];
};

Defined in: packages/nexus-agents/src/cli/vote-types.ts:292

Per-attempt timing of this seat (#6103): how long each attempt QUEUED behind its CLI’s serialized lane (#3348) and how long it RAN, in launch order — the primary attempt first, then the cross-CLI fallback (#3587) when one was made. Absent on a seat that never reached the launcher (simulation, a direct executeAgentVote); an empty attempts list on a seat the launcher refused before any attempt (cancelled). Recorded so the panel wall-clock can be attributed to queueing versus model time before a fallback lane is designed; never folded into the vote record.

attempts
readonly attempts: readonly SeatAttemptTiming[];
unverifiableSignal?
readonly optional unverifiableSignal?: UnverifiableSignal;

Defined in: packages/nexus-agents/src/cli/vote-types.ts:199

Present only when source === 'unverifiable': which evidence classified the seat (#6094). Lets an auditor tell a structured stderr signal from the reasoning-text heuristic.

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

Defined in: packages/nexus-agents/src/cli/vote-types.ts:180

conditions?
optional conditions?: string[];
confidence
confidence: number;
decision
decision: "approve" | "reject" | "abstain" = VoteDecisionSchema;
findings?
optional findings?: {
  claim: string;
  gate: {
     named_assertion: string;
     reread_cited_line: "failed" | "skipped" | "passed";
     ruled_out_language_non_issue: "failed" | "skipped" | "passed";
     traced_call_path: "failed" | "skipped" | "passed";
  };
  location: string;
  severity: "critical" | "high" | "low" | "medium";
  summary: string;
}[];

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

reasoning
reasoning: string;
rejectionCategories?
optional rejectionCategories?: (
  | "YAGNI"
  | "DRY_VIOLATION"
  | "OVER_ENGINEERING"
  | "SCOPE_CREEP"
  | "SECURITY_RISK"
  | "MISALIGNED"
  | "INSUFFICIENT_EVIDENCE")[];

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

selectedOption?
optional selectedOption?: string;

Which declared option this voter chose, when the proposal declared options (#4472). Absent when the proposal declared none, or when the voter’s selection matched no declared option — an unmatched selection is recorded as absent, never coerced onto a default.

timestamp?
optional timestamp?: string;

CollectRealVotesOptions

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:276

Options for collecting votes from multiple agents.

Extends

  • VoterAgentOptions

Properties

adapter?
readonly optional adapter?: IModelAdapter;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:113

Model adapter to use (auto-selected if not provided)

Inherited from
VoterAgentOptions.adapter
allowSimulation?
readonly optional allowSimulation?: boolean;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:119

Whether to allow simulation fallback (default: false per Issue #280)

Inherited from
VoterAgentOptions.allowSimulation
declaredOptions?
readonly optional declaredOptions?: readonly string[];

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:296

Named alternatives for a multi-option proposal (#4472); each voter picks one.

erroredRoleBackoffMs?
readonly optional erroredRoleBackoffMs?: number;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:320

Delay before the per-role retry of errored voters (#5578). Defaults to DEFAULT_ERRORED_ROLE_BACKOFF_MS; 0 disables the wait, which is what tests want. The retry itself is not optional — the panel applies it under every error policy, per the #5578 design panel (option b, 6 of 6).

gatewayAdapters?
readonly optional gatewayAdapters?: readonly IModelAdapter[];

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:294

In-process gateway model adapters (#4040) — one per discovered gateway model. When provided (and no explicit adapter override), voters route through these HTTP adapters instead of shelling out to CLIs: roles are round-robined across them for per-role model diversity, the API key stays in-process (no subprocess env-forwarding), and the nested-spawn class (#4033) cannot occur. Empty/omitted ⇒ the CLI round-robin path is used (unchanged).

interAgentDelayMs?
readonly optional interAgentDelayMs?: number;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:121

Delay between launching each agent vote to prevent rate limiting (default: 1000ms). Set to 0 to disable.

Inherited from
VoterAgentOptions.interAgentDelayMs
logger?
readonly optional logger?: ILogger;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:111

Logger instance

Inherited from
VoterAgentOptions.logger
maxRetries?
readonly optional maxRetries?: number;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:117

Maximum retries per vote (default: 2)

Inherited from
VoterAgentOptions.maxRetries
onVoteCollected?
readonly optional onVoteCollected?: (vote) => void;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:313

Per-seat progress callback (#6162): invoked with each seat’s result as it settles, on every pass (first, fallback, retry). The async-job heartbeat for vote bodies; absent changes nothing.

Parameters
vote

AgentVoteResult

Returns

void

project?
readonly optional project?: string;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:301

The project the panel is judging, already resolved and validated by the caller (#6110). Reaches every seat’s system prompt. Absent ⇒ nexus-agents.

proposal
readonly proposal: string;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:283

Proposal text

roleAdapters?
readonly optional roleAdapters?: ReadonlyMap<VoterRole, IModelAdapter>;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:327

Seats already assigned by assignPanelSeats (#6003): a caller that must know the panel’s models BEFORE the vote (the pr_review budget reads their windows) resolves the seats once and hands them back, so the panel runs on exactly what it was budgeted for. Ignored when adapter is set.

roles
readonly roles: readonly VoterRole[];

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:281

Voter roles to include

signal?
readonly optional signal?: AbortSignal;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:307

Cancellation for an in-flight panel. Stops LAUNCHING voters that have not started (#5393), aborts the adapter call of every seat already in flight (#6729), and skips the errored-seat retry pass. Absent changes nothing.

simulate?
readonly optional simulate?: boolean;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:285

Use simulation mode (explicit opt-in only)

timeoutMs?
readonly optional timeoutMs?: number;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:115

Timeout per vote in milliseconds (default: 120000, override via NEXUS_VOTE_TIMEOUT_MS)

Inherited from
VoterAgentOptions.timeoutMs
workspace?
readonly optional workspace?: string;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:278

Repository checkout used by every panel seat.

workspaceSha?
readonly optional workspaceSha?: string;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:279


ConsensusEngineConfig

Defined in: packages/nexus-agents/src/consensus/types-core.ts:307

Consensus engine configuration.

Properties

defaultTimeout
defaultTimeout: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:308

enablePerformanceTracking
enablePerformanceTracking: boolean;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:311

incrementalQuorum?
optional incrementalQuorum?: IncrementalQuorumConfig;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:317

Incremental quorum configuration (Issue #1408)

maxActiveProposals
maxActiveProposals: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:310

maxClosedProposals
maxClosedProposals: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:313

Maximum number of closed proposals to retain. Oldest are evicted when exceeded. (Issue #549)

minVotersForQuorum
minVotersForQuorum: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:309

proposalCache?
optional proposalCache?: ProposalCacheConfig;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:315

Content-based proposal caching for determinism (Issue #589)


ConsensusMetrics

Defined in: packages/nexus-agents/src/consensus/types-core.ts:384

Consensus metrics for monitoring.

Properties

algorithmUsage
algorithmUsage: Record<ConsensusAlgorithm, number>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:391

approvedProposals
approvedProposals: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:386

averageDurationMs
averageDurationMs: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:389

averageVotesPerProposal
averageVotesPerProposal: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:390

rejectedProposals
rejectedProposals: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:387

timedOutProposals
timedOutProposals: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:388

totalProposals
totalProposals: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:385


ConsensusResult

Defined in: packages/nexus-agents/src/consensus/types-core.ts:180

Result of a consensus decision.

Properties

approvalPercentage
approvalPercentage: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:196

closedAt
closedAt: string;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:199

durationMs
durationMs: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:200

outcome
outcome: "timeout" | "closed" | "rejected" | "pending" | "voting" | "approved";

Defined in: packages/nexus-agents/src/consensus/types-core.ts:183

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

Defined in: packages/nexus-agents/src/consensus/types-core.ts:182

algorithm
algorithm: 
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "higher_order"
  | "opinion_wise"
  | "proof_of_learning" = ConsensusAlgorithmSchema;
createdAt?
optional createdAt?: string;
description
description: string;
id?
optional id?: string;
metadata?
optional metadata?: Record<string, unknown>;
requiredVoters?
optional requiredVoters?: string[];
timeout?
optional timeout?: number;
title
title: string;
proposalId
proposalId: string;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:181

quorumReached
quorumReached: boolean;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:197

startedAt
startedAt: string;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:198

voteCounts
voteCounts: VoteCounts;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:185

votes
votes: Map<string, {
  conditions?: string[];
  confidence: number;
  decision: "approve" | "reject" | "abstain";
  findings?: {
     claim: string;
     gate: {
        named_assertion: string;
        reread_cited_line: "failed" | "skipped" | "passed";
        ruled_out_language_non_issue: "failed" | "skipped" | "passed";
        traced_call_path: "failed" | "skipped" | "passed";
     };
     location: string;
     severity: "critical" | "high" | "low" | "medium";
     summary: string;
  }[];
  reasoning: string;
  rejectionCategories?: (
     | "YAGNI"
     | "DRY_VIOLATION"
     | "OVER_ENGINEERING"
     | "SCOPE_CREEP"
     | "SECURITY_RISK"
     | "MISALIGNED"
    | "INSUFFICIENT_EVIDENCE")[];
  selectedOption?: string;
  timestamp?: string;
}>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:184

weightBasis?
optional weightBasis?: WeightBasis;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:195

What the weights in weightedCounts were derived from (#5117).

Carried on the RESULT, not just computed inside the strategy, because the result is what a reviewer reads. A tally reported as weighted when every weight was structurally 1.0 invites the reader to believe voter track record moved the number. Absent for strategies that do not weight at all.

weightedCounts?
optional weightedCounts?: WeightedVoteCounts;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:186


ConsolidatedFinding

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:154

A consolidated finding after deliberation.

Properties

agreementRatio
agreementRatio: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:162

category
category: 
  | "security"
  | "documentation"
  | "performance"
  | "design"
  | "other"
  | "bug"
  | "style";

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:156

description
description: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:158

id
id: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:155

location?
optional location?: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:159

originalFindings
originalFindings: {
  agentId: string;
  category:   | "security"
     | "documentation"
     | "performance"
     | "design"
     | "other"
     | "bug"
     | "style";
  confidence: number;
  description: string;
  location?: string;
  severity: "critical" | "major" | "minor" | "suggestion";
  suggestion?: string;
  timestamp?: string;
}[];

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:163

agentId
agentId: string;
category
category: 
  | "security"
  | "documentation"
  | "performance"
  | "design"
  | "other"
  | "bug"
  | "style";
confidence
confidence: number;
description
description: string;
location?
optional location?: string;
severity
severity: "critical" | "major" | "minor" | "suggestion";
suggestion?
optional suggestion?: string;
timestamp?
optional timestamp?: string;
severity
severity: "critical" | "major" | "minor" | "suggestion";

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:157

suggestion?
optional suggestion?: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:160

supportingAgents
supportingAgents: string[];

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:161


CorrelationTrackerStats

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:290

Statistics about correlation tracking.

Properties

averageCorrelation
readonly averageCorrelation: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:298

Average correlation across all pairs

independentSubsetCount
readonly independentSubsetCount: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:300

Number of identified independent subsets

pairsWithSufficientData
readonly pairsWithSufficientData: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:302

Pairs with sufficient data for correlation calculation

totalAgents
readonly totalAgents: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:292

Total agents being tracked

totalObservations
readonly totalObservations: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:296

Total voting observations recorded

trackedPairs
readonly trackedPairs: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:294

Total agent pairs with correlation data


HigherOrderVotingConfig

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:185

Configuration for higher-order voting. Correlation aggregates are lifetime evidence; retained records are count-bounded by maxProposals FIFO and maxObservationsPerAgent, and active history is partitioned by each role’s pinned model. The legacy correlation lifetime keys are deprecated and ignored.

Properties

correlationMaxAgeMs
readonly correlationMaxAgeMs: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:193

Deprecated

Ignored since 8.x: correlation evidence is lifetime and partitioned by the role’s pinned model (#5555); nothing reads this value. Removed in the next major (#5564).

correlationThreshold
readonly correlationThreshold: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:189

Correlation threshold to consider agents correlated (default: 0.3)

fallbackToSimpleVoting
readonly fallbackToSimpleVoting: boolean;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:197

Whether to fall back to simple voting when correlation data insufficient

independenceThreshold
readonly independenceThreshold: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:195

Independence threshold for ISP grouping (default: 0.2)

maxObservationsPerAgent
readonly maxObservationsPerAgent: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:203

Maximum observations to store per agent before FIFO eviction (default: 1000)

maxProposals
readonly maxProposals: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:205

Maximum total proposals to track before evicting oldest (default: 5000)

maxTrackedPairs
readonly maxTrackedPairs: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:207

Maximum pairwise history entries before LRU eviction (default: 100)

minObservationsForCorrelation
readonly minObservationsForCorrelation: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:187

Minimum observations before using correlation data (default: 10)

observationDecayFactor
readonly observationDecayFactor: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:201

Deprecated

Ignored since 8.x: correlation evidence is lifetime and partitioned by the role’s pinned model (#5555); nothing reads this value. Removed in the next major (#5564).


HigherOrderVotingResult

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:247

Result of Bayesian aggregation with correlation awareness.

Properties

decision
readonly decision: "approve" | "reject" | "no_consensus";

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:249

Final decision

downweightedAgents
readonly downweightedAgents: readonly string[];

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:265

Agents whose votes were down-weighted due to correlation

effectiveVoteCount
readonly effectiveVoteCount: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:255

Effective number of independent votes

improvementOverBaseline
readonly improvementOverBaseline: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:261

Improvement over baseline majority voting (percentage points)

independentSubsets?
readonly optional independentSubsets?: readonly IndependentSubset[];

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:263

Independent subsets used (if ISP method)

method
readonly method: "simple" | "ow" | "isp";

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:259

Method used: ‘ow’ (opinion-wise), ‘isp’, or ‘simple’ (fallback)

posteriorApproval
readonly posteriorApproval: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:251

Posterior probability of approval

posteriorRejection
readonly posteriorRejection: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:253

Posterior probability of rejection

reasoning
readonly reasoning: string;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:267

Reasoning for the decision

usedCorrelationData
readonly usedCorrelationData: boolean;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:257

Whether correlation data was sufficient


IConsensusEngine

Defined in: packages/nexus-agents/src/consensus/engine.ts:67

Interface for the consensus engine.

Methods

close()
close(proposalId): Promise<Result<ConsensusResult, ConsensusError>>;

Defined in: packages/nexus-agents/src/consensus/engine.ts:71

Parameters
proposalId

string

Returns

Promise<Result<ConsensusResult, ConsensusError>>

getMetrics()
getMetrics(): ConsensusMetrics;

Defined in: packages/nexus-agents/src/consensus/engine.ts:72

Returns

ConsensusMetrics

getResult()
getResult(proposalId): Promise<Result<ConsensusResult, ConsensusError>>;

Defined in: packages/nexus-agents/src/consensus/engine.ts:70

Parameters
proposalId

string

Returns

Promise<Result<ConsensusResult, ConsensusError>>

propose()
propose(proposal): Promise<Result<string, ConsensusError>>;

Defined in: packages/nexus-agents/src/consensus/engine.ts:68

Parameters
proposal
algorithm

| "simple_majority" | "supermajority" | "unanimous" | "higher_order" | "opinion_wise" | "proof_of_learning" = ConsensusAlgorithmSchema

createdAt?

string = ...

description

string = ...

id?

string = ...

metadata?

Record<string, unknown> = ...

requiredVoters?

string[] = ...

timeout?

number = ...

title

string = ...

Returns

Promise<Result<string, ConsensusError>>

vote()
vote(
   proposalId, 
   agentId, 
   vote
): Promise<Result<void, ConsensusError>>;

Defined in: packages/nexus-agents/src/consensus/engine.ts:69

Parameters
proposalId

string

agentId

string

vote
conditions?

string[] = ...

confidence

number = ...

decision

"approve" | "reject" | "abstain" = VoteDecisionSchema

findings?

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

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

reasoning

string = ...

rejectionCategories?

( | "YAGNI" | "DRY_VIOLATION" | "OVER_ENGINEERING" | "SCOPE_CREEP" | "SECURITY_RISK" | "MISALIGNED" | "INSUFFICIENT_EVIDENCE")[] = ...

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

selectedOption?

string = ...

Which declared option this voter chose, when the proposal declared options (#4472). Absent when the proposal declared none, or when the voter’s selection matched no declared option — an unmatched selection is recorded as absent, never coerced onto a default.

timestamp?

string = ...

Returns

Promise<Result<void, ConsensusError>>


ICorrelationTracker

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:317

Interface for correlation tracking between agents.

Methods

clear()
clear(): void;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:370

Clear all recorded data.

Returns

void

computeCorrelationMatrix()
computeCorrelationMatrix(): CorrelationMatrix;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:344

Compute the full correlation matrix for all tracked agents.

Returns

CorrelationMatrix

getCorrelation()
getCorrelation(agentA, agentB): number | undefined;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:350

Get correlation between two specific agents. Returns undefined if insufficient data.

Parameters
agentA

string

agentB

string

Returns

number | undefined

getStats()
getStats(): CorrelationTrackerStats;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:365

Get statistics about the correlation tracker.

Returns

CorrelationTrackerStats

hasSufficientData()
hasSufficientData(agentIds): boolean;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:360

Check if there is sufficient correlation data for a set of agents.

Parameters
agentIds

readonly string[]

Returns

boolean

identifyIndependentSubsets()
identifyIndependentSubsets(): readonly IndependentSubset[];

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:355

Identify groups of agents that vote independently.

Returns

readonly IndependentSubset[]

recordProposalVotes()
recordProposalVotes(
   proposalId, 
   votes, 
   outcome, 
   context?
): void;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:334

Record votes from multiple agents for the same proposal.

Parameters
proposalId

string

votes

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

outcome

"rejected" | "approved"

context?

CorrelationRecordContext

Returns

void

recordVote()
recordVote(
   agentId, 
   vote, 
   outcome, 
   context?
): void;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:324

Record a vote and its outcome for correlation tracking.

Parameters
agentId

string

vote
conditions?

string[] = ...

confidence

number = ...

decision

"approve" | "reject" | "abstain" = VoteDecisionSchema

findings?

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

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

reasoning

string = ...

rejectionCategories?

( | "YAGNI" | "DRY_VIOLATION" | "OVER_ENGINEERING" | "SCOPE_CREEP" | "SECURITY_RISK" | "MISALIGNED" | "INSUFFICIENT_EVIDENCE")[] = ...

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

selectedOption?

string = ...

Which declared option this voter chose, when the proposal declared options (#4472). Absent when the proposal declared none, or when the voter’s selection matched no declared option — an unmatched selection is recorded as absent, never coerced onto a default.

timestamp?

string = ...

outcome

"rejected" | "approved"

context?

CorrelationRecordContext

Returns

void

setCurrentModelPins()?
optional setCurrentModelPins(modelPins): void;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:319

Select the active model partition for each pinned role.

Parameters
modelPins

ReadonlyMap<string, string>

Returns

void


IHigherOrderVoting

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:380

Interface for Opinion-Wise higher-order voting.

Methods

aggregate()
aggregate(votes, tracker?): HigherOrderVotingResult;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:410

Full pipeline: estimate correlation, compute result.

tracker is OPTIONAL (#3173): when omitted, the instance uses the tracker injected at construction (OWVotingOptions.tracker), letting higher-order voting be reused as a building block without threading the tracker through every call. A per-call tracker still wins. Throws if neither is available.

Parameters
votes

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

tracker?

ICorrelationTracker

Returns

HigherOrderVotingResult

aggregateWithCorrelation()
aggregateWithCorrelation(votes, correlationMatrix): HigherOrderVotingResult;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:384

Aggregate votes using Bayesian correlation-aware method.

Parameters
votes

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

correlationMatrix

CorrelationMatrix

Returns

HigherOrderVotingResult

computeISP()
computeISP(votes, independentSubsets): HigherOrderVotingResult;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:397

Compute result using Independent Subset Partition method.

Parameters
votes

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

independentSubsets

readonly IndependentSubset[]

Returns

HigherOrderVotingResult

estimateCorrelation()
estimateCorrelation(tracker): CorrelationMatrix;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:392

Estimate correlation matrix from voting history.

Parameters
tracker

ICorrelationTracker

Returns

CorrelationMatrix

getConfig()
getConfig(): HigherOrderVotingConfig;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:418

Get the current configuration.

Returns

HigherOrderVotingConfig


IndependentSubset

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:63

A subset of agents that vote independently of each other. Used in ISP (Independent Subset Partition) method.

Properties

agentIds
readonly agentIds: readonly string[];

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:67

Agent IDs in this independent subset

id
readonly id: string;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:65

Unique identifier for this subset

independenceScore
readonly independenceScore: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:76

Average internal independence score (lower = more independent).

Averaged over the pairs that HAVE a correlation, so read it together with pairCoverage: a subset whose pairs were measured at 0 and one whose pairs were never observed both score 0, and 0 is the score that earns the maximum posterior weight.

observationCount
readonly observationCount: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:88

Number of observations supporting this grouping

pairCoverage
readonly pairCoverage: {
  observed: number;
  total: number;
};

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:86

How many of the subset’s agent pairs actually had a correlation, out of how many exist.

observed < total means independenceScore is an average over a subset of the pairs — the unobserved ones contributed nothing rather than being represented as unknown. A singleton has total: 0: there is no pair to observe, so its score is not a measurement at all.

observed
readonly observed: number;
total
readonly total: number;

IVotingProtocol

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:182

Interface for the multi-round voting protocol. (Source: Issue #100, arXiv:2512.21352)

Methods

createSession()
createSession(
   topic, 
   committee, 
   config?
): VotingSession;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:184

Create a new voting session with a committee

Parameters
topic

string

committee

string[]

config?

Partial<VotingProtocolConfig>

Returns

VotingSession

detectSycophancy()
detectSycophancy(sessionId): SycophancyReport;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:212

Check for sycophancy in the current round

Parameters
sessionId

string

Returns

SycophancyReport

getResult()
getResult(sessionId): Promise<VotingProtocolResult | null>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:209

Get the final result (closes session if complete)

Parameters
sessionId

string

Returns

Promise<VotingProtocolResult | null>

getSession()
getSession(sessionId): VotingSession | undefined;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:215

Get the current session state

Parameters
sessionId

string

Returns

VotingSession | undefined

startAnalysisRound()
startAnalysisRound(sessionId): Promise<VotingRound>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:191

Start the analysis round (Round 1)

Parameters
sessionId

string

Returns

Promise<VotingRound>

startConsensusRound()
startConsensusRound(sessionId): Promise<VotingRound>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:203

Start the consensus round (Round 3)

Parameters
sessionId

string

Returns

Promise<VotingRound>

startDeliberationRound()
startDeliberationRound(sessionId): Promise<VotingRound>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:197

Start the deliberation round (Round 2)

Parameters
sessionId

string

Returns

Promise<VotingRound>

submitFinalVote()
submitFinalVote(
   sessionId, 
   agentId, 
   vote
): Promise<void>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:206

Submit final vote during consensus

Parameters
sessionId

string

agentId

string

vote
conditions?

string[] = ...

confidence

number = ...

decision

"approve" | "reject" | "abstain" = VoteDecisionSchema

findings?

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

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

reasoning

string = ...

rejectionCategories?

( | "YAGNI" | "DRY_VIOLATION" | "OVER_ENGINEERING" | "SCOPE_CREEP" | "SECURITY_RISK" | "MISALIGNED" | "INSUFFICIENT_EVIDENCE")[] = ...

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

selectedOption?

string = ...

Which declared option this voter chose, when the proposal declared options (#4472). Absent when the proposal declared none, or when the voter’s selection matched no declared option — an unmatched selection is recorded as absent, never coerced onto a default.

timestamp?

string = ...

Returns

Promise<void>

submitFindings()
submitFindings(
   sessionId, 
   agentId, 
   findings
): Promise<void>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:194

Submit findings from an agent during analysis

Parameters
sessionId

string

agentId

string

findings

{ agentId: string; category: | "security" | "documentation" | "performance" | "design" | "other" | "bug" | "style"; confidence: number; description: string; location?: string; severity: "critical" | "major" | "minor" | "suggestion"; suggestion?: string; timestamp?: string; }[]

Returns

Promise<void>

voteOnFinding()
voteOnFinding(sessionId, vote): Promise<void>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:200

Vote on findings during deliberation

Parameters
sessionId

string

vote
agentId

string = ...

agree

boolean = ...

amendedSeverity?

"critical" | "major" | "minor" | "suggestion" = ...

findingId

string = ...

reasoning?

string = ...

Returns

Promise<void>


IVotingStrategy

Defined in: packages/nexus-agents/src/consensus/strategies.ts:24

Interface for voting strategy implementations.

Properties

algorithm
readonly algorithm: 
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "higher_order"
  | "opinion_wise"
  | "proof_of_learning";

Defined in: packages/nexus-agents/src/consensus/strategies.ts:25

Methods

calculateOutcome()
calculateOutcome(votes, weights?): VotingOutcome;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:26

Parameters
votes

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

weights?

Map<string, number>

Returns

VotingOutcome


IWeightedVoting

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:115

Interface for weighted Byzantine voting. (Source: Issue #103, arXiv:2511.10400 - CP-WBFT)

Methods

calculateWeight()
calculateWeight(agentId): number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:117

Calculate vote weight for an agent

Parameters
agentId

string

Returns

number

canVote()
canVote(agentId): boolean;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:138

Check if agent can vote

Parameters
agentId

string

Returns

boolean

flagByzantine()
flagByzantine(agentId, reason): void;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:132

Flag agent for Byzantine behavior

Parameters
agentId

string

reason

string

Returns

void

getAgentRecord()
getAgentRecord(agentId): WeightedAgentRecord | undefined;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:129

Get agent performance record

Parameters
agentId

string

Returns

WeightedAgentRecord | undefined

getAllRecords()
getAllRecords(): readonly WeightedAgentRecord[];

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:135

Get all agent records

Returns

readonly WeightedAgentRecord[]

recalibrateWeights()
recalibrateWeights(): void;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:141

Recalibrate all weights based on global performance

Returns

void

registerAgent()
registerAgent(agentId): void;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:126

Register a new agent

Parameters
agentId

string

Returns

void

updatePerformance()
updatePerformance(agentId, outcome): void;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:120

Update agent performance based on task outcome

Parameters
agentId

string

outcome

"unknown" | "success" | "failure" | "partial"

Returns

void

weightedConsensus()
weightedConsensus(votes): WeightedConsensusResult;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:123

Run weighted consensus on votes

Parameters
votes

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

Returns

WeightedConsensusResult


OWVotingOptions

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:48

Options for creating OWVoting instance.

Properties

algorithm?
readonly optional algorithm?: 
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "higher_order"
  | "opinion_wise"
  | "proof_of_learning";

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:55

Algorithm label this instance reports (#3168). Defaults to simple_majority for backward compatibility; HigherOrderVotingStrategy sets opinion_wise. Keeps the label consistent whether constructed directly or via a factory.

config?
readonly optional config?: Partial<HigherOrderVotingConfig>;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:49

tracker?
readonly optional tracker?: ICorrelationTracker;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:64

Correlation tracker this instance uses when OWVoting.aggregate is called WITHOUT a per-call tracker (#3173). Injecting here lets higher-order voting be reused as a building block (autonomous agents, test harnesses, custom pipelines) without coupling to the MCP tool’s process-wide singleton or threading the tracker through every call. Omit it to keep the singleton model — the MCP consensus path injects/passes its persistent tracker.


PairwiseVotingHistory

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:150

Aggregated voting history for a pair of agents.

Properties

agreements
readonly agreements: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:156

Number of times both agents agreed

correlation
readonly correlation: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:160

Computed correlation coefficient

disagreements
readonly disagreements: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:158

Number of times agents disagreed

jointObservations
readonly jointObservations: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:154

Number of proposals where both agents voted

lastUpdated
readonly lastUpdated: Date;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:162

Last update timestamp

pairKey
readonly pairKey: `${string}:${string}`;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:152

Agent pair key


ProposalState

Defined in: packages/nexus-agents/src/consensus/types-core.ts:363

Internal proposal state managed by the engine.

Properties

expansionInFlight?
optional expansionInFlight?: boolean;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:378

True while a quorum expansion is awaiting its callback for this proposal. Concurrent vote() calls check this to avoid double- expanding across the await gap (Issue #2861). Per-proposal so independent proposals never block each other.

expansionRounds?
optional expansionRounds?: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:371

Number of incremental quorum expansions applied (Issue #1408).

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

Defined in: packages/nexus-agents/src/consensus/types-core.ts:364

algorithm
algorithm: 
  | "simple_majority"
  | "supermajority"
  | "unanimous"
  | "higher_order"
  | "opinion_wise"
  | "proof_of_learning" = ConsensusAlgorithmSchema;
createdAt?
optional createdAt?: string;
description
description: string;
id?
optional id?: string;
metadata?
optional metadata?: Record<string, unknown>;
requiredVoters?
optional requiredVoters?: string[];
timeout?
optional timeout?: number;
title
title: string;
startedAt
startedAt: Date;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:368

status
status: "timeout" | "closed" | "rejected" | "pending" | "voting" | "approved";

Defined in: packages/nexus-agents/src/consensus/types-core.ts:365

timeoutId?
optional timeoutId?: Timeout;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:369

votes
votes: Map<string, {
  conditions?: string[];
  confidence: number;
  decision: "approve" | "reject" | "abstain";
  findings?: {
     claim: string;
     gate: {
        named_assertion: string;
        reread_cited_line: "failed" | "skipped" | "passed";
        ruled_out_language_non_issue: "failed" | "skipped" | "passed";
        traced_call_path: "failed" | "skipped" | "passed";
     };
     location: string;
     severity: "critical" | "high" | "low" | "medium";
     summary: string;
  }[];
  reasoning: string;
  rejectionCategories?: (
     | "YAGNI"
     | "DRY_VIOLATION"
     | "OVER_ENGINEERING"
     | "SCOPE_CREEP"
     | "SECURITY_RISK"
     | "MISALIGNED"
    | "INSUFFICIENT_EVIDENCE")[];
  selectedOption?: string;
  timestamp?: string;
}>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:366

voteWeights
voteWeights: Map<string, number>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:367


RoundSummary

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:169

Summary of a single round.

Properties

agreementScore
agreementScore: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:174

durationMs
durationMs: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:175

findingsCount
findingsCount: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:172

phase
phase: "analysis" | "consensus" | "deliberation";

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:171

roundNumber
roundNumber: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:170

votesCount
votesCount: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:173


SycophancyIndicator

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:232

Individual sycophancy indicator.

Properties

agents
agents: string[];

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:236

description
description: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:234

severity
severity: "high" | "low" | "medium";

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:235

type
type: 
  | "premature_consensus"
  | "opinion_convergence"
  | "confidence_inflation"
  | "echo_chamber";

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:233


SycophancyReport

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:221

Report from sycophancy detection.

Properties

affectedAgents
affectedAgents: string[];

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:225

confidenceScore
confidenceScore: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:223

detected
detected: boolean;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:222

indicators
indicators: SycophancyIndicator[];

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:224

recommendation
recommendation: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:226


VoteCounts

Defined in: packages/nexus-agents/src/consensus/types-core.ts:139

Vote counts summary.

Properties

abstain
abstain: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:142

approve
approve: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:140

reject
reject: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:141

total
total: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:143


VotingObservation

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:109

Record of a single voting observation for correlation tracking.

Properties

agentId
readonly agentId: string;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:113

Agent who cast the vote

alignedWithOutcome
readonly alignedWithOutcome: boolean;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:119

Whether the vote aligned with the final outcome

confidence
readonly confidence: number;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:117

Confidence level (0-1)

decision
readonly decision: "approve" | "reject" | "abstain";

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:115

The vote decision

modelKey?
readonly optional modelKey?: string;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:123

Pinned model identity used to select the correlation partition.

observedModel?
readonly optional observedModel?: string;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:125

Model that actually answered, retained for provenance only.

proposalId
readonly proposalId: string;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:111

Unique proposal ID

timestamp
readonly timestamp: Date;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:121

Timestamp of the vote


VotingOutcome

Defined in: packages/nexus-agents/src/consensus/strategies.ts:32

Result of a voting strategy calculation.

Properties

approvalPercentage
approvalPercentage: number;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:34

approved
approved: boolean;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:33

reason
reason: string;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:44

voteCounts
voteCounts: VoteCounts;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:35

weightBasis?
optional weightBasis?: WeightBasis;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:43

Present on weighted strategies only. Absent means the strategy does not weight at all (simple majority, supermajority, unanimous) — which is different from 'unweighted', meaning a weighted strategy ran with nothing to weight by.

weightedCounts?
optional weightedCounts?: WeightedVoteCounts;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:36


VotingProtocolConfig

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:86

Configuration for the voting protocol.

Properties

agreementThreshold
agreementThreshold: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:94

Minimum agreement threshold (default: 2/3, approximately 0.667)

committeeSize
committeeSize: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:88

Number of agents in the committee (default: 3)

enableAntiSycophancy
enableAntiSycophancy: boolean;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:96

Enable anti-sycophancy detection (default: true)

maxRounds
maxRounds: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:90

Maximum rounds before forcing decision (default: 3)

roundTimeoutMs
roundTimeoutMs: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:92

Timeout per round in milliseconds (default: multi-llm-panel guard, 900000)

sycophancyThreshold
sycophancyThreshold: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:98

Similarity threshold for sycophancy detection (default: 0.8)


VotingProtocolResult

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:139

Final result of a voting protocol session.

Properties

agreementScore
agreementScore: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:145

consolidatedFindings
consolidatedFindings: ConsolidatedFinding[];

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:143

outcome
outcome: "rejected" | "approved" | "needs_revision" | "no_consensus";

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:142

participatingAgents
participatingAgents: string[];

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:148

roundSummaries
roundSummaries: RoundSummary[];

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:144

sessionId
sessionId: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:140

sycophancyDetected
sycophancyDetected: boolean;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:146

topic
topic: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:141

totalDurationMs
totalDurationMs: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:147


VotingRound

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:71

A single voting round in the protocol.

Properties

completedAt?
optional completedAt?: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:79

finalVotes
finalVotes: Map<string, {
  conditions?: string[];
  confidence: number;
  decision: "approve" | "reject" | "abstain";
  findings?: {
     claim: string;
     gate: {
        named_assertion: string;
        reread_cited_line: "failed" | "skipped" | "passed";
        ruled_out_language_non_issue: "failed" | "skipped" | "passed";
        traced_call_path: "failed" | "skipped" | "passed";
     };
     location: string;
     severity: "critical" | "high" | "low" | "medium";
     summary: string;
  }[];
  reasoning: string;
  rejectionCategories?: (
     | "YAGNI"
     | "DRY_VIOLATION"
     | "OVER_ENGINEERING"
     | "SCOPE_CREEP"
     | "SECURITY_RISK"
     | "MISALIGNED"
    | "INSUFFICIENT_EVIDENCE")[];
  selectedOption?: string;
  timestamp?: string;
}>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:77

findings
findings: Map<string, {
  agentId: string;
  category:   | "security"
     | "documentation"
     | "performance"
     | "design"
     | "other"
     | "bug"
     | "style";
  confidence: number;
  description: string;
  location?: string;
  severity: "critical" | "major" | "minor" | "suggestion";
  suggestion?: string;
  timestamp?: string;
}>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:75

findingVotes
findingVotes: Map<string, {
  agentId: string;
  agree: boolean;
  amendedSeverity?: "critical" | "major" | "minor" | "suggestion";
  findingId: string;
  reasoning?: string;
}[]>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:76

id
id: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:72

phase
phase: "analysis" | "consensus" | "deliberation";

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:73

roundNumber
roundNumber: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:80

startedAt
startedAt: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:78

status
status: "aborted" | "completed" | "pending" | "in_progress" | "awaiting_votes";

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:74


VotingSession

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:123

Session state for a voting protocol instance.

Properties

committee
committee: string[];

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:126

completedAt?
optional completedAt?: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:132

config
config: VotingProtocolConfig;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:129

createdAt
createdAt: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:131

currentRound
currentRound: number;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:128

finalResult?
optional finalResult?: VotingProtocolResult;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:133

id
id: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:124

rounds
rounds: VotingRound[];

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:127

status
status: "aborted" | "completed" | "active";

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:130

topic
topic: string;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:125


WeightedAgentRecord

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:24

Extended agent performance with Byzantine detection.

Properties

agentId
readonly agentId: string;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:25

byzantineFlags
readonly byzantineFlags: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:33

createdAt
readonly createdAt: Date;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:35

failedTasks
readonly failedTasks: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:28

lastActive
readonly lastActive: Date;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:34

partialTasks
readonly partialTasks: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:29

successfulTasks
readonly successfulTasks: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:27

successRate
readonly successRate: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:30

totalTasks
readonly totalTasks: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:26

trustScore
readonly trustScore: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:32

weight
readonly weight: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:31


WeightedConsensusResult

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:55

Weighted consensus result.

Properties

byzantineDetected
readonly byzantineDetected: boolean;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:61

decision
readonly decision: "approve" | "reject" | "no_consensus";

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:56

participatingAgents
readonly participatingAgents: readonly string[];

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:62

quorumReached
readonly quorumReached: boolean;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:60

totalWeight
readonly totalWeight: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:59

weightBreakdown
readonly weightBreakdown: ReadonlyMap<string, number>;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:63

weightedApproval
readonly weightedApproval: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:57

weightedRejection
readonly weightedRejection: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:58


WeightedVoteCounts

Defined in: packages/nexus-agents/src/consensus/types-core.ts:170

Consensus exports - Voting protocols, consensus engine, and strategies Split from index.ts for file size compliance (Issue #285) Added to public API per Issue #351

NOTE: VoteDecision and VoteDecisionSchema are exported from agents.ts (collaboration module) NOTE: TaskOutcome and TaskOutcomeSchema are exported from learning.ts These are intentionally omitted to avoid duplicate export errors.

Properties

abstain
abstain: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:173

approve
approve: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:171

reject
reject: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:172

totalWeight
totalWeight: number;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:174


WeightedVotingConfig

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:69

Configuration for weighted Byzantine voting.

Properties

byzantineFlagThreshold
readonly byzantineFlagThreshold: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:81

Byzantine flag threshold for exclusion (default: 3)

initialWeight
readonly initialWeight: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:83

Initial weight for new agents (default: 0.5)

maxByzantineFraction
readonly maxByzantineFraction: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:73

Maximum Byzantine fault tolerance (default: 0.33)

minTrustScore
readonly minTrustScore: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:79

Trust score required to vote (default: 0.3)

minWeight
readonly minWeight: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:71

Minimum weight to participate in voting (default: 0.1)

quorumThreshold
readonly quorumThreshold: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:85

Quorum threshold for valid consensus (default: 2/3, approximately 0.667)

weightDecayFactor
readonly weightDecayFactor: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:75

Weight decay factor per failed task (default: 0.9)

weightRecoveryFactor
readonly weightRecoveryFactor: number;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:77

Weight recovery factor per successful task (default: 1.05)


WeightedVotingOptions

Defined in: packages/nexus-agents/src/consensus/weighted-voting-helpers.ts:36

Options for WeightedVoting constructor.

Properties

config?
optional config?: Partial<WeightedVotingConfig>;

Defined in: packages/nexus-agents/src/consensus/weighted-voting-helpers.ts:38

Configuration for voting thresholds and weights.

emitEvents?
optional emitEvents?: boolean;

Defined in: packages/nexus-agents/src/consensus/weighted-voting-helpers.ts:42

Whether to emit Byzantine detection events (default: true if eventBus provided).

eventBus?
optional eventBus?: ICollaborationEventBus;

Defined in: packages/nexus-agents/src/consensus/weighted-voting-helpers.ts:40

Optional event bus for Byzantine detection events (Issue #218).

Type Aliases

AgentFinding

type AgentFinding = z.infer<typeof AgentFindingSchema>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:54

Consensus exports - Voting protocols, consensus engine, and strategies Split from index.ts for file size compliance (Issue #285) Added to public API per Issue #351

NOTE: VoteDecision and VoteDecisionSchema are exported from agents.ts (collaboration module) NOTE: TaskOutcome and TaskOutcomeSchema are exported from learning.ts These are intentionally omitted to avoid duplicate export errors.


AgentPairKey

type AgentPairKey = `${string}:${string}`;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:25

Pair of agent IDs for correlation tracking. Stored as “agentA:agentB” where agentA < agentB lexicographically.


ConsensusAlgorithm

type ConsensusAlgorithm = z.infer<typeof ConsensusAlgorithmSchema>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:28

Consensus exports - Voting protocols, consensus engine, and strategies Split from index.ts for file size compliance (Issue #285) Added to public API per Issue #351

NOTE: VoteDecision and VoteDecisionSchema are exported from agents.ts (collaboration module) NOTE: TaskOutcome and TaskOutcomeSchema are exported from learning.ts These are intentionally omitted to avoid duplicate export errors.


CorrelationCoefficient

type CorrelationCoefficient = z.infer<typeof CorrelationCoefficientSchema>;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:52


CorrelationMatrix

type CorrelationMatrix = Map<AgentPairKey, CorrelationCoefficient>;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:57

Correlation matrix storing pairwise correlations between agents.


FindingVote

type FindingVote = z.infer<typeof FindingVoteSchema>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:66

Consensus exports - Voting protocols, consensus engine, and strategies Split from index.ts for file size compliance (Issue #285) Added to public API per Issue #351

NOTE: VoteDecision and VoteDecisionSchema are exported from agents.ts (collaboration module) NOTE: TaskOutcome and TaskOutcomeSchema are exported from learning.ts These are intentionally omitted to avoid duplicate export errors.


Proposal

type Proposal = z.infer<typeof ProposalSchema>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:129

Consensus exports - Voting protocols, consensus engine, and strategies Split from index.ts for file size compliance (Issue #285) Added to public API per Issue #351

NOTE: VoteDecision and VoteDecisionSchema are exported from agents.ts (collaboration module) NOTE: TaskOutcome and TaskOutcomeSchema are exported from learning.ts These are intentionally omitted to avoid duplicate export errors.


ProposalId

type ProposalId = string;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:134

Unique identifier for a proposal.


ProposalStatus

type ProposalStatus = z.infer<typeof ProposalStatusSchema>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:47

Consensus exports - Voting protocols, consensus engine, and strategies Split from index.ts for file size compliance (Issue #285) Added to public API per Issue #351

NOTE: VoteDecision and VoteDecisionSchema are exported from agents.ts (collaboration module) NOTE: TaskOutcome and TaskOutcomeSchema are exported from learning.ts These are intentionally omitted to avoid duplicate export errors.


RejectionCategory

type RejectionCategory = z.infer<typeof RejectionCategorySchema>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:62

Consensus exports - Voting protocols, consensus engine, and strategies Split from index.ts for file size compliance (Issue #285) Added to public API per Issue #351

NOTE: VoteDecision and VoteDecisionSchema are exported from agents.ts (collaboration module) NOTE: TaskOutcome and TaskOutcomeSchema are exported from learning.ts These are intentionally omitted to avoid duplicate export errors.


Vote

type Vote = z.infer<typeof VoteSchema>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:114

Consensus exports - Voting protocols, consensus engine, and strategies Split from index.ts for file size compliance (Issue #285) Added to public API per Issue #351

NOTE: VoteDecision and VoteDecisionSchema are exported from agents.ts (collaboration module) NOTE: TaskOutcome and TaskOutcomeSchema are exported from learning.ts These are intentionally omitted to avoid duplicate export errors.


VotingRoundPhase

type VotingRoundPhase = z.infer<typeof VotingRoundPhaseSchema>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:27

Consensus exports - Voting protocols, consensus engine, and strategies Split from index.ts for file size compliance (Issue #285) Added to public API per Issue #351

NOTE: VoteDecision and VoteDecisionSchema are exported from agents.ts (collaboration module) NOTE: TaskOutcome and TaskOutcomeSchema are exported from learning.ts These are intentionally omitted to avoid duplicate export errors.


VotingRoundStatus

type VotingRoundStatus = z.infer<typeof VotingRoundStatusSchema>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:39

Consensus exports - Voting protocols, consensus engine, and strategies Split from index.ts for file size compliance (Issue #285) Added to public API per Issue #351

NOTE: VoteDecision and VoteDecisionSchema are exported from agents.ts (collaboration module) NOTE: TaskOutcome and TaskOutcomeSchema are exported from learning.ts These are intentionally omitted to avoid duplicate export errors.

Variables

AgentFindingSchema

const AgentFindingSchema: ZodObject<{
  agentId: ZodString;
  category: ZodEnum<{
     bug: "bug";
     design: "design";
     documentation: "documentation";
     other: "other";
     performance: "performance";
     security: "security";
     style: "style";
  }>;
  confidence: ZodNumber;
  description: ZodString;
  location: ZodOptional<ZodString>;
  severity: ZodEnum<{
     critical: "critical";
     major: "major";
     minor: "minor";
     suggestion: "suggestion";
  }>;
  suggestion: ZodOptional<ZodString>;
  timestamp: ZodOptional<ZodISODateTime>;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:44

A finding submitted by an agent during analysis.


AgentPerformanceSchema

const AgentPerformanceSchema: ZodObject<{
  agentId: ZodString;
  correctVotes: ZodNumber;
  lastUpdated: ZodISODateTime;
  successRate: ZodNumber;
  totalVotes: ZodNumber;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:246

Agent performance schema.


ConsensusAlgorithmSchema

const ConsensusAlgorithmSchema: ZodEnum<{
  higher_order: "higher_order";
  opinion_wise: "opinion_wise";
  proof_of_learning: "proof_of_learning";
  simple_majority: "simple_majority";
  supermajority: "supermajority";
  unanimous: "unanimous";
}>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:20

Consensus algorithm types.

  • simple_majority: >50% of votes required
  • supermajority: >=67% of votes required
  • unanimous: 100% approval required
  • proof_of_learning: weighted voting based on agent performance
  • opinion_wise: higher-order voting with correlation awareness (Issue #333)
  • higher_order: alias for opinion_wise (Issue #514)

ConsensusEngineConfigSchema

const ConsensusEngineConfigSchema: ZodObject<{
  defaultTimeout: ZodDefault<ZodNumber>;
  enablePerformanceTracking: ZodDefault<ZodBoolean>;
  maxActiveProposals: ZodDefault<ZodNumber>;
  maxClosedProposals: ZodDefault<ZodNumber>;
  minVotersForQuorum: ZodDefault<ZodNumber>;
  proposalCache: ZodOptional<ZodObject<{
     enabled: ZodDefault<ZodBoolean>;
     maxEntries: ZodDefault<ZodNumber>;
     ttlMs: ZodDefault<ZodNumber>;
  }, $strip>>;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:332

Consensus engine configuration schema.


ConsensusMetricsSchema

const ConsensusMetricsSchema: ZodObject<{
  algorithmUsage: ZodRecord<ZodEnum<{
     higher_order: "higher_order";
     opinion_wise: "opinion_wise";
     proof_of_learning: "proof_of_learning";
     simple_majority: "simple_majority";
     supermajority: "supermajority";
     unanimous: "unanimous";
  }>, ZodNumber>;
  approvedProposals: ZodNumber;
  averageDurationMs: ZodNumber;
  averageVotesPerProposal: ZodNumber;
  rejectedProposals: ZodNumber;
  timedOutProposals: ZodNumber;
  totalProposals: ZodNumber;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:397

Consensus metrics schema.


ConsensusResultSchema

const ConsensusResultSchema: ZodObject<{
  approvalPercentage: ZodNumber;
  closedAt: ZodISODateTime;
  durationMs: ZodNumber;
  outcome: ZodEnum<{
     approved: "approved";
     closed: "closed";
     pending: "pending";
     rejected: "rejected";
     timeout: "timeout";
     voting: "voting";
  }>;
  proposal: ZodObject<{
     algorithm: ZodEnum<{
        higher_order: "higher_order";
        opinion_wise: "opinion_wise";
        proof_of_learning: "proof_of_learning";
        simple_majority: "simple_majority";
        supermajority: "supermajority";
        unanimous: "unanimous";
     }>;
     createdAt: ZodOptional<ZodISODateTime>;
     description: ZodString;
     id: ZodOptional<ZodString>;
     metadata: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
     requiredVoters: ZodOptional<ZodArray<ZodString>>;
     timeout: ZodOptional<ZodNumber>;
     title: ZodString;
  }, $strip>;
  proposalId: ZodString;
  quorumReached: ZodBoolean;
  startedAt: ZodISODateTime;
  voteCounts: ZodObject<{
     abstain: ZodNumber;
     approve: ZodNumber;
     reject: ZodNumber;
     total: ZodNumber;
  }, $strip>;
  votes: ZodMap<ZodString, ZodObject<{
     conditions: ZodOptional<ZodArray<ZodString>>;
     confidence: ZodNumber;
     decision: ZodEnum<{
        abstain: "abstain";
        approve: "approve";
        reject: "reject";
     }>;
     findings: ZodOptional<ZodArray<ZodObject<{
        claim: ZodString;
        gate: ZodObject<{
           named_assertion: ...;
           reread_cited_line: ...;
           ruled_out_language_non_issue: ...;
           traced_call_path: ...;
        }, $strip>;
        location: ZodString;
        severity: ZodDefault<ZodEnum<...>>;
        summary: ZodString;
     }, $strip>>>;
     reasoning: ZodString;
     rejectionCategories: ZodOptional<ZodArray<ZodEnum<{
        DRY_VIOLATION: "DRY_VIOLATION";
        INSUFFICIENT_EVIDENCE: "INSUFFICIENT_EVIDENCE";
        MISALIGNED: "MISALIGNED";
        OVER_ENGINEERING: "OVER_ENGINEERING";
        SCOPE_CREEP: "SCOPE_CREEP";
        SECURITY_RISK: "SECURITY_RISK";
        YAGNI: "YAGNI";
     }>>>;
     selectedOption: ZodOptional<ZodString>;
     timestamp: ZodOptional<ZodISODateTime>;
  }, $strip>>;
  weightedCounts: ZodOptional<ZodObject<{
     abstain: ZodNumber;
     approve: ZodNumber;
     reject: ZodNumber;
     totalWeight: ZodNumber;
  }, $strip>>;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:206

Consensus result schema for validation.


CorrelationCoefficientSchema

const CorrelationCoefficientSchema: ZodNumber;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:51

Correlation coefficient between two agents’ voting patterns. Range: -1 (perfectly anti-correlated) to +1 (perfectly correlated). 0 indicates independence.


CorrelationTrackerStatsSchema

const CorrelationTrackerStatsSchema: ZodObject<{
  averageCorrelation: ZodNumber;
  independentSubsetCount: ZodNumber;
  pairsWithSufficientData: ZodNumber;
  totalAgents: ZodNumber;
  totalObservations: ZodNumber;
  trackedPairs: ZodNumber;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:305


DEFAULT_CONSENSUS_CONFIG

const DEFAULT_CONSENSUS_CONFIG: ConsensusEngineConfig;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:344

Default configuration values.


DEFAULT_HIGHER_ORDER_CONFIG

const DEFAULT_HIGHER_ORDER_CONFIG: HigherOrderVotingConfig;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:228


DEFAULT_VOTING_PROTOCOL_CONFIG

const DEFAULT_VOTING_PROTOCOL_CONFIG: VotingProtocolConfig;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:110


DEFAULT_WEIGHTED_VOTING_CONFIG

const DEFAULT_WEIGHTED_VOTING_CONFIG: WeightedVotingConfig;

Defined in: packages/nexus-agents/src/consensus/types-weighted-voting.ts:99


FindingVoteSchema

const FindingVoteSchema: ZodObject<{
  agentId: ZodString;
  agree: ZodBoolean;
  amendedSeverity: ZodOptional<ZodEnum<{
     critical: "critical";
     major: "major";
     minor: "minor";
     suggestion: "suggestion";
  }>>;
  findingId: ZodString;
  reasoning: ZodOptional<ZodString>;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:59

Finding vote during deliberation.


HigherOrderVotingConfigSchema

const HigherOrderVotingConfigSchema: ZodObject<{
  correlationMaxAgeMs: ZodDefault<ZodNumber>;
  correlationThreshold: ZodDefault<ZodNumber>;
  fallbackToSimpleVoting: ZodDefault<ZodBoolean>;
  independenceThreshold: ZodDefault<ZodNumber>;
  maxObservationsPerAgent: ZodDefault<ZodNumber>;
  maxProposals: ZodDefault<ZodNumber>;
  maxTrackedPairs: ZodDefault<ZodNumber>;
  minObservationsForCorrelation: ZodDefault<ZodNumber>;
  observationDecayFactor: ZodDefault<ZodNumber>;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:210


HigherOrderVotingResultSchema

const HigherOrderVotingResultSchema: ZodObject<{
  decision: ZodEnum<{
     approve: "approve";
     no_consensus: "no_consensus";
     reject: "reject";
  }>;
  downweightedAgents: ZodArray<ZodString>;
  effectiveVoteCount: ZodNumber;
  improvementOverBaseline: ZodNumber;
  independentSubsets: ZodOptional<ZodArray<ZodObject<{
     agentIds: ZodArray<ZodString>;
     id: ZodString;
     independenceScore: ZodNumber;
     observationCount: ZodNumber;
     pairCoverage: ZodObject<{
        observed: ZodNumber;
        total: ZodNumber;
     }, $strip>;
  }, $strip>>>;
  method: ZodEnum<{
     isp: "isp";
     ow: "ow";
     simple: "simple";
  }>;
  posteriorApproval: ZodNumber;
  posteriorRejection: ZodNumber;
  reasoning: ZodString;
  usedCorrelationData: ZodBoolean;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:270


IndependentSubsetSchema

const IndependentSubsetSchema: ZodObject<{
  agentIds: ZodArray<ZodString>;
  id: ZodString;
  independenceScore: ZodNumber;
  observationCount: ZodNumber;
  pairCoverage: ZodObject<{
     observed: ZodNumber;
     total: ZodNumber;
  }, $strip>;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:91


PairwiseVotingHistorySchema

const PairwiseVotingHistorySchema: ZodObject<{
  agreements: ZodNumber;
  correlation: ZodNumber;
  disagreements: ZodNumber;
  jointObservations: ZodNumber;
  lastUpdated: ZodDate;
  pairKey: ZodType<`${string}:${string}`, unknown, $ZodTypeInternals<`${string}:${string}`, unknown>>;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:165


ProposalSchema

const ProposalSchema: ZodObject<{
  algorithm: ZodEnum<{
     higher_order: "higher_order";
     opinion_wise: "opinion_wise";
     proof_of_learning: "proof_of_learning";
     simple_majority: "simple_majority";
     supermajority: "supermajority";
     unanimous: "unanimous";
  }>;
  createdAt: ZodOptional<ZodISODateTime>;
  description: ZodString;
  id: ZodOptional<ZodString>;
  metadata: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
  requiredVoters: ZodOptional<ZodArray<ZodString>>;
  timeout: ZodOptional<ZodNumber>;
  title: ZodString;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:119

A proposal submitted for consensus.


ProposalStatusSchema

const ProposalStatusSchema: ZodEnum<{
  approved: "approved";
  closed: "closed";
  pending: "pending";
  rejected: "rejected";
  timeout: "timeout";
  voting: "voting";
}>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:39

Proposal status in the lifecycle.


REJECTION_CATEGORIES

const REJECTION_CATEGORIES: (
  | "YAGNI"
  | "DRY_VIOLATION"
  | "OVER_ENGINEERING"
  | "SCOPE_CREEP"
  | "SECURITY_RISK"
  | "MISALIGNED"
  | "INSUFFICIENT_EVIDENCE")[] = RejectionCategorySchema.options;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:67

All valid rejection category values, for runtime reference.


RejectionCategorySchema

const RejectionCategorySchema: ZodEnum<{
  DRY_VIOLATION: "DRY_VIOLATION";
  INSUFFICIENT_EVIDENCE: "INSUFFICIENT_EVIDENCE";
  MISALIGNED: "MISALIGNED";
  OVER_ENGINEERING: "OVER_ENGINEERING";
  SCOPE_CREEP: "SCOPE_CREEP";
  SECURITY_RISK: "SECURITY_RISK";
  YAGNI: "YAGNI";
}>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:53

Structured rejection feedback categories (Issue #1213). Enables reject→refine→re-vote feedback loops by classifying rejection reasons.


VoteSchema

const VoteSchema: ZodObject<{
  conditions: ZodOptional<ZodArray<ZodString>>;
  confidence: ZodNumber;
  decision: ZodEnum<{
     abstain: "abstain";
     approve: "approve";
     reject: "reject";
  }>;
  findings: ZodOptional<ZodArray<ZodObject<{
     claim: ZodString;
     gate: ZodObject<{
        named_assertion: ZodDefault<ZodString>;
        reread_cited_line: ZodDefault<ZodEnum<{
           failed: ...;
           passed: ...;
           skipped: ...;
        }>>;
        ruled_out_language_non_issue: ZodDefault<ZodEnum<{
           failed: ...;
           passed: ...;
           skipped: ...;
        }>>;
        traced_call_path: ZodDefault<ZodEnum<{
           failed: ...;
           passed: ...;
           skipped: ...;
        }>>;
     }, $strip>;
     location: ZodString;
     severity: ZodDefault<ZodEnum<{
        critical: "critical";
        high: "high";
        low: "low";
        medium: "medium";
     }>>;
     summary: ZodString;
  }, $strip>>>;
  reasoning: ZodString;
  rejectionCategories: ZodOptional<ZodArray<ZodEnum<{
     DRY_VIOLATION: "DRY_VIOLATION";
     INSUFFICIENT_EVIDENCE: "INSUFFICIENT_EVIDENCE";
     MISALIGNED: "MISALIGNED";
     OVER_ENGINEERING: "OVER_ENGINEERING";
     SCOPE_CREEP: "SCOPE_CREEP";
     SECURITY_RISK: "SECURITY_RISK";
     YAGNI: "YAGNI";
  }>>>;
  selectedOption: ZodOptional<ZodString>;
  timestamp: ZodOptional<ZodISODateTime>;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/types-core.ts:91

A vote cast by an agent.


VOTING_THRESHOLDS

const VOTING_THRESHOLDS: Record<ConsensusAlgorithm, number>;

Defined in: packages/nexus-agents/src/consensus/decision/thresholds.ts:29

Voting thresholds for each algorithm.


VotingObservationSchema

const VotingObservationSchema: ZodObject<{
  agentId: ZodString;
  alignedWithOutcome: ZodBoolean;
  confidence: ZodNumber;
  decision: ZodEnum<{
     abstain: "abstain";
     approve: "approve";
     reject: "reject";
  }>;
  modelKey: ZodOptional<ZodString>;
  observedModel: ZodOptional<ZodString>;
  proposalId: ZodString;
  timestamp: ZodDate;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:128


VotingProtocolConfigSchema

const VotingProtocolConfigSchema: ZodObject<{
  agreementThreshold: ZodDefault<ZodNumber>;
  committeeSize: ZodDefault<ZodNumber>;
  enableAntiSycophancy: ZodDefault<ZodBoolean>;
  maxRounds: ZodDefault<ZodNumber>;
  roundTimeoutMs: ZodDefault<ZodNumber>;
  sycophancyThreshold: ZodDefault<ZodNumber>;
}, $strip>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:101


VotingRoundPhaseSchema

const VotingRoundPhaseSchema: ZodEnum<{
  analysis: "analysis";
  consensus: "consensus";
  deliberation: "deliberation";
}>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:26

Voting round phases.

  • analysis: Independent analysis (Round 1)
  • deliberation: Share findings and discuss (Round 2)
  • consensus: Final vote on recommendations (Round 3)

VotingRoundStatusSchema

const VotingRoundStatusSchema: ZodEnum<{
  aborted: "aborted";
  awaiting_votes: "awaiting_votes";
  completed: "completed";
  in_progress: "in_progress";
  pending: "pending";
}>;

Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:32

Voting round status.

Functions

buildFinalResult()

function buildFinalResult(
   state, 
   proposalId, 
   outcome, 
   config
): ConsensusResult;

Defined in: packages/nexus-agents/src/consensus/result-builder.ts:54

Build a final result for a closed proposal.

Parameters

state

ProposalState

proposalId

string

outcome

VotingOutcome

config

ConsensusEngineConfig

Returns

ConsensusResult


buildPendingResult()

function buildPendingResult(
   state, 
   proposalId, 
   outcome, 
   config
): ConsensusResult;

Defined in: packages/nexus-agents/src/consensus/result-builder.ts:28

Build a pending result for an active proposal.

Parameters

state

ProposalState

proposalId

string

outcome

VotingOutcome

config

ConsensusEngineConfig

Returns

ConsensusResult


buildTimeoutResult()

function buildTimeoutResult(
   state, 
   proposalId, 
   outcome, 
   config
): ConsensusResult;

Defined in: packages/nexus-agents/src/consensus/result-builder.ts:83

Build a timeout result for an expired proposal.

Parameters

state

ProposalState

proposalId

string

outcome

VotingOutcome

config

ConsensusEngineConfig

Returns

ConsensusResult


calculateVoteWeight()

function calculateVoteWeight(performance): number;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:339

Calculate vote weight for an agent based on their performance history.

Weight ranges from 0.5 (never correct) to 1.0 (perfect track record). An agent with NO history returns 1.0, not 0.5 — the doc used to say “0.5 (no history)”, which the code has never done (#5117). The distinction matters: a 1.0 default is indistinguishable from a perfect record by value alone, which is why callers must not infer “was this measured?” from the number. deriveWeightBasis answers that from provenance instead.

Parameters

performance

AgentPerformance | undefined

Returns

number


collectRealVotes()

function collectRealVotes(options): Promise<readonly AgentVoteResult[]>;

Defined in: packages/nexus-agents/src/cli/voter-agents.ts:580

Parameters

options

CollectRealVotesOptions

Returns

Promise<readonly AgentVoteResult[]>


createAgentPairKey()

function createAgentPairKey(agentA, agentB): `${string}:${string}`;

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:31

Creates a canonical agent pair key for correlation lookup. Orders agents lexicographically to ensure consistent keys.

Parameters

agentA

string

agentB

string

Returns

`${string}:${string}`


createConsensusEngine()

function createConsensusEngine(config?, logger?): ConsensusEngine;

Defined in: packages/nexus-agents/src/consensus/engine.ts:721

Create a consensus engine with the given configuration.

Parameters

config?

Partial<ConsensusEngineConfig>

logger?

ILogger

Returns

ConsensusEngine

Example

const engine = createConsensusEngine({
  defaultTimeout: 60000,
  maxActiveProposals: 10,
});

createCorrelationTracker()

function createCorrelationTracker(config?): ICorrelationTracker;

Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:385

Creates a new correlation tracker instance.

Parameters

config?

Partial<HigherOrderVotingConfig>

Returns

ICorrelationTracker


createHigherOrderVotingStrategy()

function createHigherOrderVotingStrategy(options?): HigherOrderVotingStrategy;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:320

Creates a higher-order voting strategy for use with ConsensusEngine.

Parameters

options?

OWVotingOptions

Returns

HigherOrderVotingStrategy


createOWVoting()

function createOWVoting(options?): IHigherOrderVoting;

Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:303

Creates a new OWVoting instance.

Parameters

options?

OWVotingOptions

Returns

IHigherOrderVoting


createStrategyFactory()

function createStrategyFactory(): VotingStrategyFactory;

Defined in: packages/nexus-agents/src/consensus/strategies.ts:395

Creates a voting strategy factory with default strategies.

Returns

VotingStrategyFactory


createVotingProtocol()

function createVotingProtocol(customLogger?): VotingProtocol;

Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:409

Create a voting protocol instance.

Parameters

customLogger?

ILogger

Returns

VotingProtocol


createWeightedVoting()

function createWeightedVoting(options?): IWeightedVoting;

Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:360

Create a weighted voting instance.

Parameters

options?

WeightedVotingOptions

Returns

IWeightedVoting


determineFinalStatus()

function determineFinalStatus(quorumReached, approved): "timeout" | "closed" | "rejected" | "pending" | "voting" | "approved";

Defined in: packages/nexus-agents/src/consensus/decision/verdict.ts:65

Determine final status based on quorum and approval.

Parameters

quorumReached

boolean

approved

boolean

Returns

"timeout" | "closed" | "rejected" | "pending" | "voting" | "approved"


generateProposalId()

function generateProposalId(): string;

Defined in: packages/nexus-agents/src/consensus/helpers.ts:13

Generate a unique proposal ID.

Returns

string


parseAgentPairKey()

function parseAgentPairKey(key): [string, string];

Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:38

Extracts agent IDs from a pair key.

Parameters

key

`${string}:${string}`

Returns

[string, string]