code wiki / _hdl_build / nx_workstream_popqueue_run.nx

nx_workstream_popqueue_run.nx source

↩ module page · 25 lines · 1396 B

1// nx_workstream_popqueue_run.nx -- thin RUNNABLE driver for WMS rung REG-POP. 2// Populates the live ws- registry from assignment_queue.tsv via the nx_workstream_popqueue LIB, 3// then emits the locked-atomic evidence line. Idempotent (re-run registers 0 new). The REFEREE is 4// nx_workstream_popqueue_gate (before/after audit drop + neg-control + idempotency). license_tier: ORIGINAL 5import "nx_workstream_popqueue.nx" 6import "nx_syscalls.nx" 7 8func _pw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 9func _pn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; 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{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 } 10 11func main() -> i64 { 12 let out4: *i64 = sys_mmap(8 * 4) as *i64 13 let rc: i64 = pq_populate(out4) 14 var green: i64 = 0 15 if rc == 0 { green = 1 } 16 _pw("REG-POP populate live ws- registry from assignment_queue\n" as *u8) 17 _pw(" queued="); _pn(out4[0]) 18 _pw(" registered_new="); _pn(out4[1]) 19 _pw(" skipped="); _pn(out4[2]) 20 _pw(" errors="); _pn(out4[3]); _pw("\n" as *u8) 21 if green == 1 { _pw("verdict=GREEN\n" as *u8) } else { _pw("verdict=RED\n" as *u8) } 22 pq_log(out4, green) 23 if green == 1 { return 0 } 24 return 1 25}