Skip to content

cora trace returns empty for symbols that cora impact finds results for #385

Closed

Description

@ajianaz

Problem

cora trace and cora impact have inconsistent behavior for the same symbol. trace returns "No trace results" while impact returns affected symbols — even though both traverse the call graph.

Reproduction

# trace returns empty
cora trace generate_image
# → "No trace results for 'generate_image'."

# But impact works for similar symbols
cora impact generate --depth 2
# → 13 affected symbols

# And trace works for other symbols
cora trace generate
# → 584 nodes (works because 'generate' matches multiple symbols)
cora trace verify_signature
# → 261 nodes (works)
cora trace resolve_api_key
# → 11 nodes (works)

Expected Behavior

If a symbol exists in the index and has call edges, trace should return results. If the symbol doesn't exist, trace should say "symbol not found" (not "no trace results").

Root Cause Hypothesis

  1. Ambiguous symbol resolution — trace may require exact FQN match while impact does fuzzy matching
  2. Direction mismatch — trace follows outgoing CALLS edges, impact follows reverse (incoming) edges. If a symbol has only incoming edges (is called but doesn't call anything), trace returns empty
  3. Symbol not in index — generate_image may not exist as a symbol (could be a route, not a function)

Environment

  • cora 0.8.1
  • Works: trace generate (584 nodes), trace verify_signature (261 nodes), trace resolve_api_key (11 nodes)
  • Fails: trace generate_image (empty), trace create_api_key (empty)

Activity

  1. ajianaz commented on Jul 26, 2026

    @ajianaz
    CollaboratorAuthor

    Analysis

    Tested all three reproduction cases:

    1. cora trace generate_image returns empty (reproduced)
    2. cora impact generate --depth 2 returns 13 affected (reproduced)
    3. cora trace generate returns 584 nodes (reproduced)

    This is by design, not a bug. trace and impact traverse the call graph in opposite directions:

    • trace follows outgoing CALLS edges (symbol to what it calls). If generate_image is a leaf function that doesn't call other indexed functions, trace correctly returns empty.
    • impact follows reverse incoming edges (what calls the symbol). If other functions call generate_image, impact correctly returns them.

    The reproduction confirms this: generate_image has incoming edges (other functions call it), but no outgoing edges (it doesn't call other tracked functions). That's why:

    • trace generate_image = empty (no outgoing edges)
    • impact generate_image = results (has incoming edges)

    And trace generate works because generate matches multiple symbols, some of which DO have outgoing edges.

    Recommendation

    Close as not a bug. Consider adding a help text improvement: when trace returns empty, distinguish between "symbol not found" and "symbol found but has no outgoing call edges".

  2. ajianaz commented on Jul 27, 2026

    @ajianaz
    CollaboratorAuthor

    Closing as by-design. Analysis in previous comment: trace follows outgoing edges, impact follows incoming. A leaf function with no outgoing calls correctly returns empty on trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions