code wiki / _hdl_build / nx_magicratchet.nx
nx_magicratchet.nx
buildroot/runtime/_hdl_build/nx_magicratchet.nx
about
nx_magicratchet.nx -- F881 MAGIC-NUMBER RATCHET (the enforcement the operator demanded 2026-07-21: catch
me at submission, not by re-sweeping). A build must NOT INCREASE an organ's inline-magic-number count vs
its stored baseline. First build self-baselines (grandfathers existing violations); a build that ADDS a
magic number is REFUSED. Non-breaking (existing organs build), unbypassable (wired into /api/build),
fail-OPEN on any count/read uncertainty (a false refusal would be worse than a miss). Counting is DELEGATED
to `nx_law_warden countfile` -- ONE canonical L001 counter, no divergent reimplementation. Rule-11 CLEAN
itself (named consts, no inline magic). license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_estr.nxnx_tool_run.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
| 12 | const MR_CAPBUF: i64 = 4096 |
| 13 | const MR_SMALLBUF: i64 = 64 |
| 14 | const MR_ARGVN: i64 = 64 |
| 15 | const MR_MODE: i64 = 0x1a4 |
| 16 | const MR_DIRMODE: i64 = 0x1ed |
| 17 | const MR_REFUSE: i64 = 3 |
| 18 | const MR_FEEDBUF: i64 = 8192 |
| 19 | const MR_MAPCAP: i64 = 1600 // bounded embed of nx_magic map output (keeps the refusal under the mgmt read cap) |
functions
| 22 | func mr_parse_magic(buf: *u8, n: i64) -> i64 called by 1: main |
| 48 | func mr_read_int(path: *u8) -> i64 |
| 64 | func mr_write_int(path: *u8, v: i64) -> i64 |
| 76 | func main(argc: i64, argv: *i64) -> i64 |