code wiki / _hdl_build / nx_brand_publish_submit.nx

nx_brand_publish_submit.nx source

↩ module page · 44 lines · 2998 B

1// nx_brand_publish_submit.nx -- Submits a branded homepage to the Nishi publisher via the sanctioned pub_submit function for operator approval. 2import "nx_gate_gn.nx" 3import "nx_gate_base.nx" 4// nx_brand_publish_submit.nx -- pass the BRAND UPDATE to THE NISHI PUBLISHER the lawful way: via pub_submit (the 5// single sanctioned intake), NOT a direct push. Operator: "pass updates to the nishi publisher." Submits the 6// branded andelinwest homepage as an OUTWARD request -> it is QUEUED + sha-stamped + HELD until the operator 7// approves the exact artifact (R6 policy gate). This honors the Publisher LAW ([[project-nishi-publisher-role]]) 8// and the no-bypass audit (this file calls ONLY pub_submit + read-only status/dryrun -- never nx_aw_send/push or 9// pub_deploy/promote). 100% sovereign. license_tier: ORIGINAL expect_exit: 0 10import "nx_syscalls.nx" 11import "nx_publisher.nx" 12 13func grow(name: *u8, ok: i64) -> i64 { if ok==1 { gw(" PASS " as *u8) } else { gw(" FAIL " as *u8) } gw(name); gw(" 14" as *u8); return ok } 15 16func main() -> i64 { 17 gw("=== passing the brand update to THE NISHI PUBLISHER (pub_submit -- the single sanctioned intake) ===\n" as *u8) 18 19 // submit the branded andelinwest homepage as an OUTWARD request (operator-gated by construction) 20 let r: i64 = pub_submit("web_assets/andelin_branded.html" as *u8, "andelinwest/index.html" as *u8, "andelinwest" as *u8, "brand-ux-cx-arc-2026-06-21" as *u8, "outward" as *u8) 21 gw("pub_submit(andelin_branded.html -> andelinwest/index.html, policy=outward): result=" as *u8); gn(r); gw("\n" as *u8) 22 if r != 1 { gw("SUBMIT FAILED (src missing or queue error)\n" as *u8); return 1 } 23 24 let approvald: *u8 = "knowledge/publish/approved" as *u8 25 let st: *i64 = sys_mmap(64) as *i64 26 pub_status(pub_queue_default(), pub_ledger_default(), approvald, st) 27 gw("publisher status -> PENDING=" as *u8); gn(st[0]); gw(" PUBLISHED(ledger)=" as *u8); gn(st[1]) 28 gw(" ready-now=" as *u8); gn(st[2]); gw(" HELD(awaiting operator approval)=" as *u8); gn(st[3]); gw("\n" as *u8) 29 30 let pl: *i64 = sys_mmap(64) as *i64 31 pub_dryrun(pub_queue_default(), pub_ledger_default(), approvald, pl) 32 gw("dry-run (zero side effects) -> would-publish-now=" as *u8); gn(pl[1]); gw(" held=" as *u8); gn(pl[2]) 33 gw(" (OUTWARD requires operator approval of the exact sha -> NOT auto-pushed)\n" as *u8) 34 35 var ok: i64 = 0 36 if r == 1 { if st[0] >= 1 { if pl[1] == 0 { ok = 1 } } } // submitted + queued + correctly HELD (0 ready) 37 if ok == 1 { 38 gw("\nVERDICT=GREEN -- update QUEUED in the publisher + HELD for operator approval. No direct push; Publisher LAW honored.\n" as *u8) 39 gw("TO GO LIVE (operator): approve the exact artifact (pub_approve by content sha) -> pub_run_governed stages->verifies->atomic-promotes->smoke-tests->ledgers.\n" as *u8) 40 return 0 41 } 42 gw("\nVERDICT=RED -- unexpected publisher state (an outward request should be HELD, not ready)\n" as *u8) 43 return 1 44}