Create a new PersonalityMutationStore.
A storage adapter implementing the IStorageAdapter interface. The same adapter used by EmergentToolRegistry can be reused.
Record a new personality mutation.
Inserts a mutation record with initial strength of 1.0 and the current timestamp. The mutation ID is generated deterministically from the current time and a random suffix.
The mutation parameters (agent, trait, delta, reasoning, values).
The generated mutation ID.
Load all active mutations for a given agent.
Returns only mutations whose strength is above the 0.1 pruning threshold, ordered by creation time (newest first).
The agent whose mutations to load.
An array of PersonalityMutation records.
Compute the effective (strength-weighted) delta for each trait.
For each active mutation, multiplies the raw delta by the mutation's current strength, then sums per trait. This gives a realistic picture of how much each trait has drifted from baseline, accounting for decay.
The agent whose effective deltas to compute.
A map of trait name to effective delta (sum of delta * strength).
Decay all active mutations by the given rate and prune expired ones.
For each mutation with strength above 0.1:
rate from its strength.This implements Ebbinghaus-style forgetting: mutations that aren't reinforced by repeated adaptation gradually fade away.
The amount to subtract from each mutation's strength. Typically 0.05 (the default from SelfImprovementConfig).
A DecayResult with counts of decayed and pruned mutations.
SQLite-backed persistence layer for personality mutations with decay.
Follows the same
ensureSchema()pattern as EmergentToolRegistry: a cached promise guards against concurrent DDL execution, and all DML methods await schema readiness before proceeding.Example