code wiki / _hdl_build / nx_wiki_versioned_publish_gate.nx

nx_wiki_versioned_publish_gate.nx

buildroot/runtime/_hdl_build/nx_wiki_versioned_publish_gate.nx

16097 B287 linesdepth 11pulls 12 transitivereach 0 importersview sourcekind gate/prooftopic wiki
docsdependenciesstructsconstsfunctions

about

nx_wiki_versioned_publish_gate.nx -- TEETH for A4a (versioned-publish + multi-point rollback). HERMETIC: a fresh per-run archive/index store prefix in /tmp; EVERY publish/restore uses do_push_flag=0 so the gate NEVER touches the network/vault/SSH -- but it DOES exercise the archive + version-index + restore BYTE-PATH fully (read blob back by CID, write to a local file, re-read). No fake-green: exit 0 iff every assertion passes; a PASS line is appended to knowledge/status/ only on all-pass. WHAT IS PROVEN (each asserts EXACT bytes/identities, not merely "ok"): C1 publish v1,v2,v3 (3 DISTINCT contents) -> each vpub returns VP_OK and assigns v#=1,2,3. C2 MULTI-POINT: vp_list(slug) returns exactly 3 retained rollback points with 3 DISTINCT CIDs (not just the latest) -- the core "MULTIPLE rollback points" guarantee. C3 restore -> v1 yields the EXACT v1 bytes (byte-for-byte) live-staged. C4 restore -> the MIDDLE v2 yields the EXACT v2 bytes (proves rollback to ANY point, not just last). C5 restore -> an unknown v# (99) is REFUSED (VR_NOT_FOUND) and push is NOT invoked (fail-closed). C6 APPEND-ONLY: after v2 AND v3 were published, v1's retained record (its CID and the bytes that CID resolves to) is BYTE-IDENTICAL to what it was right after v1 -- a new publish never mutates/deletes an older version. C7 the 3 distinct contents are pairwise distinct (sanity: distinct CIDs require distinct bytes). license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_wiki_versioned_publish.nx nx_wiki_restore.nx nx_syscalls.nx nx_wiki_versioned_publish_gate

imports: nx_wiki_versioned_publish.nxnx_wiki_restore.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap g_cat g_catnum sys_mmap ↻ sys_now_us sys_mmap ↻ sys_clock_gettime_mono g_slen 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 ↻ g_w sys_write

structs

none

consts

none

functions

24func g_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: g_rowmain calls 1: sys_write
25func g_num(v: i64) -> i64
called by 2: g_rowmain calls 2: sys_mmapsys_write
33func g_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64 = off; var k: i64 = 0; while s[k] != (0 as u8) { dst[o] = s[k]; o = o + 1; k = k + 1 } return o }
called by 2: g_build_pagemain
34func g_catnum(dst: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
40func g_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
43func g_byteq(a: *u8, an: i64, b: *u8, bn: i64) -> i64
called by 1: main
50func g_streq(a: *u8, b: *u8) -> i64
called by 1: main
61func g_stage(path: *u8, buf: *u8, n: i64) -> i64
70func g_row(id: i64, ok: i64, what: *u8) -> i64
called by 1: main calls 2: g_wg_num
79func g_build_page(buf: *u8, marker: *u8, goodcid: *u8) -> i64
called by 1: main calls 1: g_cat
91func main() -> i64