nx_writehub_grow.nx
buildroot/runtime/nx_writehub_grow.nx
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
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
structs
| none |
consts
| 15 | const K_MAGIC_262144: i64 = 262144 |
| 16 | const K_MAGIC_4096: i64 = 4096 |
| 17 | const K_MAGIC_2048: i64 = 2048 |
| 18 | const K_MAGIC_65536: i64 = 65536 |
| 19 | const K_MAGIC_131072: i64 = 131072 |
| 20 | const K_MAGIC_8300: i64 = 8300 |
| 21 | const K_MAGIC_1048576: i64 = 1048576 |
functions
| 23 | func wg_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 24 | func 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 |
| 25 | func 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 } |
| 26 | func 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 } |
| 27 | func wg_appc(dst: *u8, off: i64, ch: i64) -> i64 { dst[off]=ch as u8; return off+1 } |
| 28 | func 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 |
| 30 | func wg_app_esc(dst: *u8, off: i64, src: *u8, len: i64) -> i64 |
| 43 | func 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 } |
| 44 | func 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 } |
| 47 | func wg_kv_match(buf: *u8, i: i64, n: i64, key: *u8) -> i64 called by 1: wg_kv_get |
| 55 | func wg_kv_get(buf: *u8, n: i64, key: *u8, out: *u8, outcap: i64) -> i64 |
| 79 | func wg_app_keywords(dst: *u8, off: i64, kw: *u8, kwlen: i64) -> i64 |
| 105 | func main() -> i64 |