openclaw/docs/help
Nickolai Yegorov d91522d4a6 feat: hierarchical memory structure (YYYY/MM/) with automatic migration
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
2026-01-27 23:20:08 +03:00
..
faq.md feat: hierarchical memory structure (YYYY/MM/) with automatic migration 2026-01-27 23:20:08 +03:00
index.md docs: redirect /install/node to install section 2026-01-16 23:18:50 +00:00
troubleshooting.md refactor: rename clawdbot to moltbot with legacy compat 2026-01-27 12:21:02 +00:00