nx_catnlaw_gate.nx
buildroot/runtime/nx_catnlaw_gate.nx
about
nx_catnlaw_gate.nx -- HOW DOES EVERY NUMBER FORMATTER IN THE ESTATE RENDER A NEGATIVE?
WHY. nx_tools_api.ta_catn had `while m > 0` with NO negative guard, so a negative value emitted
ZERO CHARACTERS and produced malformed JSON -- literally `"exit_code":,"bytes":0`. A timed-out exec
returns a negative rc, so the one value the formatter could not print was the one that appears only
when something has gone wrong, and every caller had to GUESS whether its write had landed.
Three behaviours exist in this estate and they are NOT equally bad:
SIGNED `if m < 0 { d[o] = 45; m = 0 - m }` -- correct
CLAMPED `if m < 0 { m = 0 }` -- prints 0 for -1. VALID output, WRONG number, and
the direction is the dangerous one: a -1 meaning
UNKNOWN/FAILED renders as 0, which reads as SUCCESS.
SILENT no guard -- emits nothing; breaks the surrounding format.
★ A FORMATTER THAT CANNOT PRINT A SENTINEL TURNS AN ERROR PATH INTO EITHER A PROTOCOL VIOLATION OR
A FALSE SUCCESS, AND BOTH ARE INVISIBLE UNTIL SOMETHING IS ALREADY WRONG.
Census only -- names offenders, blocks nothing. Comments STRIPPED so it measures code, not prose.
license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: syscalls.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
| 22 | const CL_CAP: i64 = 1048576 |
| 23 | const CL_MAXF: i64 = 24000 |
| 24 | const CL_NAMEBUF: i64 = 1400000 |
functions
| 26 | func cl_read(path: *u8, buf: *u8, cap: i64) -> i64 called by 1: main |
| 38 | func cl_strip(src: *u8, n: i64, dst: *u8) -> i64 called by 1: main |
| 49 | func cl_find(b: *u8, n: i64, pat: *u8, from: i64) -> i64 called by 1: main |
| 62 | func cl_ends_nx(nm: *u8, nl: i64) -> i64 called by 1: main |
| 70 | func main() -> i64 |