Repository navigation
feat(memory): implement Living Memory system with file routing, CLI, and CI fixes (#741) - #769
Merged
Merged
Conversation
…store, and pii filtering
…pose in public APIs
…prehensive unit/integration tests
- test_edge: create platform-appropriate fake binary (.bat on Windows, shebang script on Unix) to fix WinError 193 - test_onnx: use importlib.util.find_spec() instead of sys.modules check to reliably detect installed onnxruntime - test_tools: bump PythonREPLTool timeout from 2s to 10s to prevent flaky failures under system load - Apply ruff formatting fixes across 9 source files (line length, redundant defaults, raw regex strings, unused imports/variables)
- Remove unused 'import sys' from test_onnx.py (ruff F401) - Remove redundant casts in decorators.py (mypy redundant-cast) - Assert avg_cost is not None before _ema call (mypy arg-type)
PatchStore.update() no longer calls patch.sign() with an empty secret.
Callers already sign patches with the correct secret right before
calling update() (LivingMemory.apply/revert/_apply_patch_to_file), so
the unconditional resign was overwriting valid secret-signed
signatures with unsigned ones before persisting, breaking
patch.verify(secret) and allowing forged signatures to pass.
MemoryPIIFilter.filter_content() no longer reports content as clean
based solely on the underlying PIIDetector's check. PIIDetector only
recognizes a handful of built in PII patterns (email, phone, ssn,
credit_card, ip_address), while MemoryPIIFilter supports extra types
like api_key. filter_content() now also checks the extra redaction
patterns not covered by PIIDetector before deciding content is clean,
so content containing only an api_key is correctly flagged and
redacted.
filter_content() with redact=False also had a violation type parsing
bug: splitting on "(" and ")" and ":" produced "email)" instead of
"email" because rstrip(")") stripped the trailing paren from the
"instance(s)" suffix. Replaced with a regex extraction of the type
name from the violation string.
Added regression tests in tests/memory/test_living_memory.py covering
all three fixes, including negative cases (wrong secret fails to
verify, api_key mixed with a supported type still redacts both).
Co-authored-by: Dhruv Garg <[email protected]>
Collaborator
|
Thanks for this, Dhruv. Solid foundation for the Living Memory system. Before merging I fixed three bugs found in review:
Added regression tests for all three and ran the full suite, everything green. Merged into main. |
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.
Summary
Implements the Living Memory subsystem for SynapseKit — an intelligent, file-routed memory layer that manages persistent agent memory through diffable patches, occurrence tracking, and PII filtering.
Changes
Core Features
MemoryPatch,OccurrenceRecord,MemoryFileCategory, diff engine, patch store, PII filtersynapsekit memory review|approve|reject|apply|revert|logsubcommandsCI & Test Fixes
test_edge_quantize(.baton Windows, shebang on Unix) — fixesWinError 193importlib.util.find_spec()instead ofsys.modulescheck intest_onnxfor reliable installed-package detectionPythonREPLTooltimeout from 2s to 10s to prevent subprocess startup failures under loaddecorators.py, add type narrowing assert foravg_costinagent_registry.pyTest Results
4351 passed, 29 skipped, 0 failures (138s)Closes #741