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 nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_exit ↻ wg_fn sys_mmap ↻ sys_write ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close wg_contains nx_inv_query_term nx_inv_hash_bytes_lower nx_inv_lookup_slot nx_inv_slot_at nx_inv_slot_hash nx_inv_slot_postings_count nx_inv_slot_postings_offse nx_inv_slot_write_cursor sys_openat_append wg_w2

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