From the ai-teammate review round on #226 (lib/src/js/async_job_pool.dart:190).
The __jsr* host-function protocol is implemented twice: the adapter-owned dispatchAsyncJob/waitAsyncJob (this repo) and AsyncEnginePool's host-fn half (quickjs_runtime). Same host-fn names, same __jsError sentinel, same {ok, result, error} envelope. The prelude JS half lives in the package while the host-fn half lives here — a jsr minor bump changing the prelude's expectations breaks the adapter at runtime instead of compile time.
Mitigation in place: test/js/async_prelude_contract_test.dart tripwire (landed in 7b4171c) + lockstep doc comments.
Proper fix: extend quickjs_runtime (fork + PR per GOAL.md rule) so attachMainRuntime accepts a per-dispatch context provider (or dispatch takes an optional context), then delete dispatchAsyncJob/waitAsyncJob and delegate.
From the ai-teammate review round on #226 (lib/src/js/async_job_pool.dart:190).
The
__jsr*host-function protocol is implemented twice: the adapter-owneddispatchAsyncJob/waitAsyncJob(this repo) andAsyncEnginePool's host-fn half (quickjs_runtime). Same host-fn names, same__jsErrorsentinel, same{ok, result, error}envelope. The prelude JS half lives in the package while the host-fn half lives here — a jsr minor bump changing the prelude's expectations breaks the adapter at runtime instead of compile time.Mitigation in place:
test/js/async_prelude_contract_test.darttripwire (landed in 7b4171c) + lockstep doc comments.Proper fix: extend quickjs_runtime (fork + PR per GOAL.md rule) so
attachMainRuntimeaccepts a per-dispatch context provider (ordispatchtakes an optional context), then deletedispatchAsyncJob/waitAsyncJoband delegate.