# Class OutcomeFeedbackCollector

Outcome feedback collector implementation.

#### Implements

- IOutcomeFeedback

- Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:44

##### Index

### Constructors

constructor

### Methods

registerLinUCBBandit
registerPreferenceRouter
onOutcomeProcessed
recordRoutingDecision
recordOutcome
processOutcome
computeReward
getStats
getPendingDecisions
clearExpiredDecisions
reset

## Constructors

### constructor

- new OutcomeFeedbackCollector(
  config?: Partial<FeedbackCollectorConfig>,
  ): OutcomeFeedbackCollector

  #### Parameters

  - `Optional` config: Partial<FeedbackCollectorConfig>

  #### Returns OutcomeFeedbackCollector

  - Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:55

## Methods

### registerLinUCBBandit

- registerLinUCBBandit(bandit: LinUCBBandit): void

  Register LinUCB bandit for direct feedback.

  #### Parameters

  - bandit: LinUCBBandit

  #### Returns void

  - Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:70

### registerPreferenceRouter

- registerPreferenceRouter(router: PreferenceRouter): void

  Register PreferenceRouter for direct feedback.

  #### Parameters

  - router: PreferenceRouter

  #### Returns void

  - Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:78

### onOutcomeProcessed

- onOutcomeProcessed(callback: OutcomeProcessedCallback): () => void

  Subscribe to outcome processed events.

  #### Parameters

  - callback: OutcomeProcessedCallback

  #### Returns () => void

  - Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:86

### recordRoutingDecision

- recordRoutingDecision(decision: FeedbackRoutingDecision): void

  Record a routing decision for tracking.

  #### Parameters

  - decision: FeedbackRoutingDecision

  #### Returns void

  Implementation of IOutcomeFeedback.recordRoutingDecision

  - Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:93

### recordOutcome

- recordOutcome(outcome: TaskOutcome): void

  Record an outcome for a routing decision.

  #### Parameters

  - outcome: TaskOutcome

  #### Returns void

  Implementation of IOutcomeFeedback.recordOutcome

  - Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:119

### processOutcome

- processOutcome(
  traceId: string,
  partialOutcome: Omit<TaskOutcome, "routingDecisionId">,
  ): void

  Process outcome for a trace ID (finds matching decision and computes reward).

  #### Parameters

  - traceId: string
  - partialOutcome: Omit<TaskOutcome, "routingDecisionId">

  #### Returns void

  Implementation of IOutcomeFeedback.processOutcome

  - Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:140

### computeReward

- computeReward(outcome: TaskOutcome): ComputedReward

  Compute reward from an outcome.

  #### Parameters

  - outcome: TaskOutcome

  #### Returns ComputedReward

  Implementation of IOutcomeFeedback.computeReward

  - Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:156

### getStats

- getStats(): FeedbackLoopStats

  Get feedback loop statistics.

  #### Returns FeedbackLoopStats

  Implementation of IOutcomeFeedback.getStats

  - Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:196

### getPendingDecisions

- getPendingDecisions(): readonly FeedbackRoutingDecision[]

  Get pending decisions (waiting for outcomes).

  #### Returns readonly FeedbackRoutingDecision[]

  Implementation of IOutcomeFeedback.getPendingDecisions

  - Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:214

### clearExpiredDecisions

- clearExpiredDecisions(): number

  Clear expired pending decisions.

  #### Returns number

  Implementation of IOutcomeFeedback.clearExpiredDecisions

  - Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:218

### reset

- reset(): void

  Reset all state.

  #### Returns void

  Implementation of IOutcomeFeedback.reset

  - Defined in packages/nexus-agents/src/learning/outcome-feedback.ts:250