nx_web_crawl_breadth.nx
buildroot/runtime/nx_web_crawl_breadth.nx
about
nx_web_crawl_breadth.nx -- BREADTH crawl: start from ONE seed page, EXTRACT its links, and fetch the linked
pages too (bounded) -> the external engine reaches the web by FOLLOWING links, not just a fixed seedlist.
Sovereign TLS-1.3 fetch (no browser). Politeness/safety BY CONSTRUCTION: same-domain article links only
(href="/wiki/<Title>", namespaced titles with ':' skipped), de-duplicated, hard MAX_PAGES cap (no runaway).
Emits one `id<TAB>text` line per page to knowledge/index/web_breadth_corpus.tsv for nx_onsite_index.
expect_exit: 0 license_tier: ORIGINAL (fetch machinery from nx_web_crawl_index; + link extractor + frontier)
dependencies 10 imports · 0 importers
imports: nx_syscalls.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_tls13_client_validate_certificate.nxnx_tls13_client_session_run.nxnx_https_url_for_fetch.nxnx_https_url_connect.nxnx_https_get.nxnx_https_get_complete.nxnx_http_response_parse.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
| 17 | const CB_MAGIC_4194304: i64 = 4194304 |
| 18 | const CB_MAGIC_65536: i64 = 65536 |
| 20 | const CB_TEXTCAP: i64 = 65536 |
| 21 | const CB_MAX_PAGES: i64 = 6 // hard cap (seed + up to 5 discovered) -- no runaway |
| 22 | const CB_HOST: *u8 = "en.wikipedia.org" as *u8 |
| 23 | const CB_PREFIX: *u8 = "https://en.wikipedia.org/wiki/" as *u8 // 30 chars |
| 24 | const CB_SEED: *u8 = "https://en.wikipedia.org/wiki/Information_retrieval\x00" |
| 25 | const CB_SEED_ID: *u8 = "Information_retrieval" as *u8 |
| 26 | const CB_OUT: *u8 = "knowledge/index/web_breadth_corpus.tsv" as *u8 |
functions
| 28 | func cb_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 29 | func cb_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=(48 as u8);k=1}; while m>0{t[k]=((48+(m%10)) as u8);m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 } |
| 30 | func cb_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 32 | func cb_path_off(url: *u8, n: i64) -> i64 |
| 44 | func cb_fetch(store: *TrustStore, full_url: *u8, out_buf: *i64, out_len: *i64) -> i64 |
| 80 | func cb_emit(ofd: i64, id: *u8, buf: *u8, n: i64, tbuf: *u8) -> i64 |
| 96 | func cb_links(html: *u8, n: i64, tbuf: *u8, toff: *i64, cap: i64, tbufcap: i64) -> i64 |
| 133 | func main() -> i64 |