feat(temporal): resolve unregistered activities by func-name convention - #89
Merged
Merged
Conversation
avfirsov
force-pushed
the
pr/temporal-unregistered-activities
branch
from
June 15, 2026 05:07
ace2b50 to
806a762
Compare
…vention Activity repos hold the functions but register them from a separate worker-runner, so the register-based index never sees them. Add a convention fallback: index Go functions/methods named like activities/ workflows (suffix Activity/Workflow) and, when no registered handler matches a dispatch name (directly or via its const value), resolve to the unambiguous convention-named function — at the inferred tier (temporal_resolution_via=convention), since it's a naming convention not a register-confirmed binding. This is Pattern 2's two-part naming (ActivityFuncName const → the func) and Stage 1.2 generally (func names match dispatch strings 1:1). e2e: workflow dispatches via ActivityFuncName const -> unregistered GetProductOfferingActivity function. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
avfirsov
force-pushed
the
pr/temporal-unregistered-activities
branch
from
June 15, 2026 06:56
806a762 to
fef01ac
Compare
zzet
added a commit
to avfirsov/gortex
that referenced
this pull request
Jun 15, 2026
Reconcile var-trace / const-alias / exact-name signature dispatch (zzet#98) with the convention (zzet#89) and env-helper (zzet#90) tiers now on main: - resolution ladder keeps exactSig (speculative) after the cross-language join; the env-default tier-override now also covers var_trace origins and preserves zzet#90's source-tiering (allowlist/os_getenv/const_ref stay visible) - single temporal_resolution_via stamp (exact_sig | convention) instead of two blocks that clobbered each other - fold the funcExact (zzet#98) and funcByName (zzet#89) indexes into one node sweep - goConstLiteralValue: keep main's grouped-const selection (drop zzet#98's equivalent duplicate) - lookupConvention drops cross-repo *_test.go stubs (matches main's fix) - regression test for parallel-assignment var-trace (x, act := _, "Name")
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
Adds a convention fallback to Temporal dispatch resolution: when a dispatch name doesn't resolve to a registered activity/workflow, fall back to an exported Go function/method of that name following the activity/workflow naming convention (suffix
Activity/Workflow).Resolves the dispatch at the inferred tier (
graph.OriginASTInferred, confidence0.6,temporal_resolution_via="convention") — it's a naming convention, not a register-confirmed binding. Tries the dispatch name directly, then its const-deref value.Why
Activity repos commonly hold the functions but register them from a separate worker-runner, so the register-based index never sees them and the dispatch stays
broken_dispatch. This recovers the common 1:1func name == dispatch stringcase (Pattern 2:ActivityFuncNameconst → the function).How it fits current main
Ported onto the post-#82 resolver:
lookupConvention(kind, name, callerRepo, callerLang)mirrorsidx.lookup's same-language gate (a Go dispatch never lands on a like-named symbol in another language).funcByNameindex (convention-named Go funcs/methods only) is built inbuildTemporalIndex.Includes a small prerequisite fix to
goConstLiteralValue: it now selects the matchingconst_specby name inside a groupedconst ( … )block (previously only single-spec blocks yielded a const value), which the feature's own grouped-const dispatch test exercises.Tests
New e2e
TestTemporalE2E_GoUnregisteredActivityByConvention(workflow dispatches via anActivityFuncNameconst to an unregisteredGetProductOfferingActivity).go build ./...clean; resolver / parser / indexer suites pass.