code wiki / _hdl_build / _wiki_discovery_gate.nx

_wiki_discovery_gate.nx

buildroot/runtime/_hdl_build/_wiki_discovery_gate.nx

8775 B165 linesdepth 10pulls 24 transitivereach 0 importersview sourcekind gate/prooftopic wiki
docsdependenciesstructsconstsfunctions

about

_wiki_discovery_gate.nx -- unit gate for the wiki content loader's V+1 AUTO-DISCOVERY (nx_wcl_discover_dir). NO mocks, NO HTTP daemon: drives the real loader functions against the REAL wiki content dir (/mnt/c/Users/elder/nishi-silicon), then renders a discovered page via the real nx_wiki_doc_render, then builds the real inverted index and runs a POSITIVE + NEGATIVE search control. Judged by the printed WIKIDISCOVERY marker (verdict=GREEN only if EVERY assertion holds), NOT by $? -- mirrors the gate convention in runtime/_hdl_build (e.g. _eoe_gate.nx). PROVES the V+1 TODO is closed: a new .md dropped into the content dir becomes a page + search hit with ZERO code edit, because the getdents64 walk enumerates the dir at load time. Import set mirrors the PROVEN-SAFE composition already shipping in wiki/nx_wiki_doc_handler.nx (nx_syscalls + index_builder[->search] + doc_render): import each module exactly ONCE to avoid the double-import nxasm rc6 trap. nx_wiki_content_loader transitively pulls nx_wiki_index_builder (doc store + inverted index). Evidence -> knowledge/status/wiki_discovery_gate.log + stdout. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_wiki_content_loader.nx nx_wiki_doc_render.nx _wiki_discovery_gate.nx

imports: nx_syscalls.nxnx_wiki_content_loader.nxnx_wiki_doc_render.nx

imported by: nobody (leaf or entry point)

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

main wg_fp sys_write sys_mmap nx_wiki_doc_store_init sys_mmap ↻ sys_exit nx_wiki_index_builder_init nx_inv_new nx_wcl_discover_dir sys_openat_rd nx_wiki_index_builder_get_ nx_wiki_doc_store_count sys_mmap ↻ sys_getdents64 dirent_reclen dirent_name dirent_type nx_wcl_is_md nx_wcl_lc nx_wcl_discover_one sys_mmap ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_close nx_wib_extract_md_title nx_wcl_slug_from_name nx_wcl_lc ↻ nx_wiki_index_builder_add nx_wiki_doc_store_add sys_mmap ↻ nx_wib_pool_alloc nx_inv_index_row nx_inv_is_token_char nx_inv_hash_bytes_lower nx_inv_add_posting nx_inv_count_token

structs

none

consts

56const WG_K_MIN: i64 = 10 // assert: discovered at least this many .md pages
57const WG_OUT_CAP: i64 = 1048576 // 1 MiB render output buffer
58const WG_SCRATCH_CAP: i64 = 1048576 // 1 MiB wikilink-preprocess scratch

functions

29func wg_fp(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 2: wg_w2main calls 1: sys_write
30func wg_fn(fd: i64, v: i64) -> i64
called by 2: wg_n2main calls 2: sys_mmapsys_write
38func wg_w2(lfd: i64, s: *u8) -> i64 { wg_fp(1, s); if lfd >= 0 { wg_fp(lfd, s) } return 0 }
called by 1: main calls 1: wg_fp
39func wg_n2(lfd: i64, v: i64) -> i64 { wg_fn(1, v); if lfd >= 0 { wg_fn(lfd, v) } return 0 }
called by 1: main calls 1: wg_fn
42func wg_contains(hay: *u8, hay_n: i64, needle: *u8, needle_n: i64) -> i64
called by 1: main
60func main() -> i64