Skip to content

fix(memory): include archives tier in export and flat saves (fixes #283)#297

Open
sshekhar563 wants to merge 1 commit into
qbtrix:devfrom
sshekhar563:fix/archives-tier-283
Open

fix(memory): include archives tier in export and flat saves (fixes #283)#297
sshekhar563 wants to merge 1 commit into
qbtrix:devfrom
sshekhar563:fix/archives-tier-283

Conversation

@sshekhar563

Copy link
Copy Markdown
Collaborator

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 omitted archives (consolidated conversation summaries). Even though MemoryManager.to_dict() emits it and from_dict() would restore it, the data was never written to the .soul archive 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:

File Change
src/soul_protocol/runtime/export/pack.py:120 Added "archives" to the pack tier list
src/soul_protocol/runtime/export/unpack.py:110 Added "archives" to the unpack tier list
src/soul_protocol/runtime/storage/file.py:163 Added ("archives", []) to _FLAT_TIERS

Tests Added

  • test_export_awaken_preserves_archives — seeds an archive, exports to .soul, awakens, verifies archive survived
  • test_save_load_preserves_archives — saves to directory, verifies archives.json exists on disk, loads back and checks content

Verification

…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.
@sshekhar563 sshekhar563 requested a review from prakashUXtech July 7, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant