code wiki / _hdl_build / nx_self_model_regen.nx
nx_self_model_regen.nx
buildroot/runtime/_hdl_build/nx_self_model_regen.nx
about
nx_self_model_regen.nx -- the LIBRARIAN regenerates the self-model count FROM the registry (data), instead
of Claude hand-editing a 229-cap inline main() that overruns the compiler's register allocator and
segfaults (operator: "keep building the team and dont do the work yourself"). The registry is DATA (one
CAPREG line per cap, written by nx_cap_register); this reader LOOPS over it -- a SMALL main, no reg
pressure, scales to thousands. This is the fix for the fat-main crash AND removes Claude from self-model
upkeep: the team registers caps -> the registry grows -> the Librarian regenerates the count. license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_self_model_regen_test.nx
structs
| none |
consts
| none |
functions
| 11 | func smr_count(buf: *u8, n: i64, mark: *u8) -> i64 |
| 23 | func smr_proven(buf: *u8, n: i64) -> i64 { return smr_count(buf, n, "status=2 " as *u8) } |
| 24 | func smr_building(buf: *u8, n: i64) -> i64 { return smr_count(buf, n, "status=1 " as *u8) } |
| 25 | func smr_total(buf: *u8, n: i64) -> i64 { return smr_count(buf, n, "CAPREG idx=" as *u8) } |