nx_motion_serve.nx
buildroot/runtime/nx_motion_serve.nx
about
nx_motion_serve.nx -- /motion AS A TOOL, NOT A BROCHURE (2026-09-06): a visitor uploads a mesh, the sovereign auto-rig
rigs it, the page shows it from three sides with its own numbers, a library clip retargets onto it, the result exports,
and the operator's ACCEPT or REJECT lands from the same page. The mesh2motion-class surface, on the estate's own organs.
nx_motion_serve [port] serve on LOOPBACK (default 18132); the edge proxies /motion to it
nx_motion_serve emit <out.html> write the static fallback -- THE SAME RENDERER, the empty form, byte-identical
SHAPE, and why (the /math pattern): plain GET and POST forms, no script, no fetch, no client runtime, so it works
with JavaScript off, every job is a shareable URL, and there is no third party anywhere in the path. Routing is
prefix-agnostic on purpose: the edge forwards /motion/upload and a loopback test sends /upload, and both route the same.
The daemon never does the work: it types the upload by MAGIC, writes a digit-named job directory, and spawns the job
organ DETACHED (double fork), so accept() is never held by a rig. It reads status rows the job writes and shows them.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_http_server.nxnx_motion_lib.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
| 18 | const MS_PORT_DEFAULT: i64 = 18132 |
| 19 | const MS_BACKLOG: i64 = 64 |
| 20 | const MS_RESP_RESERVE: i64 = 1024 |
| 21 | const MS_METHOD_GET: i64 = 1 |
| 22 | const MS_METHOD_POST: i64 = 2 |
| 23 | const MS_CELLS_MIN: i64 = 48 |
| 24 | const MS_CELLS_MAX: i64 = 256 |
| 25 | const MS_CELLS_DEFAULT: i64 = 192 |
| 26 | const MS_WORDS_CAP: i64 = 200 |
| 27 | const MS_EXIT_USAGE: i64 = 2 |
| 28 | const MS_REFRESH_HEAD: *u8 = "<meta http-equiv=\"refresh\" content=\"4\">" |
| 29 | const MS_RIG_ELF: *u8 = "_offc/nx_motion_rig.elf" |
| 30 | const MS_STORE_ELF: *u8 = "_offc/nx_store_put.elf" |
| 31 | const MS_ACCEPT_PLANE: *u8 = "knowledge/store/accept-" |
functions
| 33 | func msw(s: *u8) -> i64 { sys_write(1, s, mo_slen(s)); return 0 } |
| 35 | func ms_send(cfd: i64, status: *u8, ctype: *u8, body: *u8, n: i64) -> i64 |
| 49 | func ms_text(cfd: i64, status: *u8, msg: *u8) -> i64 { return ms_send(cfd, status, "text/plain; charset=utf-8" as *u8, msg, mo_slen(msg)) } |
| 50 | func ms_redirect(cfd: i64, loc: *u8) -> i64 called by 3: ms_uploadms_animms_verdict calls 4: sys_mmapmo_catnx_http_server_send_responsesys_munmap |
| 60 | func ms_render(out: *u8, cap: i64, head: *u8, body: *u8, bn: i64) -> i64 |
| 67 | func ms_render_index(out: *u8, cap: i64) -> i64 |
| 78 | func ms_page(cfd: i64, head: *u8, body: *u8, bn: i64) -> i64 |
| 87 | func ms_index(cfd: i64) -> i64 |
| 96 | func ms_jobdir(id: *u8) -> *u8 { return mo_join(MO_JOBS_DIR, id) } |
| 98 | func ms_job(cfd: i64, id: *u8) -> i64 |
| 121 | func ms_ctype(name: *u8) -> *u8 |
| 129 | func ms_file(cfd: i64, dir: *u8, name: *u8) -> i64 |
| 138 | func ms_art(cfd: i64, path: *u8, plen: i64) -> i64 |
| 146 | func ms_demo(cfd: i64, path: *u8, plen: i64) -> i64 |
| 152 | func ms_upload(cfd: i64, req: *u8, hend: i64, body: *u8, blen: i64) -> i64 |
| 211 | func ms_anim(cfd: i64, path: *u8, plen: i64) -> i64 |
| 247 | func ms_verdict(cfd: i64, body: *u8, blen: i64) -> i64 |
| 292 | func ms_emit(outpath: *u8) -> i64 |
| 304 | func main(argc: i64, argv: *i64) -> i64 |