code wiki / _hdl_build / nx_library_search_gate.nx
nx_library_search_gate.nx
buildroot/runtime/_hdl_build/nx_library_search_gate.nx
about
nx_library_search_gate.nx -- REPRODUCIBLE proof of S-class ranked retrieval over the REAL on-disk Nishi
library (knowledge/library/*.txt), with NO live server (the old nx_library_search_test needs an orphaned
:8099 fixture -> 0/8 when it is down = not reproducible by our system). This gate reads five real ingested
docs straight off disk, builds the corpus, and asserts both rankers (ls_best TF-IDF + ls_best_bm25, the
production BM25) pick the right doc for distinctive query terms, and resolve an AMBIGUOUS term (in >=2 docs)
to one deterministic best -- the honest exceed over naive substring scan, which can only say present/absent
and cannot rank or pick. Term doc-frequencies were verified against the live corpus before wiring. Fully
sovereign + reproducible: reads local files, our own ranker, no socket. GREEN iff 8/8. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_library_search.nxnx_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
| none |
functions
| 12 | func g_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 13 | func g_n(v: i64) -> i64 { var m: i64=v; if m<0{g_w("-");m=0-m} let t:*u8=sys_mmap(24); 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; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1}; sys_write(1,o,k); return 0 } |
| 14 | func g_row(id: *u8, ok: i64, pass: *i64) -> i64 { g_w(" "); g_w(id); g_w(": "); if ok==1 { g_w("OK\n"); pass[0]=pass[0]+1 } else { g_w("FAIL\n") } return 0 } |
| 17 | func gh_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 29 | func main() -> i64 |