fix(csharp): use the 0.75 discrete tier for guarded extension edges (#4828)

The INFERRED rubric is {0.55, 0.65, 0.75, 0.85, 0.95}; the guarded rungs were
emitting 0.70, which test_inferred_confidence_rubric rejects (and which the
rubric has no tier for). 0.75 is the intended one-step-below-0.85 score.
This commit is contained in:
Deepjyoti-Sarmah committed 2026-11-01 22:45:13 +05:30
1 parent d49009e351
commit 27c01196ab
3 files changed
+8 -8

No files matched your search

+5 -5
View File
@@ -6247,7 +6247,7 @@ def _resolve_csharp_extension_calls(
third-party type) cannot have its instance members enumerated, so the
instance-wins rule is replaced by two conservative proofs: the member name
is not one a BCL type owns (``ToString``, ``GetValue``, …), and no regular
method anywhere in the corpus has that name. Such an edge is INFERRED 0.70,
method anywhere in the corpus has that name. Such an edge is INFERRED 0.75,
one tier below a receiver whose declaration table typed it.
A chained receiver (``v.ToString().Mask()``) has no type at all: typing it
@@ -6491,10 +6491,10 @@ def _resolve_csharp_extension_calls(
"context": "call",
"confidence": "INFERRED",
# 0.85 when the extractor's declaration table typed the receiver;
# 0.70 when the receiver's type is out of corpus and the binding
# rests on the BCL/regular-name guards (the discrete rubric has
# no 0.75, see references/extraction-spec.md).
"confidence_score": 0.70 if roc else 0.85,
# 0.75 when the receiver's type is out of corpus (or absent) and
# the binding rests on the BCL/regular-name guards — the discrete
# INFERRED rubric in references/extraction-spec.md.
"confidence_score": 0.75 if roc else 0.85,
"source_file": src_file,
"source_location": rc.get("source_location"),
"weight": 1.0,
+1 -1
View File
@@ -855,7 +855,7 @@ def apply_strategy(
if (caller, cand.method_id) in existing:
continue
existing.add((caller, cand.method_id))
score = 0.85 if not (roc or recv_type is None) else 0.70
score = 0.85 if not (roc or recv_type is None) else 0.75
added.append(_edge(caller, cand, rc, score))
return added
+2 -2
View File
@@ -124,8 +124,8 @@ def test_out_of_corpus_extension_edge_is_scored_lower():
if e.get("relation") == "calls"
and by_id.get(e["target"], {}).get("metadata", {}).get("extension")
}
assert scores[".Mask()"] == 0.70
assert scores[".Twice()"] == 0.70
assert scores[".Mask()"] == 0.75
assert scores[".Twice()"] == 0.75
def test_bcl_member_name_on_an_undeclared_type_is_not_bound():