code wiki / wiki / nx_wiki_archive.nx

nx_wiki_archive.nx

buildroot/runtime/wiki/nx_wiki_archive.nx

12370 B266 linesdepth 6pulls 7 transitivereach 57 importersview sourcekind librarytopic wiki
docsdependenciesstructsconstsfunctions

about

nx_wiki_archive.nx -- NO-LINK-ROT for the sovereign wiki. THE LAW (operator, standing): "No link rot. Archive all information into the Nishi Library so nothing that helped us get here is lost; links should always work." This organ makes rot STRUCTURALLY IMPOSSIBLE via content-addressing. MECHANISM (why rot cannot happen here): Each page's raw bytes are stored under a KEY that IS the hash of those bytes -- the CID = "nxc1-" + 64 hex of sha256(body), from nx_canon_cid's cid_of() (substrate-canonical, FIPS 180-4 KAT'd via nx_sha256). A CID can ONLY ever name one byte string: hand back a CID, you get back the EXACT bytes that produced it, forever. So: - identical content collapses to ONE blob (same bytes -> same CID -> dedup) - a CID link NEVER rots: the key is derived from the content, so as long as the immutable append-only seg_store keeps the blob, the link resolves - this is HOW we exceed Wikipedia, which leans on the Internet Archive to paper over rot after the fact; here rot is a non-event by construction. STORE: the content-addressed append-only seg_store (runtime/nx_seg_store.nx), prefix "knowledge/store/wikiarchive-" (the library's own durability substrate). No nx_library_*.nx ingest organ exists yet, so we land in the seg_store directly; full library-corpus / BM25 unification = a flagged follow-on, NOT silently done here. LAYOUT (two key families in one store): wikiblob:<cid> -> the page bytes (content-addressed; idempotent dedup) wikicid:<slug> -> the page's CURRENT cid (slug -> content pointer; mutable by ADDITIVE re-archive, old versions stay in history) Dropping a wikicid:<slug> pointer never loses data -- the blob is still keyed by its CID (the no-loss proof). IMPORTS: nx_seg_store + nx_canon_cid. Both transitively pull nx_syscalls; the NishiLang resolver de-dups by module identity (nx_infomgmt_gate.nx imports the same trio and builds), so no double-import nxasm-rc6 landmine. Pure NishiLang, NO SQL, NO .sh/.py/.js, no new .tsv/.conf. license_tier: ORIGINAL

dependencies 2 imports · 7 importers

nx_seg_store.nx nx_canon_cid.nx nx_wiki_archive.nx _wiki_archive_gate.nx _wiki_search_gate.nx nx_wiki_bm25_search.nx nx_wiki_license.nx nx_wiki_publish_guard.nx nx_wiki_restore.nx nx_wiki_versioned_publish.nx

imports: nx_seg_store.nxnx_canon_cid.nx

imported by: _wiki_archive_gate.nx_wiki_search_gate.nxnx_wiki_bm25_search.nxnx_wiki_license.nxnx_wiki_publish_guard.nxnx_wiki_restore.nxnx_wiki_versioned_publish.nx

structs

none

consts

39const WAR_PREFIX: *u8 = "knowledge/store/wikiarchive-"

functions

42func war_len(s: *u8) -> i64
49func war_cat(dst: *u8, off: i64, s: *u8) -> i64
56func war_blobkey(cid: *u8, out: *u8) -> i64
65func war_cidkey(slug: *u8, out: *u8) -> i64
78func war_cid_of_body(body: *u8, body_n: i64, cidout: *u8) -> i64
called by 2: mainwar_archive_page calls 1: cid_of
89func war_archive_page(w: *i64, slug: *u8, body: *u8, body_n: i64, cidout: *u8) -> i64
110func war_get_by_cid(prefix: *u8, cid: *u8, ptrout: *i64, cap: i64) -> i64
123func war_cid_of_slug(prefix: *u8, slug: *u8, cidout: *u8, cap: i64) -> i64
called by 1: main calls 2: war_cidkeyss_get_cap
143func war_slug_exists(prefix: *u8, slug: *u8, slug_n: i64, cap: i64) -> i64
166func nx_wiki_rot_audit_page(prefix: *u8, body: *u8, body_n: i64, cap: i64,
called by 1: main calls 1: war_slug_exists