code wiki / _hdl_build / nx_epub_art_gate.nx

nx_epub_art_gate.nx

buildroot/runtime/_hdl_build/nx_epub_art_gate.nx

6995 B114 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic epub
docsdependenciesstructsconstsfunctions

about

nx_epub_art_gate.nx -- END-TO-END liar-kill gate for R-ART: proves nx_epub_book extracts the cover + embedded image assets from an EPUB, writes them to the served slug dir BYTE-EXACT, and references them in book.json (cover detected, is_cover flagged, distinct content). Self-contained + sovereign (fork/exec, NO shell): regen the fixture + book.json, then assert book.json asset fields AND byte-exact round-trip of the extracted files. Negative control: the two extracted assets are NOT byte-identical (real distinct extraction, no duplication). expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_epub_art_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ar_p sys_write spawn sys_fork sys_openat_wr sys_dup3 sys_mmap sys_execve sys_exit sys_wait4 ar_n sys_write ↻ sys_mmap ↻ sys_mmap ↻ ar_read sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_exit ↻ ar_find ar_slen ar_eq_lit ar_slen ↻ ar_eq_bytes

structs

none

consts

none

functions

9func ar_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
10func ar_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
11func ar_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: ar_findar_eq_lit
13func spawn(path: *u8, a0: *u8, a1: *u8, redir: *u8) -> i64
34func ar_find(hay: *u8, hl: i64, needle: *u8) -> i64
called by 1: main calls 1: ar_slen
48func ar_read(path: *u8, lp: *i64) -> *u8 { lp[0] = 0; return sys_read_file(path, lp) }
called by 1: main calls 1: sys_read_file
51func ar_eq_lit(buf: *u8, n: i64, lit: *u8) -> i64
called by 1: main calls 1: ar_slen
58func ar_eq_bytes(a: *u8, an: i64, b: *u8, bn: i64) -> i64
called by 1: main
65func main() -> i64