feat(temporal): resolve wrapper-forwarded activity/workflow dispatch#85
Draft
avfirsov wants to merge 1 commit into
Draft
feat(temporal): resolve wrapper-forwarded activity/workflow dispatch#85avfirsov wants to merge 1 commit into
avfirsov wants to merge 1 commit into
Conversation
Resolve Temporal dispatch where the activity/workflow name is forwarded
through a thin wrapper function:
func execAct(ctx workflow.Context, name string, in any) workflow.Future {
return workflow.ExecuteActivity(ctx, name, in) // name is a param
}
execAct(ctx, "ChargeCard", in) // literal at call site
The wrapper's dispatch has no literal name (it's a parameter), so the
caller's "ChargeCard" was previously lost. This recovers it (single level).
Extractor (golang.go / golang_temporal.go):
- stamp `temporal_name_param` on a dispatch stub when the name argument is
one of the enclosing function's parameters (marks the func as a wrapper);
- attach `arg_names` + `callee` to call edges so the resolver can read the
literal a caller passes at the wrapper's name position.
Resolver (temporal_calls.go):
- `resolveTemporalWrapperCalls` discovers wrappers (stub edges carrying
`temporal_name_param`), matches their call sites (by resolved node or by
callee name for cross-package calls), and mints a `temporal.stub` edge on
the caller with the forwarded literal name. Called at the top of
`ResolveTemporalCalls` so the existing sweep then resolves those stubs to
the registered handler. Idempotent; helpers `argNameAt`, `metaIntValue`,
`temporalWrapperStubExists`.
Single level only — depth>1 wrapper chains are intentionally out of scope.
Cross-language / const-deref / env-default resolution is untouched.
Tests: resolver unit, extractor unit (param-stub + arg_names), and an
end-to-end index→resolve test.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fb652a1 to
d15fa72
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Resolves Temporal dispatch where the activity/workflow name is forwarded through a thin wrapper function:
The wrapper's
ExecuteActivityhas no literal name (it's a parameter), so today the caller's"ChargeCard"is lost and the dispatch stays unresolved. This recovers it.How
Extractor (
golang.go/golang_temporal.go):temporal_name_paramon a dispatch stub when the name argument is one of the enclosing function's parameters — this marks the function as a name-forwarding wrapper;arg_names+calleeto call edges so the resolver can read the literal a caller passes at the wrapper's name position (matched by resolved node, or by callee name for cross-package calls).Resolver (
temporal_calls.go):resolveTemporalWrapperCallsdiscovers wrappers, finds their call sites, and mints atemporal.stubedge on the caller carrying the forwarded literal name. It runs at the top ofResolveTemporalCalls, so the existing stub-resolution sweep then lands those on the registered handler. Idempotent; small helpersargNameAt/metaIntValue/temporalWrapperStubExists.Scope
Tests
temporal_name_paramon the wrapper stub;arg_names/calleeon the caller edge),go build ./...andgo test -race ./internal/resolver/... ./internal/parser/languages/... ./internal/indexer/...pass.🤖 Generated with Claude Code