Backport #2152: [world-local] Reduce sequential replay I/O - #2707
Merged
Conversation
🦋 Changeset detectedLatest commit: 1afdfdb 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
|
@copilot resolve the merge conflicts in this pull request |
* [world-local] Reduce sequential replay I/O * Fix relative local event cache lookups * Keep event cache eviction test lightweight --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
pranaygp
force-pushed
the
backport/pr-2152-to-stable
branch
from
August 24, 2026 22:52
ae91f7c to
1afdfdb
Compare
Contributor
Author
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (106 failed)redis (21 failed):
turso (85 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
VaguelySerious
approved these changes
Aug 25, 2026
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.
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.