code wiki / _hdl_build / nx_planecap_gate.nx
nx_planecap_gate.nx
buildroot/runtime/_hdl_build/nx_planecap_gate.nx
about
nx_planecap_gate.nx -- WHICH PLANES HAVE OUTGROWN THE 1 MiB READER CAP? A verifier, not a fixer.
★WHY THIS EXISTS. Three organs in one session presented a TRUNCATED SCAN AS THEIR VERDICT because a
compile-time cap was outgrown by the corpus: nx_debt_hygiene (1 MiB -> hid 21 of 23 sev-9 debts),
nx_dbthyg (same bug in the superset organ), nx_tooldiff (512 rows -> INVENTED a capability regression).
A grep finds **71** organs carrying `_CAP: i64 = 1048576`. Bulk-editing 71 files blind would be reckless
and most of those caps are legitimately bounded (a per-page or per-document scratch buffer is not a
hazard). ★THE ACTIONABLE QUESTION IS NOT "who has a cap" BUT "whose CORPUS HAS PASSED IT" -- so this
measures the planes and names the ones that are live hazards TODAY.
★IT DOES NOT EDIT ANYTHING. A tool that auto-raised 71 caps would be a mass rewrite justified by a
pattern rather than by measurement, which is the same reasoning error in the other direction. This
produces the list; a human raises the caps that matter, with the plane size as the evidence.
METHOD: every `<prefix>-manifest.txt` under knowledge/store/ names a live plane. Load each with a 32 MiB
cap and report its true byte size. Anything at or above 1 MiB is flagged: any reader still sized at
1048576 will silently truncate ITS verdict on that plane.
usage: nx_planecap_gate (CWD = the store root)
exit 0 = no plane has outgrown the 1 MiB reader cap · 1 = at least one has (list printed)
license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_store_seed_lib.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
| 25 | const PC_READ: i64 = 33554432 |
| 26 | const PC_DANGER: i64 = 1048576 |
| 27 | const PC_WARN: i64 = 786432 // 75% of the cap -- outgrowing it soon is worth knowing before it bites |
functions
| 29 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 30 | func wn(v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let b: *u8=sys_mmap(28); var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 32 | func main() -> i64 |