# Class PersistentStrategyDistiller

StrategyDistiller that persists distilled rules to a JSON file.

- Construction: hydrates from rules.json via Zod validation
- distill(): calls super.distill() then atomically saves snapshot
- Corruption: warn + start fresh (no partial loads)

#### Hierarchy (View Summary)

- StrategyDistiller
  - PersistentStrategyDistiller

- Defined in packages/nexus-agents/src/learning/strategy-distiller-persistence.ts:74

##### Index

### Constructors

constructor

### Methods

distill
onOutcome
getRules
getStats
promote
loadRules

## Constructors

### constructor

- new PersistentStrategyDistiller(
  outcomeStore: OutcomeStore,
  persistConfig?: PersistentDistillerConfig,
  logger?: ILogger,
  distillerConfig?: Partial<DistillerConfig>,
  ): PersistentStrategyDistiller

  #### Parameters

  - outcomeStore: OutcomeStore
  - `Optional` persistConfig: PersistentDistillerConfig
  - `Optional` logger: ILogger
  - `Optional` distillerConfig: Partial<DistillerConfig>

  #### Returns PersistentStrategyDistiller

  Overrides StrategyDistiller.constructor

  - Defined in packages/nexus-agents/src/learning/strategy-distiller-persistence.ts:78

## Methods

### distill

- distill(): void

  Override distill to persist rules after each run.

  #### Returns void

  Overrides StrategyDistiller.distill

  - Defined in packages/nexus-agents/src/learning/strategy-distiller-persistence.ts:94

### onOutcome

- onOutcome(): void

  Called for each processed outcome. Triggers distillation at threshold.

  #### Returns void

  Inherited from StrategyDistiller.onOutcome

  - Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:193

### getRules

- getRules(status?: RuleStatus): readonly DistilledRule[]

  Get rules filtered by status.

  #### Parameters

  - `Optional` status: RuleStatus

  #### Returns readonly DistilledRule[]

  Inherited from StrategyDistiller.getRules

  - Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:233

### getStats

- getStats(): DistillerStats

  Get distiller statistics.

  #### Returns DistillerStats

  Inherited from StrategyDistiller.getStats

  - Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:240

### promote

- promote(routingMemory: IRoutingMemory): number

  Promote high-confidence rules to RoutingMemory. Rules must be active, non-tainted, with sufficient observations and confidence.

  #### Parameters

  - routingMemory: IRoutingMemory

  #### Returns number

  Inherited from StrategyDistiller.promote

  - Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:262

### `Protected` loadRules

- loadRules(rules: readonly DistilledRule[]): void

  Load pre-existing rules (e.g., from disk). Used by PersistentStrategyDistiller.

  #### Parameters

  - rules: readonly DistilledRule[]

  #### Returns void

  Inherited from StrategyDistiller.loadRules

  - Defined in packages/nexus-agents/src/learning/strategy-distiller.ts:291