code wiki / _hdl_build / _wiki_frontend_gate.nx

_wiki_frontend_gate.nx

buildroot/runtime/_hdl_build/_wiki_frontend_gate.nx

14703 B274 linesdepth 11pulls 30 transitivereach 0 importersview sourcekind gate/prooftopic wiki
docsdependenciesstructsconstsfunctions

about

_wiki_frontend_gate.nx -- THE S-CLASS WIKI-FRONTEND GATE. Re-proves, from a REAL run (never a fabricated GREEN), that the served wiki page is world-class AND that the two render bugs are dead: clean_ok the served nishi-canonical <meta> value contains ONLY a valid canonical URL ("https://nishifamily.com/wiki/<slug>") and NONE of the garbage bytes that the const-*u8-index bug used to emit (we assert the exact clean URL is present AND that no 0xEF/0xBF/0x00 byte sits inside the meta value). title_ok the served <title> contains the CLEAN heading TEXT and does NOT begin with a raw markdown '#'/"# " (the title-leak bug). semantic_ok the served HTML contains <main and <article (HTML5 semantic structure) -- the world-class chrome. cite_wired_ok a page body with [[cite:<cid>]] citing a HOSTABLE archived source renders the inline nx-cite card (the supporting-source bytes appear INSIDE a <details ... nx-cite> block) -- the cite pass that is wired into the render pipeline. Judged on GROUND-TRUTH SUBSTRINGS in the actually-rendered HTML, never a bare rc==const. The page render is driven DIRECTLY via nx_wiki_doc_handle (the same handler the daemon forks) -- no live socket. The cite check seeds a fresh per-run archive prefix (empty each run => idempotent, Rule 10). Verdict line (stdout + knowledge/status/wiki_frontend_gate.log): WIKIFRONTEND clean_ok=<0|1> title_ok=<0|1> semantic_ok=<0|1> cite_wired_ok=<0|1> verdict=GREEN|RED Pure NishiLang, NO SQL, NO .sh/.py/.js, no new .tsv/.conf. nx_sites_daemon UNTOUCHED. license_tier: ORIGINAL

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_wiki_index_builder.nx nx_wiki_content_loader.nx nx_wiki_doc_handler.nx nx_wiki_cite_render.nx nx_artifact_store.nx _wiki_frontend_gate.nx

imports: nx_syscalls.nxnx_wiki_index_builder.nxnx_wiki_content_loader.nxnx_wiki_doc_handler.nxnx_wiki_cite_render.nxnx_artifact_store.nx

imported by: nobody (leaf or entry point)

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

main wfg_p wfg_w sys_write sys_mmap nx_wiki_doc_store_init sys_mmap ↻ nx_wiki_index_builder_init nx_inv_new nx_wcl_load_discover_tree 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

structs

none

consts

37const WFG_LOG: *u8 = "knowledge/status/wiki_frontend_gate.log"
38const WFG_RESP_CAP: i64 = 2097152 // 2 MiB served-response buffer
39const WFG_OUTCAP: i64 = 1048576 // 1 MiB cite-render output buffer
40const WFG_SCAN_CAP: i64 = 64 // archive segment-scan cap

functions

43func wfg_w(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: wfg_w2wfg_p calls 1: sys_write
44func wfg_n(fd: i64, v: i64) -> i64
called by 2: wfg_n2wfg_pn calls 2: sys_mmapsys_write
53func wfg_w2(lfd: i64, s: *u8) -> i64 { wfg_w(1, s); if lfd >= 0 { wfg_w(lfd, s) } return 0 }
called by 1: main calls 1: wfg_w
54func wfg_n2(lfd: i64, v: i64) -> i64 { wfg_n(1, v); if lfd >= 0 { wfg_n(lfd, v) } return 0 }
called by 1: main calls 1: wfg_n
55func wfg_p(s: *u8) -> i64 { wfg_w(1, s); return 0 }
called by 1: main calls 1: wfg_w
56func wfg_pn(v: i64) -> i64 { wfg_n(1, v); return 0 }
called by 1: main calls 1: wfg_n
57func wfg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: wfg_findmain
59func wfg_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 1: main
64func wfg_catn(dst: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
75func wfg_find(hay: *u8, hn: i64, needle: *u8) -> i64
called by 2: wfg_hasmain calls 1: wfg_slen
93func wfg_has(hay: *u8, hn: i64, needle: *u8) -> i64
calls 1: wfg_find
98func main() -> i64