# Class HigherOrderVotingStrategy

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

#### Hierarchy (View Summary)

- OWVoting
  - HigherOrderVotingStrategy

#### Implements

- IVotingStrategy

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

##### Index

### Constructors

constructor

### Properties

algorithm

### Methods

calculateOutcome
aggregateWithCorrelation
estimateCorrelation
computeISP
aggregate
getConfig

## Constructors

### constructor

- new HigherOrderVotingStrategy(
  options?: OWVotingOptions,
  ): HigherOrderVotingStrategy

  #### Parameters

  - options: OWVotingOptions = {}

  #### Returns HigherOrderVotingStrategy

  Overrides OWVoting.constructor

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

## Properties

### `Readonly` algorithm

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

Implementation of IVotingStrategy.algorithm

Overrides OWVoting.algorithm

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

## Methods

### calculateOutcome

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

  IVotingStrategy implementation for integration with ConsensusEngine.

  #### Parameters

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

  #### Returns VotingOutcome

  Implementation of IVotingStrategy.calculateOutcome

  Inherited from OWVoting.calculateOutcome

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

### aggregateWithCorrelation

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

  Aggregate votes using Bayesian correlation-aware method.

  #### Parameters

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

  #### Returns HigherOrderVotingResult

  Inherited from OWVoting.aggregateWithCorrelation

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

### estimateCorrelation

- estimateCorrelation(tracker: ICorrelationTracker): CorrelationMatrix

  Estimate correlation matrix from voting history.

  #### Parameters

  - tracker: ICorrelationTracker

  #### Returns CorrelationMatrix

  Inherited from OWVoting.estimateCorrelation

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

### computeISP

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

  Compute result using Independent Subset Partition method.

  #### Parameters

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

  #### Returns HigherOrderVotingResult

  Inherited from OWVoting.computeISP

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

### aggregate

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

  Full pipeline: estimate correlation, compute result.

  #### Parameters

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

  #### Returns HigherOrderVotingResult

  Inherited from OWVoting.aggregate

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

### getConfig

- getConfig(): HigherOrderVotingConfig

  Get the current configuration.

  #### Returns HigherOrderVotingConfig

  Inherited from OWVoting.getConfig

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