Repository navigation
release: v3.18.1 - scope caller() and event.on identity to the querying… - #437
Merged
Merged
Conversation
…tance `api.slothlet.caller()` (#431) and the EventManager `on()` owner-wrapper capture (#429/#407) read the caller identity from the raw active AsyncLocalStorage store. The async context manager is a process-level singleton and ALS propagates a store across `await` / `queueMicrotask`, so when one instance's module flow is active and code touches a DIFFERENT instance's api, that other instance saw the foreign module as its own caller. The concrete break: @cldmv/slothlet-vine's serving side subscribes to forward an event on behalf of a far subscriber. Over a same-process (loopback) transport the far subscriber's flow propagates into the serving instance's handler, so its forwarding listener captured the far module as `ownerWrapper` and was pinned to it on every emit — the host-only `event.resolveLevel` was then denied under that leaked identity and nothing was forwarded. A real (worker/process/socket) boundary can't propagate ALS, so it surfaced only in-process, but the loopback is the e2e reference. Both accessors now pass the querying instance's id to `getCallerIdentity(instanceID)` — the same instance-scoping the read-gate already applies for the nested-boot case (#290). A foreign flow resolves to the host (no caller); this instance's own flow still reports the real module. The permission gate already scoped this way, so it is now consistent with what `caller()` and event delivery report. Adds a cross-instance isolation regression test (caller() and listener host-pinning) across the full eager/lazy × async/live matrix, with an isolated fixture.
🔒 Dependency Review
|
Shinrai
previously approved these changes
Sep 21, 2026
Contributor
Author
📦 Bundle size unchanged
📊 Generated by |
v3.18.1 fixes the cross-instance caller leak (#436) that made the 3.18.0 event-forwarding enablers drop same-process deliveries (e.g. @cldmv/slothlet-vine over loopback); cross-process forwarding was unaffected. Adds docs/changelog/v3/v3.18.1.md and moves v3.18.0 into Recent Releases (keeping 4).
Shinrai
approved these changes
Sep 21, 2026
Shinrai
added a commit
that referenced
this pull request
Sep 21, 2026
… for #318 The previous commit added a schedule cron as a "guaranteed" fallback, but that's the wrong tool: a wasteful always-on poll every 10 minutes forever, papering over the real mechanism instead of fixing it. The actual cause: GitHub does not deliver check_suite: completed for a check suite created by GitHub Actions itself — which is every check this repo's own ci.yml produces, coverage badge and PR-comment jobs included — only for one created by a third-party App. That's why zero check_suite-triggered runs of release-merge.yml ever fired for PR #437's own head branch. workflow_run is GitHub's documented replacement for "re-run something when this other workflow finishes" and doesn't have that restriction. Replace check_suite: completed + schedule with workflow_run, naming ci.yml by its literal workflow name (required — workflow_run matches on name, not filename, and can't be templated via an expression in on:). No change needed in the reusable's own resolution logic (CLDMV/.github's workflow-release-merge.yml now threads workflow_run.head_branch through as the primary source, falling back to check_suite.head_branch) — this repo just needs the trigger swap once that reaches @v4.
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.
Slothlet v3.18.1 Changelog
Release Date: September 2026
Release Type: Patch
Branch:
release/3.18.1Overview
Version 3.18.1 fixes a cross-instance context-isolation bug that made the 3.18.0 event-forwarding enablers unreliable whenever two instances share a process. The enablers themselves are unchanged; this release makes them behave as documented across every transport — in particular the same-process case (a grow/serve pair inside one process, such as
@cldmv/slothlet-vine's loopback transport) that 3.18.0 silently broke.api.slothlet.caller()(#431) and the event manager's subscribe-time owner-wrapper capture (#429 / #407) read the caller identity straight from the activeAsyncLocalStoragestore without scoping to the querying instance. The async context manager is a process-level singleton and ALS propagates its store acrossawait/queueMicrotask, so when one instance's module flow was active and code touched a different instance's api, that other instance saw the foreign module as its own caller. Concretely: a forwarding layer's serving side subscribes to re-emit an event on behalf of a far subscriber; over a same-process transport the far subscriber's flow propagated into the serving instance's handler, so its listener was pinned to the far subscriber's identity and the host-onlyevent.resolveLevelwas denied at emit — same-process deliveries were dropped. A real cross-process boundary (worker, process, socket) cannot propagate that context and was unaffected.Both accessors now pass the querying instance's id to
getCallerIdentity(instanceID)— the same instance-scoping the permission read-gate already applied for the nested-boot case (#290). A foreign instance's flow resolves to the host (no caller); the instance's own flow still reports the real module, socaller()and event delivery are now consistent with what the gate already enforced. This is a drop-in patch with no api change.🐛 Bug Fixes
caller()and event delivery no longer leak a foreign instance's caller across the shared async context (#436)api.slothlet.caller()on instance A could return instance B's module path, and an event listener registered on A while B's flow was active was pinned to B's identity, when the two instances shared a process and B's flow reached A across anawait/queueMicrotask(the async context manager is a process-level singleton whose store ALS propagates). For a cross-boundary event-forwarding layer this denied the host-only re-resolution at emit under the leaked identity, so a same-process forwarded subscription received nothing. Bothcaller()and the event manager's owner-wrapper capture now scope their identity read to the querying instance (getCallerIdentity(instanceID)), exactly as the permission read-gate already did — a foreign instance's active flow reports the host, while the instance's own flow still reports the real module. Same-process event forwarding (e.g.@cldmv/slothlet-vineover loopback) now delivers correctly; cross-process forwarding, already unaffected, is unchanged.📚 Documentation
🔧 Dependencies
No dependency updates.
Upgrade notes
A drop-in for v3.18.0. The two event-forwarding enablers (
api.slothlet.event.resolveLevel,api.slothlet.caller()) are unchanged; nothing about their signatures or return values moves.If you forward events across a same-process boundary — two slothlet instances in one process, including
@cldmv/slothlet-vine's loopback transport — upgrade to 3.18.1: on 3.18.0 those deliveries are silently dropped. Cross-process forwarding (worker / process / socket) already worked on 3.18.0 and is unaffected. Everything else is unchanged.👥 Contributors
Avg: 100.0% ·
fe594e8· Node lts/*Co-authored-by: Shinrai [email protected]