code wiki / _hdl_build / nx_search_register.nx

nx_search_register.nx

buildroot/runtime/_hdl_build/nx_search_register.nx

4124 B70 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind tooltopic search
docsdependenciesstructsconstsfunctions

about

nx_search_register.nx -- INTEGRATION DISCOVERY (loose coupling). Discovers every queryable Nishi index and writes the search-sources MANIFEST (the integration CONTRACT): knowledge/index/search_sources.txt, one line `<label> <idx_path> <docmap_path> <tier>`. Producers (nx_library_harvest_v2, nx_research_grow) just WRITE their indexes -- they do NOT know about the search engine. This registrar DISCOVERS them. The federated searcher CONSUMES the manifest -- it does NOT know about producers. Three decoupled stages talk only through the manifest artifact = proper integration, no tight coupling. Adding an index source = it gets discovered here; the searcher needs zero changes. expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_search_inverted_persist.nx nx_search_register.nx

imports: nx_search_inverted_persist.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sr_puts sys_openat_wr sr_emit sr_exists sr_cat sr_cat ↻ sr_catnum sr_exists ↻ sr_num

structs

none

consts

9const SR_MAGIC_1024: i64 = 1024
11const SR_MAXSHARD: i64 = 4096

functions

13func sr_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main
14func sr_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)) 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 }
called by 1: main
15func sr_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off+i]=s[i];i=i+1} return off+i }
called by 2: sr_emitmain
16func sr_catnum(dst: *u8, off: i64, v: i64) -> i64
called by 1: main
23func sr_exists(path: *u8) -> i64
called by 2: sr_emitmain
30func sr_emit(fd: i64, label: *u8, idx: *u8, docmap: *u8, tier: *u8) -> i64
called by 1: main calls 2: sr_existssr_cat
42func main() -> i64