Migrate conversation search to use PERSONAL_SUPERPOWERS_DIR

Updates conversation indexing and search to use the new personal superpowers
directory structure with environment variable support.

Changes:
- Added src/paths.ts for centralized directory resolution
- Updated db.ts, indexer.ts, verify.ts to use paths.ts
- Created migrate-to-config.sh for data migration from ~/.clank
- Updated all documentation references from ~/.clank to ~/.config/superpowers
- Database paths automatically updated during migration

Migration tested with 5,017 conversations and 6,385 exchanges.
This commit is contained in:
Jesse Vincent
2025-10-10 17:14:40 -07:00
parent 6c0ab4cfec
commit a48a7e5b1b
8 changed files with 203 additions and 35 deletions

View File

@@ -77,10 +77,10 @@ If issues found:
ls -l ~/.claude/hooks/sessionEnd
# Check recent conversations
ls -lt ~/.clank/conversation-archive/*/*.jsonl | head -5
ls -lt ~/.config/superpowers/conversation-archive/*/*.jsonl | head -5
# Check database size
ls -lh ~/.clank/conversation-index/db.sqlite
ls -lh ~/.config/superpowers/conversation-index/db.sqlite
# Full verification
./index-conversations --verify
@@ -190,14 +190,14 @@ sleep 60 && ./index-conversations --repair
./index-conversations --verify
# 2. Check database exists and has data
ls -lh ~/.clank/conversation-index/db.sqlite
ls -lh ~/.config/superpowers/conversation-index/db.sqlite
# Should be > 100KB if conversations indexed
# 3. Try text search (exact match)
./search-conversations --text "exact phrase from conversation"
# 4. Check for corruption
sqlite3 ~/.clank/conversation-index/db.sqlite "SELECT COUNT(*) FROM exchanges;"
sqlite3 ~/.config/superpowers/conversation-index/db.sqlite "SELECT COUNT(*) FROM exchanges;"
# Should show number > 0
```
@@ -221,7 +221,7 @@ rm -rf ~/.cache/transformers # Force re-download
**Fix:**
```bash
# 1. Backup current database
cp ~/.clank/conversation-index/db.sqlite ~/.clank/conversation-index/db.sqlite.backup
cp ~/.config/superpowers/conversation-index/db.sqlite ~/.config/superpowers/conversation-index/db.sqlite.backup
# 2. Rebuild from scratch
./index-conversations --rebuild
@@ -300,7 +300,7 @@ cp ~/.clank/conversation-index/db.sqlite ~/.clank/conversation-index/db.sqlite.b
└── prompts/
└── search-agent.md # Subagent template
~/.clank/
~/.config/superpowers/
├── conversation-archive/ # Archived conversations
│ └── <project>/
│ ├── <uuid>.jsonl # Conversation file