code wiki / _hdl_build / nx_stderronly.nx

nx_stderronly.nx

buildroot/runtime/_hdl_build/nx_stderronly.nx

68114 B1423 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_stderronly.nx -- THE SILENT-STDERR-GUARD DETECTOR. THE DEFECT. A guard that detects a fault, writes its refusal ONLY to the error channel, and then leaves the enclosing status function on a SUCCESS path reaches its caller as SILENCE: the caller reads a success code, sees nothing, and proceeds. Measured live 2026-08-20 in nx_clockjob, where a refused write was indistinguishable from a successful one. SCOPE, STATED PLAINLY -- THIS IS SOURCE-SHAPE ANALYSIS, NOT RUNTIME. It cannot observe which channel a message actually took at run time, because the estate has no fd-capture primitive: a sibling proved that nx_job_run MERGES fd1 and fd2 (one refusing write appeared exactly twice in a single capture), so a runtime channel test is currently unwritable. That missing primitive is filed separately as nx_fdcapture. Everything below is decided from the bytes of the source with comment bodies and string bodies masked out of the code view. WHAT IT THEREFORE CANNOT SEE: a verdict carried through a flag variable that is returned later; a refusal whose message is built across several lines; a condition spread over several lines; a caller that already holds the failure code (a reason-printer); any refusal worded outside the published vocabulary; anything at all at run time. THE SIGNAL IS A CONJUNCTION, AND EVERY CONJUNCT IS PUBLISHED AS ITS OWN BUCKET SO THE FUNNEL CAN BE AUDITED RATHER THAN TRUSTED: 1. the site is an fd-2 emission -- a write whose fd argument is the literal 2 OR a file-level const whose VALUE is 2 (THE SAME CONSTANT IN TWO SPELLINGS IS TWO CONSTANTS TO EVERY SCANNER: the estate writes both, so resolving by value is the only complete rule), OR a call to a same-file UNCONDITIONAL stderr helper 2. it is NOT inside such a helper's own body (a printer is not a guard) 3. its innermost enclosing block is an `if` guard, not a function body / else / loop 4. the emitted literal carries a REFUSAL token from the published vocabulary 5. the guard block carries NO non-zero verdict (no non-zero return, no non-zero sys_exit) 6. the enclosing function PROVES IT USES EXIT CODES -- it carries a non-zero verdict SOMEWHERE 7. the guard block does no other work (no assignment, so it cannot be setting a failure flag) CONJUNCT 6 IS THE DISCRIMINATOR AND IT WAS EARNED, NOT GUESSED. Without it the rule fires on every reason-printer in the estate (nx_gunzip.gu_reason, nx_refcorpus.rc_reason: a fan of `if rc == -N { emit(...) }` lines whose CALLER already holds the failure code). Such a function has no non-zero verdict anywhere, so it is not a status function at all, and its silence is correct by design. A FUNCTION THAT NEVER RETURNS A NON-ZERO CODE IS NOT FAILING TO REPORT -- IT WAS NEVER THE REPORTER. CONJUNCT 7 WAS EARNED THE SAME WAY: the corpus is full of `if x < 0 { write(fd2,"-"); x = 0 - x }` number formatters and `if p2 == 0 { werr("T2 ...") }` selftest teeth whose verdict lives in a

dependencies 2 imports · 0 importers

nx_memplane_lib.nx nx_gatekit_lib.nx nx_stderronly.nx

imports: nx_memplane_lib.nxnx_gatekit_lib.nx

imported by: nobody (leaf or entry point)

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

main mp_streq mp_cat mp_len gk_ops_path gk_ops_dir 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 ↻ gk_corpus_root sys_mmap ↻ gk_cat gk_exists sys_openat_rd sys_close gk_streq gk_cat ↻ gk_mkdir sys_mkdir gk_len gk_cat ↻ mp_readf sys_openat_rd ↻ sys_read sys_close ↻ so_vindex so_vocab_builtin mp_cat ↻

structs

none

consts

68const SO_MAXF: i64 = 32768 // corpus is ~18,600; a smaller cap would REFUSE, never truncate
69const SO_FBUF: i64 = 4194304
70const SO_FNMAX: i64 = 2048 // functions per file
71const SO_EMMAX: i64 = 64 // unconditional stderr helpers per file
72const SO_CNMAX: i64 = 512 // file-level consts whose value is 2
73const SO_W2MAX: i64 = 8192 // fd-2 write positions per file
74const SO_SITEF: i64 = 16384 // emission sites per file
75const SO_ENCLMAX: i64 = 64 // enclosing block levels walked outward from a site
76const SO_WLB: i64 = 4194304 // per-bucket worklist buffer
77const SO_WLRES: i64 = 4096 // headroom kept free so a row is never half-written
78const SO_MSG: i64 = 65536
79const SO_KEYB: i64 = 4194304
80const SO_VOCB: i64 = 65536
81const SO_VOCMAX: i64 = 256
82const SO_PATHB: i64 = 4096
84const SO_NL: i64 = 10
85const SO_SP: i64 = 32
86const SO_TABCH: i64 = 9
87const SO_CR: i64 = 13
88const SO_QUOTE: i64 = 34
89const SO_HASH: i64 = 35
90const SO_BSLASH: i64 = 92
91const SO_SLASH: i64 = 47
92const SO_LBRACE: i64 = 123
93const SO_RBRACE: i64 = 125
94const SO_LPAREN: i64 = 40
95const SO_RPAREN: i64 = 41
96const SO_COMMA: i64 = 44
97const SO_EQ: i64 = 61
98const SO_BANG: i64 = 33
99const SO_LT: i64 = 60
100const SO_GT: i64 = 62
101const SO_PLUS: i64 = 43
102const SO_STAR: i64 = 42
103const SO_PCT: i64 = 37
104const SO_D0: i64 = 48
105const SO_D9: i64 = 57
106const SO_MINUS: i64 = 45
107const SO_UPA: i64 = 65
108const SO_UPZ: i64 = 90
109const SO_LOA: i64 = 97
110const SO_LOZ: i64 = 122
111const SO_USCORE: i64 = 95
112const SO_CASEGAP: i64 = 32
113const SO_BASE10: i64 = 10
114const SO_FD2VAL: i64 = 2 // the error channel; the whole subject of this organ
116const SO_MK_CODE: i64 = 0
117const SO_MK_CMT: i64 = 1
118const SO_MK_STR: i64 = 2
121const SO_B_EMIT: i64 = 0 // inside an unconditional stderr helper's own body -- a printer
122const SO_B_NOGUARD: i64 = 1 // enclosing block is a function body / else / loop, not an `if`
123const SO_B_NOVOCAB: i64 = 2 // guarded, but the literal carries no refusal token
124const SO_B_CARRIES: i64 = 3 // guarded refusal, and the block carries a non-zero verdict <-- GOOD
125const SO_B_NOSTATUS: i64 = 4 // enclosing function has no non-zero verdict anywhere -- reason-printer
126const SO_B_HASWORK: i64 = 5 // block assigns something -- the verdict may live in a flag
127const SO_B_SILENT: i64 = 6 // <-- THE SIGNAL
128const SO_B_UNKNOWN: i64 = 7 // could not resolve the enclosing block / a cap was reached
129const SO_B_ELSEARM: i64 = 8 // the block is one arm of an if/else message SELECTOR, not a refusal
130const SO_B_RETZERO: i64 = 9 // the block returns/exits explicitly -- a chosen contract, not silence
131const SO_B_N: i64 = 10
133const SO_MODE_644: i64 = 420
137const SO_I64B: i64 = 8 // bytes per i64 slot
138const SO_NULRES: i64 = 8 // headroom left unread so a buffer can always be NUL-terminated
139const SO_ASPAN_SLOTS: i64 = 4 // so_argspan writes out[0]=open, out[1]=past-close; slack for growth
140const SO_ESCPAIR: i64 = 2 // a backslash escape consumes the slash AND the byte it escapes
142const SO_SCAN_ERR_CAP: i64 = 2 // returned as -2: the corpus exceeded the name-table cap
143const SO_SCAN_ERR_PATH: i64 = 3 // returned as -3: a source path exceeded the name slot
144const SO_EXIT_REFUSED: i64 = 2 // this organ REFUSED to judge; distinct from 1 = a NEW finding
148const SO_L_WRITE: *u8 = "sys_write("
149const SO_L_EXIT: *u8 = "sys_exit("
150const SO_L_RETURN: *u8 = "return "
151const SO_L_FUNC: *u8 = "func "
152const SO_L_CONST: *u8 = "const "
153const SO_L_IFSP: *u8 = "if "
154const SO_L_IFP: *u8 = "if("
155const SO_L_ELSE: *u8 = "else"
156const SO_L_TOPLVL: *u8 = "<top-level>"
157const SO_JOURNAL: *u8 = "knowledge/status/stderronly.log"
158const SO_L_KWIF: *u8 = "if"
159const SO_L_KWWHILE: *u8 = "while"
160const SO_L_KWRETURN: *u8 = "return"

functions

162func so_isid(c: i64) -> i64
170func so_isdig(c: i64) -> i64
called by 2: so_carriesmain
175func so_lower(c: i64) -> i64
called by 1: so_ifind
181func so_at(buf: *u8, p: i64, n: i64, lit: *u8) -> i64
191func so_same(buf: *u8, p: i64, q: i64, ln: i64, n: i64) -> i64
called by 1: main
207func so_mask(buf: *u8, n: i64, mk: *u8) -> i64
called by 1: main
253func so_find(buf: *u8, mk: *u8, s: i64, e: i64, lit: *u8, want: i64) -> i64
called by 1: main calls 1: so_at
267func so_ifind(buf: *u8, mk: *u8, s: i64, e: i64, lit: *u8, ll: i64) -> i64
called by 1: so_hasvocab calls 1: so_lower
288func so_bmatch(buf: *u8, mk: *u8, open: i64, n: i64) -> i64
called by 1: main
307func so_encl(buf: *u8, mk: *u8, p: i64, lo: i64) -> i64
called by 1: main
328func so_carries(buf: *u8, mk: *u8, s: i64, e: i64) -> i64
called by 1: main calls 4: so_atmp_lenso_isidso_isdig
381func so_assigns(buf: *u8, mk: *u8, s: i64, e: i64) -> i64
called by 1: main
414func so_isguard(buf: *u8, mk: *u8, op: i64, lo: i64) -> i64
called by 1: main calls 2: so_atso_isid
448func so_elsefollows(buf: *u8, mk: *u8, cl: i64, n: i64) -> i64
called by 1: main calls 1: so_at
476func so_argspan(buf: *u8, mk: *u8, site: i64, n: i64, out: *i64) -> i64
called by 1: main
512func so_othercall(buf: *u8, mk: *u8, isemit: *u8, s: i64, e: i64) -> i64
called by 1: main calls 3: so_isidmp_lenso_at
548func so_lineno(buf: *u8, p: i64) -> i64
called by 1: main
557func so_vocab_builtin(vb: *u8) -> i64
called by 1: main calls 1: mp_cat
574func so_vocab_loose(vb: *u8) -> i64
called by 1: main calls 1: mp_cat
583func so_vindex(vb: *u8, n: i64, off: *i64, len: *i64, cap: i64) -> i64
called by 1: main
616func so_hasvocab(buf: *u8, mk: *u8, s: i64, eol: i64, vb: *u8, off: *i64, len: *i64, vn: i64) -> i64
called by 1: main calls 1: so_ifind
635func so_journal(path: *u8, corpus: i64, sites: i64, silent: i64, unknown: i64, nadd: i64, green: i64) -> i64
called by 1: main calls 3: mp_catnmp_catmp_write_all
659func main(argc: i64, argv: *i64) -> i64