Skip to content

neighbors generic Cypher uses typed-union RETURN over heterogeneous edge types (latent portability risk) #356

Description

@HumanBean17

Summary

The generic neighbors Cypher for flat (non-CALLS) edge labels RETURNs a fixed superset of attributes (confidence, strategy, match, mechanism, annotation, field_or_param, source, call_site_line, call_site_byte, arg_count, resolved) regardless of which edge types matched — the "typed-union RETURN-column" anti-pattern AGENTS.md warns against.

Evidence (confirmed; latent, not a live bug today)

mcp_v2.py:1898-1926. On LadybugDB (current backend) missing columns return None and _neighbor_edge_attrs drops None/"", so no junk leaks today. On a stricter binder or Kùzu this could error.

Impact

Latent portability risk; contradicts the documented Cypher guidance.

Suggested fix

Select attributes per-edge-type, or use untyped [e] + a properties(e) fetch. Low urgency given current backend behavior. Related: #318 (native-stack crash risk).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions