code wiki / _hdl_build / _wiki_wikilink_gate.nx

_wiki_wikilink_gate.nx

buildroot/runtime/_hdl_build/_wiki_wikilink_gate.nx

8445 B176 linesdepth 11pulls 29 transitivereach 0 importersview sourcekind gate/prooftopic wiki
docsdependenciesstructsconstsfunctions

about

_wiki_wikilink_gate.nx -- THE LIVE-[[WIKILINK]] GATE. Re-proves, from a REAL run (never a fabricated GREEN), that served [[wikilink]] cross-references actually WORK -- they render as LIVE clickable <a> anchors (resolved) or clean broken-spans (missing), NOT as html-escaped dead text (&lt;a ...) and NOT always-broken. Judged on GROUND-TRUTH SUBSTRINGS in the actually-served HTML, driven through the SAME handler the daemon forks (nx_wiki_doc_handle) -- never a bare rc==const. THE TWO BUGS THIS KILLS (both pre-existing): 1. ESCAPED -- the preprocessor expanded [[X]] -> <a ...> BEFORE markdown, so markdown_inline html-escaped the '<','>' to &lt;,&gt; and the link served as DEAD TEXT. FIX: resolve [[X]] in a POST-markdown pass, emitting the <a> RAW (never re-escaped). 2. BROKEN -- the handler init'd the resolver with doc_names_count=0 (a 16-arg IR cap trimmed the names arg), so EVERY [[X]] resolved to a broken-span even when X existed. FIX: derive the known-page set FROM THE STORE the handler holds. SEED a doc store with two pages: realpage -- a real page (URL /wiki/realpage), so [[realpage]] resolves. linker -- body "...[[realpage]]... [[zzqmissing]]..." (URL /wiki/linker); the page under test. zzqmissing is NOT a page -> broken-span. live_ok the served HTML contains a LIVE <a href="/wiki/realpage" (NOT &lt;a, NOT a broken-span for realpage). not_escaped the served HTML does NOT contain "&lt;a href=" ANYWHERE (no dead html-escaped anchor leaked through). broken_ok [[zzqmissing]] rendered to <span class="wikilink-broken". Verdict line (stdout + knowledge/status/wiki_wikilink_gate.log): WIKILINKLIVE live_ok=<0|1> not_escaped=<0|1> broken_ok=<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 under test; each shared base module resolves via a single canonical path to avoid the nxasm rc6 double-import. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_wiki_index_builder.nx nx_wiki_doc_handler.nx nx_artifact_store.nx _wiki_wikilink_gate.nx

imports: nx_syscalls.nxnx_wiki_index_builder.nxnx_wiki_doc_handler.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 wlg_p wlg_w sys_write sys_mmap nx_wiki_doc_store_init sys_mmap ↻ wlg_pn wlg_n sys_mmap ↻ sys_write ↻ nx_wiki_doc_store_add sys_mmap ↻ nx_wib_pool_alloc wlg_slen nx_wiki_doc_store_count wlg_find wlg_slen ↻ sys_write ↻ sys_openat_append wlg_w2 wlg_w ↻ wlg_n2 wlg_n ↻ sys_close sys_exit

structs

none

consts

43const WLG_LOG: *u8 = "knowledge/status/wiki_wikilink_gate.log"
44const WLG_RESP_CAP: i64 = 2097152 // 2 MiB served-response buffer

functions

47func wlg_w(fd: i64, s: *u8) -> i64
called by 2: wlg_w2wlg_p calls 1: sys_write
53func wlg_n(fd: i64, v: i64) -> i64
called by 2: wlg_n2wlg_pn calls 2: sys_mmapsys_write
66func wlg_w2(lfd: i64, s: *u8) -> i64 { wlg_w(1, s); if lfd >= 0 { wlg_w(lfd, s) } return 0 }
called by 1: main calls 1: wlg_w
67func wlg_n2(lfd: i64, v: i64) -> i64 { wlg_n(1, v); if lfd >= 0 { wlg_n(lfd, v) } return 0 }
called by 1: main calls 1: wlg_n
68func wlg_p(s: *u8) -> i64 { wlg_w(1, s); return 0 }
called by 1: main calls 1: wlg_w
69func wlg_pn(v: i64) -> i64 { wlg_n(1, v); return 0 }
called by 1: main calls 1: wlg_n
70func wlg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: wlg_findmain
73func wlg_find(hay: *u8, hn: i64, needle: *u8) -> i64
called by 2: wlg_hasmain calls 1: wlg_slen
91func wlg_has(hay: *u8, hn: i64, needle: *u8) -> i64
calls 1: wlg_find
96func main() -> i64