code wiki / _hdl_build / nx_polite_daemon.nx
nx_polite_daemon.nx
buildroot/runtime/_hdl_build/nx_polite_daemon.nx
about
nx_polite_daemon.nx -- the team's CONTINUOUS, HOSTING-AWARE autonomous backlog loop. KEPT SMALL so the
(currently toy-level) sovereign compiler builds it deterministically -- the live-monitor PAGE is built
SEPARATELY by the website builder (backlog refactor), reading this loop's heartbeat. Each beat: sense the
host (nx_sysload: load, cpu, free mem, live :8443 conns) -> governor (nx_resource_governor) decides
SERVE-FIRST pause (yield to live hosting) / minimal / run -> compose-or-raise-hand -> append a HEARTBEAT to
/tmp/nishi_loop_status.log -> sleep. Stop via /tmp/nishi_loop_stop. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_sysload.nxnx_resource_governor.nxnx_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
| 16 | const PL_RESERVE: i64 = 1 |
| 17 | const PL_MEM_FLOOR_MB: i64 = 1024 |
| 18 | const PL_INTERVAL_MS: i64 = 60000 |
| 19 | const PL_MAXTICKS: i64 = 100000 |
| 20 | const NTYPE: i64 = 8 |
| 21 | const NP: i64 = 8 |
| 22 | const NTASK: i64 = 6 |
functions
| 11 | func pd_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } calls 1: sys_write |
| 12 | func pd_n(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; let t: *u8=sys_mmap(28); 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}; var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1}; sys_write(1,b,k); return 0 } |
| 13 | func pd_fw(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 14 | func pd_fn(fd: i64, v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; let t: *u8=sys_mmap(28); 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}; var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1}; sys_write(fd,b,k); return 0 } |
| 24 | func pd_reach(tin: i64, tout: i64, pin: *i64, pout: *i64, pav: *i64, reach: *i64) -> i64 called by 1: main |
| 32 | func main() -> i64 |