code wiki / _hdl_build / nx_reader_page.nx
nx_reader_page.nx
buildroot/runtime/_hdl_build/nx_reader_page.nx
about
nx_reader_page.nx -- the SOVEREIGN emitter for the reader last-mile (R-EMIT: closes the hardware-rung-up gap
"even the last-mile HTML must be EMITTED by a Nishi organ"). It produces the served reader.html from a canonical
source artifact via Nishi syscalls only (no shell/cp), and is FAIL-CLOSED on sovereignty: if the source carries
ANY third-party load (<script src>, offsite src/href, @import, <iframe>, CDN, epub.js) the organ REFUSES to emit
and the served file is left untouched -- so a 3rd-party dependency can never reach the deployable by accident.
SSOT = runtime/assets/reader_src.html (the source you edit). Output = knowledge/staging/media/reader.html (served).
Bootstrap: on first default run, if the source is missing, it is SEEDED from the current served reader.html, so
this is a byte-identical, zero-regression cutover. argv override: `nx_reader_page <src> <dest>` (used by the gate
to test fail-closed on a scratch source without touching the real files). expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_reader_sov.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 14 | func rp_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func rp_n(v0: i64) -> i64 { var v: i64=v0; if v<0 { sys_write(1,"-" as *u8,1); v=0-v } let b: *u8=sys_mmap(24); var k: i64=0; if v==0 {b[0]=48 as u8;k=1} while v>0 {b[k]=(48+(v%10)) as u8; v=v/10; k=k+1} let o: *u8=sys_mmap(24); var j: i64=0; while j<k {o[j]=b[k-1-j];j=j+1} sys_write(1,o,k); return 0 } |
| 16 | func rp_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 17 | func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 } called by 1: main |
| 18 | func rp_write(path: *u8, buf: *u8, n: i64) -> i64 |
| 27 | func main(argc: i64, argv: *i64) -> i64 |