feat(job)!: stream typed lifecycle and progress events - #27
Merged
Conversation
Jobs now expose eagerly subscribed lifecycle and validated progress streams, including run-and-watch and id-only reattachment. BREAKING CHANGE: WorkflowJob no longer exposes groupId. This release requires a full process restart because older peers can misread lifecycle or progress records on the completion channel. Closes #23 Closes #24 Closes #25 Closes #26 Created with AI. Verified by a human. Co-authored-by: Codex <codex@openai.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.
Jobs are opaque between enqueue and their terminal result. Consumers cannot observe attempts or typed progress, safely subscribe before enqueue, or reconstruct a typed handle from a known job id.
This introduces an eagerly subscribed
job.watch()stream for lifecycle, progress, and terminal events. Progress is validated through Standard Schema, nested steps can emit it,runAndWatch()closes the enqueue race, andgetJob(jobId)supports producer-only reattachment. Lifecycle and progress records remain transient.Warning
This release requires a full process restart.
WorkflowJob.groupIdis removed, and older peers can misread lifecycle or progress records on the shared completion channel. Do not rolling-deploy this version with an older release.Reviews
All follow-up review passes are clean.
Verification
pnpm type-checkpnpm lintpnpm testwith 90 passing testspnpm buildCloses #23
Closes #24
Closes #25
Closes #26