You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AI recommendation: This is a self-contained @workflow/world-local performance optimization plus correctness bug fixes (relative-dataDir cache misses, cached-object aliasing, external-directory cleanup recovery) with focused regression tests, marked as a patch. All changed files are in packages/world-local/, which is actively maintained on stable (verified the files exist there and several match the commit's merge-base blobs), so the changes apply to functionality already present on stable.
Conflict resolution (taken over manually)
The original AI conflict resolution had gone stale — stable moved ~85 commits past the branch point. I rebased onto current stable (853a316c7) and resolved the conflicts by hand. The branch is now a single signed commit parented directly on stable HEAD.
Two conflicts, both between disjoint additions:
File
Conflict
Resolution
src/index.ts
stable replaced mergedConfig.recoverActiveRuns ?? true with resolveRecoverActiveRuns(mergedConfig) (#2914) on the line adjacent to the new createStorage destructuring
Kept both: destructure clearCache off createStorage, keep resolveRecoverActiveRuns
src/fs.test.ts
stable added a deleteJSON describe block and import (#3215 Windows EPERM retry) where the patch adds an ensureDir block and its imports
Kept both blocks and both imports
I also dropped one gratuitous change the AI resolution had carried over from main: it pluralized the // Per-instance in-process mutex comment above hookLocks. main has several lock maps there; stable has only hookLocks, so the singular was correct and the change was both unrelated to this patch and inaccurate here. The diff against stable is now exactly the upstream #2152 change, nothing more.
Semantic-conflict review
Clean textual merges can still be wrong, so I checked the stable-only world-local changes that land near the new event cache. The cache is read-through over append-only event files, so the risk is any path that deletes or overwrites an event file:
Scope correlation-ID event lookups to a run #3762 (scope correlation-ID lookups to a run) — merged into the same listByCorrelationId call the patch adds cachedItems to. The runId filter is preserved and is orthogonal to the cache (which is keyed by path, with the filter still applied downstream).
fix(world-local): rebuild hook caches from event log #2747 (rebuild hook caches from event log) and repairHookEntityFromPersistedEvent — read events straight from disk without the cache. That's a cache miss, not staleness; disk stays authoritative.
legacy.ts writes wait_completed / hook_received via writeJSON, bypassing storeEvent. Also a miss, not staleness — and identical to main's behavior.
clear() in index.ts is the one path that deletes event files; the patch already guards it with clearStorageCache().
I confirmed the cache-key alignment the patch depends on still holds on stable: taggedPath → resolveWithinBase → path.resolve, and paginatedFileSystemQuery now resolves its directory too, so writer and reader agree on absolute keys even when dataDir is relative.
Verification
pnpm typecheck — 40/40 tasks pass.
@workflow/world-local — 448/448 tests pass, including the patch's new cases (ensureDir mkdir-dedup + both external-cleanup recovery tests, the four event-cache tests, the tagged-clear() test) running alongside stable's own (deleteJSON EPERM retry, rebuilds missing hook caches from a committed hook_created event).
@workflow/world-testing — 6/6 pass (conformance suite against the local world).
biome check on the changed files reports the same 9 pre-existing warnings as stable's versions of those files. No new findings.
@workflow/core fails 7 DOMException serialization tests on my machine, on Node v22.18.0. That is environmental and pre-existing: this branch does not touch packages/core (see the diffstat — every changed file is under packages/world-local/ plus the changeset).
Changeset
patch on @workflow/world-local, unchanged. stable is in regular (non-pre) mode, so this publishes as a latest patch.
CI on the rebased commit
Green on everything that gates: E2E Required Check, Unit Tests on ubuntu + windows, E2E Windows Tests, and every E2E Local Dev / Local Postgres / Local Prod / Vercel Prod lane across all frameworks.
Four red, none of them gating and none related to this change (it touches only packages/world-local/):
E2E Community World (Redis) / (Turso) — FAILURE; (MongoDB) — CANCELLED. These are excluded from e2e-required-check by design; the job's own comment says so ("The job is non-blocking via its exclusion from e2e-required-check, so this surfaces failures without gating merges"). Redis fails in dev.test.ts, a known-flaky discovery suite.
Vercel – workbench-python-workflow — a workbench deploy unrelated to world-local.
stable has since advanced to 699e01ed1 (#2889, namespaced active-run recovery). This branch does not conflict with it, and stable's ruleset sets strict_required_status_checks_policy: false, so no rebase is needed. I checked the overlap anyway: #2889 gives reenqueueActiveRuns an optional fourth namespace parameter, so the three-argument call in world-local/src/index.ts — the file I resolved a conflict in — is unaffected, and its other world-local edit is confined to reenqueue.test.ts, which this branch does not touch.
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
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.
Automated backport of #2152 to
stable(backport job run).AI recommendation: This is a self-contained
@workflow/world-localperformance optimization plus correctness bug fixes (relative-dataDir cache misses, cached-object aliasing, external-directory cleanup recovery) with focused regression tests, marked as apatch. All changed files are inpackages/world-local/, which is actively maintained onstable(verified the files exist there and several match the commit's merge-base blobs), so the changes apply to functionality already present onstable.Conflict resolution (taken over manually)
The original AI conflict resolution had gone stale —
stablemoved ~85 commits past the branch point. I rebased onto currentstable(853a316c7) and resolved the conflicts by hand. The branch is now a single signed commit parented directly onstableHEAD.Two conflicts, both between disjoint additions:
src/index.tsstablereplacedmergedConfig.recoverActiveRuns ?? truewithresolveRecoverActiveRuns(mergedConfig)(#2914) on the line adjacent to the newcreateStoragedestructuringclearCacheoffcreateStorage, keepresolveRecoverActiveRunssrc/fs.test.tsstableadded adeleteJSONdescribe block and import (#3215 Windows EPERM retry) where the patch adds anensureDirblock and its importsI also dropped one gratuitous change the AI resolution had carried over from
main: it pluralized the// Per-instance in-process mutexcomment abovehookLocks.mainhas several lock maps there;stablehas onlyhookLocks, so the singular was correct and the change was both unrelated to this patch and inaccurate here. The diff againststableis now exactly the upstream #2152 change, nothing more.Semantic-conflict review
Clean textual merges can still be wrong, so I checked the
stable-onlyworld-localchanges that land near the new event cache. The cache is read-through over append-only event files, so the risk is any path that deletes or overwrites an event file:max_eventsper run limit #3042 (max_events) — only reports a per-run ceiling on responses; never prunes events. No interaction.listByCorrelationIdcall the patch addscachedItemsto. TherunIdfilter is preserved and is orthogonal to the cache (which is keyed by path, with the filter still applied downstream).repairHookEntityFromPersistedEvent— read events straight from disk without the cache. That's a cache miss, not staleness; disk stays authoritative.legacy.tswriteswait_completed/hook_receivedviawriteJSON, bypassingstoreEvent. Also a miss, not staleness — and identical tomain's behavior.clear()inindex.tsis the one path that deletes event files; the patch already guards it withclearStorageCache().I confirmed the cache-key alignment the patch depends on still holds on
stable:taggedPath→resolveWithinBase→path.resolve, andpaginatedFileSystemQuerynow resolves its directory too, so writer and reader agree on absolute keys even whendataDiris relative.Verification
pnpm typecheck— 40/40 tasks pass.@workflow/world-local— 448/448 tests pass, including the patch's new cases (ensureDirmkdir-dedup + both external-cleanup recovery tests, the four event-cache tests, the tagged-clear()test) running alongsidestable's own (deleteJSONEPERM retry,rebuilds missing hook caches from a committed hook_created event).@workflow/world-testing— 6/6 pass (conformance suite against the local world).biome checkon the changed files reports the same 9 pre-existing warnings asstable's versions of those files. No new findings.@workflow/corefails 7DOMExceptionserialization tests on my machine, on Node v22.18.0. That is environmental and pre-existing: this branch does not touchpackages/core(see the diffstat — every changed file is underpackages/world-local/plus the changeset).Changeset
patchon@workflow/world-local, unchanged.stableis in regular (non-pre) mode, so this publishes as alatestpatch.CI on the rebased commit
Green on everything that gates: E2E Required Check,
Unit Testson ubuntu + windows,E2E Windows Tests, and everyE2E Local Dev/Local Postgres/Local Prod/Vercel Prodlane across all frameworks.Four red, none of them gating and none related to this change (it touches only
packages/world-local/):E2E Community World (Redis)/(Turso)— FAILURE;(MongoDB)— CANCELLED. These are excluded frome2e-required-checkby design; the job's own comment says so ("The job is non-blocking via its exclusion frome2e-required-check, so this surfaces failures without gating merges"). Redis fails indev.test.ts, a known-flaky discovery suite.Vercel – workbench-python-workflow— a workbench deploy unrelated toworld-local.stablehas since advanced to699e01ed1(#2889, namespaced active-run recovery). This branch does not conflict with it, andstable's ruleset setsstrict_required_status_checks_policy: false, so no rebase is needed. I checked the overlap anyway: #2889 givesreenqueueActiveRunsan optional fourthnamespaceparameter, so the three-argument call inworld-local/src/index.ts— the file I resolved a conflict in — is unaffected, and its otherworld-localedit is confined toreenqueue.test.ts, which this branch does not touch.