code wiki / _hdl_build / nx_envelope_audit.nx

nx_envelope_audit.nx

buildroot/runtime/_hdl_build/nx_envelope_audit.nx

10633 B203 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_envelope_audit.nx

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

main sys_mmap ea_read sys_openat_rd sys_read sys_close ea_werr sys_write ea_slen sys_exit ea_puts ea_has ea_slen ↻ ea_puti sys_mmap ↻ sys_write ↻ sys_openat_wr sys_close ↻ sys_renameat

structs

none

consts

23const EA_ALLOW: *u8 = "tool_allowlist.conf" as *u8
24const EA_OUT: *u8 = "knowledge/status/envelope_audit.log" as *u8
25const EA_D1: *u8 = "buildroot/runtime/_hdl_build/" as *u8
26const EA_D2: *u8 = "buildroot/runtime/" as *u8
27const EA_ALLOWCAP: i64 = 262144
28const EA_SRCCAP: i64 = 262144
29const EA_REPCAP: i64 = 131072
30const EA_MAXROWS: i64 = 512
31const EA_MAXLIST: i64 = 64
32const EA_NL: i64 = 10
33const EA_TAB: i64 = 9
34const EA_HASH: i64 = 35
35const EA_SLASH: i64 = 47
36const EA_DOT: i64 = 46
37const EA_MODE: i64 = 0x1a4
38const EA_STDOUT: i64 = 1
39const EA_STDERR: i64 = 2
40const EA_PATHCAP: i64 = 512
41const EA_NAMECAP: i64 = 256

functions

43func ea_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: ea_werrea_has
44func ea_werr(s: *u8) -> i64 { sys_write(EA_STDERR, s, ea_slen(s)); return 0 }
called by 1: main calls 2: sys_writeea_slen
45func 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
46func ea_puti(b: *u8, off: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
58func ea_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
67func ea_has(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: ea_slen
81func main(argc: i64, argv: *i64) -> i64