# Class CorrelationTracker

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

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

#### Implements

- ICorrelationTracker

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

##### Index

### Constructors

constructor

### Methods

recordVote
recordProposalVotes
computeCorrelationMatrix
getCorrelation
identifyIndependentSubsets
hasSufficientData
getStats
clear

## Constructors

### constructor

- new CorrelationTracker(
  config?: Partial<HigherOrderVotingConfig>,
  ): CorrelationTracker

  #### Parameters

  - `Optional` config: Partial<HigherOrderVotingConfig>

  #### Returns CorrelationTracker

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

## Methods

### recordVote

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

  Record a vote and its outcome for correlation tracking.

  #### Parameters

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

    - ##### decision: "approve" | "reject" | "abstain"

    - ##### reasoning: string

    - ##### confidence: number

    - ##### `Optional` conditions?: string[]

    - ##### `Optional` rejectionCategories?: (
      | "YAGNI"
      | "DRY_VIOLATION"
      | "OVER_ENGINEERING"
      | "SCOPE_CREEP"
      | "SECURITY_RISK"
      | "MISALIGNED"
      | "INSUFFICIENT_EVIDENCE"
      )[]

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

    - ##### `Optional` 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;
      }[]

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

    - ##### `Optional` timestamp?: string

  - outcome: "rejected" | "approved"

  #### Returns void

  Implementation of ICorrelationTracker.recordVote

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

### recordProposalVotes

- recordProposalVotes(
  proposalId: string,
  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;
  },
  >,
  outcome: "rejected" | "approved",
  ): void

  Record votes from multiple agents for the same proposal.

  #### Parameters

  - proposalId: string
  - 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;
    },
    >
  - outcome: "rejected" | "approved"

  #### Returns void

  Implementation of ICorrelationTracker.recordProposalVotes

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

### computeCorrelationMatrix

- computeCorrelationMatrix(): CorrelationMatrix

  Compute the full correlation matrix for all tracked agents.

  #### Returns CorrelationMatrix

  Implementation of ICorrelationTracker.computeCorrelationMatrix

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

### getCorrelation

- getCorrelation(agentA: string, agentB: string): number | undefined

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

  #### Parameters

  - agentA: string
  - agentB: string

  #### Returns number | undefined

  Implementation of ICorrelationTracker.getCorrelation

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

### identifyIndependentSubsets

- identifyIndependentSubsets(): readonly IndependentSubset[]

  Identify groups of agents that vote independently.

  #### Returns readonly IndependentSubset[]

  Implementation of ICorrelationTracker.identifyIndependentSubsets

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

### hasSufficientData

- hasSufficientData(agentIds: readonly string[]): boolean

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

  #### Parameters

  - agentIds: readonly string[]

  #### Returns boolean

  Implementation of ICorrelationTracker.hasSufficientData

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

### getStats

- getStats(): CorrelationTrackerStats

  Get statistics about the correlation tracker.

  #### Returns CorrelationTrackerStats

  Implementation of ICorrelationTracker.getStats

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

### clear

- clear(): void

  Clear all recorded data.

  #### Returns void

  Implementation of ICorrelationTracker.clear

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