code wiki / _hdl_build / nx_asset_dashboard_publish.nx

nx_asset_dashboard_publish.nx source

↩ module page · 77 lines · 4435 B

1// nx_asset_dashboard_publish.nx -- land /wiki/assets.html LIVE through the GUARDED + VERSIONED publish 2// path (vpub): snapshot a content-addressed rollback version, then the A3 fail-closed guard must ALLOW 3// (every /wiki/<slug>.html link must resolve to a corpus member) before the NAS push runs. ADDITIVE. 4// 5// Publishes the re-emitted START hub first (its rendered tree now links to the new assets child -> keeps 6// reachability=100) then assets.html. Corpus set = all 23 live wiki slugs (22 + assets); a dead link => 7// the guard rejects with a fail-closed PG code -- the safety net. 8// 9// REUSE: nx_wiki_versioned_publish vpub. Mirrors nx_ims_search_publish exactly. license_tier: ORIGINAL 10import "nx_wiki_versioned_publish.nx" 11import "nx_syscalls.nx" 12 13func p_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } 14func p_num(v: i64) -> i64 { 15 let bb: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { sys_write(1, "-" as *u8, 1); m = 0 - m } 16 let t: *u8 = sys_mmap(28); var k: i64 = 0 17 if m == 0 { t[0] = 48 as u8; k = 1 } 18 while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } 19 var i: i64 = 0; while i < k { bb[i] = t[k - 1 - i]; i = i + 1 } 20 sys_write(1, bb, k); return 0 21} 22 23// fixed epoch for deterministic version records (NO wall-clock in the version index). 24const AP_EPOCH: i64 = 1781880000 25 26func ap_publish(slug: *u8, path: *u8, cs_ptr: *i64, cs_len: *i64, ncorpus: i64) -> i64 { 27 let res: *PubResult = sys_mmap(64) as *PubResult 28 let vout: *i64 = sys_mmap(16) as *i64 29 let rc: i64 = vpub(slug, path, cs_ptr, cs_len, ncorpus, AP_EPOCH, 1, res, vout) 30 p_w(" vpub("); p_w(slug); p_w(") rc="); p_w(vp_status_name(rc)) 31 p_w(" version#="); p_num(vout[0]) 32 p_w(" | push="); p_w(pub_status_name(res.status)) 33 p_w(" push_invoked="); p_num(res.push_invoked) 34 p_w(" push_rc="); p_num(res.push_rc) 35 p_w(" bytes="); p_num(res.bytes); p_w("\n") 36 if rc == VP_OK { if res.push_invoked == 1 { return 0 } } 37 return 0 - 1 38} 39 40func main() -> i64 { 41 // corpus set = all 23 live wiki slugs (the 22 + the new assets dashboard). Every href in start/assets 42 // must resolve to one of these or the A3 guard fail-closes the publish. 43 let cs_ptr: *i64 = sys_mmap(32 * 8) as *i64 44 let cs_len: *i64 = sys_mmap(32 * 8) as *i64 45 cs_ptr[0] = "start" as *u8 as i64; cs_len[0] = 5 46 cs_ptr[1] = "charter" as *u8 as i64; cs_len[1] = 7 47 cs_ptr[2] = "nist_stem" as *u8 as i64; cs_len[2] = 9 48 cs_ptr[3] = "roadmap" as *u8 as i64; cs_len[3] = 7 49 cs_ptr[4] = "board" as *u8 as i64; cs_len[4] = 5 50 cs_ptr[5] = "devlog" as *u8 as i64; cs_len[5] = 6 51 cs_ptr[6] = "econsim" as *u8 as i64; cs_len[6] = 7 52 cs_ptr[7] = "products" as *u8 as i64; cs_len[7] = 8 53 cs_ptr[8] = "genesis_genealogy" as *u8 as i64; cs_len[8] = 17 54 cs_ptr[9] = "access_wall" as *u8 as i64; cs_len[9] = 11 55 cs_ptr[10] = "formats_uxf" as *u8 as i64; cs_len[10] = 11 56 cs_ptr[11] = "math_render" as *u8 as i64; cs_len[11] = 11 57 cs_ptr[12] = "media_studio" as *u8 as i64; cs_len[12] = 12 58 cs_ptr[13] = "search" as *u8 as i64; cs_len[13] = 6 59 cs_ptr[14] = "substrate" as *u8 as i64; cs_len[14] = 9 60 cs_ptr[15] = "nishi_os" as *u8 as i64; cs_len[15] = 8 61 cs_ptr[16] = "sovereign_email" as *u8 as i64; cs_len[16] = 15 62 cs_ptr[17] = "simd_backend" as *u8 as i64; cs_len[17] = 12 63 cs_ptr[18] = "neural_mt" as *u8 as i64; cs_len[18] = 9 64 cs_ptr[19] = "vision_fr" as *u8 as i64; cs_len[19] = 9 65 cs_ptr[20] = "voxelworld" as *u8 as i64; cs_len[20] = 10 66 cs_ptr[21] = "figures" as *u8 as i64; cs_len[21] = 7 67 cs_ptr[22] = "assets" as *u8 as i64; cs_len[22] = 6 68 let ncorpus: i64 = 23 69 70 p_w("=== ASSET DASHBOARD PUBLISH: re-emit start hub + assets.html -> LIVE (guarded+versioned) ===\n") 71 var ok: i64 = 0 72 if ap_publish("start" as *u8, "web_assets/ai_start.html" as *u8, cs_ptr, cs_len, ncorpus) == 0 { ok = ok + 1 } 73 if ap_publish("assets" as *u8, "web_assets/assets.html" as *u8, cs_ptr, cs_len, ncorpus) == 0 { ok = ok + 1 } 74 p_w("=== published "); p_num(ok); p_w("/2 LIVE (start + assets; fail-closed if any) ===\n") 75 if ok == 2 { sys_exit(0); return 0 } 76 sys_exit(1); return 1 77}