§03 call resolution tier2 scip
Goal
Ground-truth method resolution: rust-analyzer SCIP for .rs riding the shipped scip-emission hybrid-provenance arbitration; assess ori-compiler-scip for .ori calls; GDS projections filter by confidence so heuristics never distort centrality.
Implementation Sketch
- Stage 2 SCIP overlay already handles per-file suppression (import_scip.py:447 gate); add rust-analyzer scip output for compiler_repo to repos.yaml indexers + sync_ori_graph_scip.py; arbitration discriminator {ori-compiler-scip, rust-analyzer-scip, tree-sitter} already canonical (s-0226f4b1).
- .ori: oric emit-scip exists (scip-emission plan); assess call-edge quality for library/std + tests/spec; ADR records wire/defer verdict.
- GDS: _project_directed CALLS projections add the confidence predicate (agy F1).
- Cadence: measure rust-analyzer scip wall-clock; pick scope-gated auto vs standalone per the RC-remarks/SZZ precedent split.
Spec References
- intel_repo/neo4j/import_scip.py (suppression gate); intel_repo/neo4j/sync_ori_graph_scip.py; plans/completed/scip-emission/ (hybrid-provenance arbitration + oric emit-scip); intel_repo/repos.yaml indexers
Work Items
- Wire rust-analyzer SCIP indexing for compiler_repo .rs into the existing Stage 2 SCIP overlay (repos.yaml indexers entry + sync_ori_graph_scip.py), scoping every index run and ingest strictly to repo=ori’s own source_root and Symbol nodes so the new indexer entry never merges or leaks records with the pre-existing
rustreference-repo’s independent rust-analyzer-scip coverage; gate the repo-wide per-language suppression on measured indexing coverage completeness across the .rs corpus (or an equivalent per-file success set mirroring the .ori emit-scip two-stage scip_imported gate) so a partial or failed rust-analyzer run never silently drops a file’s tree-sitter CALLS with no SCIP replacement; emit exact compiler-symbol CALLS through the existing per-file purge-then-merge declarative replacement (_merge_call_edges), and require zero exact/fallback overlap bycall_site_key, including files where rust-analyzer’s coverage yields zero exact call edges. - Assess ori-compiler-scip (oric emit-scip) coverage for .ori call edges; wire ingestion for library/std + tests/spec if index quality passes the arbitration gate; record the verdict as a decisions/ ADR either way
- Confidence-filter GDS projections: gds_enrich.py CALLS projections consume the shared confidence predicate (build_confidence_predicate) so heuristic false binds cannot distort centrality/community metrics, and add the CALLS.provenance/match_tier relationship-property index the predicate-filtered projection and the Tier-2 verifier both need so filtering runs as an indexed, bounded lookup rather than a full CALLS-relationship scan.
- Cadence + staleness: measure rust-analyzer SCIP wall-clock over the full compiler_repo .rs corpus and, when indexing cost warrants it, checkpoint the indexing-and-ingest run (mirroring the existing checkpointed batch/resume architecture in relationship_rebuild.py) so an interrupted run resumes from its last completed batch instead of restarting; use that measurement to pick the SCIP re-index cadence class (scope-gated auto vs standalone) per the RC-remarks/SZZ precedent split, and record the facet timestamp and incremental cost; run the deterministic Tier-2 verifier (verify-call-resolution-tier2-scip.py, criterion sc-f449c981) and require it to report true, which strictly requires the resolved-CALLS edge ratio to exceed the authoritative Tier-1 floor read live from the durable Tier-1 acceptance artifact, never a restated literal.
Fresh intel (regenerated)
This section is a graph-improvement task whose ENTIRE terrain is the graph’s own builder (intel_repo/neo4j/*.py) — and that builder is DARK to the graph itself (symbols import_scip -> count 0; the graph indexes compiler_repo Rust + scripts/ Python as repo ori, never intel_repo). So the recon inverts: the graph cannot describe its own SCIP-ingestion code, but it CAN be queried for the STATE that code produces — and that live state is the terrain. The state says the acceptance gate is red for a precise, measurable reason.
The decisive [JOIN]: the section’s acceptance floor 0.22758683068017366 is NOT an arbitrary target — the Tier-2 verifier (verify-call-resolution-tier2-scip.py:_tier1_floor) reads it verbatim from the frozen Tier-1 acceptance artifact’s readings.resolved_calls_edge_probe.ratio.after. It IS the shipped Tier-1 heuristic ceiling. Today the live graph mints ori-compiler-scip = 6 CALLS and rust-analyzer-scip = 0 CALLS against tree-sitter = 110,576; the resolved-calls-ratio fitness probe reads FAIL. SCIP is wired-but-inert. This section’s job is to turn 6+0 exact edges into a population large enough that the resolved ratio strictly exceeds the frozen heuristic ceiling.
Decisions this package forces before any work:
- Treat the frozen Tier-1 surface as OFF-LIMITS. The Tier-1 heuristic resolver (
_resolve_target_py,_build_symbol_index) and itscontent/evidence/call-resolution-tier1-acceptance.jsonartifact are a COMPLETE, separately-gated tier (54-case false-bind negative corpus green). Tier-2 is an independent overlay — modifying Tier-1 re-opens its acceptance. Do not query Neo4j to reconstruct the floor (§02 record directive); read the artifact. - Consume the confidence SSOT, never fork it.
edge_confidence.pyowns the CALLS CASE viabuild_confidence_predicate(contract_id, alias, minimum_class); ADR 01 mandates “consumers must not copy it” and “do not persist a parallelconfidence_class.” The GDS work item (w-72873dec) must CONSUME the predicate, not re-encode the matrix — the liveLEAK:algorithmic-duplication/LEAK:scattered-knowledgerisk. - Honor the edges-only ori-SCIP invariant.
import_scip.pyroutes the ori path EDGES-ONLY (BUG-07-266: minting.oriSCIP nodes duplicates the tree-sitterori_adapternodes and splits the call graph); the rust-analyzer path keeps node-MERGE and is counted independently (“never folded into the ori provenance count”). w-f628945d wires rust-analyzer through the existing node-MERGE branch — do not flip theis_origuard. - The acceptance harness requires ALL of:
scip_calls > 0,exact_scip_calls == scip_calls(every SCIP edge iscompiler-symbol/exact),overlapping_call_site_keys == 0, andratio > floorstrictly.
["_resolve_target_py", "_build_symbol_index"]
DIG DEEPER
scripts/intel-query.sh fitness --json | python3 -c "import sys,json;d=json.load(sys.stdin);[print(p['probe_id'],p['state']) for p in d['data']['probes']]"
scripts/intel-query.sh cypher "MATCH (:Symbol {repo:'ori'})-[r:CALLS]->() WHERE r.provenance IS NOT NULL RETURN r.provenance, count(*) ORDER BY count(*) DESC" --human
(full dossier: call-resolution-tier2-scip—s-0464bdef.intel.md)