Skip to content

bug: native engine does not track dynamic import() expressions #410

@carlos-alm

Description

@carlos-alm

Found during dogfooding v3.1.2

Severity: Medium
Command: codegraph build --engine native / codegraph stats

Reproduction

codegraph build <repo> --engine wasm --no-incremental
codegraph stats --json | jq '.edges.byKind["dynamic-imports"]'
# → 99

codegraph build <repo> --engine native --no-incremental  
codegraph stats --json | jq '.edges.byKind["dynamic-imports"]'
# → 0

Expected behavior

Native engine should produce the same dynamic-imports edges as WASM (99 edges for codegraph self-analysis).

Actual behavior

Native engine produces 0 dynamic-imports edges. WASM correctly produces 99.

Root cause

The v3.1.2 feature "track dynamic import() expressions as dynamic-imports graph edges" (#389) was implemented in the JS/WASM builder path but the Rust native engine was not updated to extract and emit dynamic import edges.

Impact

  • Dead-export analysis has false positives on native builds (symbols consumed only via dynamic imports appear unused)
  • Impact tracing misses dynamic import paths on native builds
  • Engine parity gap: native reports 43 unused exports vs WASM's 25

Suggested fix

Add dynamic import detection to the Rust edge builder — look for import(...) call expressions and emit dynamic-imports edges.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdogfoodFound during dogfooding

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions