code wiki / _hdl_build / _wiki_engine_gate.nx

_wiki_engine_gate.nx

buildroot/runtime/_hdl_build/_wiki_engine_gate.nx

9529 B182 linesdepth 11pulls 30 transitivereach 0 importersview sourcekind gate/prooftopic wiki
docsdependenciesstructsconstsfunctions

about

_wiki_engine_gate.nx -- unit gate PROVING the INTERNAL sovereign wiki engine SERVES auto-discovered pages, including SUBDIR charters reached only by the new RECURSIVE walk. NO mocks, NO live socket: drives the REAL loader + REAL route handler against the REAL wiki content dir (/mnt/c/Users/elder/nishi-silicon). 1. fresh index builder -> nx_wcl_discover_tree (RECURSIVE walk) -> assert pages >= 35 (31 top-level + subdir charters) 2. resolve a KNOWN TOP-LEVEL slug (/wiki/nishi-wiki-charter) through the real nx_wiki_doc_handle route path -> assert HTTP 200 + a known body substring ("charter") -> toplevel_ok + render_ok 3. resolve a KNOWN SUBDIR slug (/wiki/hdl-hacking, produced by the recursion for hdl/HACKING.md) through nx_wiki_doc_handle -> assert HTTP 200 -> subdir_ok (PROVES recursion serves) 4. search "sovereign" -> >=1 hit (search_ok); bogus term -> 0 hits (search_neg) 5. emit ONE marker line (stdout + knowledge/status/wiki_engine_gate.log): WIKIENGINE pages=<n> toplevel_ok=.. subdir_ok=.. render_ok=.. search_ok=.. search_neg=.. verdict=GREEN|RED Judged by the printed WIKIENGINE marker (verdict=GREEN only if EVERY assertion holds), NOT by $? -- mirrors _wiki_discovery_gate.nx. LANDMINE (per the engineering rules + nx_wiki_index_builder DEBT note): the native compiler can desync `let rc = <cross-fn call>` vs an immediate `rc == const` compare. So EVERY assertion is judged on a GROUND-TRUTH observable: the doc-store count delta (pages), the bytes in the response buffer (served HTTP 200), and the query result's n_rowids_filled (hits) -- never a bare returned status code. Import set: nx_syscalls + content_loader (discovery) + doc_handler (the route path; transitively pulls index_builder->search_inverted + doc_render). Each base module is imported exactly ONCE to avoid the double-import nxasm rc6 trap. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_wiki_content_loader.nx nx_wiki_doc_handler.nx _wiki_engine_gate.nx

imports: nx_syscalls.nxnx_wiki_content_loader.nxnx_wiki_doc_handler.nx

imported by: nobody (leaf or entry point)

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

main eg_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_tree sys_openat_rd sys_close 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_path 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_relpath 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

structs

none

consts

68const EG_K_MIN: i64 = 35 // assert: >= 31 top-level + subdir charters
69const EG_RESP_CAP: i64 = 1048576 // 1 MiB HTTP response buffer

functions

41func eg_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: eg_w2main calls 1: sys_write
42func eg_fn(fd: i64, v: i64) -> i64
called by 2: eg_n2main calls 2: sys_mmapsys_write
50func eg_w2(lfd: i64, s: *u8) -> i64 { eg_fp(1, s); if lfd >= 0 { eg_fp(lfd, s) } return 0 }
called by 1: main calls 1: eg_fp
51func eg_n2(lfd: i64, v: i64) -> i64 { eg_fn(1, v); if lfd >= 0 { eg_fn(lfd, v) } return 0 }
called by 1: main calls 1: eg_fn
54func eg_contains(hay: *u8, hay_n: i64, needle: *u8, needle_n: i64) -> i64
called by 1: eg_serves
75func eg_serves(store: *NxWikiDocStore, url: *u8, url_n: i64,
called by 1: main calls 2: sys_mmapeg_contains
93func main() -> i64