code wiki / _hdl_build / nx_builder_authors_inet_fetch.nx

nx_builder_authors_inet_fetch.nx source

↩ module page · 53 lines · 3364 B

1// nx_builder_authors_inet_fetch.nx -- the BUILDER authors the team's SOVEREIGN internet-fetch modules (Claude 2// does NOT hand-write them). TWO templates now: 3// (1) ma_emit_inet_fetch -- the original PLAIN-HTTP fetch (sovereign DNS + nx_browse_text), kept intact. 4// (2) ma_emit_h2_inet_fetch -- R4-H2 capstone NBC-FETCH-001: a sovereign HTTP/2-over-TLS GET that negotiates 5// ALPN "h2" (h2-only ClientHello) and drives the team's OWN HTTP/2 client (preface -> SETTINGS -> 6// HEADERS GET -> read HEADERS+DATA, HPACK-decode :status, reassemble body) over the existing TLS1.3 7// app-data path. The Builder USES the capability; the Engineer compiles+runs the authored organ against 8// real hosts; Claude evaluates. KEEP author=organ: the Builder emits the source, it is not hand-written. 9// HONEST: the authored organ NEVER fabricates a 200 -- an h2-refusing/walled host is a NEGATIVE rc + named diag 10// in the durable status log; verdict=GREEN strictly iff a real h2 host returned :status 200 + non-empty body. 11// license_tier: ORIGINAL 12import "nx_module_author.nx" 13import "nx_syscalls.nx" 14 15func _bif_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 16 17// author ONE h2-fetch organ for (url, sni, outpath) into outpath; rung/organ tag the durable status line. 18func _bif_author_h2(url: *u8, sni: *u8, snilen: i64, outpath: *u8, rung: *u8, organ: *u8) -> i64 { 19 let afd: i64 = sys_openat_wr(outpath, 0x1a4) 20 if afd < 0 { _bif_puts(" could not open authored-module path for write: " as *u8); _bif_puts(outpath); _bif_puts("\n" as *u8); return 0 - 1 } 21 ma_emit_h2_inet_fetch(afd, url, sni, snilen, "knowledge/status/h2_nbc_fetch.log" as *u8, rung, organ) 22 sys_close(afd) 23 _bif_puts(" Builder authored " as *u8); _bif_puts(outpath); _bif_puts("\n" as *u8) 24 return 0 25} 26 27func main() -> i64 { 28 _bif_puts("=== BUILDER authors the sovereign HTTP/2 inet-fetch organs (R4-H2 capstone NBC-FETCH-001) ===\n" as *u8) 29 30 // (kept) the original plain-HTTP fetch organ -- info.cern.ch via DNS root 8.8.8.8, tx_id 0x4e58. 31 let src: *u8 = "runtime/_hdl_build/_inet_fetch_authored.nx" as *u8 32 let afd: i64 = sys_openat_wr(src, 0x1a4) 33 if afd < 0 { _bif_puts(" could not open plain-HTTP authored-module path\n" as *u8); sys_exit(2); return 2 } 34 ma_emit_inet_fetch(afd, "info.cern.ch" as *u8, 12, 8, 8, 8, 8, 0x4e58) 35 sys_close(afd) 36 _bif_puts(" Builder authored runtime/_hdl_build/_inet_fetch_authored.nx (plain HTTP, unchanged)\n" as *u8) 37 38 // (NEW) two sovereign HTTP/2-over-TLS fetch organs: rumble.com (HTTP/1.1 FETCH-FAIL today) + www.google.com. 39 _bif_author_h2( 40 "https://www.google.com/" as *u8, "www.google.com" as *u8, 14, 41 "runtime/_hdl_build/_h2_fetch_google.nx" as *u8, 42 "R4-H2-FETCH" as *u8, "h2_fetch_google" as *u8 43 ) 44 _bif_author_h2( 45 "https://rumble.com/" as *u8, "rumble.com" as *u8, 10, 46 "runtime/_hdl_build/_h2_fetch_rumble.nx" as *u8, 47 "R4-H2-FETCH" as *u8, "h2_fetch_rumble" as *u8 48 ) 49 50 _bif_puts(" composition: nx_tls13_client_session_run_h2 (ALPN h2-only) + h2_tls_get over the sovereign TLS app-data path\n" as *u8) 51 _bif_puts(" author=organ: the Builder EMITTED these; Engineer compiles+runs vs real hosts; verdict from the durable log\n" as *u8) 52 sys_exit(0); return 0 53}