nx_writer_serve.nx
buildroot/runtime/nx_writer_serve.nx
about
nx_writer_serve.nx -- WRITING HUB rung R6: the SOVEREIGN LIVE SURFACE. Operator: "api nishi ecosystem based,
surface it to nishifamily.com/writer." A sovereign HTTP server (nx_syscalls, the nx_gallery_serve pattern)
exposing the writing hub as REAL APIs + a page -- the page calls the ACTUAL organs, not JS copies:
GET / (and /writer) -> the writer page (Score prose + Verify claim)
POST /score -> body=prose; nx_writehub_score.whl_eval -> JSON {quality,verdict,directive,...}
POST /factcheck -> body=claim; nx_writehub_factlib.fcl_check (composes nx_research_corroborate over
the banked corpus) -> JSON {verdict,classes,sources[]} (grounded, cited)
GET /health -> ok
100% sovereign+local (no cloud, no seat). Bash is only ever a LAUNCHER. Default port 8098; test: nx_writer_serve <port>.
license_tier: ORIGINAL module: nishi-core.writehub.serve
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_writehub_score.nxnx_writehub_factlib.nxnx_lane_conf.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
| 15 | const K_MAGIC_200000: i64 = 200000 |
| 16 | const K_MAGIC_3000: i64 = 3000 |
| 17 | const K_MAGIC_60000: i64 = 60000 |
| 18 | const K_MAGIC_65536: i64 = 65536 |
| 19 | const K_MAGIC_4096: i64 = 4096 |
| 20 | const K_MAGIC_2097152: i64 = 2097152 |
| 21 | const K_MAGIC_8192: i64 = 8192 |
| 22 | const K_MAGIC_4094: i64 = 4094 |
| 23 | const K_MAGIC_8098: i64 = 8098 |
| 24 | const K_MAGIC_16384: i64 = 16384 |
| 25 | const K_MAGIC_262144: i64 = 262144 |
functions
| 27 | func ws_strlen(s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){i=i+1} return i } |
| 28 | func ws_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off+i]=s[i];i=i+1} return off+i } |
| 29 | func ws_u(dst: *u8, off: i64, v: i64) -> i64 |
| 35 | func ws_qs(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; dst[o]=34 as u8; o=o+1; o=ws_cat(dst,o,s); dst[o]=34 as u8; o=o+1; return o } |
| 36 | func ws_write_all(fd: i64, buf: *u8, n: i64) -> i64 |
| 41 | func ws_find(buf: *u8, n: i64, pat: *u8, plen: i64) -> i64 |
| 46 | func ws_body(buf: *u8, n: i64) -> i64 |
| 51 | func ws_wrap(rbuf: *u8, ctype: *u8, body: *u8, blen: i64) -> i64 |
| 60 | func ws_404(rbuf: *u8) -> i64 { return ws_cat(rbuf, 0, "HTTP/1.1 404 Not Found\r\nContent-Type: text/plain\r\nContent-Length: 9\r\nConnection: close\r\n\r\nnot found" as *u8) } |
| 61 | func ws_health(rbuf: *u8) -> i64 { return ws_cat(rbuf, 0, "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 2\r\nConnection: close\r\n\r\nok" as *u8) } |
| 65 | func ws_capcap() -> i64 |
| 73 | func ws_page(rbuf: *u8) -> i64 |
| 100 | func ws_write_gen(rbuf: *u8, req: *u8, rn: i64, cfd: i64) -> i64 |
| 200 | func ws_writeget(rbuf: *u8, req: *u8, rn: i64) -> i64 |
| 244 | func ws_fork_nx_write(a1: *u8, a2: *u8, ob: *u8, cap: i64) -> i64 |
| 281 | func ws_modes(rbuf: *u8) -> i64 |
| 289 | func ws_score(rbuf: *u8, req: *u8, rn: i64) -> i64 |
| 316 | func ws_factcheck(rbuf: *u8, req: *u8, rn: i64) -> i64 |
| 354 | func ws_census(rbuf: *u8) -> i64 |
| 381 | func main(argc: i64, argv: *i64) -> i64 |