code wiki / (root) / nx_catnlaw_gate.nx

nx_catnlaw_gate.nx

buildroot/runtime/nx_catnlaw_gate.nx

8920 B193 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

syscalls.nx nx_gate_verdict.nx nx_catnlaw_gate.nx

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

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 ↻ cl_ends_nx cl_find cl_read cl_strip gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_check gv_puts ↻ gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻ gv_num ↻ gv_puts ↻

structs

none

consts

22const CL_CAP: i64 = 1048576
23const CL_MAXF: i64 = 24000
24const CL_NAMEBUF: i64 = 1400000

functions

26func cl_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main
38func cl_strip(src: *u8, n: i64, dst: *u8) -> i64
called by 1: main
49func cl_find(b: *u8, n: i64, pat: *u8, from: i64) -> i64
called by 1: main
62func cl_ends_nx(nm: *u8, nl: i64) -> i64
called by 1: main
70func main() -> i64