Off-rubric INFERRED confidence_score still emitted at 9 sites; the #2813 guard does not cover them
Follow-up to #2813 / #2823. Same class: INFERRED edges that carry a confidence_score outside the documented rubric (0.55 / 0.65 / 0.75 / 0.85 / 0.95), in places the guard test from that fix does not look at.
Found on v8 @ 48d7c0e (0.9.75). Nine emission sites, all explicitly INFERRED:
| File | Line | Score |
|---|---|---|
graphify/cross_repo_calls.py |
238 | 0.8 |
graphify/cross_repo_types.py |
68 | 0.9 |
graphify/interface_dispatch.py |
153 | 0.9 |
graphify/extract.py |
3926, 4218, 4384, 4606, 4816, 5007 | 0.8, the else branch of 1.0 if type_qualified else 0.8 (and 1.0 if exact else 0.8 for Java) |
In each extract.py ternary the other branch is EXTRACTED / 1.0, so only the INFERRED side is off the scale.
Why the existing guard misses them
test_no_module_hardcodes_an_off_rubric_inferred_score is parametrized over four files and matches the literal text "confidence_score": 0.8,. The ternary branches in extract.py are not that text, and cross_repo_calls.py, cross_repo_types.py and interface_dispatch.py are not in the list.
Reproduce
grep -rnE 'confidence_score' graphify/*.py | grep -E '0\.8|0\.9'
This also prints a few score consumers (.get("confidence_score", ...) fallbacks) next to the nine emission lines above.
Proposed fix
I have a patch ready and will open a PR that links here:
- Snap the nine sites to 0.85, following the #2813 precedent. 0.8 and 0.9 sit between rubric tiers, so 0.85 is the conservative same-tier choice. If you would rather have 0.95 for the two 0.9 sites, say so and I will change it.
- Replace the file-list guard with one that parses every
.pyundergraphify/and checks dict values, keyword args, assignments and ternary branches.
EXTRACTED / 1.0 and AMBIGUOUS / 0.2 stay allowed. No edge targets, relations or tiers change.
AI disclosure: this was found and written with AI assistance (Claude).
Thanks for opening this issue, @DeepanshuPal. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
Fixed in v0.9.76 (live on PyPI as graphifyy==0.9.76) via #4046, thanks @DeepanshuPal. 🙏