feat(world-postgres): event-first start-hook admission#2764
Draft
NathanColosimo wants to merge 1 commit into
Draft
feat(world-postgres): event-first start-hook admission#2764NathanColosimo wants to merge 1 commit into
NathanColosimo wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: febb8ba The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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✅ All tests passed Summary
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
d5b2a73 to
17d3b9c
Compare
84e800b to
306be29
Compare
78e0202 to
23c48fc
Compare
23c48fc to
f31c202
Compare
Adds the workflow_hook_claims table (single-owner token constraint; lifecycle state derived from hookId/expiresAt). run_created claims the token in the same transaction as the run and event inserts, createHook materializes the claim, disposal and run completion retain TTL-carrying claims with set-based statements, cancellation releases unmaterialized claims, and terminal-run cleanup GCs expired claim debris. Also lifts the postgres-lane skip from the start-hook e2e test.
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 3/4 · #2762 → #2763 → this PR → #2765
Implements event-first start-hook admission for
@workflow/world-postgres.workflow_hook_claimstable (migration0016): token PK, owning run, optionalhookId,ttlSeconds, optionalexpiresAt. Lifecycle state is derived, not stored: unmaterialized start claim =hookId IS NULL; materialized =hookIdset; retained =expiresAtset.run_createdclaims the token in the same transaction as the run and event inserts; same-run duplicate deliveries resolve toEntityConflictError(never a self-conflict), foreign owners toHookConflictErrorwith the owning run.createHookmaterializes the claim and creates the hook row in one transaction; plain hooks get attlSeconds = 0guard row (fixing a pre-existing token-uniqueness race —hooks.tokenhas no unique index).step_startedpath and lazy event-ID allocation, including its regression test.