code wiki / _hdl_build / nx_gen_mesh_gate.nx
nx_gen_mesh_gate.nx
buildroot/runtime/_hdl_build/nx_gen_mesh_gate.nx
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
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
structs
| none |
consts
| none |
functions
| 14 | func gm(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func gm_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 16 | func 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 } |
| 17 | func 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 |
| 18 | func 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 } |
| 19 | func gm_find(buf: *u8, n: i64, needle: *u8) -> i64 |
| 26 | func gm_listen(port: i64) -> i64 |
| 37 | func gm_connect(port: i64) -> i64 called by 2: gm_post_meshgm_get calls 5: sys_socketsys_set_socket_timeoutsys_mmapnx_connect_boundedsys_close |
| 47 | func gm_readresp(fd: i64, resp: *u8, cap: i64) -> i64 |
| 52 | func gm_truncate(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd>=0 {sys_close(fd)} return 0 } |
| 54 | func gm_post_mesh(port: i64, body: *u8, resp: *u8, cap: i64) -> i64 |
| 65 | func gm_get(port: i64, path: *u8, resp: *u8, cap: i64) -> i64 |
| 76 | func main() -> i64 |