mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-05 00:13:38 +00:00
Rename propagation * `rename_memory_and_propagate_references` enumerated `get_full_list()`, which includes the memories matched by `read_only_memory_patterns`. * Writing one of those raises `PermissionError` in `_check_write_access`, so a rename of a memory that was referenced from a read-only memory failed *after* `move_memory` had already applied the rename. * The memory graph was then half-updated: the renamed memory existed under its new name while the writable referrers still held `mem:OLD_NAME`, and retrying the rename failed with "Memory not found". Fix * In a tool context, propagate only into the memories that accept writes, sorted to keep the enumeration order that `get_full_list()` provided. * Outside a tool context nothing changes, so read-only memories are still updated when the user renames through the CLI. * A reference which thereby remains in a read-only memory is still reported as stale by `validate_referential_integrity`, so it is not hidden. Documentation * `docs/02-usage/045_memories.md` promised that the tool rewrites every reference across all memories. That is now only true for the memories the agent may write, so the caveat is stated where the promise is made. Tests * Add a regression pair: the tool-context rename completes and rewrites both occurrences in a writable referrer, while the CLI context additionally rewrites the read-only one.