Gate guest entry during mutation application, not just in-flight calls #1
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.40) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 312 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.344
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1"
general
weight: 0.35
lann
Fixes the second reentrancy window found in review (H1).
The queue added with the TodoMVC port (aee9b6d) serializes guest entries only while a
handle-eventcall is in flight. But mutations are also applied inside the mutation stream's direct-readconsumecallback — synchronously inside the guest's write rendezvous, with a live guest turn on the stack. A scheduler-driven flush (timer / async re-render, nohandle-eventin flight) whose DOM application detaches a focused element firesfocusoutsynchronously, and the delegated listener dispatched straight into the guest from inside the rendezvous:runtime/src/task/thread.ts/exec/boundary.ts:1376), andDirectSourceview aliases guest linear memory, which guest code couldmemory.grow/detach mid-decode.(Post CM PR #705 the trap likely becomes an implicit deferral, but the A21 rule stays in force — this fix is portable across both.)
Change
host/src/dispatch.ts(new):DispatchGate— pure, unit-testable serialization of guest entries across both forbidden windows (in-flight call, apply window). Queued dispatches capture payload/DomEventat raise time and drain FIFO, one live entry at a time; the apply-window drain defers viaqueueMicrotask(an empty JS stack ⇒ the rendezvous turn has unwound ⇒ instance enterable). Idle dispatches stay synchronous sopreventDefaultkeeps working in the native listener frame.host/src/host.ts:consumebrackets decoding withbeginApply/endApply;dispatchEventroutes through the gate; comments updated for both triggers.dispose()drops queued entries instead of replaying them into the guest (the queued-replay part of review M1; the other teardown gaps are unchanged).Gates
deno task checkcleandeno test host/tests/43/43 (fullstack + counter round-trips included; 9 newdispatch_test.tscases: FIFO replay, both-windows interleavings, sync-throw/rejection recovery, dispose, reentrant dispatch from a running call)cargo testgreen at base