Skip to content

fix(trace-path): keep only injected callers of same-named methods - #123

Merged
spelech merged 2 commits into
mainfrom
fix/csharp-receiver-typed-calls
Nov 12, 2026
Merged

spelech merged 2 commits into
mainfrom
fix/csharp-receiver-typed-calls

Conversation

@spelech

@spelech spelech commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Problem

trace_path stores a C# call such as _toolRepository.PublishInstance(id) with the bare target PublishInstance. The callers query matched every method with that name. In a controller → service → repository layout, the callers of AssistantService.PublishInstance included ToolsController.PublishInstance, ToolService.PublishInstance, and the call in AssistantService to its own repository. The only real caller was AssistantsController.PublishInstance.

Fix

In the callers walk, when the target is qualified (Class.Method), the call target is a bare name, and two or more classes have that method, trace_path now resolves the call from the caller's class with the same DI rules that the callees walk uses (_resolve_di_callee: constructor signatures and IMPLEMENTS edges). It drops the edge only when the call resolves to a different class. It keeps calls from the target's own class and calls that it cannot resolve, so no real caller is lost.

Tests

  • tests/test_trace_path_di_callers.py: two controllers, two services, two repositories, all with PublishInstance; each target gets only its injected caller. A call that cannot be resolved is kept.
  • REQUIREMENTS.md regenerated.

🤖 Generated with Claude Code

Steve Pelech and others added 2 commits November 12, 2026 12:10
A call stored as a bare method name (for example `_repo.PublishInstance()`)
matched every method with that name. Callers of AssistantService.PublishInstance
then included ToolsController, ToolService, and AssistantService itself.

When more than one class has the method, trace_path now resolves the call
through the caller's injected interfaces (constructor signatures and
IMPLEMENTS edges). It drops the edge only when the call resolves to a
different class. Calls that cannot be resolved are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@spelech
spelech merged commit 682f1d0 into main Nov 12, 2026
15 checks passed
@spelech
spelech deleted the fix/csharp-receiver-typed-calls branch November 12, 2026 19:15
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.

1 participant