code wiki / _hdl_build / nx_sclass_dispatch_gate.nx

nx_sclass_dispatch_gate.nx

buildroot/runtime/_hdl_build/nx_sclass_dispatch_gate.nx

13846 B227 linesdepth 5pulls 10 transitivereach 0 importersview sourcekind gate/prooftopic sclass
docsdependenciesstructsconstsfunctions

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

nx_ws_cas.nx nx_arbiter.nx nx_heartbeat_str.nx nx_gate_verdict.nx nx_artifact_root.nx nx_sclass_dispatch_gate.nx

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

main sd_w sd_register sys_openat_append sys_flock sd_key sd_cat sd_num sys_now_realtime_sec sys_mmap sys_clock_gettime_real ws_put_p sys_mmap ↻ ws_len 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 ss_begin ss_begin_cap sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len ↻ ws_seg_next ss_next_segid sys_mmap ↻ ss_cat ↻ ss_readall ↻ ss_segid_ok ss_commit

structs

none

consts

20const SD_RUNNER: *u8 = "_offc/nx_sov_build_run.elf"
21const SD_HBP: *u8 = "knowledge/status/wms_heartbeat.log"
22const SD_PROOF_GATE: *u8 = "nx_raci_gate" // a real, light, GREEN leaf gate = the proof stream's work

functions

24func 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
25func 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 }
26func 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 }
27func 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 }
called by 1: main calls 1: sd_num
28func 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
29func 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 }
40func sd_build_only(name: *u8) -> i64
62func sd_run_gate(name: *u8) -> i64
97func sd_organ_exists(name: *u8) -> i64
called by 1: sd_dispatch_one calls 2: sd_catar_resolve
118func sd_register(id: *u8, state: *u8, code: *u8) -> i64
155func sd_field(id: *u8, f: i64, out: *u8) -> i64
164func sd_set_state(id: *u8, newstate: *u8) -> i64
187func sd_dispatch_one(id: *u8) -> i64
200func main() -> i64