Skip to content

fix(python): read reach through an importing module's caller as static_unknown (#12955) - #13890

Merged
EffortlessSteven merged 15 commits into
mainfrom
claude/project-thread-om4vsf
Nov 17, 2026
Merged

EffortlessSteven merged 15 commits into
mainfrom
claude/project-thread-om4vsf

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Summary

  • A Python function that a test in another package reaches only through a function of another module no longer reads no_static_path ("No Python test references discount("). The issue's ws-test-other-crate shape is test_checkout -> checkout in app/app.py, which imports and calls discount from wscore/core.py.
  • The bounded helper-caller chain (helper_owner_call, python: private helper reached only through a same-module public function is no_static_path #4568) can now take its first hop from a function of another module. That function must bind the helper exactly, with from <owner module> import <name> (aliased or not), and bare-call it. Later hops stay in the file of the function they call, within the same three-hop bound.
  • Such a test gets the reach-only cross_module_caller_call relation. When every related test is reached this way, the finding is static_unknown under missing_import_graph. It names the caller and its file and starts no repair. A test that also reaches the helper through a same-module caller keeps the existing helper_owner_call reading.
  • If more than 32 functions of other modules call the helper, none of them is followed. With no other related test, the helper reads static_unknown rather than no_static_path.

This is the Python part of #12955 and follows the shape #13669 gave TypeScript. The Rust part is not in this PR: #13059 closed unmerged as superseded by the #9982 facade contract, and the Rust follow-up is #13974.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Proposal: n/a
Spec: docs/specs/RIPR-SPEC-0028-python-preview-static-facts.md (Cross-Module Caller Amendment)
ADR: n/a
Plan item: TypeScript/Python monorepo support
Governing issue or accepted claim: #12955 (Python part, claimed on the issue)
Acceptance delta (one sentence): Python reach that enters the changed module only from an importing module's caller reads static_unknown naming that caller, never no_static_path, and bindings that are not exact add no edge.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): claude/project-thread-om4vsf
Stack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): none
Accepted winner and losing candidate disposition (when decided): n/a

Scope

  • related_tests.rs:
    • helper_owner_call_candidates follows the cross-module first hop.
    • New: cross_module_owner_binding, cross_module_callers, cross_module_callers_exceed_cap, MAX_CROSS_MODULE_CALLERS, and the CrossModuleCallerCall relation.
    • The memo caches the over-cap check once per owner.
  • static_limits.rs: cross_module_reach_limit.
  • classify.rs: wiring and the cross_module_caller_call: evidence line.
  • cross_module_caller_tests.rs: 11 new tests.
  • The RIPR-SPEC-0028 amendment, a traceability entry and a changelog fragment.

Scope Classification

  • One production behavior

Production delta:

  • A cross-module importer's caller is a reach-only path into a changed Python helper, read as static_unknown.

Evidence/support delta:

  • Positive tests:
    • the plain cross-module wrapper;
    • an aliased import;
    • a same-module hop behind the importer;
    • the fan-in cap, which tells > from >=.
  • Negative controls stay no_static_path:
    • no test calls the wrapper;
    • a same-named function of another module;
    • a local def shadowing the name;
    • a top-level def after the import;
    • a namespace import core.discount(...);
    • the owner passed as a value;
    • a parameter shadow;
    • two imports binding the owner;
    • an alias collision;
    • a method caller in another module, reached by a bare call, and a method behind a crossed hop.
  • Ordering: a same-module caller keeps the helper_owner_call reading over a cross-module caller at hop 1 and at hop 2.

Single acceptance criterion:

  • In the issue's ws-test-other-crate Python shape, the changed discount reads static_unknown, with test_checkout_at_boundary related through checkout (app/app.py), where it used to read no_static_path. A package that does not import the changed one still reads no_static_path.

Non-goals:

  • Namespace-import attribute calls (core.discount(...)), star imports, and imports inside functions or try/if blocks are not followed.
  • Values are not evaluated across the module boundary.
  • validate_agent_gap_record_packet is not loosened.

Support-tier Impact

  • none

Policy Impact

  • none

Proof

On head 99169ca (current main merged in):

cargo test -p ripr --lib language::python   # 2112 passed, 0 failed (includes the 11 cross_module_caller_tests)
cargo xtask precommit                       # exit 0

Real-binary check on the issue's fixture shape (earlier head, same production logic):

Case Result
Wrapper in app/ imports and calls discount static_unknown, limit missing_import_graph, related test_checkout_at_boundary (was no_static_path)
Namespace-import wrapper no_static_path
Same-named function of another module no_static_path
No test calls the wrapper no_static_path
Unrelated wrapper no_static_path

Result, failures, or skipped proof:

  • Full workspace tests run in hosted CI.
  • An independent subagent reviewed the code before publication. It found one real ordering regression: a deeper same-module chain lost to a cross-module caller. That is fixed, with a regression test.
  • A fresh independent review of the 2026-11-15 main merge found the conflict resolution correct (main's dunder protocol helper path is kept unchanged).

Claim Boundary

  • What can be claimed: a Python test that reaches a changed top-level function only through an exactly bound importer's caller in another module reads static_unknown, never no_static_path.
  • What cannot be claimed: that such reach exposes the change, or that namespace-import or dynamically bound callers are followed.

Rollback

Reverting the squash commit is enough. There is no schema or fact-store change, because the relation is built from existing owner facts (imports, module_callees).

Spec-Test-Code Traceability

  • Spec: RIPR-SPEC-0028 (Cross-Module Caller Amendment)
  • Tests: crates/ripr/src/analysis/language/python/cross_module_caller_tests.rs (11 tests, listed in .ripr/traceability.toml)
  • Code: crates/ripr/src/analysis/language/python/{related_tests,static_limits,classify}.rs
  • Golden outputs: none changed
  • Metrics: n/a
  • ADR/learning: n/a

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

CI Economics

n/a

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.
  • Errors are reported with actionable context.

Gates

  • cargo fmt --check, cargo xtask check-static-language and the other repository policy checks, all through cargo xtask precommit (exit 0).
  • The workspace-wide check, test, clippy, doc and package gates run in hosted CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UNUoLWNfokgGZdJ7U9uwns

claude added 10 commits November 8, 2026 15:59
… anchored at its declaring config (#11204)

A relative extends base anywhere inside the workspace root (regular file,
no symlink) is now followed; an inherited baseUrl resolves against the
config that declares it, as tsc does. An unfollowable base is ignored only
when the extending config declares both baseUrl and paths; cycles always
fail closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLWNfokgGZdJ7U9uwns
- An explicit null baseUrl/paths clears the inherited value (tsc semantics)
  instead of silently keeping the base's aliases.
- A cycle anywhere in the chain fails closed even under a self-sufficient
  config; visited entries are popped on every outcome.
- Symlinked intermediate directories are refused, not only the final file.
- A relative workspace root ('.') no longer rejects in-root chains.
- An extends target without a .json suffix tries <target>.json first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLWNfokgGZdJ7U9uwns
… back to <target> (#11204)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLWNfokgGZdJ7U9uwns
…irectory extends resolves end to end (#11204)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLWNfokgGZdJ7U9uwns
…c_unknown (#12955)

A Python function that a test in another package reached only through a
function of another module that imports and calls it read no_static_path.
The bounded helper-caller chain now also enters from a function of another
module that binds the helper exactly (`from <owner module> import <name>`,
aliased or not, the only binding of that name, not shadowed by a top-level
def or class) and bare-calls it. Such a test gets the reach-only
cross_module_caller_call relation; when every related test is reached that
way the finding is static_unknown under missing_import_graph, naming the
caller and its file, with no repair card. A same-module caller keeps the
existing helper_owner_call reading. More than 32 cross-module callers are not
followed, and with no other related test the owner reads static_unknown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLWNfokgGZdJ7U9uwns
…h and memoize the cap (#12955)

Review of the cross-module caller relation:
- A test reaching the owner through a deeper same-module chain and a
  cross-module caller kept the cross-module label because callers were only
  ordered within a hop; all same-module callers now fold first.
- The over-cap count is computed once per owner through the related-candidate
  memo instead of a workspace owner scan per changed line.
- The spec and changelog state what the binding check actually reads:
  top-level imports and top-level def/class only.
- New tests: a hop-two same-module chain beside a cross-module caller, and
  ambiguous local bindings (two imports of the owner, alias collision).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLWNfokgGZdJ7U9uwns
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 8, 2026 22:06
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 146 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 75c96b1b-1454-4f5e-a59f-6e542615647c
Commits

Reviewing files that changed from the base of the PR and between 60114de and 99169ca.

Files selected for processing: 8

  • .ripr/traceability.toml
  • changelog.d/12955-python-cross-module-caller-reach.md
  • crates/ripr/src/analysis/language/python.rs
  • crates/ripr/src/analysis/language/python/classify.rs
  • crates/ripr/src/analysis/language/python/cross_module_caller_tests.rs
  • crates/ripr/src/analysis/language/python/related_tests.rs
  • crates/ripr/src/analysis/language/python/static_limits.rs
  • docs/specs/RIPR-SPEC-0028-python-preview-static-facts.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY for head 99c6736

Source review of head 99c6736. An independent subagent reviewed the change read-only before publication. It checked:

  • that no cross-module path reaches exposed, weakly_exposed or a repair card;
  • how this interacts with the leading static limits, the imported-literal lift, owner-exact substitution and activation-limited rows;
  • the rewritten same-file frontier against the old one;
  • how exactly the bindings are read;
  • the cost of the cap.

It found one ordering regression, where a deeper same-module chain lost to a cross-module caller. The second commit fixes it and adds a hop-two regression test. The same commit memoizes the over-cap scan per owner and narrows the spec and changelog wording to what the binding check reads, which is top-level imports and top-level def/class only.

Local proof: cargo test -p ripr --lib language::python gives 1976 passed, and cargo xtask precommit exits 0. On the issue's fixture, the real binary reads static_unknown with checkout (app/app.py) named, and the four negative controls read no_static_path. Hosted qualification is requested next.


Generated by Claude Code

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

ripr static exposure check

Commit 1f4dd2e238b5 · run · advisory, static evidence only (not a mutation run).

#ripr agent static-advisory base=e810807e938f9d6e0d00423864a659e90cb42dbd findings=178 gaps=5 infection_unknown=4 propagation_unknown=3 static_unknown=56 weakly_exposed=115
weakly_exposed|crates/ripr/src/analysis/language/python/related_tests.rs:83|Self::CrossModuleCallerCall =>|missing=No strong discriminator was detected|test=t1|id=probe:crates_ripr_src_analysis_language_python_related_tests.rs:match_arm:c450ff64
weakly_exposed|crates/ripr/src/analysis/language/python/related_tests.rs:644|!helper_owner_is_unique_top_level_function(owner, owners)|missing=Check unconfirmed: no supported assertion that distinguishes the changed behavio…|test=t2|id=probe:crates_ripr_src_analysis_language_python_related_tests.rs:predicate:1726e8a1
weakly_exposed|crates/ripr/src/analysis/language/python/related_tests.rs:645|return Vec::new()|missing=No strong discriminator was detected|test=t3|id=probe:crates_ripr_src_analysis_language_python_related_tests.rs:return_value:2f5a4496
weakly_exposed|crates/ripr/src/analysis/language/python/related_tests.rs:647|owners .iter() .filter(\|caller\| { top_level_function(caller) && cross_module_own…|missing=No strong discriminator was detected|test=t3|id=probe:crates_ripr_src_analysis_language_python_related_tests.rs:return_value:1c61316c
weakly_exposed|crates/ripr/src/analysis/language/python/related_tests.rs:650|top_level_function(caller) && cross_module_owner_binding(caller, owner, owners) …|missing=Check unconfirmed: no supported assertion that distinguishes the changed behavio…|test=t2|id=probe:crates_ripr_src_analysis_language_python_related_tests.rs:predicate:a75ea8df
t1=crates/ripr/src/analysis/classify/transitive_reach.rs:6019 a_call_witness_outranks_a_derive_witness exact_value `assert_eq!( witness.map(|w| ( w.test_name, w.entry_symbol, w.via_derive, w.other…` miss=observation_unconfirmed
t2=crates/ripr/src/analysis/language/python/cross_module_caller_tests.rs:216 given_more_cross_module_callers_than_the_cap_then_the_owner_reads_static_unknown relational_check `assert!( finding.missing.iter().any(|line| line.contains(&format!( "more than {}…` miss=weak_assertion
t3=crates/ripr/src/analysis/classify/related_tests.rs:16282 absolute_workspace_probe_keeps_relative_cross_crate_guard relational_check `if !related.is_empty() { return Err(format!("cross-crate test must stay unrelate…` miss=weak_assertion
limits=infection_unknown:4,propagation_unknown:3,static_unknown:56,weakly_exposed:110
next=ripr explain --root . --base e810807e938f9d6e0d00423864a659e90cb42dbd --committed --mode draft --format agent probe:crates_ripr_src_analysis_language_python_related_tests.rs:match_arm:c450ff64
verify=refused|outcome=complete_with_findings|findings=178|exposed=0|reason=gaps_remain

Took 72s.

…12955)

Devin review of #13890: a method of an importing module that calls the
changed helper was a cross-module entry, and related_test_relation matches a
method owner by a bare `name(` call in the test without proving the receiver.
A test calling an unrelated same-named `checkout` from another module was
then linked to the helper. Past a module boundary only top-level functions
are now callers; the spec also states that a limit read from the changed line
itself can take precedence over missing_import_graph (still static_unknown).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLWNfokgGZdJ7U9uwns

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY for head 736dc65

Source review of head 736dc65. The change since the reviewed 99c6736 answers the two Devin threads, which are now replied to and resolved.

  • A method of an importing module is no longer a cross-module caller. Only top-level functions are followed past a module boundary, in both cross_module_callers and crossed same-file hops. The new test given_a_method_caller_in_another_module_then_a_same_named_bare_call_makes_no_edge reproduced the wrong link before the fix and pins no_static_path after it.
  • The spec now states that a limit read from the changed line itself can take precedence over missing_import_graph. The finding stays static_unknown either way.

Local proof: cargo test -p ripr --lib language::python gives 1990 passed, and cargo xtask precommit exits 0. Hosted qualification is requested next.


Generated by Claude Code

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head review (head 736dc65)

Reviewed against base 5e85e36124dc (merge-base with main). I first reviewed head 99c67364, then re-reviewed the delta 99c67364..736dc653 and re-ran everything at this head.

Surfaces covered:

  • related_tests.rs: cross-module first hop, binding check, cap, memo;
  • static_limits.rs::cross_module_reach_limit;
  • the classify.rs wiring and evidence line;
  • the 10 tests in cross_module_caller_tests.rs;
  • the RIPR-SPEC-0028 amendment, .ripr/traceability.toml and the changelog fragment.

The PR body has Governing issue or accepted claim: #12955 and an Acceptance delta line.

Result: no blocking findings. There are 2 low-severity findings, both about tests and wording. The new relation fails closed: it adds no oracle, no grade and no repair.

Verified

  • No oracle and no repair.
    • CrossModuleCallerCall is not in uses_oracle() (related_tests.rs:85).
    • python_repair_placement_on only places a repair on a uses_oracle() candidate (related_tests.rs:672).
    • So the relation never reaches weakly_exposed/exposed and never produces a repair card.
  • Every leading static limit gives static_unknown.
    • Any static_limit maps to ExposureClass::StaticUnknown (classify.rs:1122-1126).
    • The imported-literal lift requires has_oracle_eligible_relation (classify.rs:1095-1104). That never holds when every related test is cross-module.
    • The amended spec now says a limit read from the changed line can take precedence over missing_import_graph (RIPR-SPEC-0028…md:1765-1767). That matches the order static_limit_for_focused_change(...).or_else(&fallback_limits).
  • Same-module callers take precedence. same_file_edge takes .min() over the crossed flag, and callers.sort_by_key(|(_, crossed)| *crossed) runs before the per-test fold. Both are pinned by the hop-1 and hop-2 ordering tests.
  • Methods in other modules are excluded. The 99c6736 version accepted them, and I reproduced the wrong link on that head: a Checkout.checkout method linked test_other, which only calls an unrelated checkout(...), and test_cart, which calls cart.checkout(...) on object(). Both read static_unknown / missing_import_graph there. At this head both entry points require top_level_function(caller):
    • cross_module_callers (related_tests.rs:549);
    • crossed same-file hops (related_tests.rs:379).
  • The cap is exact. The check is entries.len() > MAX_CROSS_MODULE_CALLERS, and the cap test checks both 33 and 32 callers.
  • Windows path rendering. The caller label uses normalized_path. On native Windows the checkout (app/app.py) expectation passed, so the label uses forward slashes there.
  • Command I ran, in a detached worktree at 736dc65 (Git Bash on Windows): cargo test -p ripr --lib cross_module_caller -- --nocapture --test-threads=1.
    • Result: 14 passed; 0 failed. That is the PR's 10 tests plus 4 scratch probes, which were not committed or pushed.
    • All 4 probes read NoStaticPath, related=[]: method caller with a bare same-name call; method caller with an unrelated receiver; top-level wrapper with cart.checkout(...); and a method that reaches the owner through a cross-module top-level _apply.
  • Not run by me: the full language::python suite, cargo xtask precommit and check-traceability.
  • Hosted checks at read time: 21 pass, 5 pending. The required check comes from Ripr Rust Small on GitHub Hosted / Rust gates, which is still pending. The one red, ub-review, ended with Process completed with exit code 143. That is a terminated or cancelled run, and the check is not in the required contexts (["Ripr Rust Small Result"]).

Findings

1. Low: the hop-2 method guard is not pinned by any test in the PR

At crates/ripr/src/analysis/language/python/related_tests.rs:379, this guard keeps methods out of crossed same-file hops:

                    if top_level_function(caller) {
                        crossing.push((caller, true));
                    }

Negative experiment. I changed that line to if true || top_level_function(caller) { and re-ran the same command. All 10 PR tests still passed. Only my scratch probe changed:

PROBE4 class=StaticUnknown limit=Some(MissingImportGraph) related=["test_cart"]

The probe fixture is:

  • app/app.py:
    from wscore.core import discount
    
    def _apply(price):
        return discount(price)
    
    class Checkout:
        def checkout(self, price):
            return _apply(price)
    
  • the test:
    def test_cart():
        cart = object()
        assert cart.checkout(100) == 90
    

The new test given_a_method_caller_in_another_module_then_a_same_named_bare_call_makes_no_edge covers only the hop-1 entry at :549, through a bare call.

Fix. Add the fixture above as a no_static_path control, plus the unrelated-receiver variant (a method caller with cart.checkout(...) and no other/lib.py), and list both in .ripr/traceability.toml. Without them, removing the hop-2 guard would bring back the over-credit fixed in the latest commit, and no test would fail.

2. Low: the spec still contradicts itself on imports inside try/if

docs/specs/RIPR-SPEC-0028-python-preview-static-facts.md:1776-1779 says both of these:

"A module-level assignment to that name or an import inside a try/if block is not seen, so it can still make an edge"

"An import inside a function or a try/if block makes no edge."

The intended meaning seems to be:

  • a rebinding inside try/if does not stop a top-level binding from making an edge;
  • a binding that exists only inside try/if makes no edge.

Say that explicitly so the paragraph does not read as two opposite claims.

Residuals (not findings)

  • Name-only match for top-level wrappers. A top-level cross-module wrapper still relates tests by name when the test's import has no workspace rival, for example from thirdparty import checkout. That is the existing bare_name_bound_to_other_module policy, not something this PR adds. The worst outcome is no_static_path becoming static_unknown.
  • Module-level assignment. A module-level assignment that rebinds the imported name still makes an edge. The spec states this.
  • Hop 1 only. The cross-module entry is followed at hop 1 only. An importer of a same-module caller of the helper is not followed, which is consistent with the non-goals.

…dings (#12955)

Exact-head review of #13890: removing the top_level_function guard on a
crossed same-file hop left every test green. The new control covers a method
behind a cross-module `_apply` hop and a method entry, each with a bare call
and with an unrelated receiver, and fails when the guard is removed. The spec
now separates a rebinding inside try/if (not seen) from a binding that exists
only there (no edge).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLWNfokgGZdJ7U9uwns

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY for head b78870e

Source review of head b78870e. The change since the reviewed 736dc65 answers both low findings from the exact-head review (5820113271). Production code is unchanged.

  • Added test given_a_method_behind_a_cross_module_hop_then_no_edge_is_made covers four combinations: a method behind a cross-module _apply hop and a method entry, each with a bare call and with an unrelated receiver. A negative experiment (changing the crossed-hop top_level_function guard to true ||) turns exactly this test red while the other 10 stay green; with the guard restored all 11 are green.
  • The RIPR-SPEC-0028 amendment separates two cases. A rebinding inside try/if of a name that a top-level import already binds is not seen. A binding that exists only inside a function or a try/if block makes no edge.

Local proof: cargo test -p ripr --lib cross_module_caller_tests gives 11 passed, and cargo xtask check-static-language and cargo xtask check-traceability both exit 0.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Ripr Rust Small on GitHub Hosted / Rust gates is red on b78870e, but the failure is not from this PR. The lib-test build of the merge ref fails with E0063: missing field owner_opt_outs in initializer of app::CheckOutput at crates/ripr/src/output/human.rs:9236. That test literal is on main as it stands: #13874 added the owner_opt_outs field, and a test added in parallel builds CheckOutput without it. This PR does not touch human.rs or CheckOutput.

Two open PRs already fix main: #13920 and #13912. I will not copy that fix into this PR. Once one of them lands, I will merge main into this branch and request qualification again.


Generated by Claude Code

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

merge-ready is set, but this PR conflicts with main (head b78870ee), so GitHub creates no test-merge ref and no qualification run can start. Merge main into the branch and resolve the conflicts, then remove and re-apply merge-ready.

…-om4vsf

# Conflicts:
#	crates/ripr/src/analysis/language/python.rs
#	crates/ripr/src/analysis/language/python/related_tests.rs
#	crates/ripr/src/analysis/language/python/static_limits.rs

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY for head 1f4dd2e

Source review of head 1f4dd2e. The change since the reviewed b78870e is two merges of current main.

The first merge resolved a conflict with #13806 (dunder-helper reach). That PR split helper_owner_call_candidates into helper_owner_call_candidates_indexed, module_function_callers and helper_candidates_from_callers. The cross-module first hop now sits in module_function_callers, which returns each caller with its crossed flag, keeping same-module callers first at every hop and only top-level functions past the boundary. Dunder entry callers are always same-module. The candidate fold is unchanged from main except for the crossed flag and the caller label. The second merge brought in #13912, which fixed main's owner_opt_outs lib-test build. The python.rs and static_limits.rs conflicts were import and module lists, and both sides were kept.

Local proof on the merged tree: cargo test -p ripr --lib language::python gives 2033 passed, which covers main's new dunder-helper tests and the 11 cross-module tests. cargo xtask precommit exits 0.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

The Rust-only feature lane failure on head 1f4dd2e is a main break, not this change. The error is error[E0062]: field owner_opt_outs specified more than once at crates/ripr/src/output/human.rs:9264. Main has carried that duplicate initializer since #13432 composed onto #13912, and this PR does not touch human.rs. The fix is open as #13938. Once it lands I will merge main into this branch, re-run the Python tests, re-attest the new head and requalify.


Generated by Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs verification checks before upstream.

Verification questions

  • Confirm the documented import-rebinding limitation is explicit: module-level assignments and rebinding inside try/if blocks are not detected, while function/block-only bindings make no edge.
  • Confirm no sibling helper-path expansion is justified by this diff: the relevant parallel surfaces are the existing same-module caller traversal, dunder entry handling, and cross-module top-level callers, all routed through the indexed helper-candidate fold.

Refuted

  • No worker handoff surface is present in the changed files; the diff only changes Python analysis and documentation.

Parked follow-ups

  • The over-cap path intentionally converts an otherwise unconnected helper into static_unknown rather than broadening cross-module analysis to arbitrary helper groups.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.
  • The late cargo-test receipt was absent from the shared review packet.
  • Current executable evidence is incomplete despite seeded author claims of passing Python and precommit runs.
  • Full test and analyzer completion remain unverified because cargo-test receipt is absent and ripr exited with code 2.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

merge-ready is set, but this PR conflicts with main (head 1f4dd2e2), so GitHub creates no test-merge ref and no qualification run can start. Merge main into the branch and resolve the conflicts, then remove and re-apply merge-ready.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Disposition: parked, not merge-ready.

This PR is CONFLICTING with main at head 1f4dd2e2, so it cannot pass late qualification or land as-is. The merge-ready label was removed on 2026-11-14.

Owner: coding ripr-swarm. Revisit by 2026-11-21, or close it earlier as superseded if another candidate lands the same issue. No code was rejected here; this records the unowned state rather than leaving it silent.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: APPROVE 1f4dd2e — no blocking findings on this head.

Scope reviewed: the #12955 Python cross-module caller reach at the exact head 1f4dd2e2 (base e810807e): python/related_tests.rs (cross_module_owner_binding, cross_module_callers, module_function_callers), python/static_limits.rs:1678 (cross_module_reach_limit), python/classify.rs:433 and :735, the new cross_module_caller_tests.rs (11 tests) and the RIPR-SPEC-0028 amendment. Static only: no build, no test run.

Why the new reading is honest:

  • The entry edge needs an exact binding: from <owner module> import <owner> (aliased or not) whose source module resolves to the owner's module under the same provenance rules a test import uses, exactly one import binding that local name, no top-level def/class of the caller's file with that name, and a bare name( call in the caller's own body (module_callees, which already excludes parameters and local rebinds) — related_tests.rs:604-641.
  • Only a top-level function of another module is an entry (top_level_function), and only the first hop may cross the boundary; later hops stay in the caller's file — related_tests.rs:431-505. A method, a namespace import, a star import, a value pass, a same-named function of another module, a second import of the local name and an alias collision all make no edge; six negative controls plus the two Devin cases assert NoStaticPath and no cross_module_caller_call evidence.
  • Every such candidate is reach-only (uses_oracle() false, rank 2) and the classifier reads it as static_unknown under missing_import_graph, naming the caller and file (static_limits.rs:1678). The limit fires only when all related rows are cross-module helpers, or when no row exists and more than 32 cross-module callers were not followed. python_repair_placement needs WeaklyExposed plus an oracle relation, so this relation cannot produce a repair card — structural, not only tested.
  • Same-module callers sort before cross-module callers (related_tests.rs:504), so a test reached both ways keeps the existing helper_owner_call reading; two tests pin that at hop 1 and hop 2.
  • The cap is > 32 not followed, == 32 still followed (related_tests.rs:437); one test pins both sides of the boundary and the message text.

What the tests pin, and what they do not:

  • They pin class, limit kind, the exact cross_module_caller_call: checkout (app/app.py) calls discount (test_...) evidence, the missing line naming the caller, the absence of an oracle, and the negative controls.
  • They do not pin the absence of a repair card directly; that holds because of the WeaklyExposed-only guard in python_repair_placement, not because of a test.
  • They do not exercise a namespace-import wrapper (import wscore.core; core.discount(...)) on the positive side — a declared non-goal that stays no_static_path.

Qualification this head still lacks: it is CONFLICTING/DIRTY. The merge-ref run 42544085548 fails Rust gates with E0062: field 'owner_opt_outs' specified more than once at crates/ripr/src/output/human.rs:9264 — a file this PR does not touch, i.e. the conflict, not the diff. So there is no hosted green on a mergeable head; the review above is source-level only. Base e810807e is six days behind main.

Non-blocking:

  1. The PR body says "The Rust part is covered by open #13059"; #13059 was closed unmerged on 2026-11-09 as superseded by the #9982 facade contract, and the Rust follow-up is now #13974. A fresh session reading the body would think the Rust half is in flight.
  2. The body says "9 new tests"; the traceability entry and the module list 11.
  3. Cost: cross_module_callers scans every owner and, for each importer, scans owners again for a same-named top-level definition (related_tests.rs:640-657 via :621-639). It runs before the cap is applied, so a helper imported by thousands of functions pays the full scan. No benchmark here; worth an early exit if that shape is real.

Limits: no build, no test run, no mutation, no checkout; read via gh pr diff, gh api at the head, and git log on a clean checkout.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Disposition: conflict resolution dispatched at 1f4dd2e2.

The conflict is not in this PR's diff. The merge-ref run 42544085548 fails Rust gates with E0062 duplicate owner_opt_outs at crates/ripr/src/output/human.rs:9264, a file this PR does not touch. So this is a merge resolution, not a code repair: merge current main, resolve the duplicate, keep the approved Python cross-module caller reach unchanged.

Two body facts are also wrong and cheap to fix: the body says the Rust part is "covered by open #13059", but #13059 was closed unmerged on 2026-11-09 (superseded by the #9982 facade contract) — the Rust follow-up is #13974. And the body says "9 new tests"; there are 11.

The approval at 1f4dd2e2 does not carry to the resolved head; a fresh review is required after the merge.

#13900 (bd21b9df, also CONFLICTING, 281 commits behind main) is the next of this class. Its green is on the head as of 2026-11-09, not on a mergeable head, so it needs the same treatment; it is queued behind #13890 rather than dispatched in parallel.

…-om4vsf

# Conflicts:
#	crates/ripr/src/analysis/language/python/classify.rs
#	crates/ripr/src/analysis/language/python/related_tests.rs

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY for head 99169ca

Scope: the main merge 99169ca on top of the source-reviewed and approved head 1f4dd2e. That merge resolved conflicts in python/related_tests.rs and python/classify.rs against main's dunder protocol helper path.

  • Resolution: helper_owner_call_candidates_indexed returns (callers, dunder_module_helper), with false for dunder-entry callers and true for the module-function path, as on main. It passes both into helper_candidates_from_callers(owner, callers, all_tests, dunder_module_helper, owners). Main's dunder_protocol_helper_call and its condition are unchanged. The classify.rs import keeps main's PythonStaticLimit and adds cross_module_reach_limit.
  • A fresh independent reviewer compared the PR's own diff with what the merge adds on top of main and found no main behavior dropped. Crossed callers are top-level functions only, so dunder_method_class returns None for them and the dunder path cannot add a cross-module relation. Main's mock-sibling drop only removes oracle candidates, so the all-cross-module limit guard stays valid.
  • The reviewer also raised a possible narrowing: the same_file_edge guard caller.name != *name could drop a same-named method such as Cart.g that calls g. I checked it by experiment. With that guard removed, a test reaching discount through Cart().g() still gets no relation, because bare_callees drops a name the owner text binds, including its own def g header. The guard is redundant rather than narrowing, so the head is unchanged.
  • Proof on 99169ca: cargo test -p ripr --lib language::python reports 2112 passed, 0 failed, including all 11 cross_module_caller_tests. cargo xtask precommit exits 0.

Hosted qualification for this head is requested through the merge-ready label.


Generated by Claude Code

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: APPROVE 99169ca — no blocking findings on this head.

SOURCE_REVIEW_READY

This is the verdict carrier for the source review already recorded on this head (review 5911318347). The head has not moved since that review.

What moved since my APPROVE at 1f4dd2e2. Base only. The candidate's own five #12955 commits (aaef2cbfe9, df1fdf4a7a, 99c6736443, 736dc65311, b78870eea9) are byte-identical at both heads; the 93 non-merge commits between them are main's. The merge base moved from e810807e93 to 60114de3c7.

The merge was not clean, so I checked the resolution. git merge-tree --write-tree 1f4dd2e2 60114de3c7 reports content conflicts in crates/ripr/src/analysis/language/python/classify.rs and .../related_tests.rs — the two files this candidate owns. I compared the candidate's added lines at the old head against the added lines at this head:

  • classify.rs: the only difference is main's rustfmt reflow of the static_limits import list. Every added statement (cross_module_over_cap, the cross_module_reach_limit fallback ahead of module_object_rebind_limit, the cross_module_caller_call evidence label) is unchanged.
  • related_tests.rs: the difference is main's dunder_module_helper flag and the extra owners argument. helper_candidates_from_callers now takes both, and its relation closure reads dunder_module_helper && dunder_protocol_helper_call(test, caller, owners) alongside the candidate's cross_module flag. Neither side was dropped.

Why the combination stays sound. A crossed caller is a top-level function of another module, so dunder_method_class returns None for it and the dunder path cannot manufacture a cross-module relation. Main's mock-sibling drop only removes oracle candidates, so the all-cross-module limit guard keeps its meaning. The prior source review reached the same conclusion independently and also tested the same_file_edge caller.name != *name guard by removing it: a test reaching discount through Cart().g() still gets no relation, because bare_callees drops a name the owner text binds, including its own def g header. The guard is redundant, not narrowing.

Prior findings carry over. The entry edge still needs an exact from <owner module> import <owner> binding, a bare name( call in the caller's own body, and a top-level function past the boundary; every such candidate is reach-only and reads static_unknown under missing_import_graph; python_repair_placement needs WeaklyExposed plus an oracle relation, so this route cannot produce a repair card. The > 32 cap boundary is unchanged.

Qualification. Head 99169ca9 is MERGEABLE/CLEAN. The required run at this head is fully green: Admit PR Candidate, Ripr Rust Small on GitHub Hosted / Rust gates, Ripr Rust Small Result, all four test shards, Rust test shards verify, Route Ripr Rust Small, vscode surface and Detect Docs-Only Surface. Both review threads are resolved. The prior source review reports cargo test -p ripr --lib language::python at 2112 passed and cargo xtask precommit exit 0 on this head; that is its measurement, not mine.

Limits. Static review plus hosted check status; no local build or test run by this review. I did not re-execute the Python suite or the mutation experiments. The non-blocking notes from my 1f4dd2e2 review (stale #13059 reference in the body, "9 new tests" vs 11, and the uncapped cross_module_callers scan cost) are unchanged and still non-blocking.

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit bef2d25 Nov 17, 2026
21 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/project-thread-om4vsf branch November 17, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants