code wiki / _hdl_build / nx_pm_sclass_loop.nx

nx_pm_sclass_loop.nx

buildroot/runtime/_hdl_build/nx_pm_sclass_loop.nx

12445 B213 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind tooltopic pm
docsdependenciesstructsconstsfunctions

about

nx_pm_sclass_loop.nx -- THE LIVE PM ITERATION (operator: "iterate with the team ... in a live fashion"). One pass of the PM's S-class-exceed program: (1) SWEEP+DISPATCH every ready program stream (lease -> run its real evidence-gate -> complete iff GREEN -- the autonomous flow), then (2) print the PROGRAM CONVERGENCE SCORECARD read straight from the registry (how many of the 10 gap-items the MACHINE has driven to DONE) + live flow (hbm_scan) + Pillar-C reproduction (the team's census == the audit, from the converge log), then (3) heartbeat the loop. Gate-shaped: GREEN iff a real program item was completed by the machine this pass, the scorecard's done-count is honest (liar-kill: a known-ACTIVE item is NOT counted DONE), and the live signals are real (neg-control). This is the loop that, run again and again, converges the team onto the audit. DRY DEBT (noted): the sd_* dispatch helpers are copied from nx_sclass_dispatch_gate; next rung = extract a shared nx_sclass_dispatch lib (no main) and import it from both. REUSE: ws_*/ws_put_locked, fl_*, hb/hbm. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_ws_cas.nx nx_arbiter.nx nx_heartbeat_str.nx nx_pm_sclass_loop.nx

imports: nx_ws_cas.nxnx_arbiter.nxnx_heartbeat_str.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main lw lp_set_code lkey ws_get ss_get sys_mmap ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss_scan_seglist ss_len sys_mmap ↻ ss_cat ss_readall ss_r32 ws_field lcat lnum sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real ws_put_locked sys_mmap ↻ wc_lockpath sys_openat_append sys_flock ws_put_p sys_mmap ↻ ws_len ss_get ↻ ss_begin ss_begin_cap sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ↻ ws_seg_next

structs

none

consts

15const LP_MAGIC_1024: i64 = 1024
16const LP_MAGIC_4096: i64 = 4096
17const LP_MAGIC_86400: i64 = 86400
19const LP_RUNNER: *u8 = "_offc/nx_sov_build_run.elf"
20const LP_HBP: *u8 = "knowledge/status/wms_heartbeat.log"
21const LP_CVLOG: *u8 = "knowledge/status/pm_sclass_converge.log"

functions

23func lw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: lp_rowmain
24func lcat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){ dst[o]=s[i]; o=o+1; i=i+1 } return o }
25func lnum(dst: *u8, off: i64, v0: i64) -> i64 { var o: i64=off; var v: i64=v0; if v<0 {dst[o]=45 as u8;o=o+1;v=0-v} let t: *u8=sys_mmap(24); var k: i64=0; if v==0{t[0]=48 as u8;k=1} while v>0{t[k]=(48+(v-(v/10)*10)) as u8;v=v/10;k=k+1} var i: i64=0; while i<k{dst[o+i]=t[k-1-i];i=i+1} return o+k }
26func ln(v: i64) -> i64 { let b: *u8=sys_mmap(24); let e: i64=lnum(b,0,v); sys_write(1,b,e); return 0 }
called by 1: main calls 1: lnum
27func lstreq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8){ if a[i]!=b[i]{return 0} i=i+1 } if b[i]!=(0 as u8){return 0} return 1 }
28func lkey(id: *u8, out: *u8) -> i64 { out[0]=119 as u8; out[1]=115 as u8; out[2]=58 as u8; var k: i64=0; while id[k]!=(0 as u8){ out[3+k]=id[k]; k=k+1 } out[3+k]=0 as u8; return 3+k }
30func lp_run_gate(name: *u8) -> i64
47func lp_organ_exists(name: *u8) -> i64
called by 1: lp_dispatch calls 1: lcat
60func lp_field(id: *u8, f: i64, out: *u8) -> i64
68func lp_set_field5_done(id: *u8) -> i64
90func lp_set_code(id: *u8, newcode: *u8) -> i64
113func lp_dispatch(id: *u8) -> i64
128func lp_row(id: *u8, owner: *u8) -> i64
called by 1: main calls 3: lp_fieldlwlstreq
138func lp_pillarC_reproduced() -> i64
called by 1: main calls 1: sys_read_file
151func main() -> i64