code wiki / _hdl_build / _h2_multistream_interop_gate.nx
_h2_multistream_interop_gate.nx
buildroot/runtime/_hdl_build/_h2_multistream_interop_gate.nx
about
_h2_multistream_interop_gate.nx -- TUTOR-BOOTSTRAP SCAFFOLD (Claude, B1 rung(6)
R4-H2-009), NOT credited as team self-authoring (EoE back-fill owed).
THE SOVEREIGN EXTERNAL-INTEROP GATE ORGAN for persistent multi-stream h2. This
REPLACES the ad-hoc inline curl orchestration I ran by hand at rung(6) (and the
kind of committed .sh harness BL-025 forbids) with a SINGLE self-contained
sovereign organ: it stands up OUR persistent multi-stream ALPN-h2 server AND
drives an EXTERNAL curl --http2 against it AND emits a machine-checkable verdict
-- all in one process tree, no shell, no committed script. Run it and it tells
you GREEN/RED; nothing to orchestrate by hand.
TOPOLOGY (design B -- self-contained, chosen because the runtime has no
sys_unlink/sys_nanosleep so composing the prebuilt daemon ELF would race on a
STALE cert.pem; here the PARENT mints a FRESH cert each run and binds BEFORE
forking, so there is no stale-key risk and no readiness race):
parent: mint fresh Ed25519 SAN=localhost leaf (shared nx_h2_test_leaf) +
export PEM /tmp/nx_h2_gate_cert.pem + bind 127.0.0.1:9445 + listen.
pipe2 -> fork:
child : dup3 pipe-write over stdout, execve /usr/bin/curl --http2 with 4
same-origin URLs (the multiplex/reuse test) + -w num_connects.
parent: accept ONE connection -> h2_serve_connection_multi (cap=16) ->
served count; drain curl's captured stdout; wait4 curl -> exit.
VERDICT GREEN iff: served == 4 (4 streams answered on the ONE accepted conn)
AND curl_exit == 0 (every transfer succeeded) AND http200_count == 4 AND
newconn_count == 1 (curl opened exactly ONE TCP connection for all 4 transfers
= real reuse/multiplex, the discriminating measurement). curl is the LAST-MILE
interop ORACLE (nghttp2/OpenSSL) -- unfakeable; OUR side is 100% sovereign.
HONEST scope: ONE connection / 4 sequential-or-multiplexed streams (curl decides
reuse vs multiplex; both prove persistence). This organ is the REPRODUCIBLE
gate; the rung(6) capability itself is R4-H2-008 (already DONE).
COMPOSES (each imported once): nx_h2_serve_multi (the persistent driver +
transitive framing/tls transport stones), nx_h2_test_leaf (shared cert/PEM),
nx_x25519_ephemeral + nx_csprng (per-connection handshake entropy), nx_syscalls
(sockets/fork/execve/pipe/wait4/dup3).
license_tier: INDEPENDENT_REDERIVE
genealogy_id: international-research-sources/ietf/rfc_9113 + rfc_7301 + rfc_8446
lineage_id: nishi_h2_multistream_interop_gate_b1r6
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_h2_serve_multi.nxnx_h2_test_leaf.nxnx_x25519_ephemeral.nxnx_csprng.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 48 | const IG_PORT_REAL: i64 = 9445 |
| 49 | const IG_NURLS: i64 = 4 |
functions
| 51 | func ig_addr(out: *u8, port: i64) -> i64 called by 1: main |
| 64 | func ig_count_sub(buf: *u8, blen: i64, pat: *u8, patlen: i64) -> i64 called by 1: main |
| 79 | func ig_wn(fd: i64, v: i64) -> i64 |
| 88 | func ig_log(green: i64, served: i64, curl_exit: i64, h200: i64, newconn: i64) -> i64 |
| 106 | func ig_puts(fd: i64, s: *u8) -> i64 |
| 115 | func ig_log_adv(adv_ok: i64, interop_green: i64) -> i64 |
| 129 | func main() -> i64 |