nx_container_spec_emit.nx
buildroot/runtime/nx_container_spec_emit.nx
about
nx_container_spec_emit.nx -- R1 of the Nishi Container Host: SPEC-DRIVEN container emit (the sovereign `docker build`).
Reads a ContainerSpec (data: cmdline + out path) and STAMPS it onto the PROVEN governance-binary TEMPLATE
(nx_pe_container_sdserver.exe): .text/.idata = the immutable Job-Object base layer; .data = the per-service cmdline.
= ONE emitter governs ANY service per spec, killing the hand-authored-container-organ-per-service copy-paste (Rule 15).
NEVER-BRICK by construction: refuses a cmdline that would overflow the template .data (Rule 12, bounds at the front door).
GATE: same-cmdline stamp -> byte-identical to template (lossless); diff-cmdline -> only .data changes (.text/.idata
immutable); over-long -> refused. NO fake greens. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_runtime.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
| 10 | const TPL_MAGIC_8192: i64 = 8192 |
| 11 | const TPL_MAGIC_8191: i64 = 8191 |
| 12 | const TPL_MAGIC_2048: i64 = 2048 |
| 13 | const TPL_MAGIC_1024: i64 = 1024 |
| 15 | const TEMPLATE: *u8 = "/mnt/c/Users/elder/elder-ai-platform/services/sdcpp/elder-sdcpp/build-nishi-cuda/bin/nx_pe_container_sdserver.exe" |
| 16 | const SPEC: *u8 = "knowledge/containers/elderai.spec" |
| 17 | const TPL_SIZE: i64 = 0xA00 |
| 18 | const DATA_OFF: i64 = 0x400 |
| 19 | const DATA_CAP: i64 = 0x400 |
| 20 | const SD_CMD: *u8 = "sd-server.exe --diffusion-model C:/Users/elder/elder-ai-platform/models/unified/diffusion/zimage_turbo_nsfw_2602-Q8_0.gguf --llm C:/Users/elder/elder-ai-platform/models/unified/text_encoder/Z-Image_Qwen_3_4b-Q6_K.gguf --vae C:/Users/elder/elder-ai-platform/models/unified/vae/ae.safetensors --listen-port 7861" |
functions
| 22 | func csp_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 23 | func csp_wn(fd: i64, v: i64) -> i64 |
| 36 | func csp_p(s: *u8) -> i64 { return csp_w(1, s) } |
| 37 | func csp_pn(v: i64) -> i64 { return csp_wn(1, v) } |
| 38 | func csp_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 40 | func csp_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 53 | func csp_find(buf: *u8, n: i64, pat: *u8, pl: i64) -> i64 called by 1: csp_get_str |
| 65 | func csp_get_str(buf: *u8, n: i64, key: *u8, out: *u8, outcap: i64) -> i64 |
| 78 | func csp_zero(buf: *u8, off: i64, len: i64) -> i64 { var i: i64 = 0; while i < len { buf[off+i] = 0 as u8; i = i + 1 } return 0 } called by 1: csp_stamp |
| 79 | func csp_put_utf16(buf: *u8, off: i64, s: *u8) -> i64 called by 1: csp_stamp |
| 86 | func csp_cmp(a: *u8, b: *u8, off: i64, len: i64) -> i64 { var i: i64 = 0; while i < len { if a[off+i] != b[off+i] { return 1 } i = i + 1 } return 0 } called by 1: main |
| 87 | func csp_copy(dst: *u8, src: *u8, len: i64) -> i64 { var i: i64 = 0; while i < len { dst[i] = src[i]; i = i + 1 } return 0 } called by 1: main |
| 89 | func csp_stamp(out_buf: *u8, cmd: *u8) -> i64 |
| 97 | func main() -> i64 |