You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Persist the relation-publication retry marker inside the accepted-write transaction #1661
Follow-up from basic-memory-cloud docs/MATERIALIZATION_WEBHOOK_PLAN.md (step C4), split out of basic-memory#1660.
Gap
After an accepted note write commits, _finish_mutation (services/note_content_writes.py:253-273) publishes the note's graph (observations, relations, sections). Before publishing, RelationRepository.begin_relation_generation_publication persists a RelationSearchRefresh.publication_generation retry marker, and cleanup_relation_generations clears it after success. While the marker exists, EntityRepository.get_by_file_paths masks entity.checksum, so the next storage notification or project index re-reads the note and republishes its graph. That is the repair path, and it survives basic-memory#1660.
The remaining hole: a crash or database error after the accepted write commits but before the retry marker is written leaves no marker. The graph stays unpublished, nothing masks the checksum, and once #1660 records the materialized object's storage checksum, the storage notification finds the note current and does not repair it. Today a graph-publication failure is only logged ("a later index pass can republish").
Proposed fix
Write the publication retry marker in the same transaction as the accepted write, so every committed accepted generation either has its graph published or carries a durable marker until it is.
Confirm the marker is cleared by the in-request publish on the happy path, so the next notification is not masked unnecessarily (that would bring back the re-index this plan removes).
Not in scope
Lost embeddings: basic-memory-cloud now queues embeddings from the durable materialize_note_file job.
Follow-up from basic-memory-cloud
docs/MATERIALIZATION_WEBHOOK_PLAN.md(step C4), split out of basic-memory#1660.Gap
After an accepted note write commits,
_finish_mutation(services/note_content_writes.py:253-273) publishes the note's graph (observations, relations, sections). Before publishing,RelationRepository.begin_relation_generation_publicationpersists aRelationSearchRefresh.publication_generationretry marker, andcleanup_relation_generationsclears it after success. While the marker exists,EntityRepository.get_by_file_pathsmasksentity.checksum, so the next storage notification or project index re-reads the note and republishes its graph. That is the repair path, and it survives basic-memory#1660.The remaining hole: a crash or database error after the accepted write commits but before the retry marker is written leaves no marker. The graph stays unpublished, nothing masks the checksum, and once #1660 records the materialized object's storage checksum, the storage notification finds the note current and does not repair it. Today a graph-publication failure is only logged ("a later index pass can republish").
Proposed fix
Write the publication retry marker in the same transaction as the accepted write, so every committed accepted generation either has its graph published or carries a durable marker until it is.
Care needed
RelationSearchRefreshinsert to the accept transaction needs a PostgreSQL concurrency test, alongsidetest-int/test_note_materialization_lock_order.py, proving the order still holds.Not in scope
Lost embeddings: basic-memory-cloud now queues embeddings from the durable
materialize_note_filejob.🤖 Generated with Claude Code
https://claude.ai/code/session_01T8wjd6HrtSA2LN9ssC4NzF