You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
slice(#2664-A): allow cross-crate test match when calls_owner signal is true (minimal fix) #2971
Implementation plan: cross-crate calls_owner match (STARTABLE NOW)
The fix
In related_tests.rs:43-48, the package-prefix guard runs BEFORE calls_owner is computed (L55-57). A cross-crate test that genuinely calls the owner is filtered out before the strong signal can save it.
Minimal fix: Move the calls_owner / assertions_reference_owner computation (L55-70) ABOVE the prefix block (L44-54), then change the guard to only suppress weak signals:
if let Some(prefix) = &owner_package_prefix
&& !normalize_path(&test.file).starts_with(prefix)
&& !calls_owner
{
continue;
}
Test update required
related_tests.rs:177-201 (given_owner_function_when_tests_share_name_across_packages) currently asserts len()==1. Under the fix, a crate_b test whose body calls 'score' would now match. Update the test: either (a) remove the calls_owner trigger from the decoy test (preserving the same-name false-positive guard intent), or (b) assert len()==2 and rename to reflect cross-crate callers are now related.
Positive test to add
Cross-crate test that calls the owner -> related with RelationReason::DirectOwnerCall.
Reopening — the #3014 implementation credits name-token coincidence across crates
Evidence (verified on clean main 992e594e, 2026-08-08):
cargo test -p ripr --lib given_owner_symbol_when_resolving_ownerfails on main: assertion failed: left: 2, right: 1 at crates/ripr/src/analysis/classifier.rs:84.
The fixture has score in both crate_a and crate_b; crate_b_score_test calls score(2) — crate_b'sscore, not the probe owner (crates/crate_a/src/lib.rs::score). The test exists to prove full-identity alignment wins over name alignment.
fix(analysis): allow cross-crate test match when calls_owner is true (#2971) #3014's change computes calls_owner by bare call-name equality (call.name == owner_name) and lets it override the package-prefix guard, so a cross-crate test calling a different same-named function is credited as related to the probe's owner. That is the token-coincidence false-exposed family from AGENTS.md / docs/LEARNINGS.md — the guard the change relaxes is the production discriminator for exactly this case.
The same-name decoy the PR updated only covers a cross-crate test with empty calls; any cross-crate test that calls a same-named function still defeats the guard.
Disposition: the related_tests change is reverted on the main-unblock branch (#3028) to restore the identity-precision invariant and the required gate. #2971's premise is real — a cross-crate test genuinely calling the owner is invisible today — but a correct implementation must align on identity (e.g. receiver/path resolution, or an explicit ambiguity rule when multiple same-named owners exist), not on the bare name token. Restoring status/needs-work; kept target/0.13 + target/conditional.
PR #3014 landed the intended production reorder, but its test change is not discriminating: the cross-crate decoy now has no relation signal and would be dropped even if the package-prefix guard were broken, while no positive cross-crate direct-owner-call fixture proves the new path.
#3033 owns the bounded positive/negative oracle repair and removal experiments. This issue is therefore status/partial, not completed. Close it only after #3033 proves both the direct-call exception and the weak-signal false-positive guard.
Activity
EffortlessSteven commentedon Aug 7, 2026
Implementation plan: cross-crate calls_owner match (STARTABLE NOW)
The fix
In related_tests.rs:43-48, the package-prefix guard runs BEFORE calls_owner is computed (L55-57). A cross-crate test that genuinely calls the owner is filtered out before the strong signal can save it.
Minimal fix: Move the calls_owner / assertions_reference_owner computation (L55-70) ABOVE the prefix block (L44-54), then change the guard to only suppress weak signals:
Test update required
related_tests.rs:177-201 (given_owner_function_when_tests_share_name_across_packages) currently asserts len()==1. Under the fix, a crate_b test whose body calls 'score' would now match. Update the test: either (a) remove the calls_owner trigger from the decoy test (preserving the same-name false-positive guard intent), or (b) assert len()==2 and rename to reflect cross-crate callers are now related.
Positive test to add
Cross-crate test that calls the owner -> related with RelationReason::DirectOwnerCall.
fix(analysis): allow cross-crate test match when calls_owner is true (#…
EffortlessSteven commentedon Aug 8, 2026
Reopening — the #3014 implementation credits name-token coincidence across crates
Evidence (verified on clean main
992e594e, 2026-08-08):cargo test -p ripr --lib given_owner_symbol_when_resolving_ownerfails on main:assertion failed: left: 2, right: 1atcrates/ripr/src/analysis/classifier.rs:84.scorein bothcrate_aandcrate_b;crate_b_score_testcallsscore(2)— crate_b'sscore, not the probe owner (crates/crate_a/src/lib.rs::score). The test exists to prove full-identity alignment wins over name alignment.calls_ownerby bare call-name equality (call.name == owner_name) and lets it override the package-prefix guard, so a cross-crate test calling a different same-named function is credited as related to the probe's owner. That is the token-coincidence false-exposedfamily fromAGENTS.md/docs/LEARNINGS.md— the guard the change relaxes is the production discriminator for exactly this case.Disposition: the related_tests change is reverted on the main-unblock branch (#3028) to restore the identity-precision invariant and the required gate. #2971's premise is real — a cross-crate test genuinely calling the owner is invisible today — but a correct implementation must align on identity (e.g. receiver/path resolution, or an explicit ambiguity rule when multiple same-named owners exist), not on the bare name token. Restoring
status/needs-work; kepttarget/0.13+target/conditional.EffortlessSteven commentedon Aug 8, 2026
Reopened after post-merge review
PR #3014 landed the intended production reorder, but its test change is not discriminating: the cross-crate decoy now has no relation signal and would be dropped even if the package-prefix guard were broken, while no positive cross-crate direct-owner-call fixture proves the new path.
#3033 owns the bounded positive/negative oracle repair and removal experiments. This issue is therefore
status/partial, not completed. Close it only after #3033 proves both the direct-call exception and the weak-signal false-positive guard.fix(analysis): revert the name-token cross-crate owner match from #3014
fix(workspace): restore the required gates on main after the instant-…
fix(classify): calls_owner respects crate boundaries for shared names (…
fix(analysis): derive the uniqueness gate from the index selection, n…
fix(analysis): match owner calls by boundary, not by anchoring to the…
fix(analysis): drop the receiver rejection that downgraded every meth…
analysis(classify): fail closed on unscopable absolute related-test p…
analysis(classify): fail closed on unscopable absolute related-test p…
fix(workspace): attribute custom-target changes and declared dependen…
feat(workspace): scope diffs through path-dependency reachability (#3616
fix(classify): restrict the dependency-edge admit to callable forward…
fix(classify): require parser-backed, import-attributed call identity…
feat(classify): admit cross-crate test matches through dependency edg…