code wiki / _hdl_build / _wiki_cite_live_gate.nx

_wiki_cite_live_gate.nx

buildroot/runtime/_hdl_build/_wiki_cite_live_gate.nx

14066 B264 linesdepth 11pulls 29 transitivereach 0 importersview sourcekind gate/prooftopic wiki
docsdependenciesstructsconstsfunctions

about

_wiki_cite_live_gate.nx -- THE LIVE INLINE-CITE-CARD GATE (served output). Re-proves, from a REAL run (never a fabricated GREEN), that the anti-pushout [[cite:<cid>]] supporting-source cards render LIVE (UNESCAPED) in the SERVED wiki page -- judged on the actually-served (post-markdown) HTTP bytes, driven through the SAME render body the daemon forks (nx_wiki_doc_handle_cp, the cite-prefix-injectable form of nx_wiki_doc_handle). THE BUG THIS KILLS (the SAME shape as the escaped-[[wikilink]] bug): the cite pass USED to expand [[cite:<cid>]] -> <details class="nx-cite"> card HTML BEFORE markdown ran, so markdown_inline html-escaped the '<','>' to &lt;,&gt; and the SERVED bytes were &lt;details... (dead escaped text), NOT a real expandable card. The old cite gates "passed" only because they asserted the substring in the PRE-markdown cite-render buffer -- a MEASUREMENT ARTIFACT; the served output was escaped. FIX (mirrors the wikilink split): leave the literal [[cite:<cid>]] token in the body, render markdown, then a POST-markdown cite pass replaces each token with the card HTML emitted RAW (never escaped). SEED a FRESH per-run content-addressed archive prefix (empty each run => idempotent, Rule 10; never the production WAR_PREFIX) with: S1 HOSTABLE (CC_BY) content "ALPHA-INLINE-EVIDENCE-777" S2 PROPRIETARY (NOT host) content "SECRET-NOHOST-888" SEED a doc store with ONE page whose body cites BOTH: "... [[cite:<cid_S1>]] ... [[cite:<cid_S2>]] ..." RENDER it via nx_wiki_doc_handle_cp(..., prefix) and judge the SERVED HTML: card_live the served HTML contains a LIVE "<details class=\"nx-cite\"" (NOT "&lt;details") AND "ALPHA-INLINE-EVIDENCE-777" sits INSIDE that card (after the details-open + the card body div). not_escaped the served HTML does NOT contain "&lt;details" ANYWHERE (no dead html-escaped card leaked through). liar_kill "SECRET-NOHOST-888" appears NOWHERE in the served HTML (the proprietary source's bytes are suppressed), while a link + license-note for S2 IS present (nx-cite-link + the note text). Verdict line (stdout + knowledge/status/wiki_cite_live_gate.log): WIKICITELIVE card_live=<0|1> not_escaped=<0|1> liar_kill=<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 (which transitively pulls the

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_wiki_index_builder.nx nx_wiki_doc_handler.nx nx_wiki_cite_render.nx nx_artifact_store.nx _wiki_cite_live_gate.nx

imports: nx_syscalls.nxnx_wiki_index_builder.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 wcl_p wcl_w sys_write sys_mmap wcl_cat wcl_catn sys_mmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real ss_begin ss_begin_cap sys_mmap ↻ war_archive_page war_cid_of_body cid_of sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_final blk_set_byte ↻ sha256_compress ↻ cid_from_digest sys_munmap war_blobkey war_cat ss_add ss_add2 ss_w32 ss_len war_cidkey war_cat ↻

structs

none

consts

49const WCL_LOG: *u8 = "knowledge/status/wiki_cite_live_gate.log"
50const WCL_RESP_CAP: i64 = 2097152 // 2 MiB served-response buffer
51const WCL_SCAN_CAP: i64 = 64 // archive segment-scan cap

functions

54func wcl_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: wcl_w2wcl_p calls 1: sys_write
55func wcl_n(fd: i64, v: i64) -> i64
called by 2: wcl_n2wcl_pn calls 2: sys_mmapsys_write
64func wcl_w2(lfd: i64, s: *u8) -> i64 { wcl_w(1, s); if lfd >= 0 { wcl_w(lfd, s) } return 0 }
called by 1: main calls 1: wcl_w
65func wcl_n2(lfd: i64, v: i64) -> i64 { wcl_n(1, v); if lfd >= 0 { wcl_n(lfd, v) } return 0 }
called by 1: main calls 1: wcl_n
66func wcl_p(s: *u8) -> i64 { wcl_w(1, s); return 0 }
called by 1: main calls 1: wcl_w
67func wcl_pn(v: i64) -> i64 { wcl_n(1, v); return 0 }
called by 1: main calls 1: wcl_n
68func wcl_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: wcl_findmain
70func wcl_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 1: main
75func wcl_catn(dst: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
86func wcl_find(hay: *u8, hn: i64, needle: *u8) -> i64
called by 2: wcl_hasmain calls 1: wcl_slen
104func wcl_has(hay: *u8, hn: i64, needle: *u8) -> i64
called by 1: main calls 1: wcl_find
109func main() -> i64