Implement hierarchical memory structure to improve filesystem performance when dealing with large numbers of memory files. ## Changes ### Core Implementation (src/memory/internal.ts) - Add isOldMemoryFormat() - detect old flat format files - Add migrateMemoryFile() - migrate to YYYY/MM/ structure with: * Date validation (rejects invalid dates like 2025-99-99) * Atomic file creation (wx flag) to prevent race conditions * Optional logger parameter for production use - Add migrateAllMemoryFiles() - bulk migration with: * Full recursive scan via findOldFormatFiles() * Dry-run mode for preview * Detailed metrics (totalBytes, durationMs, file lists) - Update walkDir() - auto-migrate on file access - Update listMemoryFiles() - add logger parameter ### Tests (src/memory/internal.test.ts) - 20 comprehensive unit tests - Test old-format detection, date validation, race conditions - Test dry-run mode and detailed metrics - 100% coverage of key functionality ### Documentation - docs/concepts/memory-migration.md (NEW) - migration guide - docs/concepts/memory.md - backward compatibility section - docs/help/faq.md - migration FAQ entries ## Backward Compatibility - Automatic migration on file access - Old files preserved as backup - Zero breaking changes - Both formats supported |
||
|---|---|---|
| .. | ||
| faq.md | ||
| index.md | ||
| troubleshooting.md | ||