Problem
hermes sessions export can export sessions to JSONL, but there is no corresponding import command. The exported JSONL is effectively one-way (backup/analysis only).
Proposed Solution
1. SessionDB.import_session() in hermes_state.py
- Insert session dict + messages into SQLite
- Collision: skip by default,
--force overwrites
- Dangling
parent_session_id: set to NULL
- Unknown columns stripped (future-proofing)
- JSON fields re-serialized automatically
2. CLI subcommand
hermes sessions import <file> # import from JSONL
hermes sessions import - # import from stdin
hermes sessions import backup.jsonl --force # overwrite colliding IDs
hermes sessions import backup.jsonl --dry-run # preview without writing
hermes sessions import backup.jsonl --source cli # filter by source
3. Tests
- 12 unit tests for
import_session()
- 10 CLI integration tests
- Round-trip: export -> import -> all messages preserved
Problem
hermes sessions exportcan export sessions to JSONL, but there is no correspondingimportcommand. The exported JSONL is effectively one-way (backup/analysis only).Proposed Solution
1.
SessionDB.import_session()inhermes_state.py--forceoverwritesparent_session_id: set to NULL2. CLI subcommand
3. Tests
import_session()