feat: add typed workflow branching - #52
Merged
Merged
Conversation
Signed-off-by: haseebahmed248 <haseebahmed6157@gmail.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
Add explicit workflow decisions without moving control flow into host adapters. The compiler checks every final-result path, and selected branches share the runtime's existing permissions and budgets.
This is a draft pending the public RFC review in #51. Please record the RFC outcome before merging; this PR does not publish to npm.
Related issue
Closes #20.
RFC: #51. The deadline-dispatch guard also relates to #34.
Changes
Validation
Local verification: Node.js 25.2.1, npm 11.6.2. The existing CI matrix covers Node.js 22/24 and package checks on Linux, macOS and Windows.
npm run checknpm run check:generatednpm test— 167 tests passedAdditional validation:
npm ci.npm run test:release— 4 tests passed.npm run test:package— 115 package files, 7 public exports and both CLI aliases; generated v2 contracts type-check in an isolated consumer and both aliases pass all 5 branching scenarios.git diff --check.Risk and compatibility
compileSourcereturnsWorkflowIr(v1 | v2). Explicit v1 consumers must narrow the version. Old npm runtimes cannot consume v2. Nested model contracts use path-qualified names. The event schema remains v1.docs/BRANCHING.md.Checklist
Signed-off-byline.