code wiki / _hdl_build / nx_hub_publish.nx

nx_hub_publish.nx source

↩ module page · 43 lines · 3052 B

1// nx_hub_publish.nx -- PARTNER WITH THE PUBLISHER: submit the hub artifacts to the publisher's governed 2// intake queue (NO direct nx_aw_send -- honoring the publisher LAW that all publishing flows through ONE 3// publisher). policy="outward" => the artifacts are queued PENDING and HELD: pub_run_governed will only 4// stage+promote them once the operator drops an approval token (approval_dir/<sha>). So submitting is 5// safe + reversible (append-only intake, zero live change), and the actual NAS promote stays operator-gated. 6// Sovereign: nx_syscalls + nx_publisher. license_tier: ORIGINAL 7import "nx_syscalls.nx" 8import "nx_publisher.nx" 9 10func pp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 11func pn(v: i64) -> i64 { 12 var m: i64 = v 13 if m < 0 { sys_write(1, "-" as *u8, 1); m = 0 - m } 14 let bb: *u8 = sys_mmap(28); var k: i64 = 0 15 if m == 0 { bb[0]=48 as u8; sys_write(1,bb,1); return 0 } 16 let t: *u8 = sys_mmap(28) 17 while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } 18 var i: i64=0; while i<k { bb[i]=t[k-1-i]; i=i+1 } 19 sys_write(1,bb,k); return 0 20} 21func sub(src: *u8, dest: *u8, label: *u8) -> i64 { 22 let r: i64 = pub_submit(src, dest, "nishifamily.com" as *u8, "elderwesto" as *u8, "outward" as *u8) 23 pp(" submit " as *u8); pp(label as *u8); pp(" -> " as *u8) 24 if r == 1 { pp("QUEUED\n" as *u8) } else { pp("FAIL r=" as *u8); pn(r); pp("\n" as *u8) } 25 return r 26} 27 28func main(argc: i64, argv: *i64) -> i64 { 29 pp("=== nx_hub_publish: hub artifacts -> publisher governed queue (policy=outward, operator-approval-gated) ===\n" as *u8) 30 var ok: i64 = 0 31 if sub("knowledge/hub/maturity.tsv" as *u8, "/volume1/ai/hub/maturity.tsv" as *u8, "maturity.tsv (registry)" as *u8) == 1 { ok = ok + 1 } 32 if sub("knowledge/hub/roles.tsv" as *u8, "/volume1/ai/hub/roles.tsv" as *u8, "roles.tsv" as *u8) == 1 { ok = ok + 1 } 33 if sub("knowledge/hub/pages/index.html" as *u8, "/volume1/ai/hub/pages/index.html" as *u8, "pages/index.html" as *u8) == 1 { ok = ok + 1 } 34 if sub("knowledge/hub/pages/welcome.html" as *u8, "/volume1/ai/hub/pages/welcome.html" as *u8, "pages/welcome.html" as *u8) == 1 { ok = ok + 1 } 35 if sub("knowledge/hub/pages/family.html" as *u8, "/volume1/ai/hub/pages/family.html" as *u8, "pages/family.html" as *u8) == 1 { ok = ok + 1 } 36 if sub("knowledge/hub/pages/ops.html" as *u8, "/volume1/ai/hub/pages/ops.html" as *u8, "pages/ops.html" as *u8) == 1 { ok = ok + 1 } 37 pp("RESULT queued=" as *u8); pn(ok); pp("/6 (PENDING; outward => operator approval gate before any NAS promote)\n" as *u8) 38 pp("NOTE: the two BINARIES (nx_hub_gw.elf [new gateway] + sites_daemon_v2.elf [carries the /hub proxy route])\n" as *u8) 39 pp(" are NOT auto-submitted -- ship them via the publisher binary-rung (nx_pub_ship) with VERIFIED live\n" as *u8) 40 pp(" paths + the F-class selfswap runbook. sites.elf is the critical front daemon: operator-coordinated.\n" as *u8) 41 if ok == 6 { sys_exit(0); return 0 } 42 sys_exit(1); return 1 43}