feat(core): add optional branch/merge connections to model graph - #3
Merged
Conversation
Transforms can now be connected as a branch/merge graph via an optional `connections` list, while a transforms-only config still runs as a straight line (full back-compat). A transform runs once every transform feeding it has produced output; transforms whose inputs are all ready run together, and a merge transform receives the ordered list of its feeders' outputs. Cycles are rejected; repeating a run stays a concern for the layer above the graph. Co-authored-by: Cursor <cursoragent@cursor.com>
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
connectionslist tocreateModelGraphso transforms can run as a branch/merge graph, while a transforms-only config still runs as a straight line (full back-compat).Promise.all). A merge transform receives the ordered list of its feeders' outputs.start/endcan be set explicitly). Cycles are rejected with a clear error — repeating a run belongs to the layer above the graph.GraphRun/TraceStep/RunContexttypes are unchanged, so existing consumers keep working.@composable-model-graph/coreto0.2.0and updates README §7 (Branching Model) from "future" to supported, in domain-neutral language.Test plan
pnpm buildpnpm test(19 tests pass, incl. newmodel-graph-connections.test.ts: linear still works, branch runs both sides, merge receives ordered list, cycle rejected, unknown-ref rejected)Made with Cursor