code wiki / (root) / nx_unidoc_gate.nx

nx_unidoc_gate.nx

buildroot/runtime/nx_unidoc_gate.nx

11584 B127 linesdepth 6pulls 8 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_unidoc_gate.nx -- INDEPENDENT GATE for the unified document page (nx_unidoc_lib, rung UD1 of /compare/unidoc). Inherits nx_gate_verdict: one gv_check per tooth, gv_bite for the escape cell (must FIRE on hostile text and stay SILENT on plain text), gv_need for the real-world Word fixture and the promoted format organ, gv_verdict carrying the verdict in the EXIT CODE. Fixtures are assembled at RUNTIME under /tmp/nx_unidoc_gate/ (never a production plane). The load-bearing teeth are the ones a stub cannot pass: a document CONTAINING "<script>" renders as visible text and never as a tag; the page carries a fail-closed CSP; a web page is REFUSED by name; the same bytes render to the same page twice; and the portal's forms appear only when a base is given. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_unidoc_lib.nx nx_gate_verdict.nx nx_unidoc_gate.nx

imports: nx_unidoc_lib.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ ug_write ud_slen gv_check gv_puts ↻ ug_exists ug_render ud_render_path ud_kind_of_path sys_mmap ↻ ud_ext ud_slen ↻ ud_lower ud_kind_of_ext ud_streq sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read

structs

none

consts

12const UG_SCRATCH: *u8 = "/tmp/nx_unidoc_gate"
13const UG_DIRMODE: i64 = 493
14const UG_OUTCAP: i64 = 4194304
15const UG_SMALL: i64 = 4096
16const UG_WORD_FIXTURE: *u8 = "knowledge/fetched/cmp_legalpractice_msword_fixture.docx"
17const UG_WORD_MIN_BLOCKS: i64 = 10

functions

19func ug_write(path: *u8, content: *u8) -> i64
called by 1: main calls 1: ud_slen
27func ug_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
28func ug_has(buf: *u8, n: i64, needle: *u8) -> i64 { if ud_find(buf, n, needle) >= 0 { return 1 } return 0 }
called by 1: main calls 1: ud_find
29func ug_same(a: *u8, b: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { if a[i] != b[i] { return 0 } i = i + 1 } return 1 }
called by 1: main
30func ug_render(path: *u8, base: *u8, out: *u8, kind: *i64) -> i64 { return ud_render_path(path, "/orig" as *u8, base, out, UG_OUTCAP, kind) }
called by 1: main calls 1: ud_render_path
32func main() -> i64