code wiki / _hdl_build / nx_external_corpus.nx
nx_external_corpus.nx
buildroot/runtime/_hdl_build/nx_external_corpus.nx
about
nx_external_corpus.nx -- EXTERNAL (offsite) search corpus builder: turns the team's SOVEREIGN-FETCHED web
pages (knowledge/fetched/*.raw -- real pages pulled over the Nishi TLS-1.3 stack this session, NOT a browser)
into the same `id<TAB>text` source the reusable ingestor (nx_onsite_index) consumes. This is the OFFSITE half
of the charter's scope=onsite|offsite|both: ONE engine, two scopes. id = the real Wikipedia title (so the
result URL https://en.wikipedia.org/wiki/<id> is CORRECT + clickable), text = the page bytes with tabs/
newlines normalized to spaces (HTML tags become corpus-wide low-IDF tokens BM25 down-weights, so content
terms still discriminate). Bounded reads (no 4GB sys_read_file reservation). license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 10 | const EC_READ: i64 = 524288 // read up to 512KB of each fetched page |
| 11 | const EC_TEXTCAP: i64 = 65536 // emit up to 64KB of normalized text per doc |
| 12 | const EC_OUT: *u8 = "knowledge/index/web_src.tsv" as *u8 |
functions
| 14 | func ec_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func ec_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 } |
| 16 | func ec_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: ec_emit |
| 19 | func ec_read_file(path: *u8, buf: *u8, cap: i64) -> i64 |
| 30 | func ec_emit(ofd: i64, id: *u8, path: *u8, rbuf: *u8, tbuf: *u8) -> i64 |
| 49 | func main() -> i64 |