Repository navigation
refactor(op): Unified Method type, ReceiverRegistry, severed starlark (#264) - #269
Merged
Merged
Conversation
…#264) Phase 5+6: sever starlark from pkg/op, consolidate registries, unify method dispatch. Method type (pkg/op/method.go): - Unified action implementation replacing actionBase, action, fallibleAction, compensableAction - Implements Action and CompensableAction interfaces - DoFunc/UndoFunc closures set by bind during registration - MethodKind enum: pure, fallible, compensable - Shared between graph execution and starlark bridge construction ReceiverRegistry (pkg/op/registry.go): - Stores factories (by receiver name) and Methods (by action name) - RegisterMethod for *Method entries - Legacy Register path wraps handwritten actions into *Method - Method() for typed lookup alongside Get() for Action interface ReceiverFactory interface: - MethodParams()/MethodParamsFor() on the interface - Register(ctx, registry) — ctx first - Generated receivers: single file, inline params, no params.gen.go Starlark severed from pkg/op: - Context.Thread: *starlark.Thread → any; bind.ThreadFrom() accessor - ResourceBase.MarshalStarvalue removed; ID()/OriginID() exported - PlanningReceiverFactory/ExecutingReceiverFactory moved to bind - Override removed from both receivers Code generator: - params.gen.go.template deleted, params inline in receiver template - *args/**kwargs inferred from Go types (args []T, kwargs map[string]any) - ResolveAttr in SKIP_METHODS - dependent_type template updated - Register(ctx, registry) signature Other: - ActionRegistry renamed to ReceiverRegistry throughout - RegisterReceiverParams calls removed from generated Register methods - Flow integration tests use plangen.Receiver - Test mocks updated for new ReceiverFactory interface
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.
Summary
Phases 5+6 of #264 — sever starlark from
pkg/op, consolidate registries, unify method dispatch.Methodtype (pkg/op/method.go) — unified action implementation replacing four separate types. ImplementsAction/CompensableAction.DoFunc/UndoFuncclosures set by bind during registration. Shared between graph execution and starlark bridges.ReceiverRegistry— stores factories by receiver name and*Methodentries by action name. LegacyRegister(Action)wraps handwritten actions.ReceiverFactoryinterface —MethodParams()/MethodParamsFor()on interface,Register(ctx, registry).Context.Thread→any,MarshalStarvalueremoved,ID()/OriginID()exported, factory interfaces in bind.params.gen.go),*args/**kwargsinference, updated templates.Test plan
make clean build test-racepassespkg/opsource files: zerogo.starlark.netimports