code wiki / _hdl_build / nx_lastmile_ratchet.nx

nx_lastmile_ratchet.nx

buildroot/runtime/_hdl_build/nx_lastmile_ratchet.nx

5308 B103 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_lastmile_ratchet.nx -- LAST-MILE THINNESS RATCHET (operator 2026-07-02: "make sure we arent building into third party systems like js ... last mile emitting as much as possible ... truly nishi"). The doctrine with TEETH: measures the hand-maintained JS surface of the /video client (app.js bytes) against the Nishi core (nx_video_client.wasm, compiled from runtime/nx_video_client_wasm.nx) and RATCHETS: the JS surface may NEVER exceed its recorded floor. Every future feature must land in the core / an emitter organ -- landing it in loose JS turns this gate RED. Shrinking JS lowers the floor (monotone). State = append-only knowledge/status/lastmile_ratchet.log (LASTMILE epoch=.. js=.. wasm=.. floor=.. verdict=..); first run records the baseline floor honestly (today's debt, named). expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_lastmile_ratchet.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 pw sys_write slen fsize sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close last_floor sys_mmap ↻ sys_read_file ↻ pn sys_mmap ↻ sys_write ↻ sys_mmap ↻ apps appn sys_mmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_openat_append sys_write ↻ sys_close ↻

structs

none

consts

11const K_MAGIC_1024: i64 = 1024

functions

13func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: pw
14func pw(s: *u8) -> i64 { sys_write(1,s,slen(s)); return 0 }
called by 1: main calls 2: sys_writeslen
15func pn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
19func apps(b: *u8, n: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){b[n+i]=s[i];i=i+1} return n+i }
called by 1: main
20func appn(b: *u8, n: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
23func fsize(path: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
30func last_floor(logpath: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
63func main() -> i64