code wiki / _hdl_build / nx_sclass_dispatch_gate.nx
nx_sclass_dispatch_gate.nx
buildroot/runtime/_hdl_build/nx_sclass_dispatch_gate.nx
about
nx_sclass_dispatch_gate.nx -- SCLASS-FLOW-01: AUTONOMOUS FLOW over the REAL WMS registry (the audit's #1
gap: "no real registered stream is auto-picked, leased, RUN, and COMPLETED by the machine"). This closes
the execute+complete half that nx_dispatch_lease (pick+lease only) left open: the dispatcher PICKS a real
registered stream, LEASES it (fl_acquire), RUNS the gate named in its code_link (fork/exec the sovereign
runner, verdict on the exit code -- nx_gate_sweep idiom), and -- iff GREEN -- marks the stream DONE in the
registry (ws_put_locked) + beats its heartbeat. So the MACHINE moves a real stream ACTIVE->DONE, not Claude.
LIAR-KILL / neg-control: a stream whose code_link names a NON-EXISTENT gate is NEVER completed (stays ACTIVE).
REUSE (rule 15): fl_acquire/fl_release (nx_arbiter), ws_put_p/ws_get/ws_field/ws_member/WS_PREFIX (registry),
ws_put_locked (nx_ws_cas), hb_beat_s (nx_heartbeat_str), run_gate fork/exec (nx_gate_sweep). Sovereign,
concurrency-safe, additive, liar-killed. license_tier: ORIGINAL expect_exit: 0
dependencies 5 imports · 0 importers
imports: nx_ws_cas.nxnx_arbiter.nxnx_heartbeat_str.nxnx_gate_verdict.nxnx_artifact_root.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
| 20 | const SD_RUNNER: *u8 = "_offc/nx_sov_build_run.elf" |
| 21 | const SD_HBP: *u8 = "knowledge/status/wms_heartbeat.log" |
| 22 | const SD_PROOF_GATE: *u8 = "nx_raci_gate" // a real, light, GREEN leaf gate = the proof stream's work |
functions
| 24 | func sd_w(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 1: main |
| 25 | func sd_cat(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 } |
| 26 | func sd_num(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 } |
| 27 | func sd_n(v: i64) -> i64 { let b: *u8=sys_mmap(24); let e: i64=sd_num(b,0,v); sys_write(1,b,e); return 0 } |
| 28 | func sd_streq(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 } called by 1: main |
| 29 | func sd_key(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 } |
| 40 | func sd_build_only(name: *u8) -> i64 |
| 62 | func sd_run_gate(name: *u8) -> i64 |
| 97 | func sd_organ_exists(name: *u8) -> i64 |
| 118 | func sd_register(id: *u8, state: *u8, code: *u8) -> i64 |
| 155 | func sd_field(id: *u8, f: i64, out: *u8) -> i64 |
| 164 | func sd_set_state(id: *u8, newstate: *u8) -> i64 |
| 187 | func sd_dispatch_one(id: *u8) -> i64 |
| 200 | func main() -> i64 |