Qualify temporal memory end to end across a projection rebuild - #1783
Merged
Merged
Conversation
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.
Second of three deliveries for #1717.
Problem
A full projection rebuild (
WorkshopEventStore.rebuild_projection) reset the memory vector outbox tables and replayed events. Outbox outcomes (status, vector row id) come from executing the outbox, not from events, so every operation came backpendingwith no row id. Recall admitted nothing until recovery ran, and recovery would project each revision again. Nothing calls a rebuild in production today, but temporal memory has to survive one.The existing real-path memory tests also stopped at single transitions for one owner, while qualification needs every path through the production layers.
Changes
CanonicalConversationProjection.prepare_rebuildsnapshots vector outbox outcomes for facts and episodes, andfinish_rebuildrestores them onto the replayed rows by event position and item id. Outcomes whose event no longer replays are dropped and logged, never attached elsewhere.tests/memory_fixtures.pynow holds the one real-path harness (fake Mem0 storage, protected store, seeded runs, query service), with helpers for a second owner. The existing test files import it instead of each other.tests/test_memory_qualification.pyis the matrix. Each test drives the production layers and, where facts remain, proves recall, authorized history, and zero integrity, projection, and drift gaps:Verification
pendingwith no row id) and passes with it.