You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b910f45
Browse filesBrowse the repository at this point in the historyBrowse files
Structural refactor making executableUnit's containment serializable and
extending every executable unit (Node, Subgraph) with retryPolicy and
errorAction fields per plan-doc D5 / D11.
executableUnit (pkg/op/executable_unit.go, full rewrite)
- parent *Subgraph -> parentID string. By-ID rather than by-pointer
because containment must round-trip through plan.save / plan.load
(pointers don't serialize). Graph.Root has parentID == "" (the only
unit with an empty parentID after wiring). Cross-Graph reuse works
because graph.Root.ID is the constant "root" across all Graphs, so
an Invocation that's a root child in two different Graphs stamps the
same parentID value both times — idempotent.
- retryPolicy *RetryPolicy and errorAction ExecutableUnit fields
added. Nil retryPolicy means no retry; nil errorAction defaults to
the flow.Provider.Failed sentinel at dispatch time.
- Accessors: ParentID() / RetryPolicy() / SetRetryPolicy() /
ErrorAction() / SetErrorAction().
- stampParent(newParentID) is the package-private helper that
AddChild calls. Idempotent: calling again with the same parentID
succeeds silently; calling with a different non-empty parentID
panics — within a single Graph context, a unit can be a child of
only one Subgraph at a time. The conflict panic catches accidental
double-parenting bugs.
Subgraph (pkg/op/subgraph.go)
- AddChild updated to call stampParent (was direct pointer assignment
on child.Node.parent / child.Subgraph.parent).
- Subgraph.Retry *RetryPolicy field removed. Retry now lives on the
embedded executableUnit via retryPolicy; callers access through
RetryPolicy() / SetRetryPolicy() instead of struct field access.
Node (pkg/op/graph.go)
- Node.Retry *RetryPolicy field removed for the same reason. Same
accessor migration.
Retry-field migration across the codebase
- pkg/op/marshal.go: Node and Subgraph JSON/YAML marshalers updated
to route Retry envelope field through RetryPolicy() (read) and
SetRetryPolicy() (write). The "retry" JSON/YAML field stays — only
the Go-side accessor changed.
- pkg/op/executor.go: sg.Retry references migrated to sg.RetryPolicy()
in executeSubgraph's retry-loop logic.
- pkg/op/starlarkbridge/task_builder.go: node.Retry assignment
migrated to node.SetRetryPolicy(...).
- pkg/op/starlarkbridge/promise.go: same migration for p.node.Retry.
- cmd/lore/lore/builder.go: sg.Retry == nil check and assignment in
buildPackageNodes migrated to sg.RetryPolicy() / sg.SetRetryPolicy().
marshal.go deserialization bypass sites migrated to AddChild
Three sites where Subgraph.Children was bulk-assigned from the
unmarshaled payload now iterate and call AddChild per child, so each
deserialized child gets its parentID re-stamped to its enclosing
Subgraph's ID. This closes the Phase 3 "5 bypass sites" list partially
— see deferred items below for the other two.
- applyPayload (Graph deserialization, graph payload to g.Root)
- Subgraph.UnmarshalJSON
- Subgraph.UnmarshalYAML
Tests
- pkg/op/subgraph_test.go: 4 Parent() test sites migrated to
ParentID() string-equality assertions. Fixed-point semantics
preserved (graph root has ParentID() == "").
Deferred (intentionally NOT in this commit; require Phase 5 bridge work)
- cmd/lore/lore/builder.go:341 — buildPackageNodes moves children
from graph.Root into a freshly-created phase Subgraph. AddChild's
parent-conflict check would reject this re-parenting. The clean
fix is for the bridge to know its target Subgraph at script-execution
time and emit directly into the phase Subgraph; that requires the
bridge target work that's Phase 5 scope. Until then, this site keeps
bulk Children manipulation; the parentID on moved children stays
stale ("root").
- cmd/devlore-test/devloretest/runner.go:438 — wrapUngroupedNodes
same shape. Same Phase 5 dependency.
- addNativePMNodes mechanical migration: small, but related to the
above bridge work; landing together makes the buildPackageNodes
story coherent.
- Subgraph.Parameters() kwargs-binding filter: per plan-doc D8 the
bridge should stamp boundVariables on a Subgraph at classification
time, and Subgraph.Parameters() should subtract those from the
returned surface. Bridge work; Phase 5.
- Bridge kwarg classification (body= / items= / error_action= /
retry_policy= reserved kwargs + parent-stamping at body inclusion)
— depends on the uniform Subgraph(items, kwargs) Go signature for
flow's container methods. Both Phase 5 scope.
Build state
make build / make vet clean. pkg/op + all provider packages green.
Pre-existing cmd/devlore-test / cmd/star/star failures (13.0(n) graph-
executor harness scope) unchanged by this commit.
Issue: #283
0 commit comments