code wiki / _hdl_build / _wiki_cite_gate.nx

_wiki_cite_gate.nx

buildroot/runtime/_hdl_build/_wiki_cite_gate.nx

18660 B355 linesdepth 11pulls 29 transitivereach 0 importersview sourcekind gate/prooftopic wiki
docsdependenciesstructsconstsfunctions

about

_wiki_cite_gate.nx -- THE WIKIPEDIA-EXCEED INLINE-CITATION GATE. Re-proves, from a REAL run (no fabricated GREEN), the anti-pushout differentiator: a cited supporting source is rendered INLINE in the wiki (read in place, no leaving for a paywalled/rotted/dead link) -- but ONLY when licensing permits hosting it. Judged on SUBSTRING presence/absence in the actually-rendered HTML (ground truth), never a bare rc==const. inline_ok A CC-BY source S1 ("ALPHA-SUPPORT-EVIDENCE-12345"), archived + license-tagged, rendered via [[cite:<cid>]] -> the HTML CONTAINS the evidence string INSIDE a <details ... nx-cite ...> block (inline reading works). license_respected THE LIAR-KILL: a PROPRIETARY source S2 ("PROPRIETARY-SECRET-67890"), archived but NOT hostable, cited -> the HTML CONTAINS a link/license-note for it but does NOT CONTAIN the secret bytes ANYWHERE. Unlicensed content is never inlined -- respected, not merely labeled. pending_ok A random NON-archived cid cited -> the HTML CONTAINS "(source archiving pending)". EXCEED vs Wikipedia: Wikipedia pushes you OUT to a citation that may be dead. Here the supporting source is read IN the page, pulled from the no-link-rot content-addressed archive, gated by a sealed license layer so we never host what we are not licensed to host. Determinism: a FRESH store prefix keyed by the wall-clock epoch => an empty archive each run (idempotent re-run, Rule 10). Production archive prefix is knowledge/store/wikiarchive- (in nx_wiki_archive). Verdict line (judged by this marker; stdout + knowledge/status): WIKICITE inline_ok=<0|1> license_respected=<0|1> pending_ok=<0|1> verdict=GREEN|RED Pure NishiLang, NO SQL, NO .sh/.py/.js, no new .tsv/.conf. nx_sites_daemon UNTOUCHED. Imports the cite-render organ under test (which transitively pulls the license layer + archive + seg_store + canon_cid, each spliced ONCE). license_tier: ORIGINAL

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_wiki_cite_render.nx nx_wiki_index_builder.nx nx_wiki_doc_handler.nx nx_artifact_store.nx _wiki_cite_gate.nx

imports: nx_syscalls.nxnx_wiki_cite_render.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 wcg_p wcg_w sys_write sys_mmap wcg_cat wcg_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 WCG_LOG: *u8 = "knowledge/status/wiki_cite_gate.log"
50const WCG_RESP_CAP: i64 = 2097152 // 2 MiB served-response buffer
51const WCG_CAP: i64 = 64 // manifest segment-scan cap (>> our few commits)
52const WCG_OUTCAP: i64 = 1048576 // rendered-HTML output buffer (1 MiB headroom)

functions

55func wcg_w(fd: i64, s: *u8) -> i64
called by 2: wcg_w2wcg_p calls 1: sys_write
61func wcg_n(fd: i64, v: i64) -> i64
called by 2: wcg_n2wcg_pn calls 2: sys_mmapsys_write
75func wcg_w2(lfd: i64, s: *u8) -> i64 { wcg_w(1, s); if lfd >= 0 { wcg_w(lfd, s) } return 0 }
called by 1: main calls 1: wcg_w
76func wcg_n2(lfd: i64, v: i64) -> i64 { wcg_n(1, v); if lfd >= 0 { wcg_n(lfd, v) } return 0 }
called by 1: main calls 1: wcg_n
78func wcg_p(s: *u8) -> i64 { wcg_w(1, s); return 0 }
called by 1: main calls 1: wcg_w
79func wcg_pn(v: i64) -> i64 { wcg_n(1, v); return 0 }
called by 1: main calls 1: wcg_n
80func wcg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: wcg_findmain
83func wcg_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 1: main
89func wcg_catn(dst: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
106func wcg_find(hay: *u8, hn: i64, needle: *u8) -> i64
called by 2: wcg_hasmain calls 1: wcg_slen
125func wcg_has(hay: *u8, hn: i64, needle: *u8) -> i64
called by 1: main calls 1: wcg_find
130func main() -> i64