Files
compliance-scanner-agent/compliance-graph
Sharang Parnerkar 08a1ee2f00
Some checks failed
CI / Check (pull_request) Failing after 12m5s
CI / Detect Changes (pull_request) Has been skipped
CI / Deploy Agent (pull_request) Has been skipped
CI / Deploy Dashboard (pull_request) Has been skipped
CI / Deploy Docs (pull_request) Has been skipped
CI / Deploy MCP (pull_request) Has been skipped
fix: synthesise Contains edges and improve cross-file resolution in code graph
The code graph produced disconnected "islands" because:
1. No Contains edges were created between File/Module nodes and their
   children (functions, classes, structs), leaving file nodes isolated
2. Cross-file call resolution was too strict — calls like
   `crate::config::load` failed to resolve to `src/config.rs::load`

Fix:
- After resolving explicit parser edges, synthesise Contains edges by
  walking each node's qualified-name hierarchy and linking to the
  closest ancestor that exists in the node map
- Improve edge resolution with module-path matching: strip Rust
  prefixes (crate::, super::, self::) and try progressively shorter
  suffix matches for cross-file calls

Adds 4 new tests covering Contains edge synthesis, dedup with existing
edges, cross-file module path resolution, and parent qname lookup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 11:12:38 +02:00
..