| … | … | @@ -3124,7 +3124,7 @@ injected per layer: |
| 3124 | 3124 | - `resumeVia_`: a resume is `rt::queueMicrotask`. |
| 3125 | 3125 | - `ss::Loop` and `ss::Timers`: ss calls `rt`. |
| 3126 | 3126 | |
| 3127 | | **Open decision — storage await.** |
| 3127 | **Storage await — DECIDED 2026-10-04 (user): (b), async through the libuv thread pool.** |
| 3128 | 3128 | - **JS:** hypercore-storage awaits rocksdb-native, whose reads and writes complete on libuv's |
| 3129 | 3129 | thread pool, as callbacks on the loop. So storage completions interleave with network I/O. |
| 3130 | 3130 | - **keetd:** storage is synchronous. That is a documented divergence ("wire order may differ"), |
| … | … | @@ -3137,6 +3137,9 @@ injected per layer: |
| 3137 | 3137 | |
| 3138 | 3138 | The choice decides how much of the composed order the gates can compare. |
| 3139 | 3139 | |
| 3140 | **(b) chosen.** R4 makes every storage completion a loop callback (the thread pool, as |
| 3141 | rocksdb-native does), and every call site a continuation, exactly where JS awaits. |
| 3142 | |
| 3140 | 3143 | **Migration (each step re-runs every gate and drill):** |
| 3141 | 3144 | - **R1:** `hc::rt`, both the real libuv runtime and the virtual one. Gate: Bare probe scripts |
| 3142 | 3145 | (microtask vs timer vs immediate vs I/O vs uncaught ordering, as in the 2026-10-04 probe) |