| … | … | @@ -2424,6 +2424,26 @@ SessionState's truncate / reorg / named-session machinery. |
| 2424 | 2424 | - two concurrent appends ("core recovered during append"); |
| 2425 | 2425 | - a commit that waits; |
| 2426 | 2426 | - recovery peers that exclude the remote: never recovers (pending at the end). |
| 2427 | - **(c) DONE 2026-10-03** (keetd a4d23ae, a8af45d). |
| 2428 | - **Ported:** `waitForRecovery` (a timer-owned context keeps the state, as JS's promise |
| 2429 | does), `RECOVERY_PEERS`, and Session `recover()`. |
| 2430 | - **The waits:** append waits when default and recovering, with the key pair chosen |
| 2431 | first; commit waits when recovering (`commitLocked_`). |
| 2432 | - **Core hooks** `onsettimeout` and `onrecoverypeers`, set by the Replicator. Peers |
| 2433 | carry `remotePublicKey`: the swarm tools pass the stream's key; everything else is |
| 2434 | all-zero, as is the pipe harness's JS stream. |
| 2435 | - **Pipe s18 (writer mode, ~100 s per side)** covers: waiting appends, `recover()`, a |
| 2436 | waiting commit from a named batch, an excluding filter, and a timing segment (marks |
| 2437 | between JS's schedule and each shortcut's). |
| 2438 | - **NOT gated: two appends racing one recovery.** JS's second append succeeds only |
| 2439 | because the first's flushHints / append I/O outlasts the ≤1 ms skew between the two |
| 2440 | timer chains. keetd's storage is synchronous, so the second sees the first's append |
| 2441 | and raises "core recovered during append" (as JS would with faster I/O). That branch |
| 2442 | has no deterministic JS-matching case. |
| 2443 | - **Drill `m5g3e3`: 9/9 red.** The first gate killed 5/9: the other 4 only changed WHEN |
| 2444 | recovery ended. The drill SCENARIO_TIMEOUT is now 300 s (an uncached s18 exceeded |
| 2445 | 180 s). |
| 2446 | - **M5g-3 COMPLETE 2026-10-03** (3a–3e). Next: M5g-4, the rest of the Hypercore surface. |
| 2427 | 2447 | - **M5g-4 — the rest of the surface:** |
| 2428 | 2448 | - value encodings and `encodeBatch` (DECODING_ERROR); `postappend`, `onseq`, `onwait`; |
| 2429 | 2449 | - `setEncryption` / `setEncryptionKey` / `setKeyPair` / `setGroup`; |