code wiki / _hdl_build / _wiki_cite_gate.nx
_wiki_cite_gate.nx
buildroot/runtime/_hdl_build/_wiki_cite_gate.nx
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
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
structs
| none |
consts
| 49 | const WCG_LOG: *u8 = "knowledge/status/wiki_cite_gate.log" |
| 50 | const WCG_RESP_CAP: i64 = 2097152 // 2 MiB served-response buffer |
| 51 | const WCG_CAP: i64 = 64 // manifest segment-scan cap (>> our few commits) |
| 52 | const WCG_OUTCAP: i64 = 1048576 // rendered-HTML output buffer (1 MiB headroom) |
functions
| 55 | func wcg_w(fd: i64, s: *u8) -> i64 |
| 61 | func wcg_n(fd: i64, v: i64) -> i64 |
| 75 | func wcg_w2(lfd: i64, s: *u8) -> i64 { wcg_w(1, s); if lfd >= 0 { wcg_w(lfd, s) } return 0 } |
| 76 | func wcg_n2(lfd: i64, v: i64) -> i64 { wcg_n(1, v); if lfd >= 0 { wcg_n(lfd, v) } return 0 } |
| 78 | func wcg_p(s: *u8) -> i64 { wcg_w(1, s); return 0 } |
| 79 | func wcg_pn(v: i64) -> i64 { wcg_n(1, v); return 0 } |
| 80 | func wcg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 83 | func wcg_cat(dst: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 89 | func wcg_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 106 | func wcg_find(hay: *u8, hn: i64, needle: *u8) -> i64 |
| 125 | func wcg_has(hay: *u8, hn: i64, needle: *u8) -> i64 |
| 130 | func main() -> i64 |