code wiki / _hdl_build / nx_library_harvest.nx

nx_library_harvest.nx

buildroot/runtime/_hdl_build/nx_library_harvest.nx

6575 B98 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind tooltopic library
docsdependenciesstructsconstsfunctions

about

nx_library_harvest.nx -- ASSIGNMENT D (tutored): turn the team's DARK knowledge into a persistent, searchable index. The Researcher's deep-research output (knowledge/research/*.md) was never indexed -- invisible to the team's own search. This harvest reads those docs, combines them into a line-oriented corpus, builds the inverted index (nx_inv_build_from_jsonl tokenizes each line), and PERSISTS it (nx_inv_save) so the team builds once and queries forever. Proof: a term that exists ONLY in the dark research (not the old 52-line Library) becomes searchable from the on-disk index. Composes the team's own primitives -- Claude tutored the doc-reader composition (the novel rung), the team owns the index + persistence + syscalls. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_search_inverted_persist.nx nx_library_harvest.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 hv_puts harvest_combine sys_openat_wr sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close hv_num nx_inv_build_from_jsonl sys_read_file ↻ nx_inv_new_sized nx_inv_index_row nx_inv_is_token_char nx_inv_hash_bytes_lower nx_inv_add_posting nx_inv_count_token nx_inv_slot_at nx_inv_slot_hash nx_inv_slot_set_hash nx_inv_slot_set_postings_c nx_inv_slot_postings_count nx_inv_finalize_offsets nx_inv_slot_at ↻ nx_inv_slot_hash ↻ nx_inv_slot_postings_count ↻ nx_inv_slot_set_postings_o nx_inv_slot_set_write_curs nx_inv_emit_row nx_inv_is_token_char ↻ nx_inv_hash_bytes_lower ↻ nx_inv_emit_posting nx_inv_slot_at ↻ nx_inv_slot_hash ↻ nx_inv_slot_postings_count ↻ nx_inv_slot_postings_offse nx_inv_slot_write_cursor nx_inv_slot_set_write_curs ↻

structs

none

consts

none

functions

10func hv_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
11func hv_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 }
called by 1: main
15func harvest_combine(paths: *i64, n: i64, out_path: *u8) -> i64
called by 1: main calls 2: sys_openat_wrsys_read_file
36func hv_query(idx: *NxInvIndex, term: *u8, tlen: i64) -> i64
called by 1: main calls 1: nx_inv_query_term
43func main() -> i64