Skip to content

feat(core): add optional branch/merge connections to model graph - #3

Merged
bigboateng merged 1 commit into
mainfrom
feat/branch-merge-connections
Jun 9, 2026
Merged

feat(core): add optional branch/merge connections to model graph#3
bigboateng merged 1 commit into
mainfrom
feat/branch-merge-connections

Conversation

@bigboateng

Copy link
Copy Markdown
Contributor

Summary

  • Adds an optional connections list to createModelGraph so transforms can run as a branch/merge graph, 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 (Promise.all). A merge transform receives the ordered list of its feeders' outputs.
  • The graph input goes to the single transform with no incoming connection; the graph output is the single transform with no outgoing connection (start / end can be set explicitly). Cycles are rejected with a clear error — repeating a run belongs to the layer above the graph.
  • GraphRun / TraceStep / RunContext types are unchanged, so existing consumers keep working.
  • Bumps @composable-model-graph/core to 0.2.0 and updates README §7 (Branching Model) from "future" to supported, in domain-neutral language.

Test plan

  • pnpm build
  • pnpm test (19 tests pass, incl. new model-graph-connections.test.ts: linear still works, branch runs both sides, merge receives ordered list, cycle rejected, unknown-ref rejected)

Made with Cursor

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>
@bigboateng
bigboateng merged commit 982728e into main Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant