Skip to content

Fix #6149: resolve has_method edges regardless of symbol declaration order - #6188

Open
wanjinhao1 wants to merge 1 commit into
repowise-dev:mainfrom
wanjinhao1:agent/fix-6149-has-method-order
Open

wanjinhao1 wants to merge 1 commit into
repowise-dev:mainfrom
wanjinhao1:agent/fix-6149-has-method-order

Conversation

@wanjinhao1

Copy link
Copy Markdown
Contributor

Summary

  • GraphBuilder.add_file now defers intra-file has_method containment edges until all symbols of the file are added, then resolves them in a second pass
  • A method emitted before its enclosing class/struct (Go receiver methods above the type, a Rust impl above its struct) keeps its has_method edge instead of silently dropping it
  • A method whose parent never appears in the file still yields no edge (previous behavior preserved)

Related Issues

Fixes #6149

Test Plan

  • Tests pass (pytest) — tests/unit/ingestion/test_graph.py (66 passed), plus tests/unit/pipeline/test_incremental_graph_patch.py and tests/unit/pipeline/test_graph_seed_cache.py (164 passed total)
  • Lint passes (ruff check .) — ruff clean on both changed files
  • Web build passes (npm run build) — no frontend changes

New TestHasMethodEdgeOrder cases cover method-before-parent, parent-before-method, and missing-parent.

Checklist

  • My code follows the project's code style
  • I have added tests for new functionality
  • All existing tests still pass
  • I have updated documentation if needed — internal edge resolution, no docs change

This change was implemented with AI assistance and reviewed by me (@wanjinhao1).

@repowise-bot

repowise-bot Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

🟢 Safe to merge. No open points.

Defers intra-file has_method containment edges in GraphBuilder.add_file until all of a file's symbols are added, so a method emitted before its class or struct still gets its edge. Adds three ordering tests.

Checked: health of changed files Fair (unchanged), no new security findings.


View on Repowise
Deep review of 06f5da1 · Plain markdown for agents

Settings and updates

Silence one PR with [skip repowise] in the title · Bot settings
/repowise recheck reviews the current head again
/repowise review deep runs the deep review on it
/repowise remember <text> tells the reviewer what to leave out next time (reply on a finding to scope it to that file)
/repowise help lists the commands
⭐ Star Repowise · 📥 Install on another repo

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Out-of-order method declarations silently drop has_method containment edges in graph builder

1 participant