refactor(retention): extract retention module from workspace-memory

Move retention constants and math to a focused src/retention.ts module:
- All half-life, reinforcement, dormancy constants
- TYPE_FACTOR, SOURCE_FACTOR, USER_IMPORTANCE_FACTOR
- RETENTION_TYPE_MAX (renamed from TYPE_MAX)
- calculateInitialStrength, calculateEffectiveHalfLife,
  calculateRetentionStrength, calculateDormantDays,
  calculateEffectiveAgeDays, reinforceMemory

No behavior changes. retention.ts imports only types from types.ts.
Workspace-memory.ts still owns storage, consolidation, and rendering.
This commit is contained in:
Ralph Chang
2026-04-30 17:28:31 +08:00
parent 36f00147ca
commit aa7cc6c60e
5 changed files with 166 additions and 159 deletions
+1 -1
View File
@@ -36,8 +36,8 @@ import {
updateWorkspaceMemory,
updateWorkspaceMemoryWithAccounting,
renderWorkspaceMemory,
reinforceMemory,
} from "./workspace-memory.ts";
import { reinforceMemory } from "./retention.ts";
import {
appendPendingMemories,
clearPendingMemories,