feat(world-local): event-first start-hook admission#2763
Draft
NathanColosimo wants to merge 1 commit into
Draft
Conversation
🦋 Changeset detectedLatest commit: a7c963c The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Contributor
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests▲ Vercel Production (1 failed)hono (1 failed):
Details by Category❌ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
✅ 📋 Other
❌ Some E2E test jobs failed:
Check the workflow run for details. |
This was referenced Jul 2, 2026
01a094a to
baaa0b3
Compare
79beb9d to
41bdb5a
Compare
78e0202 to
23c48fc
Compare
23c48fc to
f31c202
Compare
run_created atomically claims the start-hook token (converging duplicate deliveries on one canonical event), createHook materializes the claim, disposal and run completion retain TTL-carrying claims, and cancellation releases unmaterialized claims so cancel-then-retry can reuse the token. Terminal-run cleanup opportunistically GCs expired claim debris. Includes the e2e coverage for start-hook conflicts (skipped on the postgres lane until the next PR in the stack).
| tag, | ||
| hookData.token, | ||
| existingClaim, | ||
| { |
Contributor
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.
Stack 2/4 · #2762 → this PR → #2764 → #2765
Implements event-first start-hook admission for
@workflow/world-local(filesystem dev world), on top of the core API PR.run_createdatomically claims the token via an exclusive constraint-file write; duplicate deliveries of the same run converge on one canonicalrun_createdevent ID recorded in the claim, so the exclusive event publish dedups instead of appending twice.createHook({ token })inside the workflow materializes the reserved claim; a lost concurrent materialize converges instead of emitting a spurious self-hook_conflict.expiresAt = max(hookCreatedAt + ttl, prior window, now)); cancellation releases claims the workflow never materialized, so cancel-then-retry (includingstart()'s own queue-failure cleanup) can reuse the token immediately.