Repository navigation
fix(remember): keep an explicit domain instead of remapping it by substring (#721, slice 1) - #877
Conversation
…string (#721, slice 1) remember(domain=...) went through resolve_domain, which treats its input as a hint and returns the canonical of the longest known repository fragment found inside it: with a harness-comparison repository in the dev root, domain="scifact-comparison" was persisted as harness-comparison through the shared fragment "comparison". resolve_explicit_domain maps only an exact known repository name (or its ADR-0647 family) to its canonical and keeps any other name as given, stripped and lowercased. remember uses it for the caller's domain; inferred hints (profile detection, slugs, paths) still use resolve_domain. Refs #721 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYumzRRnGTwTkCk6tdj
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 2m 59s —— View job PR #877 review: done
The review found no Blockers and posts 3 Notes. Its verdict is approve. I couldn't run pytest, ruff or the craftsmanship gate in this job because the Bash commands weren't permitted. The gate result comes from reading |
Review of PR #877 (review 1 of 3) — commit 5c6cc80I found no Blockers. I read the diff myself and five agents reviewed it (code quality, security, test coverage, docs accuracy, performance). I traced these points:
I couldn't run pytest, ruff or the gate myself because the commands were not permitted in this job, so the last two lines above rely on the baseline file and CI. Notes, no action before merge
Verdict: approve |
…e (ADR-1122) (#898) * ci: run only the mutants of the changed functions in the mutation gate (ADR-1122) mutation_check.sh ran `mutmut run` with no name, so mutmut ran every mutant of each changed file and the gate judged the changed functions afterwards. #865 (backend_resolution.py, 262 mutants) was cancelled at the six-hour job limit after 141; #877 ran past two hours. The script now passes one `<prefix>*` name per changed function (scripts/ci_mutation_scope.py --globs). mutmut 3.8.1 asserts when no mutant matches; after a failed run the gate passes only when mutmut's stats file exists and its .meta files hold no mutant in scope, any other failure fails the job. Without MUTATION_ONLY_PREFIXES, every mutant runs as before. Measured on #877's diff (local macOS arm64, PostgreSQL 18.6): 36 mutants instead of 1,164, verdict in 21 min 15 s. No mutant hit mutmut's CPU timeout, so no wall-clock cap is added. * test(ci): keep the mutation scope test helper within four parameters * ci: fail loudly when the glob helper fails, and require each target's meta for an empty scope Review 1 of #898 notes: - A failure of `ci_mutation_scope.py --globs` inside `< <(...)` did not stop the script: NAMES stayed empty and every mutant ran. The names are now read from an assignment, so `set -e` stops the gate. - `--empty-scope` passed when the mutated file's `.meta` was missing. It now takes the mutated files and concludes only when each `.meta` exists; an empty file list is a usage error. - The shell tests used rc=1 for the fake failures; they now use 3, so the script must forward mutmut's own exit code.
|
Claude finished @cdeust's task in 46s —— View job PR #877 review 2 of 3: done
The review found no Blockers and adds 1 Note. Its verdict is approve. Not done:
|
Review of PR #877 (review 2 of 3): commit e9b0077I found no Blockers. Earlier Blockers: review 1 (commit What changed since review 1: one commit,
The merge adds no new code from this PR, so I didn't re-run the five agent reviews on code review 1 already checked. That follows the review contract: review only the commits pushed after the last review. I didn't run pytest, ruff or the craftsmanship gate locally. On this head, CodeQL and Notes, no action before merge
Verdict: approve |
) The mutation gate (ADR-1122) of check `unit`, run 42137023299, failed on PR #877. mcp_server.shared.domain_mapping.x_resolve_explicit_domain__mutmut_4 survived because `(name or "")` guards an input the contract never sends (`domain` is a str and the caller checks `if domain:`). No test reached the 26 mutants of remember._resolve_domain quickly enough, so each one ran the whole suite and hit its timeout. Run locally with only the explicit-domain and remember tests, 24 of the 26 survived. Drop the dead guard, drop the redundant default in `detection.get("domain", "") or ""`, which produced two equivalent mutants, and test the resolution order of _resolve_domain with fakes that only answer for the arguments the contract passes. Local mutmut 3.8.1 (SQLite, root): resolve_explicit_domain 8/8 killed; remember._resolve_domain gate on the CI's 36-file selection exits 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYumzRRnGTwTkCk6tdj
|
CI autopilot :
Non vérifié : le gate sur PostgreSQL (absent ici), et le gate Generated by Claude Code |
|
Claude finished @cdeust's task in 1m 37s —— View job Review of PR #877 (review 3 of 3): commit d31dd3cI found no Blockers. Earlier Blockers: reviews 1 ( What changed since review 2: one commit,
Not run: I couldn't run pytest, ruff or the craftsmanship gate because those Bash commands weren't permitted in this job. The new test file is 63 lines and What is accepted: the whole PR, meaning all three commits and all four files ( Notes, no action before merge
Verdict: approve |
…ess (ADR-1122) (#906) mutmut's default fork isolation forks every mutant from the process that already ran the suite. On the Linux runner the child then hangs in torch autograd (titans_memory.py loss.backward) until mutmut times it out, and a timeout fails the gate: #877's 26 _resolve_domain mutants all timed out, and #878 was cancelled at the six-hour job limit. Reproduced in an Ubuntu 26.04 container set up as ci.json "unit" on 11 mutants of #878: fork, 5 of the first 7 timed out (py-spy: child idle in backward()); forkserver, 0 of 11 timed out in 71 s. mutmut 3.8.1 documents forkserver for test setups that are not fork-safe (gevent, grpc, torch).
Summary
remember(domain=...)passed the caller's domain toresolve_domain, which treats its input as a hint: when no exact name matches, it returns the canonical of the longest known repository fragment found as a substring of the input. With aharness-comparisonrepository in the dev root,domain="scifact-comparison"was persisted asharness-comparisonthrough the shared fragmentcomparison— the collision reported in the SciFact campaign (mcp_server/shared/domain_mapping.py, step 4 ofresolve_domain).Root cause: no distinction between an explicit domain identity and an inferred hint. This PR adds
resolve_explicit_domain(mcp_server/shared/domain_mapping.py): only an exact known repository name (remote or directory name, or its ADR-0647 family) maps to its canonical; any other name is kept as given, stripped and lowercased.rememberuses it for the caller'sdomain; inferred hints (profile detection, slugs, paths) keep usingresolve_domain.Refs #721 (slice 1 — the remaining acceptance items are listed below, so this PR does not close the issue).
Type of change
Test plan
tests_py/shared/test_explicit_domain_identity.py(6 tests), built from real repository directories undertmp_path(controlled registry):resolve_domain("scifact-comparison") == "harness-comparison");resolve_explicit_domain("scifact-comparison")staysscifact-comparison;cortex-cowork→cortex);rememberhandler (SQLite), the persisted row'sdomainisscifact-comparison. Without theremember.pychange this test fails with'harness-comparison' == 'scifact-comparison'(checked locally).pytest tests_py/shared tests_py/handlers tests_py/invariants: 2580 passed, 105 skipped (PostgreSQL not reachable here → PG-gated tests skipped).python scripts/check_craftsmanship.py: OK.ruff check/ruff format --check(0.17.3, fromuv.lock) clean on the three touched files.Audit notes
domain="architect"with anai-architectrepo) is no longer remapped; it is kept asarchitect. Exact repository names and their ADR-0647 families still map.torchcould not be installed (proxy), so embedding-dependent tests ran on whatever the suite does without it.Remaining slices for #721
rememberresolvesdirectorybeforedomain, so a caller-supplieddomaindoes not override a known repository cwd although the schema documents it as an "override" — needs an owner decision on precedence.recall/fetchpassdomainto the store unresolved, soremember(domain="cortex-cowork")(stored ascortex) andrecall(domain="cortex-cowork")do not agree on canonical scope.Coding-standards compliance
Generated by Claude Code