Refactor session manager: migration chain, validation, tests
- Add migrateV1ToV2/migrateToCurrentVersion for extensible migrations - createSummaryMessage now takes timestamp from entry - loadEntriesFromFile validates session header - findMostRecentSession only returns valid session files (reads first 512 bytes) - Remove ConversationEntry alias - Fix mom context.ts TreeNode type Tests: - migration.test.ts: v1 migration, idempotency - build-context.test.ts: 14 tests covering trivial, compaction, branches - file-operations.test.ts: loadEntriesFromFile, findMostRecentSession
This commit is contained in:
@@ -98,9 +98,9 @@ export class MomSessionManager {
|
||||
this.leafId = null;
|
||||
}
|
||||
|
||||
private _createTreeNode(): TreeNode {
|
||||
private _createTreeNode(): Omit<TreeNode, "type"> {
|
||||
const id = uuidv4();
|
||||
const node: TreeNode = {
|
||||
const node = {
|
||||
id,
|
||||
parentId: this.leafId,
|
||||
timestamp: new Date().toISOString(),
|
||||
|
||||
Reference in New Issue
Block a user