code wiki / (root) / nx_writehub_grow.nx

nx_writehub_grow.nx

buildroot/runtime/nx_writehub_grow.nx

11092 B192 linesdepth 6pulls 9 transitivereach 0 importersview sourcekind tooltopic writehub
docsdependenciesstructsconstsfunctions

about

nx_writehub_grow.nx -- WRITING HUB rung R3: the sovereign SYSTEM-DATA GROWTH organ. Operator 2026-06-30: "integrate with system data and EXPAND it so we can grow clothing etc." Reads a new catalog entry (knowledge/staging/writehub_grow_req.txt, key=value lines) and emits an ADDITIVE svc-content add-request: a NEW <entity>_key + prompt_fragment + zimage_sentence (the writer<->image bridge) + keyword aliases. Stages the exact request to knowledge/staging/writehub_grow_out.json and POSTs it to svc-content:8300 /v2/content/add-<entity> over sovereign HTTP (127.0.0.1, no curl/shell). Additive ONLY (Rule 13: a NEW key, never an overwrite; Rule 25: MORE options, never fewer). Composes nx_http_client (same primitive as nx_writehub_seat = consolidation). HONEST: the live add-outfit endpoint sets only 4 cols (no zimage_sentence) -> the staged .json carries it for the EXTENDED endpoint (API to extend, build-if-missing); the live POST body uses exactly the endpoint's fields so it never 422s. The add-LOCATION endpoint has a base_prompt-vs- prompt_fragment column bug -> grow outfits/poses until it is fixed. license_tier: ORIGINAL module: nishi-core.writehub.grow

dependencies 3 imports · 0 importers

nx_http_client.nx nx_connect.nx nx_gate.nx nx_writehub_grow.nx

imports: nx_http_client.nxnx_connect.nxnx_gate.nx

imported by: nobody (leaf or entry point)

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

main gw sys_write sys_read wg_kv_get wg_kv_match wg_appc wg_appq wg_appc ↻ wg_app wg_appq_esc wg_appc ↻ wg_app_esc wg_appc ↻ wg_strlen wg_app_keywords wg_appc ↻ wg_app_range wg_app ↻ sys_openat_wr nx_http_client_sockaddr_ip sys_socket nx_connect_bounded nx_fcntl sys_connect sys_mmap sys_poll nx_http_client_build_reque nx_dec_emit_u63 wg_drain sys_read ↻ wg_atoi3 gn sys_write ↻ sys_mmap ↻

structs

none

consts

15const K_MAGIC_262144: i64 = 262144
16const K_MAGIC_4096: i64 = 4096
17const K_MAGIC_2048: i64 = 2048
18const K_MAGIC_65536: i64 = 65536
19const K_MAGIC_131072: i64 = 131072
20const K_MAGIC_8300: i64 = 8300
21const K_MAGIC_1048576: i64 = 1048576

functions

23func wg_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
24func wg_atoi3(buf: *u8, off: i64) -> i64 { var v: i64=0; var i: i64=0; while i<3 { let d: i64=buf[off+i] as i64; if d>=48 { if d<=57 { v=v*10+(d-48) } } i=i+1 } return v }
called by 1: main
25func wg_drain(fd: i64, buf: *u8, cap: i64) -> i64 { var off: i64=0; var go: i64=1; while go==1 { if off>=cap { go=0 } else { let r: i64=sys_read(fd, ((buf as i64)+off) as *u8, cap-off); if r<=0 { go=0 } else { off=off+r } } } return off }
called by 1: main calls 1: sys_read
26func wg_app(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: wg_appqmain
27func wg_appc(dst: *u8, off: i64, ch: i64) -> i64 { dst[off]=ch as u8; return off+1 }
28func wg_app_range(dst: *u8, off: i64, src: *u8, a: i64, b: i64) -> i64 { var o: i64=off; var i: i64=a; while i<b { dst[o]=src[i]; o=o+1; i=i+1 } return o }
called by 1: wg_app_keywords
30func wg_app_esc(dst: *u8, off: i64, src: *u8, len: i64) -> i64
called by 1: wg_appq_esc calls 1: wg_appc
43func wg_appq_esc(dst: *u8, off: i64, src: *u8, len: i64) -> i64 { var o: i64=off; o=wg_appc(dst,o,34); o=wg_app_esc(dst,o,src,len); o=wg_appc(dst,o,34); return o }
called by 1: main calls 2: wg_appcwg_app_esc
44func wg_appq(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; o=wg_appc(dst,o,34); o=wg_app(dst,o,s); o=wg_appc(dst,o,34); return o }
called by 1: main calls 2: wg_appcwg_app
47func wg_kv_match(buf: *u8, i: i64, n: i64, key: *u8) -> i64
called by 1: wg_kv_get
55func wg_kv_get(buf: *u8, n: i64, key: *u8, out: *u8, outcap: i64) -> i64
called by 1: main calls 1: wg_kv_match
79func wg_app_keywords(dst: *u8, off: i64, kw: *u8, kwlen: i64) -> i64
called by 1: main calls 2: wg_appcwg_app_range
105func main() -> i64