consensus
Classes
ConsensusEngine
Defined in: packages/nexus-agents/src/consensus/engine.ts:141
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:153
Parameters
config?
Partial<ConsensusEngineConfig>
logger?
Returns
Methods
clearCache()
clearCache(): void;
Defined in: packages/nexus-agents/src/consensus/engine.ts:763
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:275
Parameters
proposalId
string
Returns
Promise<Result<ConsensusResult, ConsensusError>>
Implementation of
getActiveProposalCount()
getActiveProposalCount(): number;
Defined in: packages/nexus-agents/src/consensus/engine.ts:295
Returns
number
getCacheSize()
getCacheSize(): number;
Defined in: packages/nexus-agents/src/consensus/engine.ts:756
Gets the current cache size (for testing/monitoring).
Returns
number
getMetrics()
getMetrics(): ConsensusMetrics;
Defined in: packages/nexus-agents/src/consensus/engine.ts:279
Returns
Implementation of
getResult()
getResult(proposalId): Promise<Result<ConsensusResult, ConsensusError>>;
Defined in: packages/nexus-agents/src/consensus/engine.ts:262
Parameters
proposalId
string
Returns
Promise<Result<ConsensusResult, ConsensusError>>
Implementation of
propose()
propose(proposal): Promise<Result<string, ConsensusError>>;
Defined in: packages/nexus-agents/src/consensus/engine.ts:170
Parameters
proposal
algorithm
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise" = ConsensusAlgorithmSchema
artifactDigest?
string = ...
SHA-256 digest of required artifact fixture (#M1 connected autonomy).
createdAt?
string = ...
description
string = ...
id?
string = ...
metadata?
Record<string, unknown> = ...
requireArtifact?
boolean = ...
Whether artifact inspection is mandatory for eligible votes.
requiredVoters?
string[] = ...
timeout?
number = ...
title
string = ...
totalRoles?
number = ...
Total panel size for artifact inspection floor calculations (#M1).
Returns
Promise<Result<string, ConsensusError>>
Implementation of
setVoterExpansionCallback()
setVoterExpansionCallback(callback): void;
Defined in: packages/nexus-agents/src/consensus/engine.ts:166
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
vote()
vote(
proposalId,
agentId,
vote
): Promise<Result<void, ConsensusError>>;
Defined in: packages/nexus-agents/src/consensus/engine.ts:211
Parameters
proposalId
string
agentId
string
vote
artifactReadiness?
"ready" | "unverifiable" | "artifact_starved" = ...
Worker readiness status for the required artifact.
boundArtifactDigest?
string = ...
Bound SHA-256 digest of reviewed artifact (#M1 connected autonomy).
conditions?
string[] = ...
confidence
number = ...
decision
"approve" | "reject" | "abstain" = VoteDecisionSchema
findings?
{
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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
ConsensusError
Defined in: packages/nexus-agents/src/consensus/engine.ts:56
Error class for consensus-related failures.
Extends
Constructors
Constructor
new ConsensusError(message, context?): ConsensusError;
Defined in: packages/nexus-agents/src/consensus/engine.ts:57
Parameters
message
string
context?
Record<string, unknown>
Returns
Overrides
Properties
cause
readonly cause: Error | undefined;
Defined in: packages/nexus-agents/src/core/errors.ts:105
Inherited from
code
readonly code: ErrorCode;
Defined in: packages/nexus-agents/src/core/errors.ts:103
Inherited from
context
readonly context: Record<string, unknown> | undefined;
Defined in: packages/nexus-agents/src/core/errors.ts:104
Inherited from
message
message: string;
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075
Inherited from
name
name: string;
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1074
Inherited from
stack?
stack?: string;
Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stackTraceLimit
static stackTraceLimit: number;
Defined in: node_modules/.pnpm/@types+node@24.19.2/node_modules/@types/node/globals.d.ts:68
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
Methods
toJSON()
toJSON(): SerializedError;
Defined in: packages/nexus-agents/src/core/errors.ts:121
Serializes the error to a JSON-safe object.
Returns
Inherited from
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;
Defined in: node_modules/.pnpm/@types+node@24.19.2/node_modules/@types/node/globals.d.ts:52
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
prepareStackTrace()
static prepareStackTrace(err, stackTraces): any;
Defined in: node_modules/.pnpm/@types+node@24.19.2/node_modules/@types/node/globals.d.ts:56
Parameters
err
Error
stackTraces
CallSite[]
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
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
Methods
clear()
clear(): void;
Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:257
Clear all recorded data.
Returns
void
Implementation of
computeCorrelationMatrix()
computeCorrelationMatrix(): CorrelationMatrix;
Defined in: packages/nexus-agents/src/consensus/correlation-tracker.ts:147
Compute the full correlation matrix for all tracked agents.
Returns
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
Implementation of
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, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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
artifactReadiness?
"ready" | "unverifiable" | "artifact_starved" = ...
Worker readiness status for the required artifact.
boundArtifactDigest?
string = ...
Bound SHA-256 digest of reviewed artifact (#M1 connected autonomy).
conditions?
string[] = ...
confidence
number = ...
decision
"approve" | "reject" | "abstain" = VoteDecisionSchema
findings?
{
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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:309
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:310
Parameters
options?
OWVotingOptions = {}
Returns
Overrides
Properties
algorithm
readonly algorithm:
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise";
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:70
Implementation of
Inherited from
Methods
aggregate()
aggregate(votes, tracker?): HigherOrderVotingResult;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:197
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, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
tracker?
Returns
Inherited from
aggregateWithCorrelation()
aggregateWithCorrelation(votes, correlationMatrix): HigherOrderVotingResult;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:90
Aggregate votes using Bayesian correlation-aware method.
Parameters
votes
ReadonlyMap<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
correlationMatrix
Returns
Inherited from
OWVoting.aggregateWithCorrelation
calculateOutcome()
calculateOutcome(votes, _weights?): VotingOutcome;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:85
IVotingStrategy implementation for integration with ConsensusEngine.
Parameters
votes
Map<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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
Implementation of
IVotingStrategy.calculateOutcome
Inherited from
computeISP()
computeISP(votes, independentSubsets): HigherOrderVotingResult;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:150
Compute result using Independent Subset Partition method.
Parameters
votes
ReadonlyMap<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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
Inherited from
estimateCorrelation()
estimateCorrelation(tracker): CorrelationMatrix;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:146
Estimate correlation matrix from voting history.
Parameters
tracker
Returns
Inherited from
getConfig()
getConfig(): HigherOrderVotingConfig;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:249
Get the current configuration.
Returns
Inherited from
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
Overrides
Error.constructor
Properties
cause?
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?
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@24.19.2/node_modules/@types/node/globals.d.ts:68
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@24.19.2/node_modules/@types/node/globals.d.ts:52
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@24.19.2/node_modules/@types/node/globals.d.ts:56
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:69
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:75
Parameters
options?
OWVotingOptions = {}
Returns
Properties
algorithm
readonly algorithm:
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise";
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:70
Implementation of
Methods
aggregate()
aggregate(votes, tracker?): HigherOrderVotingResult;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:197
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, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
tracker?
Returns
Implementation of
aggregateWithCorrelation()
aggregateWithCorrelation(votes, correlationMatrix): HigherOrderVotingResult;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:90
Aggregate votes using Bayesian correlation-aware method.
Parameters
votes
ReadonlyMap<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
correlationMatrix
Returns
Implementation of
IHigherOrderVoting.aggregateWithCorrelation
calculateOutcome()
calculateOutcome(votes, _weights?): VotingOutcome;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:85
IVotingStrategy implementation for integration with ConsensusEngine.
Parameters
votes
Map<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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
Implementation of
IVotingStrategy.calculateOutcome
computeISP()
computeISP(votes, independentSubsets): HigherOrderVotingResult;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:150
Compute result using Independent Subset Partition method.
Parameters
votes
ReadonlyMap<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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
Implementation of
estimateCorrelation()
estimateCorrelation(tracker): CorrelationMatrix;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:146
Estimate correlation matrix from voting history.
Parameters
tracker
Returns
Implementation of
IHigherOrderVoting.estimateCorrelation
getConfig()
getConfig(): HigherOrderVotingConfig;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:249
Get the current configuration.
Returns
Implementation of
SimpleMajorityStrategy
Defined in: packages/nexus-agents/src/consensus/strategies.ts:84
Simple majority voting strategy (>50% approval).
Extends
BaseVotingStrategy
Constructors
Constructor
new SimpleMajorityStrategy(): SimpleMajorityStrategy;
Returns
Inherited from
BaseVotingStrategy.constructor
Properties
algorithm
readonly algorithm:
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise" = 'simple_majority';
Defined in: packages/nexus-agents/src/consensus/strategies.ts:85
Overrides
BaseVotingStrategy.algorithm
Methods
calculateOutcome()
calculateOutcome(votes): VotingOutcome;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:87
Parameters
votes
Map<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
Returns
Overrides
BaseVotingStrategy.calculateOutcome
countVotes()
protected countVotes(votes): VoteCounts;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:58
Count votes by decision type.
Parameters
votes
Map<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
Returns
Inherited from
BaseVotingStrategy.countVotes
SupermajorityStrategy
Defined in: packages/nexus-agents/src/consensus/strategies.ts:122
Supermajority voting strategy (at least 2/3 approval).
Extends
BaseVotingStrategy
Constructors
Constructor
new SupermajorityStrategy(): SupermajorityStrategy;
Returns
Inherited from
BaseVotingStrategy.constructor
Properties
algorithm
readonly algorithm:
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise" = 'supermajority';
Defined in: packages/nexus-agents/src/consensus/strategies.ts:123
Overrides
BaseVotingStrategy.algorithm
Methods
calculateOutcome()
calculateOutcome(votes): VotingOutcome;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:125
Parameters
votes
Map<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
Returns
Overrides
BaseVotingStrategy.calculateOutcome
countVotes()
protected countVotes(votes): VoteCounts;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:58
Count votes by decision type.
Parameters
votes
Map<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
Returns
Inherited from
BaseVotingStrategy.countVotes
UnanimousStrategy
Defined in: packages/nexus-agents/src/consensus/strategies.ts:161
Unanimous voting strategy (100% approval required).
Extends
BaseVotingStrategy
Constructors
Constructor
new UnanimousStrategy(): UnanimousStrategy;
Returns
Inherited from
BaseVotingStrategy.constructor
Properties
algorithm
readonly algorithm:
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise" = 'unanimous';
Defined in: packages/nexus-agents/src/consensus/strategies.ts:162
Overrides
BaseVotingStrategy.algorithm
Methods
calculateOutcome()
calculateOutcome(votes): VotingOutcome;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:164
Parameters
votes
Map<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
Returns
Overrides
BaseVotingStrategy.calculateOutcome
countVotes()
protected countVotes(votes): VoteCounts;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:58
Count votes by decision type.
Parameters
votes
Map<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
Returns
Inherited from
BaseVotingStrategy.countVotes
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?
Returns
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
Implementation of
detectSycophancy()
detectSycophancy(sessionId): SycophancyReport;
Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:345
Detect sycophancy patterns.
Parameters
sessionId
string
Returns
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
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
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
artifactReadiness?
"ready" | "unverifiable" | "artifact_starved" = ...
Worker readiness status for the required artifact.
boundArtifactDigest?
string = ...
Bound SHA-256 digest of reviewed artifact (#M1 connected autonomy).
conditions?
string[] = ...
confidence
number = ...
decision
"approve" | "reject" | "abstain" = VoteDecisionSchema
findings?
{
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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
VotingStrategyFactory
Defined in: packages/nexus-agents/src/consensus/strategies.ts:214
Factory for creating voting strategies.
Constructors
Constructor
new VotingStrategyFactory(): VotingStrategyFactory;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:217
Returns
Methods
getAvailableAlgorithms()
getAvailableAlgorithms(): (
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise")[];
Defined in: packages/nexus-agents/src/consensus/strategies.ts:251
Get all available algorithm types.
Returns
(
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise")[]
getStrategy()
getStrategy(algorithm): IVotingStrategy;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:230
Get a voting strategy by algorithm type.
Parameters
algorithm
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise"
Returns
registerStrategy()
registerStrategy(strategy): void;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:244
Register a custom voting strategy.
Parameters
strategy
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?
Returns
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
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
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
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
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, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
Returns
Implementation of
IWeightedVoting.weightedConsensus
Interfaces
AgentVoteResult
Defined in: packages/nexus-agents/src/cli/vote-types.ts:185
Individual agent vote with metadata.
Properties
assignedCli?
readonly assignedCli?: string;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:274
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).
attemptTelemetry?
readonly attemptTelemetry?: Readonly<{
events: readonly Readonly<{
adapter: string;
attemptKind: | "unknown"
| "initial"
| "parse_retry"
| "error_retry"
| "role_retry"
| "cli_fallback"
| "option_reask";
cli: string;
id: string;
model?: string;
outcome: "unknown" | "superseded" | "parsed" | "parse_failed" | "final";
role: string;
usage: | Readonly<{
kind: "unknown";
}>
| Readonly<{
cacheCreation?: number;
cached?: number;
input: number;
kind: "reported";
output: number;
reasoning?: number;
}>;
withinRoleRetry?: boolean;
}>[];
observableAttempts: number;
}>;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:342
Immutable snapshot of settled outer responses, separate from final-seat usage.
attemptUsage?
readonly attemptUsage?: AttemptUsage;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:340
Usage summed over EVERY outer completion this seat settled (#6821): the answering one, parse-failed attempts, the first pass the per-role retry replaced (#5578) and the primary of a cross-CLI fallback (#3587). The token fields above stay the ANSWERING completion’s own report.
Absent when no completion settled — never a zero record. Counters are a
lower bound when reportedCompletions < completions. Adapter errors,
timeouts, completions still in flight at the panel deadline and retries
inside an adapter are not observed.
cacheCreationInputTokens?
readonly cacheCreationInputTokens?: number;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:328
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 cachedInputTokens?: number;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:323
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 cli?: string;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:208
CLI that executed this vote (for adaptive routing feedback).
error?
readonly error?: string;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:344
Error message if vote fell back to simulation or encountered an error
fallback?
readonly fallback?: SeatFallback;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:293
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 gatewayArm?: `api:${string}`;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:285
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 inputTokens?: number;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:312
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 model?: string;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:247
Configured/requested adapter model id, when known (e.g. ‘claude-sonnet’). Carried as configured/requested provenance; spend attribution uses servedModel. Absent for error/simulation votes that never reached a model.
modelPinWarning?
readonly modelPinWarning?: string;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:265
Ignored operator pins and this seat’s primary assignment, disclosed in panelWarning.
operationalModel?
readonly operationalModel?: string;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:258
Per-completion operational selection; never serving evidence or a pricing input.
optionReask?
readonly optionReask?: {
resolved: boolean;
};
Defined in: packages/nexus-agents/src/cli/vote-types.ts:220
Present only after the single option-selection re-ask (#4495).
resolved
readonly resolved: boolean;
outputTokens?
readonly outputTokens?: number;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:317
Output tokens the adapter reported for this voter’s LLM call, when known (#3910). See AgentVoteResult.inputTokens.
pinnedModel?
readonly pinnedModel?: string;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:263
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:188
retried?
readonly retried?: boolean;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:232
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 retriedFrom?: RetriedFrom;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:241
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:186
selectedOption?
readonly selectedOption?: string;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:218
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 servedModel?: string;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:256
Model id explicitly reported for this vote (CompletionResponse.reportedModel),
when it reported one (#6660). Differs from model — the adapter’s
construction-time id, i.e. the model REQUESTED. A derived CLI fallback alias
is operational selection, not a report. 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:200
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 overvote.decisioncan fold it back into the abstain bucket. Thevote.decisionis alwaysabstain— an unverifiable seat never carries approve/reject, whatever the model returned.
timing?
readonly timing?: {
attempts: readonly SeatAttemptTiming[];
};
Defined in: packages/nexus-agents/src/cli/vote-types.ts:304
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 unverifiableSignal?: UnverifiableSignal;
Defined in: packages/nexus-agents/src/cli/vote-types.ts:206
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: {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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:187
artifactReadiness?
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
Worker readiness status for the required artifact.
boundArtifactDigest?
boundArtifactDigest?: string;
Bound SHA-256 digest of reviewed artifact (#M1 connected autonomy).
conditions?
conditions?: string[];
confidence
confidence: number;
decision
decision: "approve" | "reject" | "abstain" = VoteDecisionSchema;
findings?
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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?
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?
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?
timestamp?: string;
CollectRealVotesOptions
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:253
Options for collecting votes from multiple agents.
Extends
VoterAgentOptions
Properties
adapter?
readonly adapter?: IModelAdapter;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:114
Model adapter to use (auto-selected if not provided)
Inherited from
VoterAgentOptions.adapter
allowSimulation?
readonly allowSimulation?: boolean;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:120
Whether to allow simulation fallback (default: false per Issue #280)
Inherited from
VoterAgentOptions.allowSimulation
declaredOptions?
readonly declaredOptions?: readonly string[];
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:273
Named alternatives for a multi-option proposal (#4472); each voter picks one.
erroredRoleBackoffMs?
readonly erroredRoleBackoffMs?: number;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:297
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 gatewayAdapters?: readonly IModelAdapter[];
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:271
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 interAgentDelayMs?: number;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:122
Delay between launching each agent vote to prevent rate limiting (default: 1000ms). Set to 0 to disable.
Inherited from
VoterAgentOptions.interAgentDelayMs
logger?
readonly logger?: ILogger;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:112
Logger instance
Inherited from
VoterAgentOptions.logger
maxRetries?
readonly maxRetries?: number;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:118
Maximum retries per vote (default: 2)
Inherited from
VoterAgentOptions.maxRetries
onVoteCollected?
readonly onVoteCollected?: (vote) => void;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:290
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
Returns
void
project?
readonly project?: string;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:278
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:260
Proposal text
roleAdapters?
readonly roleAdapters?: ReadonlyMap<VoterRole, IModelAdapter>;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:304
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:258
Voter roles to include
signal?
readonly signal?: AbortSignal;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:284
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 simulate?: boolean;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:262
Use simulation mode (explicit opt-in only)
timeoutMs?
readonly timeoutMs?: number;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:116
Timeout per vote in milliseconds (default: 120000, override via NEXUS_VOTE_TIMEOUT_MS)
Inherited from
VoterAgentOptions.timeoutMs
workspace?
readonly workspace?: string;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:255
Repository checkout used by every panel seat.
workspaceSha?
readonly workspaceSha?: string;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:256
ConsensusEngineConfig
Defined in: packages/nexus-agents/src/consensus/types-core.ts:299
Consensus engine configuration.
Properties
defaultTimeout
defaultTimeout: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:300
incrementalQuorum?
incrementalQuorum?: IncrementalQuorumConfig;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:308
Incremental quorum configuration (Issue #1408)
maxActiveProposals
maxActiveProposals: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:302
maxClosedProposals
maxClosedProposals: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:304
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:301
proposalCache?
proposalCache?: ProposalCacheConfig;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:306
Content-based proposal caching for determinism (Issue #589)
ConsensusMetrics
Defined in: packages/nexus-agents/src/consensus/types-core.ts:372
Consensus metrics for monitoring.
Properties
algorithmUsage
algorithmUsage: Record<ConsensusAlgorithm, number>;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:379
approvedProposals
approvedProposals: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:374
averageDurationMs
averageDurationMs: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:377
averageVotesPerProposal
averageVotesPerProposal: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:378
rejectedProposals
rejectedProposals: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:375
timedOutProposals
timedOutProposals: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:376
totalProposals
totalProposals: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:373
ConsensusResult
Defined in: packages/nexus-agents/src/consensus/types-core.ts:185
Result of a consensus decision.
Properties
approvalPercentage
approvalPercentage: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:201
artifactFloorUnmet?
artifactFloorUnmet?: boolean;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:209
Whether artifact inspection floor was unmet (#M1 connected autonomy).
closedAt
closedAt: string;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:204
durationMs
durationMs: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:205
outcome
outcome: "voting" | "timeout" | "closed" | "rejected" | "approved" | "pending";
Defined in: packages/nexus-agents/src/consensus/types-core.ts:188
proposal
proposal: {
algorithm: | "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise";
artifactDigest?: string;
createdAt?: string;
description: string;
id?: string;
metadata?: Record<string, unknown>;
requireArtifact?: boolean;
requiredVoters?: string[];
timeout?: number;
title: string;
totalRoles?: number;
};
Defined in: packages/nexus-agents/src/consensus/types-core.ts:187
algorithm
algorithm:
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise" = ConsensusAlgorithmSchema;
artifactDigest?
artifactDigest?: string;
SHA-256 digest of required artifact fixture (#M1 connected autonomy).
createdAt?
createdAt?: string;
description
description: string;
id?
id?: string;
metadata?
metadata?: Record<string, unknown>;
requireArtifact?
requireArtifact?: boolean;
Whether artifact inspection is mandatory for eligible votes.
requiredVoters?
requiredVoters?: string[];
timeout?
timeout?: number;
title
title: string;
totalRoles?
totalRoles?: number;
Total panel size for artifact inspection floor calculations (#M1).
proposalId
proposalId: string;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:186
quorumReached
quorumReached: boolean;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:202
reason?
reason?: string;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:207
Explanation for outcome when applicable (e.g. unmet artifact floor).
startedAt
startedAt: string;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:203
voteCounts
voteCounts: VoteCounts;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:190
votes
votes: Map<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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:189
weightBasis?
weightBasis?: WeightBasis;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:200
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?
weightedCounts?: WeightedVoteCounts;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:191
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?
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?
location?: string;
severity
severity: "critical" | "major" | "minor" | "suggestion";
suggestion?
suggestion?: string;
timestamp?
timestamp?: string;
severity
severity: "critical" | "major" | "minor" | "suggestion";
Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:157
suggestion?
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:273
Statistics about correlation tracking.
Properties
averageCorrelation
readonly averageCorrelation: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:281
Average correlation across all pairs
independentSubsetCount
readonly independentSubsetCount: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:283
Number of identified independent subsets
pairsWithSufficientData
readonly pairsWithSufficientData: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:285
Pairs with sufficient data for correlation calculation
totalAgents
readonly totalAgents: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:275
Total agents being tracked
totalObservations
readonly totalObservations: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:279
Total voting observations recorded
trackedPairs
readonly trackedPairs: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:277
Total agent pairs with correlation data
HigherOrderVotingConfig
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:186
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.
Properties
correlationThreshold
readonly correlationThreshold: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:190
Correlation threshold to consider agents correlated (default: 0.3)
fallbackToSimpleVoting
readonly fallbackToSimpleVoting: boolean;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:194
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:192
Independence threshold for ISP grouping (default: 0.2)
maxObservationsPerAgent
readonly maxObservationsPerAgent: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:196
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:198
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:200
Maximum pairwise history entries before LRU eviction (default: 100)
minObservationsForCorrelation
readonly minObservationsForCorrelation: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:188
Minimum observations before using correlation data (default: 10)
HigherOrderVotingResult
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:230
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:232
Final decision
downweightedAgents
readonly downweightedAgents: readonly string[];
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:248
Agents whose votes were down-weighted due to correlation
effectiveVoteCount
readonly effectiveVoteCount: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:238
Effective number of independent votes
improvementOverBaseline
readonly improvementOverBaseline: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:244
Improvement over baseline majority voting (percentage points)
independentSubsets?
readonly independentSubsets?: readonly IndependentSubset[];
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:246
Independent subsets used (if ISP method)
method
readonly method: "simple" | "ow" | "isp";
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:242
Method used: ‘ow’ (opinion-wise), ‘isp’, or ‘simple’ (fallback)
posteriorApproval
readonly posteriorApproval: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:234
Posterior probability of approval
posteriorRejection
readonly posteriorRejection: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:236
Posterior probability of rejection
reasoning
readonly reasoning: string;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:250
Reasoning for the decision
usedCorrelationData
readonly usedCorrelationData: boolean;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:240
Whether correlation data was sufficient
IConsensusEngine
Defined in: packages/nexus-agents/src/consensus/engine.ts:66
Interface for the consensus engine.
Methods
close()
close(proposalId): Promise<Result<ConsensusResult, ConsensusError>>;
Defined in: packages/nexus-agents/src/consensus/engine.ts:70
Parameters
proposalId
string
Returns
Promise<Result<ConsensusResult, ConsensusError>>
getMetrics()
getMetrics(): ConsensusMetrics;
Defined in: packages/nexus-agents/src/consensus/engine.ts:71
Returns
getResult()
getResult(proposalId): Promise<Result<ConsensusResult, ConsensusError>>;
Defined in: packages/nexus-agents/src/consensus/engine.ts:69
Parameters
proposalId
string
Returns
Promise<Result<ConsensusResult, ConsensusError>>
propose()
propose(proposal): Promise<Result<string, ConsensusError>>;
Defined in: packages/nexus-agents/src/consensus/engine.ts:67
Parameters
proposal
algorithm
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise" = ConsensusAlgorithmSchema
artifactDigest?
string = ...
SHA-256 digest of required artifact fixture (#M1 connected autonomy).
createdAt?
string = ...
description
string = ...
id?
string = ...
metadata?
Record<string, unknown> = ...
requireArtifact?
boolean = ...
Whether artifact inspection is mandatory for eligible votes.
requiredVoters?
string[] = ...
timeout?
number = ...
title
string = ...
totalRoles?
number = ...
Total panel size for artifact inspection floor calculations (#M1).
Returns
Promise<Result<string, ConsensusError>>
vote()
vote(
proposalId,
agentId,
vote
): Promise<Result<void, ConsensusError>>;
Defined in: packages/nexus-agents/src/consensus/engine.ts:68
Parameters
proposalId
string
agentId
string
vote
artifactReadiness?
"ready" | "unverifiable" | "artifact_starved" = ...
Worker readiness status for the required artifact.
boundArtifactDigest?
string = ...
Bound SHA-256 digest of reviewed artifact (#M1 connected autonomy).
conditions?
string[] = ...
confidence
number = ...
decision
"approve" | "reject" | "abstain" = VoteDecisionSchema
findings?
{
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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:300
Interface for correlation tracking between agents.
Methods
clear()
clear(): void;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:353
Clear all recorded data.
Returns
void
computeCorrelationMatrix()
computeCorrelationMatrix(): CorrelationMatrix;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:327
Compute the full correlation matrix for all tracked agents.
Returns
getCorrelation()
getCorrelation(agentA, agentB): number | undefined;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:333
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:348
Get statistics about the correlation tracker.
Returns
hasSufficientData()
hasSufficientData(agentIds): boolean;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:343
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:338
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:317
Record votes from multiple agents for the same proposal.
Parameters
proposalId
string
votes
ReadonlyMap<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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:307
Record a vote and its outcome for correlation tracking.
Parameters
agentId
string
vote
artifactReadiness?
"ready" | "unverifiable" | "artifact_starved" = ...
Worker readiness status for the required artifact.
boundArtifactDigest?
string = ...
Bound SHA-256 digest of reviewed artifact (#M1 connected autonomy).
conditions?
string[] = ...
confidence
number = ...
decision
"approve" | "reject" | "abstain" = VoteDecisionSchema
findings?
{
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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()?
setCurrentModelPins?(modelPins): void;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:302
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:363
Interface for Opinion-Wise higher-order voting.
Methods
aggregate()
aggregate(votes, tracker?): HigherOrderVotingResult;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:393
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, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
tracker?
Returns
aggregateWithCorrelation()
aggregateWithCorrelation(votes, correlationMatrix): HigherOrderVotingResult;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:367
Aggregate votes using Bayesian correlation-aware method.
Parameters
votes
ReadonlyMap<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
correlationMatrix
Returns
computeISP()
computeISP(votes, independentSubsets): HigherOrderVotingResult;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:380
Compute result using Independent Subset Partition method.
Parameters
votes
ReadonlyMap<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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
estimateCorrelation()
estimateCorrelation(tracker): CorrelationMatrix;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:375
Estimate correlation matrix from voting history.
Parameters
tracker
Returns
getConfig()
getConfig(): HigherOrderVotingConfig;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:401
Get the current configuration.
Returns
IndependentSubset
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:65
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:69
Agent IDs in this independent subset
id
readonly id: string;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:67
Unique identifier for this subset
independenceScore
readonly independenceScore: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:78
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:90
Number of observations supporting this grouping
pairCoverage
readonly pairCoverage: {
observed: number;
total: number;
};
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:88
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
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
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
artifactReadiness?
"ready" | "unverifiable" | "artifact_starved" = ...
Worker readiness status for the required artifact.
boundArtifactDigest?
string = ...
Bound SHA-256 digest of reviewed artifact (#M1 connected autonomy).
conditions?
string[] = ...
confidence
number = ...
decision
"approve" | "reject" | "abstain" = VoteDecisionSchema
findings?
{
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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";
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, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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
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, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
summary: string;
}[];
reasoning: string;
rejectionCategories?: (
| "YAGNI"
| "DRY_VIOLATION"
| "OVER_ENGINEERING"
| "SCOPE_CREEP"
| "SECURITY_RISK"
| "MISALIGNED"
| "INSUFFICIENT_EVIDENCE")[];
selectedOption?: string;
timestamp?: string;
}>
Returns
OWVotingOptions
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:46
Options for creating OWVoting instance.
Properties
algorithm?
readonly algorithm?:
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise";
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:53
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 config?: Partial<HigherOrderVotingConfig>;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:47
tracker?
readonly tracker?: ICorrelationTracker;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:62
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:152
Aggregated voting history for a pair of agents.
Properties
agreements
readonly agreements: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:158
Number of times both agents agreed
correlation
readonly correlation: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:162
Computed correlation coefficient
disagreements
readonly disagreements: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:160
Number of times agents disagreed
jointObservations
readonly jointObservations: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:156
Number of proposals where both agents voted
lastUpdated
readonly lastUpdated: Date;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:164
Last update timestamp
pairKey
readonly pairKey: `${string}:${string}`;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:154
Agent pair key
ProposalState
Defined in: packages/nexus-agents/src/consensus/types-core.ts:352
Internal proposal state managed by the engine.
Properties
expansionInFlight?
expansionInFlight?: boolean;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:366
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?
expansionRounds?: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:359
Number of incremental quorum expansions applied (Issue #1408).
proposal
proposal: {
algorithm: | "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise";
artifactDigest?: string;
createdAt?: string;
description: string;
id?: string;
metadata?: Record<string, unknown>;
requireArtifact?: boolean;
requiredVoters?: string[];
timeout?: number;
title: string;
totalRoles?: number;
};
Defined in: packages/nexus-agents/src/consensus/types-core.ts:353
algorithm
algorithm:
| "simple_majority"
| "supermajority"
| "unanimous"
| "higher_order"
| "opinion_wise" = ConsensusAlgorithmSchema;
artifactDigest?
artifactDigest?: string;
SHA-256 digest of required artifact fixture (#M1 connected autonomy).
createdAt?
createdAt?: string;
description
description: string;
id?
id?: string;
metadata?
metadata?: Record<string, unknown>;
requireArtifact?
requireArtifact?: boolean;
Whether artifact inspection is mandatory for eligible votes.
requiredVoters?
requiredVoters?: string[];
timeout?
timeout?: number;
title
title: string;
totalRoles?
totalRoles?: number;
Total panel size for artifact inspection floor calculations (#M1).
startedAt
startedAt: Date;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:356
status
status: "voting" | "timeout" | "closed" | "rejected" | "approved" | "pending";
Defined in: packages/nexus-agents/src/consensus/types-core.ts:354
timeoutId?
timeoutId?: Timeout;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:357
votes
votes: Map<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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:355
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: "consensus" | "analysis" | "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: "medium" | "low" | "high";
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:165
Vote counts summary.
Properties
abstain
abstain: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:168
approve
approve: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:166
reject
reject: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:167
total
total: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:169
VotingObservation
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:111
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:115
Agent who cast the vote
alignedWithOutcome
readonly alignedWithOutcome: boolean;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:121
Whether the vote aligned with the final outcome
confidence
readonly confidence: number;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:119
Confidence level (0-1)
decision
readonly decision: "approve" | "reject" | "abstain";
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:117
The vote decision
modelKey?
readonly modelKey?: string;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:125
Pinned model identity used to select the correlation partition.
observedModel?
readonly observedModel?: string;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:127
Model that actually answered, retained for provenance only.
proposalId
readonly proposalId: string;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:113
Unique proposal ID
timestamp
readonly timestamp: Date;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:123
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
artifactFloorUnmet?
artifactFloorUnmet?: boolean;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:44
Whether outcome was marked unapproved due to unmet artifact floor (#M1).
reason
reason: string;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:42
voteCounts
voteCounts: VoteCounts;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:35
weightBasis?
weightBasis?: WeightBasis;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:41
Retained for historical results and custom weighted strategies. Built-in strategies leave this absent after the proof-of-learning retirement (#5234).
weightedCounts?
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?
completedAt?: string;
Defined in: packages/nexus-agents/src/consensus/types-voting-protocol.ts:79
finalVotes
finalVotes: Map<string, {
artifactReadiness?: "ready" | "unverifiable" | "artifact_starved";
boundArtifactDigest?: string;
conditions?: string[];
confidence: number;
decision: "approve" | "reject" | "abstain";
findings?: {
claim: string;
gate: {
named_assertion: string;
reread_cited_line: "failed" | "passed" | "skipped";
ruled_out_language_non_issue: "failed" | "passed" | "skipped";
traced_call_path: "failed" | "passed" | "skipped";
};
location: string;
severity: "info" | "critical" | "medium" | "low" | "high";
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: "consensus" | "analysis" | "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" | "in_progress" | "pending" | "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?
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?
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:175
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:178
approve
approve: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:176
reject
reject: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:177
totalWeight
totalWeight: number;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:179
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?
config?: Partial<WeightedVotingConfig>;
Defined in: packages/nexus-agents/src/consensus/weighted-voting-helpers.ts:38
Configuration for voting thresholds and weights.
emitEvents?
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?
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:27
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:30
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:54
CorrelationMatrix
type CorrelationMatrix = Map<AgentPairKey, CorrelationCoefficient>;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:59
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:155
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:160
Unique identifier for a proposal.
ProposalStatus
type ProposalStatus = z.infer<typeof ProposalStatusSchema>;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:49
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:64
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:126
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.
ConsensusAlgorithmSchema
const ConsensusAlgorithmSchema: ZodEnum<{
higher_order: "higher_order";
opinion_wise: "opinion_wise";
simple_majority: "simple_majority";
supermajority: "supermajority";
unanimous: "unanimous";
}>;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:23
Consensus algorithm types.
- simple_majority: >50% of votes required
- supermajority: >=67% of votes required
- unanimous: 100% approval required
- 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>;
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:323
Consensus engine configuration schema.
ConsensusMetricsSchema
const ConsensusMetricsSchema: ZodObject<{
algorithmUsage: ZodRecord<ZodEnum<{
higher_order: "higher_order";
opinion_wise: "opinion_wise";
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:385
Consensus metrics schema.
ConsensusResultSchema
const ConsensusResultSchema: ZodObject<{
approvalPercentage: ZodNumber;
artifactFloorUnmet: ZodOptional<ZodBoolean>;
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";
simple_majority: "simple_majority";
supermajority: "supermajority";
unanimous: "unanimous";
}>;
artifactDigest: ZodOptional<ZodString>;
createdAt: ZodOptional<ZodISODateTime>;
description: ZodString;
id: ZodOptional<ZodString>;
metadata: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
requireArtifact: ZodOptional<ZodBoolean>;
requiredVoters: ZodOptional<ZodArray<ZodString>>;
timeout: ZodOptional<ZodNumber>;
title: ZodString;
totalRoles: ZodOptional<ZodNumber>;
}, $strip>;
proposalId: ZodString;
quorumReached: ZodBoolean;
reason: ZodOptional<ZodString>;
startedAt: ZodISODateTime;
voteCounts: ZodObject<{
abstain: ZodNumber;
approve: ZodNumber;
reject: ZodNumber;
total: ZodNumber;
}, $strip>;
votes: ZodMap<ZodString, ZodObject<{
artifactReadiness: ZodOptional<ZodEnum<{
artifact_starved: "artifact_starved";
ready: "ready";
unverifiable: "unverifiable";
}>>;
boundArtifactDigest: ZodOptional<ZodString>;
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:215
Consensus result schema for validation.
CorrelationCoefficientSchema
const CorrelationCoefficientSchema: ZodNumber;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:53
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:288
DEFAULT_CONSENSUS_CONFIG
const DEFAULT_CONSENSUS_CONFIG: ConsensusEngineConfig;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:334
Default configuration values.
DEFAULT_HIGHER_ORDER_CONFIG
const DEFAULT_HIGHER_ORDER_CONFIG: HigherOrderVotingConfig;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:213
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<{
correlationThreshold: ZodDefault<ZodNumber>;
fallbackToSimpleVoting: ZodDefault<ZodBoolean>;
independenceThreshold: ZodDefault<ZodNumber>;
maxObservationsPerAgent: ZodDefault<ZodNumber>;
maxProposals: ZodDefault<ZodNumber>;
maxTrackedPairs: ZodDefault<ZodNumber>;
minObservationsForCorrelation: ZodDefault<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:203
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:253
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:93
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:167
ProposalSchema
const ProposalSchema: ZodObject<{
algorithm: ZodEnum<{
higher_order: "higher_order";
opinion_wise: "opinion_wise";
simple_majority: "simple_majority";
supermajority: "supermajority";
unanimous: "unanimous";
}>;
artifactDigest: ZodOptional<ZodString>;
createdAt: ZodOptional<ZodISODateTime>;
description: ZodString;
id: ZodOptional<ZodString>;
metadata: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
requireArtifact: ZodOptional<ZodBoolean>;
requiredVoters: ZodOptional<ZodArray<ZodString>>;
timeout: ZodOptional<ZodNumber>;
title: ZodString;
totalRoles: ZodOptional<ZodNumber>;
}, $strip>;
Defined in: packages/nexus-agents/src/consensus/types-core.ts:131
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:41
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:69
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:55
Structured rejection feedback categories (Issue #1213). Enables reject→refine→re-vote feedback loops by classifying rejection reasons.
VoteSchema
const VoteSchema: ZodObject<{
artifactReadiness: ZodOptional<ZodEnum<{
artifact_starved: "artifact_starved";
ready: "ready";
unverifiable: "unverifiable";
}>>;
boundArtifactDigest: ZodOptional<ZodString>;
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";
info: "info";
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:93
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:130
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
proposalId
string
outcome
config
Returns
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
proposalId
string
outcome
config
Returns
buildTimeoutResult()
function buildTimeoutResult(
state,
proposalId,
outcome,
config
): ConsensusResult;
Defined in: packages/nexus-agents/src/consensus/result-builder.ts:85
Build a timeout result for an expired proposal.
Parameters
state
proposalId
string
outcome
config
Returns
collectRealVotes()
function collectRealVotes(options): Promise<readonly AgentVoteResult[]>;
Defined in: packages/nexus-agents/src/cli/voter-agents.ts:377
Parameters
options
Returns
Promise<readonly AgentVoteResult[]>
createAgentPairKey()
function createAgentPairKey(agentA, agentB): `${string}:${string}`;
Defined in: packages/nexus-agents/src/consensus/higher-order-types.ts:33
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:780
Create a consensus engine with the given configuration.
Parameters
config?
Partial<ConsensusEngineConfig>
logger?
Returns
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
createHigherOrderVotingStrategy()
function createHigherOrderVotingStrategy(options?): HigherOrderVotingStrategy;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:318
Creates a higher-order voting strategy for use with ConsensusEngine.
Parameters
options?
Returns
createOWVoting()
function createOWVoting(options?): IHigherOrderVoting;
Defined in: packages/nexus-agents/src/consensus/higher-order-voting.ts:301
Creates a new OWVoting instance.
Parameters
options?
Returns
createStrategyFactory()
function createStrategyFactory(): VotingStrategyFactory;
Defined in: packages/nexus-agents/src/consensus/strategies.ts:259
Creates a voting strategy factory with default strategies.
Returns
createVotingProtocol()
function createVotingProtocol(customLogger?): VotingProtocol;
Defined in: packages/nexus-agents/src/consensus/voting-protocol.ts:409
Create a voting protocol instance.
Parameters
customLogger?
Returns
createWeightedVoting()
function createWeightedVoting(options?): IWeightedVoting;
Defined in: packages/nexus-agents/src/consensus/weighted-voting.ts:360
Create a weighted voting instance.
Parameters
options?
Returns
determineFinalStatus()
function determineFinalStatus(quorumReached, approved): "voting" | "timeout" | "closed" | "rejected" | "approved" | "pending";
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
"voting" | "timeout" | "closed" | "rejected" | "approved" | "pending"
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:40
Extracts agent IDs from a pair key.
Parameters
key
`${string}:${string}`
Returns
[string, string]