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
feat(objectql,runtime): default-runner setters are first-wins; the private-field probes are gone (#4251) (#4398)
setDefaultBodyRunner / setDefaultActionRunner now enforce their own
documented contract -- "the runtime layer sets this once per engine" -- by
keeping the first runner and returning false for any later call. Public
accessors getDefaultBodyRunner() / getDefaultActionRunner() join them, and
the fields become real private members instead of `(this as any)`
attachments.
Before this the invariant lived in the CALLERS: AppPlugin probed the
engine's private _defaultBodyRunner / _defaultActionRunner fields through
`any` to avoid clobbering another AppPlugin's runner on a shared kernel --
an invariant owned by every caller and enforced by none, and a private
reach a field rename would have broken silently. The engine's own
bindHooks fallback and ObjectQLPlugin's authored-action re-sync read the
same fields the same way. All three read the public accessors now; the
only remaining `_default*` mentions are comments and test doubles.
Caller audit before changing semantics: every setter call site either
owns a fresh engine (sandbox + hook-binder tests) or wants exactly
keep-the-first (AppPlugin) -- nobody replaces a runner on a live engine.
void -> boolean is additive; AppPlugin uses it to keep its "Installed
default ... runner" log truthful.
Pinned in hook-binder tests: a second install is refused end-to-end (the
first runner is the one that executes) and the accessors expose what was
kept. The app-plugin test that pinned the caller-side guard now pins the
new division: setter called unconditionally, log skipped when the engine
answers false.
Verified: objectql 1464/89, runtime 1001/69 (serial runs; an earlier
6-file cloud-connection FAIL was local vitest concurrency noise beside a
parallel spec dts build -- single-file and serial reruns green, and the
"22 failures on clean HEAD" scare was a stale metadata-protocol dist, NOT
a main regression); objectql + runtime dts builds; eslint clean; ratchet
holds 168/36 none new.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
0 commit comments