fix(memory): include archives tier in export and flat saves (fixes #283)#297
Open
sshekhar563 wants to merge 1 commit into
Open
fix(memory): include archives tier in export and flat saves (fixes #283)#297sshekhar563 wants to merge 1 commit into
sshekhar563 wants to merge 1 commit into
Conversation
…trix#283) pack_soul, unpack_soul, and _FLAT_TIERS all omitted the archives tier. Consolidated conversation summaries were silently dropped on export and default-domain saves, and could not be regenerated because source entries were already marked archived=True. Adds archives to all three tier lists and regression tests for both export/awaken and save/load round-trips.
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.
Description
Fixes #283 — Export and default saves silently drop the archives memory tier.
The Bug
pack_soul's tier list,unpack_soul's tier list, and the flat on-disk layout (_FLAT_TIERS) all omittedarchives(consolidated conversation summaries). Even thoughMemoryManager.to_dict()emits it andfrom_dict()would restore it, the data was never written to the.soularchive or the flat directory layout.Exporting a soul and re-awakening it therefore loses all archival memory. Because source entries are already marked
archived=True, the re-archival filter skips them — the lost archives cannot be regenerated.The Fix
One-line addition in each of three locations:
src/soul_protocol/runtime/export/pack.py:120"archives"to the pack tier listsrc/soul_protocol/runtime/export/unpack.py:110"archives"to the unpack tier listsrc/soul_protocol/runtime/storage/file.py:163("archives", [])to_FLAT_TIERSTests Added
test_export_awaken_preserves_archives— seeds an archive, exports to.soul, awakens, verifies archive survivedtest_save_load_preserves_archives— saves to directory, verifiesarchives.jsonexists on disk, loads back and checks contentVerification