code wiki / (root) / nx_mesh_run.nx

nx_mesh_run.nx

buildroot/runtime/nx_mesh_run.nx

9348 B166 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tooltopic mesh
docsdependenciesstructsconstsfunctions

about

nx_mesh_run.nx -- WORKER MESH CONDUCTOR: runs ONE job through the whole authorized pipeline by composing the REAL mesh organs (not a re-implementation -- it fork+captures the proven elfs, gating each step on the next): 1. AUTHORIZE -> nx_worker_dispatch (capability-scoped, deny-by-default): may this job touch gpu-image + gallery? 2. ROUTE -> nx_mesh_lb (health-aware): pick a HEALTHY replica of the worker class (skip the down ones). 3. EXECUTE -> nx_mesh_gen (sovereign POST->decode->gallery): generate + publish, zero shell. Each milestone gates the next: a capability denial stops before routing; no healthy replica stops before executing. This is the mesh as ONE usable system (the operator's "the NAS dispatches jobs" = a single command), composing the individually-proven organs. Run from the nishihost cwd where the organ elfs live. CLI: run <prompt> <outpath> [caps] -> the full pipeline (caps default gpu-image,gallery; pass a lesser set to see the capability gate DENY and stop the pipeline) (no args) -> self-test GATE (the substring gate that drives step transitions) license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_runtime.nx nx_tool_run.nx nx_mesh_run.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main mr_puts sys_write mr_slen sys_mmap mr_run tr_run_capture sys_mmap ↻ sys_pipe2 sys_fork sys_close sys_dup3 sys_execve_clean sys_close ↻ sys_execve sys_exit sys_read sys_wait4 wait_exit_code mr_contains mr_slen ↻ sys_write ↻ mr_sse_pipeline sys_mmap ↻ mr_puts ↻ mr_sse2 mr_puts ↻ mr_wb sys_mmap ↻ sys_write ↻ mr_run ↻ mr_contains ↻ mr_sse1 mr_puts ↻ mr_wb ↻ mr_gate mr_puts ↻ mr_contains ↻

structs

none

consts

17const K_MAGIC_4194304: i64 = 4194304

functions

19func mr_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: mr_putsmr_contains
20func mr_puts(s: *u8) -> i64 { sys_write(1, s, mr_slen(s)); return 0 }
21func mr_contains(buf: *u8, n: i64, needle: *u8) -> i64
called by 3: mr_sse_pipelinemr_gatemain calls 1: mr_slen
33func mr_run(path: *u8, av: *i64, out: *u8, cap: i64, olen: *i64) -> i64
called by 2: mr_sse_pipelinemain calls 1: tr_run_capture
40func mr_wb(b: i64) -> i64 { let x: *u8 = sys_mmap(1); x[0] = b as u8; sys_write(1, x, 1); return 0 }
called by 2: mr_sse1mr_sse2 calls 2: sys_mmapsys_write
41func mr_sse1(event: *u8, status: *u8) -> i64
called by 1: mr_sse_pipeline calls 2: mr_putsmr_wb
46func mr_sse2(event: *u8, status: *u8, key: *u8, val: *u8) -> i64
called by 1: mr_sse_pipeline calls 2: mr_putsmr_wb
54func mr_sse_pipeline(prompt: *u8, outpath: *u8, caps: *u8) -> i64
88func mr_gate() -> i64
called by 1: main calls 2: mr_putsmr_contains
107func main(argc: i64, argv: *i64) -> i64