code wiki / _hdl_build / nx_reader_page.nx

nx_reader_page.nx

buildroot/runtime/_hdl_build/nx_reader_page.nx

3512 B58 linesdepth 2pulls 3 transitivereach 0 importersview sourcekind tooltopic reader
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_reader_sov.nx nx_reader_page.nx

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

main rp_exists sys_openat_rd sys_close ensure_dir sys_mmap sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_close ↻ rp_write sys_openat_wr sys_write sys_close ↻ rp_p sys_write ↻ sys_exit reader_sovereign_ok rsv_has rsv_find rsv_slen rp_n sys_write ↻ sys_mmap ↻

structs

none

consts

none

functions

14func 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 }
called by 1: main calls 1: sys_write
15func 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 }
called by 1: main calls 2: sys_writesys_mmap
16func rp_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
17func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 }
called by 1: main
18func rp_write(path: *u8, buf: *u8, n: i64) -> i64
27func main(argc: i64, argv: *i64) -> i64