code wiki / _hdl_build / nx_genealogy_publish.nx

nx_genealogy_publish.nx source

↩ module page · 36 lines · 2311 B

1// nx_genealogy_publish.nx -- publish web_assets/genealogy_tree.html to the LIVE wiki through the GUARDED 2// publisher: pub_publish -> pg_decide (freshness/placeholder/cite/dead-link guard, fail-closed) -> on ALLOW 3// stage awpush.src/dst + fork the proven nx_aw_push (vault auth + SSH stream) -> NAS wiki docroot. Serves at 4// nishifamily.com/wiki/genealogy_tree.html. The page now carries an epoch= freshness stamp so the guard ALLOWs; 5// no [[cite:]] tokens + no /wiki/ links so the cite/dead-link checks are vacuously satisfied (empty corpus). 6// expect_exit: 0 license_tier: ORIGINAL 7import "nx_wiki_publish.nx" 8import "nx_itoa_lib.nx" // shared MSB-first emitter (zero-alloc) 9import "nx_syscalls.nx" 10 11func gp_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 12// MIGRATED to the shared emitter (debt 1785563586). The old body mmapped a scratch buffer 13// per call and never freed it. At PAGE granularity that is 4096B leaked PER CALL -- the 14// defect that took 28.5GB of a 36GB host in nx_ts_lumadiff (2MB input, ~3.66M calls). 15// nxi_* is MSB-first, allocates NOTHING, and emits identical bytes including the sign. 16func gp_pn(v: i64) -> i64 { nxi_out(v); return 0 } 17 18func main() -> i64 { 19 gp_puts("=== nx_genealogy_publish: pushing genealogy_tree to the LIVE wiki (guarded) ===\n" as *u8) 20 let out: *PubResult = sys_mmap(64) as *PubResult 21 // corpus = empty: the page's only internal links are #anchors (walk-up), no /wiki/<slug>.html links. 22 let cs_ptr: *i64 = sys_mmap(64) as *i64 23 let cs_len: *i64 = sys_mmap(64) as *i64 24 pub_publish("web_assets/genealogy_tree.html" as *u8, "genealogy_tree" as *u8, cs_ptr, cs_len, 0, 1, out) 25 gp_puts(" status=" as *u8); gp_puts(pub_status_name(out.status)) 26 gp_puts(" guard_code=" as *u8); gp_pn(out.code) 27 gp_puts(" bytes=" as *u8); gp_pn(out.bytes) 28 gp_puts(" push_invoked=" as *u8); gp_pn(out.push_invoked) 29 gp_puts(" push_rc=" as *u8); gp_pn(out.push_rc); gp_puts("\n" as *u8) 30 if out.status == PUB_PUBLISHED { if out.push_rc == 0 { 31 gp_puts(" LIVE -> https://nishifamily.com/wiki/genealogy_tree.html\n" as *u8) 32 sys_exit(0); return 0 33 } } 34 gp_puts(" NOT live (guard rejected, or push failed -- see code/push_rc above)\n" as *u8) 35 sys_exit(1); return 1 36}