code wiki / _hdl_build / nx_envelope_audit.nx
nx_envelope_audit.nx
buildroot/runtime/_hdl_build/nx_envelope_audit.nx
about
nx_envelope_audit.nx -- F227 THE SCALE-ENVELOPE SWEEP (operator scale-law: "every tool DECLARES its
envelope IN ITS OUTPUT -- silent capping is forbidden BY CONSTRUCTION"; editcover row 3 silent-truncation).
A bounded read that never says it was bounded is how a seat (any model) silently believes a partial answer
is the whole answer -- the ark v1 lesson and the nx_debt 64KB blind spot were both this class. This organ
MEASURES the law across the fleet a seat can actually CALL (the registered tool_allowlist rows -- not all
~15k .nx, that is the honest scope: an unregistered organ cannot mislead an agent).
PER ROW: resolve the source from the elf basename -> probe buildroot/runtime/_hdl_build/<base>.nx then
buildroot/runtime/<base>.nx -> classify:
DECLARING = source carries an envelope-declaration marker (envelope | caps: | window_bytes)
SILENT-CAP-CAND = has bounded-read consts (_CAP / _MAX) but NO declaration <- the actionable set
UNBOUNDED-OR-NA = no bounded-read consts found (nothing to declare, or reads are unbounded)
NAME-PROBE-MISS = no <elfbase>.nx in either probe dir. NOT proof of missing source: a tool's elf and
source names can DIVERGE (verified 07-20: nx_fs_write.elf builds from nx_fsops_write.nx). Treat as
'not found BY NAME PROBE' and verify by content before ever claiming a source is lost.
LIAR-KILLED: this is a CANDIDATE detector over source text, never an absolute verdict -- the output says so,
and it reports counts + the candidate list so a human/referee adjudicates. Measurement first; a ratchet
floor comes only AFTER a measured baseline (never a gate on an unmeasured fleet).
DOGFOOD: declares its OWN envelope in its own output (512 rows, 256KB per source, 64 candidates listed).
nx_envelope_audit [allowlist] [outpath]
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 23 | const EA_ALLOW: *u8 = "tool_allowlist.conf" as *u8 |
| 24 | const EA_OUT: *u8 = "knowledge/status/envelope_audit.log" as *u8 |
| 25 | const EA_D1: *u8 = "buildroot/runtime/_hdl_build/" as *u8 |
| 26 | const EA_D2: *u8 = "buildroot/runtime/" as *u8 |
| 27 | const EA_ALLOWCAP: i64 = 262144 |
| 28 | const EA_SRCCAP: i64 = 262144 |
| 29 | const EA_REPCAP: i64 = 131072 |
| 30 | const EA_MAXROWS: i64 = 512 |
| 31 | const EA_MAXLIST: i64 = 64 |
| 32 | const EA_NL: i64 = 10 |
| 33 | const EA_TAB: i64 = 9 |
| 34 | const EA_HASH: i64 = 35 |
| 35 | const EA_SLASH: i64 = 47 |
| 36 | const EA_DOT: i64 = 46 |
| 37 | const EA_MODE: i64 = 0x1a4 |
| 38 | const EA_STDOUT: i64 = 1 |
| 39 | const EA_STDERR: i64 = 2 |
| 40 | const EA_PATHCAP: i64 = 512 |
| 41 | const EA_NAMECAP: i64 = 256 |
functions
| 43 | func ea_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 44 | func ea_werr(s: *u8) -> i64 { sys_write(EA_STDERR, s, ea_slen(s)); return 0 } |
| 45 | func ea_puts(b: *u8, off: i64, s: *u8) -> i64 { var o: i64 = off; var j: i64 = 0; while s[j] != (0 as u8) { if o < EA_REPCAP - 8 { b[o] = s[j]; o = o + 1 } j = j + 1 } return o } called by 1: main |
| 46 | func ea_puti(b: *u8, off: i64, v: i64) -> i64 |
| 58 | func ea_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 67 | func ea_has(buf: *u8, n: i64, needle: *u8) -> i64 |
| 81 | func main(argc: i64, argv: *i64) -> i64 |