code wiki / _hdl_build / _wiki_archive_gate.nx
_wiki_archive_gate.nx
buildroot/runtime/_hdl_build/_wiki_archive_gate.nx
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
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
structs
| none |
consts
| 36 | const WAG_LOG: *u8 = "knowledge/status/wiki_archive_gate.log" |
| 37 | const WAG_CAP: i64 = 64 // manifest segment-scan cap (>> our few commits) |
functions
| 40 | func wag_w(fd: i64, s: *u8) -> i64 |
| 46 | func wag_n(fd: i64, v: i64) -> i64 |
| 60 | func wag_w2(lfd: i64, s: *u8) -> i64 { wag_w(1, s); if lfd >= 0 { wag_w(lfd, s) } return 0 } |
| 61 | func wag_n2(lfd: i64, v: i64) -> i64 { wag_n(1, v); if lfd >= 0 { wag_n(lfd, v) } return 0 } |
| 63 | func wag_p(s: *u8) -> i64 { wag_w(1, s); return 0 } |
| 64 | func wag_pn(v: i64) -> i64 { wag_n(1, v); return 0 } |
| 66 | func wag_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 69 | func wag_cat(dst: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 75 | func wag_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 89 | func wag_bytes_eq(a: *u8, b: *u8, n: i64) -> i64 called by 1: main |
| 99 | func main() -> i64 |