feat(memory): add dormant tracking and reinforcement mechanism

Wave 2c - Dormant workspace tracking:
- Add lastActivityAt to WorkspaceMemoryStore
- Implement calculateDormantDays with 14-day grace period
- Wire dormant days into retention-strength calculation

Wave 3 - Reinforcement:
- Add lastReinforcedSessionID to LongTermMemoryEntry
- Implement reinforceMemory with guards (same-session, 1hr interval, max 6)
- Set retentionClock on memory creation in extractors.ts and plugin.ts

Tests: 219 → 222, all pass
This commit is contained in:
Ralph Chang
2026-04-29 14:32:39 +08:00
parent 4097815f3e
commit ffb612226c
7 changed files with 151 additions and 16 deletions
+5 -1
View File
@@ -317,10 +317,14 @@ export const MemoryV2Plugin: Plugin = async (input) => {
.map(memory => memoryKey(memory)),
);
const promotedAt = Date.now();
for (const memory of pending) {
const key = memoryKey(memory);
if (!existingKeys.has(key)) {
workspaceMemory.entries.push(memory);
workspaceMemory.entries.push({
...memory,
retentionClock: memory.retentionClock ?? promotedAt,
});
existingKeys.add(key);
}
}