nx_cc_record_fetch.nx
buildroot/runtime/nx_cc_record_fetch.nx
about
nx_cc_record_fetch.nx -- THE CC INGEST KEYSTONE: pull ONE real Common Crawl record end-to-end over our TLS,
proving targeted acquisition (the byte-range, NOT a 344TiB segment). Flow: (1) CDX-query CC-MAIN-2026-25 for
argv[1] (default example.com) -> JSON with filename/offset/length; (2) parse those; (3) range-fetch exactly
that slice of the WARC from data.commoncrawl.org; (4) verify it's a gzip member (1f 8b) of ~length bytes.
This is the primitive the bulk index-only ingest loops over (extract text -> ss_add doc+url+locator, serve
LIVE url). Composes nx_commoncrawl_query's endpoint + the new nx_https_fetch_range. license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.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
| 11 | const K_MAGIC_4194304: i64 = 4194304 |
| 12 | const K_MAGIC_1024: i64 = 1024 |
| 13 | const K_MAGIC_1048576: i64 = 1048576 |
functions
| 15 | func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 16 | func gn(v: i64) -> i64 { if v==0 { sys_write(1,"0" as *u8,1); return 0 } var m: i64=v; if m<0 { sys_write(1,"-" as *u8,1); m=0-m } let t: *u8=sys_mmap(24); var k: i64=0; while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } let o: *u8=sys_mmap(24); var q: i64=k-1; var x: i64=0; while q>=0 { o[x]=t[q]; x=x+1; q=q-1 } sys_write(1,o,x); return 0 } |
| 17 | func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: json_str |
| 19 | func json_str(hay: *u8, hn: i64, key: *u8, out: *u8, cap: i64) -> i64 calls 1: slen |
| 49 | func atoin(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v } |
| 51 | func main(argc: i64, argv: *i64) -> i64 |