code wiki / _hdl_build / _wiki_integrate_gate.nx

_wiki_integrate_gate.nx

buildroot/runtime/_hdl_build/_wiki_integrate_gate.nx

14362 B274 linesdepth 18pulls 94 transitivereach 0 importersview sourcekind gate/prooftopic wiki
docsdependenciesstructsconstsfunctions

about

_wiki_integrate_gate.nx -- WIKI R4 INTEGRATION GATE. Re-proves, from a REAL run (never a fabricated GREEN), that the wiki R4 navigation organs are WIRED INTO THE LIVE SERVED PAGE and that the latent wikilink-scan render bug is dead. Judged on GROUND-TRUTH SUBSTRINGS in the actually-served HTML (driven through the SAME handlers the daemon forks -- nx_wiki_doc_handle + the /wiki/graph route handler), never a bare rc==const. SEED a doc store with two pages: doc-one -- "# Doc One Title\n## Section A\n...[[doc-two]]..." (has a heading hierarchy AND a wikilink to doc-two; the page under test for TOC + wikilink rendering). doc-two -- "# Doc Two\nDoc two links back to [[doc-one]]." (links TO doc-one, so doc-one's served page shows a backlink to it). toc_live doc-one's served <article> carries <nav class="nx-toc" AND a heading stamped id="section-a" (the TOC built from the body + the anchor id injected onto <h2>Section A</h2>). backlinks_live doc-one's served HTML carries <aside class="nx-backlinks" AND the linking slug "doc-two" (the "what links here" inversion, computed from the real page bodies in the store). wikilink_fixed the [[doc-two]] in doc-one renders to a correct <a href="/wiki/doc-two... OR a clean broken-span <span class="wikilink-broken">[[doc-two]]</span>, with NO garbled bytes -- proving the single-exit scan froze the link end correctly (the bug emitted a wrong name length -> garble). graph_route driving the /wiki/graph handler returns HTML with <svg and NO <script (the static, JS-free link-graph view). Verdict line (stdout + knowledge/status/wiki_integrate_gate.log): WIKIINTEGRATE toc_live=<0|1> backlinks_live=<0|1> wikilink_fixed=<0|1> graph_route=<0|1> verdict=GREEN|RED Pure NishiLang, NO SQL, NO .sh/.py/.js, no new .tsv/.conf. nx_sites_daemon UNTOUCHED. Imports the served handler + the route library under test; each shared base module resolves via a single canonical path (the resolver canonicalizes wiki/-prefixed vs bare) to avoid the nxasm rc6 double-import. license_tier: ORIGINAL

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_wiki_index_builder.nx nx_wiki_doc_handler.nx nx_wiki_routes.nx nx_artifact_store.nx _wiki_integrate_gate.nx

imports: nx_syscalls.nxnx_wiki_index_builder.nxnx_wiki_doc_handler.nxnx_wiki_routes.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 wig_p wig_w sys_write sys_mmap nx_wiki_doc_store_init sys_mmap ↻ wig_pn wig_n sys_mmap ↻ sys_write ↻ nx_wiki_doc_store_add sys_mmap ↻ nx_wib_pool_alloc wig_slen nx_wiki_doc_store_count wig_find wig_slen ↻ nx_wiki_doc_ctx_init nx_wiki_doc_postpass_wikil nx_wiki_doc_name_resolves sys_write ↻ nx_wiki_route_serve_graph sys_mmap ↻ nx_wiki_graph_build sys_mmap ↻ nx_wiki_doc_store_count ↻ nx_wiki_doc_store_lookup nx_wiki_forward_links nx_wiki_backlink_slug_matc sys_mmap ↻ nx_wbl_strip_wiki nx_wiki_graph_render_svg nx_wgraph_emit sys_mmap ↻ nx_wgraph_node_xy sys_mmap ↻ nx_wgraph_unit nx_wgraph_emit_num sys_mmap ↻

structs

none

consts

45const WIG_LOG: *u8 = "knowledge/status/wiki_integrate_gate.log"
46const WIG_RESP_CAP: i64 = 2097152 // 2 MiB served-response buffer

functions

49func wig_w(fd: i64, s: *u8) -> i64
called by 2: wig_w2wig_p calls 1: sys_write
55func wig_n(fd: i64, v: i64) -> i64
called by 2: wig_n2wig_pn calls 2: sys_mmapsys_write
69func wig_w2(lfd: i64, s: *u8) -> i64 { wig_w(1, s); if lfd >= 0 { wig_w(lfd, s) } return 0 }
called by 1: main calls 1: wig_w
70func wig_n2(lfd: i64, v: i64) -> i64 { wig_n(1, v); if lfd >= 0 { wig_n(lfd, v) } return 0 }
called by 1: main calls 1: wig_n
71func wig_p(s: *u8) -> i64 { wig_w(1, s); return 0 }
called by 1: main calls 1: wig_w
72func wig_pn(v: i64) -> i64 { wig_n(1, v); return 0 }
called by 1: main calls 1: wig_n
73func wig_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: wig_findmain
76func wig_find(hay: *u8, hn: i64, needle: *u8) -> i64
called by 2: wig_hasmain calls 1: wig_slen
94func wig_has(hay: *u8, hn: i64, needle: *u8) -> i64
calls 1: wig_find
99func main() -> i64