Skip to content

feat(resolve): TS fresh-instance binding + decorator CALLS edges (R2 parity)#71

Closed
smochan wants to merge 1 commit into
feat/ts-path-aliasesfrom
feat/ts-r2-parity
Closed

feat(resolve): TS fresh-instance binding + decorator CALLS edges (R2 parity)#71
smochan wants to merge 1 commit into
feat/ts-path-aliasesfrom
feat/ts-r2-parity

Conversation

@smochan

@smochan smochan commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

Track B2, stacked on #67. Closes two more items from the README's deferred 'TypeScript R2 patterns':

  • Fresh-instance binding: new UserService().getUser(id) now emits CALLS to both the method AND the class (metadata fresh_instance: true). Conservative: only when the method edge resolved and the constructor resolves to a CLASS node — factory().run() correctly does not produce a class edge.
  • TS decorator CALLS edges: @Injectable() / @Get(':id') (NestJS-style) emit CALLS edges with decorator: true + captured args, mirroring the Python parser's _emit_decorator_calls conventions. Handles exported-class decorator placement and byte-offset sibling matching (tree-sitter node identity quirk).

Implemented by a Sonnet subagent against a Fable spec; reviewed (idempotency, Python-overlap dedupe, guard conditions) by the orchestrating session.

Test plan

  • 4 new tests (fresh-instance positive/negative, decorators in-repo resolve + stay-unresolved)
  • Full suite 724 passed incl. resolver idempotency; ruff + mypy --strict clean
  • cross-stack-demo: zero regression (demo has no NestJS/fresh-instance patterns — new edges only fire where the patterns exist)

🤖 Generated with Claude Code

…parity)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@smochan smochan deleted the branch feat/ts-path-aliases June 10, 2026 14:14
@smochan smochan closed this Jun 10, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant