code wiki / _hdl_build / _wiki_integrate_gate.nx
_wiki_integrate_gate.nx
buildroot/runtime/_hdl_build/_wiki_integrate_gate.nx
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
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
structs
| none |
consts
| 45 | const WIG_LOG: *u8 = "knowledge/status/wiki_integrate_gate.log" |
| 46 | const WIG_RESP_CAP: i64 = 2097152 // 2 MiB served-response buffer |
functions
| 49 | func wig_w(fd: i64, s: *u8) -> i64 |
| 55 | func wig_n(fd: i64, v: i64) -> i64 |
| 69 | func wig_w2(lfd: i64, s: *u8) -> i64 { wig_w(1, s); if lfd >= 0 { wig_w(lfd, s) } return 0 } |
| 70 | func wig_n2(lfd: i64, v: i64) -> i64 { wig_n(1, v); if lfd >= 0 { wig_n(lfd, v) } return 0 } |
| 71 | func wig_p(s: *u8) -> i64 { wig_w(1, s); return 0 } |
| 72 | func wig_pn(v: i64) -> i64 { wig_n(1, v); return 0 } |
| 73 | func wig_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 76 | func wig_find(hay: *u8, hn: i64, needle: *u8) -> i64 |
| 94 | func wig_has(hay: *u8, hn: i64, needle: *u8) -> i64 calls 1: wig_find |
| 99 | func main() -> i64 |