code wiki / _hdl_build / nx_library_search_test.nx
nx_library_search_test.nx
buildroot/runtime/_hdl_build/nx_library_search_test.nx
about
nx_library_search_test.nx -- the Researcher handles a LIBRARY OF INFORMATION, not one source, and
searches it with S-class ranked retrieval. End to end, sovereign:
1. FETCH the index, RECOGNIZE it is a library (>=3 [doc] entries)
2. HARVEST every listed doc -- follow each entry, fetch it, MIRROR it into the Nishi Library
3. build the corpus FROM THE LOCAL MIRRORS (bot-block-proof)
4. answer 3 different SEARCH PROMPTS by TF-IDF RANKING the whole corpus -- each returns the single
best-matching doc, where naive substring search would be ambiguous (e.g. "abandon" is in 2 docs)
Exit 0 on 8/8. license_tier: ORIGINAL
NOTE 2026-06-20: this is a LIVE-INTEGRATION test -- it requires a fixture HTTP server on 127.0.0.1:8099
serving a library index + the 3 docs. With no server up it reads 0/8 ("ambiguous across 0 docs") because
the harvest fetches nothing -- that is an unmet fixture dependency, NOT a search-logic regression. The
REPRODUCIBLE-BY-OUR-SYSTEM proof of the ranked-retrieval claim (no socket, real on-disk corpus, both TF-IDF
+ production BM25) is nx_library_search_gate (8/8 GREEN). Run THIS one only with the :8099 fixture live.
dependencies 4 imports · 0 importers
imports: nx_browse_text.nxnx_library_search.nxnx_library_cache.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
| 21 | func st_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 22 | func st_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;k=1}; while m>0 {t[k]=48+(m%10); 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 } |
| 25 | func st_harv_path(out: *u8, k: i64) -> i64 called by 1: main |
| 35 | func main() -> i64 |