Add backup and restore functionality for memory store#10
Merged
keepsloading merged 1 commit intoJun 22, 2026
Merged
Conversation
- Introduced `backup-restore.mjs` for serializing and restoring memory backups. - Updated `memory-schemas.mjs` with validation functions for memory backup shapes. - Modified `storage.mjs` to integrate backup and restore processes during load and save operations. - Added tests for backup and restore functionalities to ensure data integrity and validation.
Member
|
SSoC26 Labeling: This Pull Request has been automatically linked to the corresponding issue labels: |
Member
|
Hi @Ingole712521 👋 I noticed that this PR has been merged, but there is no corresponding dummy PR created in the main Context repository (Memact/Context) referencing this work. For SSoC26 tracking, please make sure to open a dummy PR in Memact/Context so your merged contribution can be verified and counted on the leaderboard. Thank you! |
Member
|
No corresponding dummy PR was found in Memact/Context. Please create one referencing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: #8
Add structural verification for memory JSON backup restore
Summary
src/memory-schemas.mjs) so restored JSON backups are checked against Memory entity models before use.src/backup-restore.mjs) —restoreMemoryFromBackup,parseMemoryBackupJson, andserializeMemoryBackup— withMemoryBackupValidationErrorfor corrupt input.graphandstatsare recomputed on load).reindexMemoryStorefrom the engine so restored stores rebuild indexes safely after validation.Why
Backups can be corrupted or tampered with (unknown keys, spoofed fields, invalid memory/relation types, bad visibility scopes). Loading them blindly could pollute the memory store or trust forged data. This change rejects invalid backups early and only restores structurally valid memory records.