code wiki / _hdl_build / nx_gen_mesh_gate.nx

nx_gen_mesh_gate.nx

buildroot/runtime/_hdl_build/nx_gen_mesh_gate.nx

8739 B159 linesdepth 9pulls 30 transitivereach 0 importersview sourcekind gate/prooftopic gen
docsdependenciesstructsconstsfunctions

about

nx_gen_mesh_gate.nx -- end-to-end gate for the /gen 3D lane over REAL loopback sockets (G2 of the gen-UI capability ladder: the CF-studio capability -- text -> printable watertight STL -- surfaced in the product). Forks the orchestrator server (go_serve_conn, the daemon's exact handler), then acts as the HTTP client: T1 POST /api/mesh {"prompt":"a snowman in the yard"} -> 200 {"object":"snowman",...,"stl":"/gen/mesh/snowman.stl"} T2 GET /mesh/snowman.stl -> 200 model/stl with a REAL ASCII STL body (solid...endsolid) T3 NEG traversal: GET /mesh/../../../etc/passwd -> 404 (client bytes never reach a filesystem path) T4 NEG empty prompt -> 400 T5 REGRESSION: GET / -> 200 gen UI still serves AND carries the new 3D section (no dead button) license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_gen_orchestrator.nx nx_connect.nx nx_syscalls.nx nx_gen_mesh_gate.nx

imports: nx_gen_orchestrator.nxnx_connect.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main gm_truncate sys_openat_wr sys_close sys_mmap gm_listen sys_socket sys_mmap ↻ sys_setsockopt sys_bind sys_listen gm sys_write sys_exit sys_fork sys_accept go_serve_conn sys_set_socket_timeout sys_mmap ↻ sys_setsockopt ↻ sys_munmap sys_mmap ↻ go_read_full sys_read go_find_seq go_hdr_int go_find_seq ↻ go_find_seq ↻ go_reqpath go_starts go_handle_generate sys_mmap ↻ go_json_str go_json_findval go_slen go_skip_sp go_400 sys_mmap ↻ go_cat go_send

structs

none

consts

none

functions

14func gm(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 calls 1: sys_write
15func gm_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: gm_findgm_post_mesh
16func gm_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 }
called by 2: gm_post_meshgm_get
17func gm_catb(dst: *u8, off: i64, src: *u8, n: i64) -> i64 { var o: i64=off; var i: i64=0; while i<n {dst[o]=src[i]; o=o+1; i=i+1} return o }
called by 1: gm_post_mesh
18func gm_itoa(dst: *u8, off: i64, v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; 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 o: i64=off; var q: i64=k-1; while q>=0{dst[o]=t[q];o=o+1;q=q-1} return o }
called by 2: gm_post_meshmain calls 1: sys_mmap
19func gm_find(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: gm_slen
26func gm_listen(port: i64) -> i64
37func gm_connect(port: i64) -> i64
47func gm_readresp(fd: i64, resp: *u8, cap: i64) -> i64
called by 2: gm_post_meshgm_get calls 1: sys_read
52func gm_truncate(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd>=0 {sys_close(fd)} return 0 }
called by 1: main calls 2: sys_openat_wrsys_close
54func gm_post_mesh(port: i64, body: *u8, resp: *u8, cap: i64) -> i64
65func gm_get(port: i64, path: *u8, resp: *u8, cap: i64) -> i64
76func main() -> i64