code wiki / (root) / nx_writer_serve.nx

nx_writer_serve.nx

buildroot/runtime/nx_writer_serve.nx

27439 B432 linesdepth 4pulls 8 transitivereach 0 importersview sourcekind servicetopic writer
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_writehub_score.nx nx_writehub_factlib.nx nx_lane_conf.nx nx_writer_serve.nx

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

main sys_mmap sys_socket sys_setsockopt sys_bind sys_listen sys_write ws_strlen ws_u ws_u ↻ sys_mmap ↻ sys_wait4 sys_accept lc_write_lane lc_geti sys_mmap ↻ lc_read sys_openat_rd sys_read sys_close lc_slen sys_fork sys_close ↻ sys_set_socket_timeout sys_mmap ↻ sys_setsockopt ↻ sys_munmap sys_read ↻ ws_find ws_factcheck ws_body sys_openat_rd ↻ sys_mmap ↻ sys_read ↻ sys_close ↻ fc_parse_manifest fcl_check sys_mmap ↻ fc_extract fc_is_alpha

structs

none

consts

15const K_MAGIC_200000: i64 = 200000
16const K_MAGIC_3000: i64 = 3000
17const K_MAGIC_60000: i64 = 60000
18const K_MAGIC_65536: i64 = 65536
19const K_MAGIC_4096: i64 = 4096
20const K_MAGIC_2097152: i64 = 2097152
21const K_MAGIC_8192: i64 = 8192
22const K_MAGIC_4094: i64 = 4094
23const K_MAGIC_8098: i64 = 8098
24const K_MAGIC_16384: i64 = 16384
25const K_MAGIC_262144: i64 = 262144

functions

27func ws_strlen(s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){i=i+1} return i }
28func 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 }
29func ws_u(dst: *u8, off: i64, v: i64) -> i64
35func 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 }
36func ws_write_all(fd: i64, buf: *u8, n: i64) -> i64
called by 2: ws_write_genmain calls 1: sys_write
41func ws_find(buf: *u8, n: i64, pat: *u8, plen: i64) -> i64
called by 2: ws_censusmain
46func ws_body(buf: *u8, n: i64) -> i64
51func ws_wrap(rbuf: *u8, ctype: *u8, body: *u8, blen: i64) -> i64
60func 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) }
61func 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) }
called by 1: main calls 1: ws_cat
65func ws_capcap() -> i64
73func ws_page(rbuf: *u8) -> i64
100func ws_write_gen(rbuf: *u8, req: *u8, rn: i64, cfd: i64) -> i64
200func ws_writeget(rbuf: *u8, req: *u8, rn: i64) -> i64
244func ws_fork_nx_write(a1: *u8, a2: *u8, ob: *u8, cap: i64) -> i64
281func ws_modes(rbuf: *u8) -> i64
289func ws_score(rbuf: *u8, req: *u8, rn: i64) -> i64
316func ws_factcheck(rbuf: *u8, req: *u8, rn: i64) -> i64
354func ws_census(rbuf: *u8) -> i64
381func main(argc: i64, argv: *i64) -> i64