Repository navigation
Description
Summary
Between 3.16.2 and 3.17.0 the public impl:created / impl:changed event payload changed where the leaf's callable lives. On 3.16.2 a public subscriber read it from a stable impl field; on 3.17.0 that field is gone from the public event, and the callable is only reachable via wrapper.__impl — the framework's own internal wrapper handle.
Removing the raw, unwrapped impl from the public tier is correct and intended (#398 — the public tier should "carry the wrapped callable + metadata, never the raw unwrapped impl"). The problem is the path changed: instead of keeping a stable public field and putting the wrapped callable there, the value was relocated into the internal wrapper.__impl shape, so external consumers both break and are forced to couple to a reserved internal handle.
Evidence (minimal repro)
Compose any api, subscribe to the public event, and inspect the payload:
import slothlet from "@cldmv/slothlet";
const api = await slothlet({ base: BASE, mode: "eager", permissions: { defaultPolicy: "allow" } });
api.slothlet.lifecycle.on("impl:created", (e) => console.log(Object.keys(e), typeof e.impl, typeof e.wrapper?.__impl));
await api.slothlet.api.add([], EXT_DIR, { moduleID: "withsib" });- 3.16.2 — event carries
impl:{ apiPath, impl },typeof e.impl === "function"for a leaf callable. - 3.17.0 — no
implfield:{ apiPath, wrapper: { __impl }, source, moduleID, filePath, sourceFolder },typeof e.impl === "undefined", callable only ate.wrapper.__impl.
(Fixture is a self-named file withsib/withsib.mjs exporting activate/deactivate plus a sibling folder withsib/sub/thing.mjs, but the payload change is general — it affects every impl:created event.)
Why it's a problem
__implis explicitly a reserved, internal handle — slothlet's own error strings call it "the framework's own wrapper handle" — and its internal consumers reach it viasubscribeInternal(the internal tier, impl:created leaks the raw unwrapped callable and fires for merge-discarded leaves #398). The public.on/.subscribeevent is now effectively handing external subscribers the internal emit shape rather than a sanitized public field.- Public consumers that read
e.impl(the documented pre-3.17 public field) silently getundefined; the only workaround is to reach intoe.wrapper.__impl, coupling application code to a reserved internal name.
Suggested fix
Keep a stable public field on the public impl:created / impl:changed event carrying the wrapped callable — e.g. restore impl holding the wrapped callable, or expose a clean documented accessor (callable/fn) — so the #398 intent (no raw impl) is met without relocating the value into wrapper.__impl.
Impact
@cldmv/rummage — the ext-host tree (src/ext-host/api-tree.mjs) and view composer (src/lib/compose-extension-views.mjs) capture each package's activate/deactivate from this event's callable field; both break on 3.17.0. (rummage's longer-term direction is to move that capture onto #400 per-entity routines / .for(key), but that's separate from this payload-contract regression.)
Activity
fix(events): public impl:created/impl:changed carry the callable on `…
Shinrai commentedon Sep 21, 2026
Implemented on
nextvia PR #434 (commit33747cfa), riding into 3.18.0.The public
impl:created/impl:changedevents now carry the wrapped callable on a stable publicimplfield — readdata.impl(the pre-3.17 field, restored; never the raw impl, never__wrapperRef). Rather than keep re-exposing the reserved internalwrapper.__implhandle,wrapperis dropped from the public event entirely (it was redundant withimpl). The internal event still carrieswrapperfor the framework's own ownership / metadata / routine subscribers (reached viasubscribeInternal), soonImplCreatedand friends are unchanged.implisnullbefore a lazy wrapper materializes.Removing the public
wrapperalso eliminates the metadata-security "wrapper leakage" attack surface at the source — the reworked payload tests now assert the public event exposes only the documented safe fields.For
@cldmv/rummage: once 3.18.0 is on npm, bumping to^3.18restorese.implwith no rummage code change. Verified across the eager/lazy matrix. Release notes: docs PRdocs/v3.18.0-notes-433. Left open per the v4 flow — thenext → masterrelease closes it.fix(events): restore stable public `impl` field on impl:created/impl:…
docs(release): add the #433 impl-event payload fix to the v3.18.0 notes
release: v3.18.0 - add host-only event.resolveLevel(subscriberPath, e…