code wiki / _hdl_build / nx_stderronly_gate.nx

nx_stderronly_gate.nx

buildroot/runtime/_hdl_build/nx_stderronly_gate.nx

22971 B454 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_stderronly_gate.nx -- END-TO-END gate for nx_stderronly, as an ORGAN. No shell. Inherits nx_gate_verdict (gv_ctr/gv_head/gv_check/gv_bite/gv_verdict) so the EXIT CODE CARRIES THE VERDICT and the declared count equals the executed count by construction. Runtime plumbing (fixture writing, fork/exec, output capture) comes from nx_gatekit_lib. EVERY FIXTURE IS ASSEMBLED AT RUNTIME UNDER /tmp/nx_stderronly_gate/ AND THE QUOTE CHARACTERS ARE COMPOSED FROM A BYTE, NEVER WRITTEN AS LITERALS. The subject is a SOURCE SCANNER, so a fixture spelled out in this file would be found by the subject when it sweeps the corpus -- a detector that scans source will find its own test fixture, and writing the pattern in a COMMENT re-arms the same trap because prose is source bytes too. A gate must also not share its fixture with a production beat, which is why the ratchet teeth pass --baseline into /tmp rather than touching nishi-ops. THE ANTI-VACUITY TOOTH IS FIRST AND IT IS A gv_bite: a trivial always-GREEN implementation fails the fires-on-bad half and a trivial always-RED implementation fails the silent-on-good half, so neither can pass this gate. Every refusal-side tooth is named neg-control-... so the census can SEE it. POSITIVE CONTROLS ON REAL ESTATE CODE, because a detector that flags a known-good guard is worse than none: nx_clockjob.nx (SEVEN real fd-2 refusal guards, every one of them carrying sys_exit) must be EXAMINED and NOT flagged, and nx_logtail_gate.nx must not be flagged. ⚠ THE SECOND CONTROL IS DELIBERATELY WEAK AND IS LABELLED AS SUCH: nx_logtail_gate contains no fd-2 write at all, so it could not be flagged by any implementation, which is why the clockjob control is the load-bearing one -- it has the emissions AND the refusal words AND must still come back clean. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_gatekit_lib.nx nx_gate_verdict.nx nx_stderronly_gate.nx

imports: nx_gatekit_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_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 ↻ gv_head gv_puts sys_write ↻ gk_cat gk_len gk_exists sys_openat_rd sys_close gs_nl gk_say gk_write_all sys_write ↻ gv_need gv_puts ↻ gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻ gv_num sys_mmap ↻

structs

none

consts

29const GS_DIR: *u8 = "/tmp/nx_stderronly_gate"
30const GS_CAP: i64 = 262144
31const GS_SRC: i64 = 65536
32const GS_PATH: i64 = 4096
33const GS_QUOTE: i64 = 34
34const GS_NLCH: i64 = 10
35const GS_HASH: i64 = 35
36const GS_SPACE: i64 = 32
37const GS_D0: i64 = 48
38const GS_D9: i64 = 57
39const GS_BASE10: i64 = 10
40const GS_NULRES: i64 = 8 // headroom kept free so a copied source can always be NUL-terminated
41const GS_LENSLOT: i64 = 16 // the out-length cell gk_run_capture writes into, with slack

functions

44func gs_qs(b: *u8, o: i64, s: *u8) -> i64
called by 1: main calls 1: gk_cat
52func gs_nl(b: *u8, o: i64) -> i64
called by 2: gs_helpermain
58func gs_helper(b: *u8, o: i64) -> i64
called by 1: main calls 2: gk_catgs_nl
63func gs_dircase(out: *u8, leaf: *u8) -> i64
75func gs_put(dirout: *u8, leaf: *u8, body: *u8) -> i64
called by 1: main calls 4: gs_dircasegk_catgk_rmgk_write
89func gs_copy_real(dirout: *u8, leaf: *u8, srcpath: *u8) -> i64
105func gs_dist(elf: *u8, dir: *u8, buf: *u8, ln: *i64) -> i64
called by 1: main calls 1: gk_run_capture
111func gs_num(buf: *u8, n: i64, key: *u8) -> i64
136func gs_silent(buf: *u8, n: i64) -> i64 { return gs_num(buf, n, "[6] SILENT =" as *u8) }
called by 1: main calls 1: gs_num
137func gs_carries(buf: *u8, n: i64) -> i64 { return gs_num(buf, n, "[3] guarded-refusal-CARRIES-verdict =" as *u8) }
called by 1: main calls 1: gs_num
138func gs_unknown(buf: *u8, n: i64) -> i64 { return gs_num(buf, n, "[7] UNKNOWN =" as *u8) }
called by 1: main calls 1: gs_num
139func gs_helperbody(buf: *u8, n: i64) -> i64 { return gs_num(buf, n, "[0] in-stderr-helper-body =" as *u8) }
called by 1: main calls 1: gs_num
140func gs_nostatus(buf: *u8, n: i64) -> i64 { return gs_num(buf, n, "[4] enclosing-func-not-a-status-func =" as *u8) }
called by 1: main calls 1: gs_num
141func gs_elsearm(buf: *u8, n: i64) -> i64 { return gs_num(buf, n, "[8] if-else-selector-arm =" as *u8) }
called by 1: main calls 1: gs_num
143func main(argc: i64, argv: *i64) -> i64