Repository navigation
fix(python): resolve project-relative module names of nested projects (#13675) - #13698
Conversation
…#13675) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 23 minutes. View limit details
|
…project Independent review found three sites that matched short project names without the project-root check (rival-definition suffix matching, client app package prefixes, module_contains_owner). Those sites keep the repository-relative owner paths; project names reach import identity only through owner_import_modules_for, which applies the root check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e
…rival clause Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e
|
Independent review record (fresh-context reviewers, no stake in the implementation). Round 1 (head 94b7cb1): 3 blocking findings, all fixed in 7dc5d39.
Repair: those sites keep the repository-relative Round 2 (head 7dc5d39): no blocking findings. The reviewer checked every reader of Non-blocking follow-up filed as #13706: a test-local helper Local proof on d54e0f3: Generated by Claude Code |
|
SOURCE_REVIEW_READY Head: Local proof on this head: Hosted qualification is requested next via Generated by Claude Code |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY for the current head d54e0f3
Two independent fresh-context review rounds ran on this candidate; the PR conversation has the full record. Round 1 findings (three false-credit paths) were repaired in 7dc5d39, and round 2 at 7dc5d39 found nothing further. d54e0f3 adds only the tests round 2 recommended. Local precommit status: pass. Hosted qualification follows.
Generated by Claude Code
ripr static exposure checkCommit Took 78s. |
…name collision A project's lib/core.py is lib.core, not core, and pkg.py beside pkg/__init__.py leaves the shared name identifying neither. Spec 0028 records the project-relative identity rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e
…roots only The 3f59e15 lib filter missed a lone lib/core.py directly under the project; the new test with no top-level core.py fails without this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e
|
Review record, continued. Devin raised 2 real false-credit edges: a nested Round 3 (fresh-context reviewer, head 3f59e15) found two blocking problems:
Both are fixed in 80793d9. Project-relative names are now built from the full relative path plus Round 3 re-check (head 80793d9) came back clean. The reviewer traced these shapes: The pre-existing src-layout short-name collision it noted is filed as #13745. Local proof on 80793d9: Generated by Claude Code |
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e
|
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY for the current head 52b9f23
Three independent fresh-context review rounds and the Devin findings were each repaired with discriminating tests. The round 3 re-check at 80793d9 was clean, and 52b9f23 only applies a clippy contains rewrite. Local precommit status: pass. The review record and follow-up issues are in the PR conversation. Hosted qualification follows.
Generated by Claude Code
…fixture fix) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY for the current head e1f739c
The earlier hosted run failed check-fixture-contracts on fixtures/module_reach_control_qualified, a Rust fixture this PR does not touch. Main fixed it in #13773. e1f739c is a merge of current main with no conflicts, so the source delta is unchanged from the reviewed 52b9f23. After the merge, check-fixture-contracts passes locally and layout_tests passes 10/10.
Generated by Claude Code
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e
main went red when #13667 (ripr completions) and #13731 (CLI reference freshness test) landed independently; the reference lacked the new command. Regenerated with RIPR_BLESS_CLI_REFERENCE=1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e
|
CI note: on e1f739c, 9dc9c0e merges current main and regenerates the reference with Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY for the current head 9dc9c0e
The Python source delta is unchanged from the reviewed 52b9f23. This head adds two things: a clean merge of current main, and a regenerated docs/CLI_REFERENCE.md. The regeneration adds only the ripr completions row and section, produced by the repository's own bless command, and repairs the stale reference on main. cli_reference_doc and layout_tests pass locally.
Generated by Claude Code
|
|
Resolves conflicts with #13745 (src short-name plain-module rival): both the shadowing rule and the nested-project names are kept, and project names record shadowed: false since same-project collisions already identify neither. The new code moves to related_tests/project_names.rs so the PR-evidence scoped check does not have to re-analyze a large diff in the 4k-line related_tests.rs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e
|
CI note for 9dc9c0e: Cause. The slowdown came from the diff, not the binary. I reproduced it locally against the same base with the PR's debug binary:
Passing PRs finish this step in about 4 to 8 minutes. The new code sat inside the ~4.2k-line Fix, in aef162e:
Proof on aef162e:
A scoped check that takes over an hour on a 160-line edit to a large file is a ripr performance problem in its own right. I'll file it separately. Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY for the current head aef162e
What was inspected for the delta since 9dc9c0e:
- The merge of main and the conflict resolution with #13745. Both the plain-module shadowing rule and the nested-project names are kept. Project names set
shadowed: false, because a same-project collision is already skipped before the entry is recorded. - The move into
related_tests/project_names.rs. Diffing the moved code against the original shows only the visibility change and the new field. - The
bare_name_bound_to_other_moduleclause for shadowed src short names. Those names are owner paths, so the clause is unchanged from main. - Proof: 1977 Python adapter tests pass, precommit passes, and the local scoped PR-evidence check finishes in 307s.
The two earlier fresh-context review rounds still cover the logic, which is unchanged.
Generated by Claude Code
|
That match comes from main through the missed-txt format change; this PR does not touch Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY for the current head 2d89c19
The only change since aef162e is a clean merge of main, which brings in the MissedTxt compile fix from #13848. No files of this PR conflicted.
- The lib compiles.
cargo test -p ripr --lib analysis::language::python: 1990 passed, 0 failed.
Generated by Claude Code
Requested by Steven Zimmerman · project thread
Summary
In a monorepo where each package is its own Python project (
svc/b/pyproject.toml) and tests import modules by their project-relative name (from core import limit), ripr never matched the import tosvc/b/core.py. Owner module paths were repository-relative only (svc.b.core), so a strong test readweakwith "could not confirm".The Python adapter now records each owner's project-relative names. The project root is the nearest non-root ancestor holding
pyproject.toml,setup.py,setup.cfg,pytest.iniortox.ini. These names go through the existing #4566 ambiguity record (AmbiguousSrcModule), so a project-relative name identifies the owner only for tests under that project root. A sibling project's same-namedcorestill gets no credit. Project names reach import identity only throughowner_import_modules_for(owner, test_file), which applies that root check. Suffix and package-prefix matchers keep the repository-relativeowner_module_paths.Governing issue or accepted claim: #13675
Acceptance delta (one sentence): A strong test in a nested Python project that imports its module by project-relative name reads
exposed, and a sibling project's same-named module does not credit it.Layout matrix (all at repo root, strong test, before this change)
These layouts already read
exposedwith the correct related test:srcand in a flat package*_test.py, nestedtests/unit,tests/__init__.py, package-internalpkg/testsfrom="src", hatch, setuptoolswhere=["lib"], uv workspace, pytestpythonpath=["lib"]The nested-project case was the only attribution gap I found. Nested-root auto-detection and doctor hints are #13618, which another candidate is handling.
Review
There were two independent fresh-context review rounds; see the review record comment. Round 1 found 3 false-credit paths (suffix matching, client-app prefixes,
module_contains_owner), and all three are fixed. Round 2 was clean. Non-blocking follow-up: #13706.Proof (head d54e0f3)
layout_tests.rspasses 7/7:import pkg; pkg.core.limit();other.core) and the exact match (x/src/core.py).cargo test -p ripr --lib analysis::language::python: 1964 passed, 0 failed.svc/bwent fromweak("could not confirm") toexposed.cargo xtask precommit: Status pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01UNUoLVHnMQXBm6voKj1B8e