code wiki / _hdl_build / nx_stderronly_gate.nx
nx_stderronly_gate.nx
buildroot/runtime/_hdl_build/nx_stderronly_gate.nx
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
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
structs
| none |
consts
| 29 | const GS_DIR: *u8 = "/tmp/nx_stderronly_gate" |
| 30 | const GS_CAP: i64 = 262144 |
| 31 | const GS_SRC: i64 = 65536 |
| 32 | const GS_PATH: i64 = 4096 |
| 33 | const GS_QUOTE: i64 = 34 |
| 34 | const GS_NLCH: i64 = 10 |
| 35 | const GS_HASH: i64 = 35 |
| 36 | const GS_SPACE: i64 = 32 |
| 37 | const GS_D0: i64 = 48 |
| 38 | const GS_D9: i64 = 57 |
| 39 | const GS_BASE10: i64 = 10 |
| 40 | const GS_NULRES: i64 = 8 // headroom kept free so a copied source can always be NUL-terminated |
| 41 | const GS_LENSLOT: i64 = 16 // the out-length cell gk_run_capture writes into, with slack |
functions
| 44 | func gs_qs(b: *u8, o: i64, s: *u8) -> i64 |
| 52 | func gs_nl(b: *u8, o: i64) -> i64 |
| 58 | func gs_helper(b: *u8, o: i64) -> i64 |
| 63 | func gs_dircase(out: *u8, leaf: *u8) -> i64 |
| 75 | func gs_put(dirout: *u8, leaf: *u8, body: *u8) -> i64 |
| 89 | func gs_copy_real(dirout: *u8, leaf: *u8, srcpath: *u8) -> i64 |
| 105 | func gs_dist(elf: *u8, dir: *u8, buf: *u8, ln: *i64) -> i64 |
| 111 | func gs_num(buf: *u8, n: i64, key: *u8) -> i64 called by 6: gs_silentgs_carriesgs_unknowngs_helperbodygs_nostatusgs_elsearm calls 2: gk_out_posgk_len |
| 136 | func gs_silent(buf: *u8, n: i64) -> i64 { return gs_num(buf, n, "[6] SILENT =" as *u8) } |
| 137 | func gs_carries(buf: *u8, n: i64) -> i64 { return gs_num(buf, n, "[3] guarded-refusal-CARRIES-verdict =" as *u8) } |
| 138 | func gs_unknown(buf: *u8, n: i64) -> i64 { return gs_num(buf, n, "[7] UNKNOWN =" as *u8) } |
| 139 | func gs_helperbody(buf: *u8, n: i64) -> i64 { return gs_num(buf, n, "[0] in-stderr-helper-body =" as *u8) } |
| 140 | func gs_nostatus(buf: *u8, n: i64) -> i64 { return gs_num(buf, n, "[4] enclosing-func-not-a-status-func =" as *u8) } |
| 141 | func gs_elsearm(buf: *u8, n: i64) -> i64 { return gs_num(buf, n, "[8] if-else-selector-arm =" as *u8) } |
| 143 | func main(argc: i64, argv: *i64) -> i64 |