Repository navigation
Graph comparison: reconcile calls like the tri-comparison — ledger, validated numbers, C8 (#3641) - #3647
Merged
Conversation
…ot callee name (#3641) `--samples` lists the most frequent FP/FN callee names (`add`, `get`, `then`), which say nothing about why the two sides disagree. `--buckets N` labels every FP/FN with a syntactic cause, with N examples each: fp:inner-{named,anonymous}-<node> tree-sitter gives the call to an inner function; the engine also counts it fp:not-a-call-in-ts:<parent<grand> the name is there, but not as a call fp:outside-ts-function the engine attributes a call from beyond tree-sitter's function (span overrun) fn:<call node>/<callee node>[+generic][+bang] the shape the engine missed fn:engine-attributes-to-another-function Labels are leads for the verification step, not verdicts. The default run and the --ci gate are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q
…validated numbers, C8 (#3641) Decided 2026-09-25: the call/import comparisons follow the structural tri-comparison process instead of grading GitGalaxy against tree-sitter. - Contract (docs/calls_out_rule_contract.md): C8 -- a call belongs to the innermost NAMED unit (nested named function: that unit only; anonymous function: the enclosing unit). C3 amended: a pattern (`Ok(t) =>`, `if let Some(x) =`) is not a call. Conversions stay calls (C3 as decided). - Harness fixes (mechanical, so code): an anonymous function no longer owns and silently drops its calls (C8) -- that bug read as 213 JS / 505 TS GitGalaxy "false positives"; go `type_conversion_expression` counts (C3); a generic call is named by its function, not its type argument (`collect::<Vec<_>>()` is `collect`, `OfType<T>()` is `OfType`). - `--ledger` merges each cause shape into docs/self_scan/graph_comparison_ledger.json through tri_comparison_ledger.py (same schema/lifecycle, separate file); every run prints raw and validated precision/recall. Validated moves only on a recorded verdict (credit geometry in graph_comparison_README.md); the --ci gate stays on raw. - Ledger seeded: 162 shapes, 23 validated by reading their examples -- all confirm GitGalaxy faults, filed as #3642 (C8 nested units), #3643 (rust macros/turbofish/patterns), #3644 (cpp/ts generics, cpp own header and `Type var(`), #3645 (go throw, conversions), #3646 (ruby span). Raw baseline, from the harness fixes: javascript precision 79.5 -> 87.6, typescript 86.2 -> 94.0, php 96.7 -> 99.7, go 99.6 -> 99.9. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q
The ledger holds hand-recorded verdicts, so it is committed like its tri-comparison twin; *.json under docs/ is otherwise ignored scan output. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q
- .github/workflows/graph-comparison-history.yml, twin of tri-comparison-history.yml: on a main push that can move a call, re-run `call_graph_accuracy.py --ledger` and auto-merge the refreshed ledger. PRs then add verdicts only; the bot commits the count churn. Never touches a verdict or the raw baseline. - LEDGER_EXAMPLES = 5 (was 10): enough to read a verdict from; the full list is one `--buckets N` away. Ledger 316 KB -> 240 KB; all 23 verdicts preserved through the merge. - README: who writes what, and why the ledger stays in this repo. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #3641, which is now scoped to calls and imports only. This implements the decisions recorded on the epic.
Why
The call comparison graded GitGalaxy against tree-sitter as ground truth. The structural comparisons stopped doing that, because tree-sitter and our own harness have faults of their own. This PR moves calls onto the same process as the structural tri-comparison. Imports follow in the next PR.
What changes
Contract (
docs/calls_out_rule_contract.md):Ok(t) =>,if let Some(x) =) is not a call.Harness fixes (mechanical, so fixed in code):
type_conversion_expressioncounts as a call (C3).collect::<Vec<_>>()iscollect).--bucketslabels every disagreement with a syntactic cause.--ledgermerges each cause shape intodocs/self_scan/graph_comparison_ledger.json.tri_comparison_ledger.py: same schema, lifecycle andcredit_toolsgeometry, separate file. The structural ledger and chart are untouched.*marks a language with open shapes.--cigate stays on raw.Post-merge refresh:
.github/workflows/graph-comparison-history.yml, the twin oftri-comparison-history.yml.--ledgerand auto-merges the refreshed counts, examples andstill_reproduces.AUTOMATION_PATmerge path as its twin.Five examples per shape (
LEDGER_EXAMPLES): enough to read a verdict from. Ledger size is 240 KB.Ledger seeded: 162 shapes, 23 validated by reading their recorded examples. All 23 confirm GitGalaxy faults, now filed:
name!(and turbofishname::<T>(missed; match/let patterns counted as calls #3643: rust macros, turbofish and patterns;name<T>(missed; cpp ownClass::method(header andType var(args)counted as calls #3644: C++/TS generic calls; C++ ownClass::method(header (793); C++Type var(;throw(dropped by the global keyword ignore;(*T)(x)conversions missed #3645: Gothrowand conversions;endafter a regex literal containing a quote #3646: Ruby span overrun after a regex literal containing a quote.So validated still equals raw everywhere. The shapes where tree-sitter may be the one that's wrong are in the smaller, mixed buckets still open, such as calls inside Rust macro token trees and C++ member initializers.
Raw baseline changes (all from the harness fixes)
The small recall drops come from newly counted calls: anonymous-callback calls and Go conversions add both matches and misses.
Verification
tests/tools/test_call_graph_accuracy.py: 12 tests. They cover C8 in both directions, Go conversions, generic naming in three languages, and the cause labels.call_graph_accuracy --ciagainst the regenerated baseline, on the pinned corpus (v1.5.0).🤖 Generated with Claude Code
https://claude.ai/code/session_01YAtpBfGGyBGGovitSVaM5Q