OverviewFilesCommitsIssuesDocsReleasesPeers

keet-daemon commits / 92a6896

CPP-PORT-DESIGN: M5g-3e (c) recovery done; M5g-3 complete
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
92a6896d178e2f0cc9d7e2c1b84f6ce817ff1002
by plankatron <fleeky@gmail.com> · 2026-10-03T19:51:42.000Z

Changed files (1) +20 -0

docs/CPP-PORT-DESIGN.md +20 -0
……@@ -2424,6 +2424,26 @@ SessionState's truncate / reorg / named-session machinery.
24242424 - two concurrent appends ("core recovered during append");
24252425 - a commit that waits;
24262426 - 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.
24272447- **M5g-4 — the rest of the surface:**
24282448 - value encodings and `encodeBatch` (DECODING_ERROR); `postappend`, `onseq`, `onwait`;
24292449 - `setEncryption` / `setEncryptionKey` / `setKeyPair` / `setGroup`;