refactor(cli): migrate get_collection call sites to PalaceRef kwargs (#37)#91
Merged
Merged
Conversation
…37) Four call sites in cli.py still used the legacy positional signature ``backend.get_collection(palace_path, collection_name)`` from before PR #21's MemPalace#665 cherry-pick. They worked because ChromaBackend.get_collection accepts both forms via ``_normalize_get_collection_args`` (the answer to issue #37 question (a): the compat shim exists and is intentional). Migrating for consistency with palace.get_collection and searcher.search_memories, which already use the new shape. Future backends (postgres, in-memory test fakes) may not carry the same positional compat surface; converging the codebase on the kwargs form keeps the migration runway short when one of those tightens. Touched sites (cli.py): - cmd_purge match-count probe (line ~1192) - cmd_drawers list-by-wing/room probe (~1282) - cmd_repair_status drawer count (~1492) - cmd_extract palace open (~1645) One test asserted the old positional call shape — updated to match the new PalaceRef call shape. 75/75 cli tests pass. Closes #37 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
cc34c55 to
bda5cf5
Compare
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
Closes the cli.py audit from #37. Four sites still used the legacy positional `backend.get_collection(palace_path, collection_name)` signature from before PR #21's MemPalace#665 cherry-pick. They worked silently because `ChromaBackend.get_collection` accepts both forms via `_normalize_get_collection_args` (intentional compat shim — issue #37 question (a)).
Migrated all four sites to the new kwargs form for consistency with `palace.get_collection` and `searcher.search_memories`. Future backends (postgres, test fakes) won't necessarily carry the same positional surface; converging now keeps the migration runway short when one tightens.
Sites touched
Test plan
Closes #37
🤖 Generated with Claude Code