๐Ÿš€ Everything is free โ€” help us improve! Submit feedback and shape the platform.
๐ŸงชTDD Challengeยทintermediateยทโฑ๏ธ 30โ€“45mยทโญ 200 XP

M-056Build a Memory Conflict Resolver

Description

Nebula Corp's AI assistant has a memory problem: when a user says 'I use React' in January and 'I switched to Vue' in March, both facts are stored and the assistant gets confused. Build a conflict resolver that detects when new memories contradict existing ones, archives the old memory, and keeps only the current fact active. The resolver should compare new facts against existing ones in the same category and handle the conflict appropriately.

Test Cases (3)

Archives conflicting memory
Old memory should be archived when new one conflicts
Input:testArchive()
Expected:CONTAINS:archived
Active shows only current
Only the latest non-conflicting memory should be active
Input:testActive()
Expected:CONTAINS:Vue
History shows both
History should include both archived and active memories
Input:testHistory()
Expected:CONTAINS_ALL:React,Vue

Related Lessons

Click Run / Check to validate your solution