code wiki / (root) / nx_content_ship.nx

nx_content_ship.nx

buildroot/runtime/nx_content_ship.nx

11043 B221 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic content
docsdependenciesstructsconstsfunctions

about

nx_content_ship.nx -- ONE sovereign command for the whole CONTENT ship loop (operator 2026-07-12: "isn't this the type of thing we can bring into nishi and get up via mcp and api"). Replaces the sh-script choreography (mint.body heredoc + grep/sed token extraction + per-file upload/promote calls + tr -d '\r' + edge check) with a single fork+capture organ over the PROVEN pieces: nx_mgmt_client (sovereign TLS-1.3) + the mgmt API. nx_content_ship <manifest> <capfile> [edge] <manifest> rows: put|<remote-target>|<local-file> upload + atomic promote_content (idempotent) verify|<url-path>|<expect-substr> GET via the edge, gate on substring comment rows start with the hash char; blank lines + CRLF tolerated (no tr -d '\r' dance) <capfile> file holding the nx_session_mint capability token (raw, one line) [edge] default https://nishifamily.com Step 0 SELF-MINTS a fresh 24h admin session over HTTPS (tools/call nx_session_mint, cap IN THE BODY -- the dummy session header is ignored by the tools daemon), so there is no pre-step and no stale token. Deploy of BINARIES/services is deliberately NOT here (that is /api/deploy, never-brick) -- this organ moves site CONTENT through the fail-closed content namespace (md_content_pfx allowlist enforced server-side).

dependencies 1 imports · 0 importers

nx_tool_run.nx nx_content_ship.nx

imports: nx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main cs_puts cs_slen cs_app cs_write_file sys_openat_wr cs_run tr_run_capture sys_mmap sys_pipe2 sys_fork sys_close sys_dup3 sys_execve_clean sys_close ↻ sys_execve sys_exit sys_read sys_wait4 wait_exit_code cs_slen ↻ cs_read_file sys_read ↻ cs_eq cs_contains cs_slen ↻ sys_sleep_ms sys_mmap ↻ sys_munmap

structs

none

consts

16const K_MAGIC_2000: i64 = 2000
17const K_MAGIC_1048576: i64 = 1048576
18const K_MAGIC_262144: i64 = 262144
19const K_MAGIC_4096: i64 = 4096
20const K_MAGIC_65536: i64 = 65536
21const K_MAGIC_4000: i64 = 4000

functions

23func cs_slen(s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { i = i + 1 } return i }
24func cs_puts(s: *u8) -> i64 { sys_write(1, s, cs_slen(s)); return 0 }
called by 1: main calls 1: cs_slen
27func cs_eq(a: *u8, b: *u8) -> i64
called by 1: main
34func cs_contains(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: cs_slen
48func cs_app(dst: *u8, off: i64, src: *u8) -> i64
called by 1: main
56func cs_write_file(path: *u8, content: *u8, n: i64) -> i64
called by 1: main calls 1: sys_openat_wr
65func cs_read_file(path: *u8, buf: *u8, bcap: i64) -> i64
called by 1: main calls 1: sys_read
79func cs_run(path: *u8, av: *i64, out: *u8, cap: i64, olen: *i64) -> i64
called by 1: main calls 1: tr_run_capture
84func main(argc: i64, argv: *i64) -> i64