This repository was archived by the owner on Jun 3, 2026. It is now read-only.
Add deterministic code and snippet memory identity - #181
Open
hunterbastian wants to merge 3 commits into
Open
hunterbastian wants to merge 3 commits into
hunterbastian wants to merge 3 commits into
Conversation
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Implements deterministic identity metadata for code annotations and personal snippets so XMem can avoid re-judging exact code/snippet memories with an LLM.
Changes:
snippet_hash,annotation_key, andannotation_hashin Pinecone metadataThis addresses the edge case discussed in #141 where a user sends a snippet, then asks for the same snippet in another session. The normalized
snippet_hashlets the judge no-op the duplicate without another model call.Verification
python3 -m compileall src/schemas/code.py src/agents/judge.py src/pipelines/ingest.py src/pipelines/weaver.py tests/unit/test_schemas.py tests/test_deterministic_memory_layer.pyuv run --extra dev pytest tests/unit/test_schemas.py tests/test_deterministic_memory_layer.py-> 12 passeduv run --extra dev pytest-> 44 passeduv run ruff check --select F401 src/schemas/code.py src/agents/judge.py src/pipelines/ingest.py src/pipelines/weaver.py tests/unit/test_schemas.py tests/test_deterministic_memory_layer.pygit diff --check/claim #141