code wiki / _hdl_build / _wiki_archive_gate.nx

_wiki_archive_gate.nx

buildroot/runtime/_hdl_build/_wiki_archive_gate.nx

12441 B253 linesdepth 7pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic wiki
docsdependenciesstructsconstsfunctions

about

_wiki_archive_gate.nx -- THE NO-LINK-ROT GATE. Re-proves, from a REAL run (no fabricated GREEN), that the sovereign wiki archive makes link rot structurally impossible via content-addressing: by_cid_ok archive pages -> each retrievable by its CID, and the readback bytes are BYTE-EQUAL to the original idempotent_ok re-archive identical bytes -> SAME CID, and the store does not grow a NEW distinguishable blob (content-address dedup) rot_clean rot audit over a clean inter-linked set -> rot == 0 rot_detected LIAR-KILL: a page with [[ZzqNonexistentTarget]] -> rot >= 1 (a real broken internal link MUST be caught, else RED) noloss_ok archive a page, DROP its slug pointer (tombstone), retrieve by CID -> STILL returns the exact bytes (nothing is lost) EXCEED vs Wikipedia: Wikipedia depends on the Internet Archive to paper over rot after links die. Here a CID is derived from the content, so a CID link resolves to the SAME bytes forever -- rot is a non-event by construction. Determinism: each run uses a FRESH store prefix keyed by the wall-clock epoch so the gate starts from an empty archive (idempotent re-run, Rule 10). The PRODUCTION archive prefix is knowledge/store/wikiarchive- (in nx_wiki_archive). Verdict line (judged by this marker, to stdout + knowledge/status): WIKIARCHIVE archived=<n> by_cid_ok=<0|1> idempotent_ok=<0|1> rot_clean=<0|1> rot_detected=<0|1> noloss_ok=<0|1> verdict=GREEN|RED Pure NishiLang, NO SQL, NO .sh/.py/.js, no new .tsv/.conf. nx_sites_daemon UNTOUCHED. Imports the proven trio + the archive module under test. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_canon_cid.nx nx_seg_store.nx nx_wiki_archive.nx _wiki_archive_gate.nx

imports: nx_syscalls.nxnx_canon_cid.nxnx_seg_store.nxnx_wiki_archive.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main wag_p wag_w sys_write sys_mmap wag_cat wag_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

36const WAG_LOG: *u8 = "knowledge/status/wiki_archive_gate.log"
37const WAG_CAP: i64 = 64 // manifest segment-scan cap (>> our few commits)

functions

40func wag_w(fd: i64, s: *u8) -> i64
called by 2: wag_w2wag_p calls 1: sys_write
46func wag_n(fd: i64, v: i64) -> i64
called by 2: wag_n2wag_pn calls 2: sys_mmapsys_write
60func wag_w2(lfd: i64, s: *u8) -> i64 { wag_w(1, s); if lfd >= 0 { wag_w(lfd, s) } return 0 }
called by 1: main calls 1: wag_w
61func wag_n2(lfd: i64, v: i64) -> i64 { wag_n(1, v); if lfd >= 0 { wag_n(lfd, v) } return 0 }
called by 1: main calls 1: wag_n
63func wag_p(s: *u8) -> i64 { wag_w(1, s); return 0 }
called by 1: main calls 1: wag_w
64func wag_pn(v: i64) -> i64 { wag_n(1, v); return 0 }
called by 1: main calls 1: wag_n
66func wag_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
69func wag_cat(dst: *u8, off: i64, s: *u8) -> i64
called by 1: main
75func wag_catn(dst: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
89func wag_bytes_eq(a: *u8, b: *u8, n: i64) -> i64
called by 1: main
99func main() -> i64