Skip to content

release: v3.18.1 - scope caller() and event.on identity to the querying… - #437

Merged
cldmv-bot[bot] merged 5 commits into
masterfrom
next
Sep 21, 2026
Merged

cldmv-bot[bot] merged 5 commits into
masterfrom
next

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Slothlet v3.18.1 Changelog

Release Date: September 2026
Release Type: Patch
Branch: release/3.18.1


Overview

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 active AsyncLocalStorage store without scoping to the querying instance. The async context manager is a process-level singleton and ALS propagates its store across await / 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-only event.resolveLevel was 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, so caller() 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 an await / 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. Both caller() 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-vine over 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

coverage

Metric Coverage
Statements 100.0%
Branches 100.0%
Functions 100.0%
Lines 100.0%

Avg: 100.0% · fe594e8 · Node lts/*

Co-authored-by: Shinrai [email protected]

Shinrai and others added 3 commits September 20, 2026 19:37
…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.
@cldmv-bot cldmv-bot Bot added ! release → master v4 flow: persistent next → master release PR (carries the next feature release) release Marks a pull request as a pending release — merge to publish a new version semver: patch This release contains only backwards-compatible bug fixes type: bug Something is broken or not behaving as expected area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure type: dependencies Relates to dependency updates, version bumps, or package management labels Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

🔒 Dependency Review

  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ✅ 0 package(s) with unknown licenses
  • ✅ 0 denied package(s)
  • ✅ 0 package(s) with OpenSSF Scorecard score < 3

Full job summary

Shinrai
Shinrai previously approved these changes Sep 21, 2026
@cldmv-bot

cldmv-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

📦 Bundle size unchanged

File Raw Δ Raw Gzipped Δ Gzipped
dist/lib/builders/api-assignment.mjs 15.6 kB — 3.4 kB —
dist/lib/builders/api_builder.mjs 52.0 kB +19 B (+0.0%) 10.4 kB +6 B
dist/lib/builders/builder.mjs 2.8 kB — 1.2 kB —
dist/lib/builders/modes-processor.mjs 46.6 kB — 7.8 kB —
dist/lib/errors.mjs 4.4 kB — 1.7 kB —
dist/lib/factories/component-base.mjs 1.7 kB — 866 B —
dist/lib/factories/context.mjs 1010 B — 525 B —
dist/lib/handlers/api-cache-manager.mjs 3.4 kB — 1.4 kB —
dist/lib/handlers/api-manager.mjs 63.6 kB — 13.0 kB —
dist/lib/handlers/context-async.mjs 4.3 kB — 1.4 kB —
dist/lib/handlers/context-live.mjs 7.0 kB — 2.2 kB —
dist/lib/handlers/event-manager.mjs 4.2 kB +15 B (+0.4%) 1.5 kB +3 B
dist/lib/handlers/framework-internals.mjs 1.1 kB — 611 B —
dist/lib/handlers/hook-manager.mjs 19.6 kB — 4.9 kB —
dist/lib/handlers/lifecycle-token.mjs 959 B — 540 B —
dist/lib/handlers/lifecycle.mjs 2.7 kB — 1.1 kB —
dist/lib/handlers/materialize-manager.mjs 1.2 kB — 672 B —
dist/lib/handlers/metadata.mjs 12.3 kB — 3.2 kB —
dist/lib/handlers/module-manager.mjs 9.8 kB — 3.1 kB —
dist/lib/handlers/ownership.mjs 9.4 kB — 2.7 kB —
dist/lib/handlers/permission-manager.mjs 19.8 kB — 4.5 kB —
dist/lib/handlers/routine-manager.mjs 19.1 kB — 4.9 kB —
dist/lib/handlers/trusted-root.mjs 3.1 kB — 1.2 kB —
dist/lib/handlers/unified-wrapper.mjs 78.6 kB — 14.0 kB —
dist/lib/handlers/version-manager.mjs 14.4 kB — 3.7 kB —
dist/lib/helpers/caller-pinning.mjs 804 B — 496 B —
dist/lib/helpers/class-instance-wrapper.mjs 2.7 kB — 1.1 kB —
dist/lib/helpers/config.mjs 20.8 kB — 5.1 kB —
dist/lib/helpers/defaults.mjs 1.3 kB — 785 B —
dist/lib/helpers/eventemitter-context.mjs 9.0 kB — 1.8 kB —
dist/lib/helpers/eventtarget-context.mjs 3.3 kB — 1.2 kB —
dist/lib/helpers/eventtarget-property-context.mjs 2.8 kB — 1.1 kB —
dist/lib/helpers/generate-manifest.mjs 10.6 kB — 3.3 kB —
dist/lib/helpers/hint-detector.mjs 1.3 kB — 756 B —
dist/lib/helpers/manifest-resolver.mjs 1004 B — 611 B —
dist/lib/helpers/modes-utils.mjs 1.1 kB — 696 B —
dist/lib/helpers/module-discovery.mjs 7.5 kB — 2.5 kB —
dist/lib/helpers/module-manifest-validator.mjs 10.1 kB — 2.0 kB —
dist/lib/helpers/module-sort.mjs 1.0 kB — 593 B —
dist/lib/helpers/observer-context.mjs 2.1 kB — 1004 B —
dist/lib/helpers/pattern-matcher.mjs 3.0 kB — 1.4 kB —
dist/lib/helpers/platform.mjs 1.8 kB — 953 B —
dist/lib/helpers/resolve-from-caller.mjs 3.0 kB — 1.3 kB —
dist/lib/helpers/sanitize.mjs 7.8 kB — 2.3 kB —
dist/lib/helpers/scheduler-context.mjs 2.0 kB — 901 B —
dist/lib/helpers/utilities.mjs 1.7 kB — 917 B —
dist/lib/i18n/languages/de-de.json 66.8 kB — 19.1 kB —
dist/lib/i18n/languages/en-gb.json 58.9 kB — 16.6 kB —
dist/lib/i18n/languages/en-us.json 58.9 kB — 16.6 kB —
dist/lib/i18n/languages/es-es.json 66.2 kB — 18.5 kB —
dist/lib/i18n/languages/es-mx.json 66.2 kB — 18.5 kB —
dist/lib/i18n/languages/fr-fr.json 67.3 kB — 18.5 kB —
dist/lib/i18n/languages/hi-in.json 111.0 kB — 20.9 kB —
dist/lib/i18n/languages/ja-jp.json 79.3 kB — 19.6 kB —
dist/lib/i18n/languages/ko-kr.json 68.8 kB — 18.6 kB —
dist/lib/i18n/languages/pt-br.json 65.5 kB — 18.2 kB —
dist/lib/i18n/languages/ru-ru.json 81.4 kB — 19.8 kB —
dist/lib/i18n/languages/zh-cn.json 57.7 kB — 18.1 kB —
dist/lib/i18n/translations.mjs 5.0 kB — 1.8 kB —
dist/lib/modes/eager.mjs 2.1 kB — 1.0 kB —
dist/lib/modes/lazy.mjs 2.5 kB — 1.2 kB —
dist/lib/processors/flatten.mjs 10.6 kB — 2.4 kB —
dist/lib/processors/loader.mjs 13.0 kB — 4.2 kB —
dist/lib/processors/type-generator.mjs 6.7 kB — 2.6 kB —
dist/lib/processors/typescript.mjs 10.7 kB — 4.0 kB —
dist/lib/runtime/runtime-asynclocalstorage.mjs 3.0 kB — 1.1 kB —
dist/lib/runtime/runtime-livebindings.mjs 3.1 kB — 1.1 kB —
dist/lib/runtime/runtime.mjs 2.2 kB — 800 B —
dist/lib/typegen/typegen.mjs 2.1 kB — 1.0 kB —
dist/slothlet.mjs 19.6 kB — 5.3 kB —
Total 1.39 MB +34 B 370.9 kB +9 B

📊 Generated by bundle-size. Brotli sizes also measured but omitted from the table for brevity.

Shinrai and others added 2 commits September 20, 2026 20:09
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).
@cldmv-bot cldmv-bot Bot added the type: documentation Relates to docs, README updates, guides, or inline code comments label Sep 21, 2026
@cldmv-bot
cldmv-bot Bot merged commit 306f10a into master Sep 21, 2026
40 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure ! release → master v4 flow: persistent next → master release PR (carries the next feature release) release Marks a pull request as a pending release — merge to publish a new version semver: patch This release contains only backwards-compatible bug fixes type: bug Something is broken or not behaving as expected type: dependencies Relates to dependency updates, version bumps, or package management type: documentation Relates to docs, README updates, guides, or inline code comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant