Repository navigation
fix(recall): scope by the domain identity remember writes (#721, slice 2) - #901
Conversation
…e 2)
remember resolves an explicit domain with resolve_explicit_domain (a
family member maps to its canonical, any other name is kept, lowercased),
but recall passed the raw argument to the store. recall(domain=
"cortex-cowork") therefore searched a scope no write used ("cortex"), and
recall(domain="SciFact") missed rows written as "scifact". recall now
resolves the argument the same way; an empty domain stays unscoped.
Refs #721
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018kyZYtYM7JyD4jA1eJJddp
The reranker-matrix probe executes the real body of recall._handler_impl with an explicit namespace that lists every global the body reads. The handler now calls resolve_explicit_domain, which the namespace lacked, so the unit check (run 42156979849, test_reranker_matrix_runtime) failed with NameError. The probe now passes the production resolver; its fixture query has no domain, so the resolver returns "" and reads no registry. Refs #721 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYtYM7JyD4jA1eJJddp
|
CI autopilot :
Generated by Claude Code |
…anged The unit check's mutation gate (ADR-1122, run 42158643521) mutates every function a PR changes. Editing one line of recall._handler_impl made the PR own that function's 133 pre-existing unkilled mutants. The domain is now resolved in _scoped_by_explicit_domain, the function the public handler wraps, which leaves _handler_impl and the reranker probe that executes its body identical to main. An empty or missing domain is left as given, as before; the caller's dict is copied, not changed. Refs #721 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYtYM7JyD4jA1eJJddp
|
CI autopilot :
Generated by Claude Code |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @cdeust's task in 1m 25s —— View job PR #901 review (1 of 3)
I found no Blockers. The full review is in this comment, with three Notes that need no action before merge. I did not run pytest or ruff here because the command was not permitted; the findings come from reading the code. Verdict: approve |
Claude review 1 of 3: PR #901 at
|
Summary
recallnow scopes by the same domain identityrememberwrites. Slice 1 (#877) maderememberresolve an explicitdomainwithresolve_explicit_domain: an exact family member maps to its canonical (cortex-cowork→cortex), any other name is kept, lowercased.recallstill passed the raw argument to the store, sorecall(domain="cortex-cowork")searched a scope no write used, andrecall(domain="SciFact")missed rows written asscifact. The handler now resolves the argument the same way; an empty or missing domain stays unscoped.Refs #721 (slice 2 of the remaining slices listed on the issue; the issue stays open).
Root cause: write and search resolved the explicit domain through two different paths (resolved on write, raw on read).
Type of change
Test plan
tests_py/handlers/test_recall_domain_scope.py(7 tests): builds a repository registry from real directories undertmp_path(cortex,cortex-cowork,harness-comparison) and reads the domain the publicrecallhandler hands topg_recall. It checks family → canonical, explicit name kept lowercased, recall scope ==remember._resolve_domain("", name)for three names, andNone/""stay unscoped.Nonealready stays unscoped). With it: 7 passed.pytest tests_py/handlers/ -k "recall or remember": 284 passed, 1 skipped (PostgreSQL is missing in this session).pytest tests_py/shared/test_explicit_domain_identity.py tests_py/handlers/test_remember_resolve_domain.py: pass.ruff checkandruff format --check(ruff 0.17.3, the pinned version) pass on both changed files.python scripts/check_craftsmanship.pypasses.Not verified here:
torchcould not be downloaded here (blocked host), so no benchmark ran. Benchmark callers pass lowercase names that are not repository names (beam,benchmark), which this change leaves as they are. The one exception would be a machine whose dev roots hold a repository named exactly like the benchmark domain.main,ruff check/ruff format --checkover the whole tree report errors inscripts/ci_pipeline_source_contract.py,scripts/tests/test_no_main_comparison.pyandtests_py/scripts/test_ci_review_required.py. This PR does not touch those files.Audit notes
handlers → shared, the same importremember.pyalready uses. No core/infrastructure change.directoryoverdomaininremember(owner decision);recall_hierarchicaland other domain filters (unified_searchgoes through this handler and inherits the fix); documenting aliases and migrating rows already written under a collided domain.Coding-standards compliance
recall.pyand_handler_implwere already in the craftsmanship baseline; the gate still passes.Breaking changes
A
recallwith an explicitdomainthat is an exact name of a repository grouped under a family now searches the family canonical, and mixed-case domains are lowercased. These are the scopesrememberhas written since #877.Generated by Claude Code