nx_unidoc_gate.nx
buildroot/runtime/nx_unidoc_gate.nx
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
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
structs
| none |
consts
| 12 | const UG_SCRATCH: *u8 = "/tmp/nx_unidoc_gate" |
| 13 | const UG_DIRMODE: i64 = 493 |
| 14 | const UG_OUTCAP: i64 = 4194304 |
| 15 | const UG_SMALL: i64 = 4096 |
| 16 | const UG_WORD_FIXTURE: *u8 = "knowledge/fetched/cmp_legalpractice_msword_fixture.docx" |
| 17 | const UG_WORD_MIN_BLOCKS: i64 = 10 |
functions
| 19 | func ug_write(path: *u8, content: *u8) -> i64 |
| 27 | func 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 |
| 28 | func ug_has(buf: *u8, n: i64, needle: *u8) -> i64 { if ud_find(buf, n, needle) >= 0 { return 1 } return 0 } |
| 29 | func 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 |
| 30 | func ug_render(path: *u8, base: *u8, out: *u8, kind: *i64) -> i64 { return ud_render_path(path, "/orig" as *u8, base, out, UG_OUTCAP, kind) } |
| 32 | func main() -> i64 |