code wiki / _hdl_build / _wiki_cite_live_gate.nx
_wiki_cite_live_gate.nx
buildroot/runtime/_hdl_build/_wiki_cite_live_gate.nx
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 <,>
and the SERVED bytes were <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 "<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 "<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
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
structs
| none |
consts
| 49 | const WCL_LOG: *u8 = "knowledge/status/wiki_cite_live_gate.log" |
| 50 | const WCL_RESP_CAP: i64 = 2097152 // 2 MiB served-response buffer |
| 51 | const WCL_SCAN_CAP: i64 = 64 // archive segment-scan cap |
functions
| 54 | func 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 } |
| 55 | func wcl_n(fd: i64, v: i64) -> i64 |
| 64 | func wcl_w2(lfd: i64, s: *u8) -> i64 { wcl_w(1, s); if lfd >= 0 { wcl_w(lfd, s) } return 0 } |
| 65 | func wcl_n2(lfd: i64, v: i64) -> i64 { wcl_n(1, v); if lfd >= 0 { wcl_n(lfd, v) } return 0 } |
| 66 | func wcl_p(s: *u8) -> i64 { wcl_w(1, s); return 0 } |
| 67 | func wcl_pn(v: i64) -> i64 { wcl_n(1, v); return 0 } |
| 68 | func wcl_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 70 | func wcl_cat(dst: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 75 | func wcl_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 86 | func wcl_find(hay: *u8, hn: i64, needle: *u8) -> i64 |
| 104 | func wcl_has(hay: *u8, hn: i64, needle: *u8) -> i64 |
| 109 | func main() -> i64 |