code wiki / _hdl_build / nx_mgmt_data.nx

nx_mgmt_data.nx

buildroot/runtime/_hdl_build/nx_mgmt_data.nx

114172 B2142 linesdepth 5pulls 14 transitivereach 10 importersview sourcekind librarytopic mgmt
docsdependenciesstructsconstsfunctions

about

nx_mgmt_data.nx -- the DATA / ADAPTER layer of the management plane (the OUTER ring; secondary adapters). The ONLY layer that touches the outside world for STATE: it parses snapshot bytes, reads the data-driven config allowlists, and drives the secondary adapters (the hostctl exec + the real-HTTP health probe). It has NO knowledge of transport (no HTTP/socket/auth); the IO ring depends on IT, never the reverse (ports & adapters / dependency inversion). Grounded in knowledge/library/arch_* (three-tier DATA tier, hexagonal secondary adapters, loose coupling). Reuses the SOTA-gated nx_deploy_lib (validate/exec) + nx_http_health_lib (probe) -- DRY. license_tier: ORIGINAL

dependencies 7 imports · 3 importers

nx_syscalls.nx nx_connect.nx nx_adnet_invoice.nx nx_adnet_creative.nx nx_deploy_lib.nx nx_http_health_lib.nx nx_tool_run.nx nx_mgmt_data.nx nx_mgmt_api.nx nx_promote_deny_gate.nx nx_route_ctl_gate.nx

imports: nx_syscalls.nxnx_connect.nxnx_adnet_invoice.nxnx_adnet_creative.nxnx_deploy_lib.nxnx_http_health_lib.nxnx_tool_run.nx

imported by: nx_mgmt_api.nxnx_promote_deny_gate.nxnx_route_ctl_gate.nx

structs

none

consts

100const MD_ADNET_INV: *u8 = "/volume1/homes/elderwesto/nishihost/sites/nishifamily/synth/adnet_inventory.txt" as *u8
101const MD_ADNET_RATES: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/status/adnet_rates.conf" as *u8
102const MD_ADNET_SERVED: *u8 = "/volume1/homes/elderwesto/nishihost/adnet_impressions.log" as *u8
103const MD_ADNET_CLICKS: *u8 = "/volume1/homes/elderwesto/nishihost/adnet_clicks.log" as *u8
104const MD_ADNET_VIEW: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/status/adnet_viewable.log" as *u8
111const MD_ADNET_SYNTH: *u8 = "/volume1/homes/elderwesto/nishihost/sites/nishifamily/synth/" as *u8
1428const MD_PROV_HIST: *u8 = "knowledge/promote_history.tsv" as *u8
1429const MD_PROV_CAP: i64 = 1048576
1430const MD_PROV_RDCH: i64 = 262144
1431const MD_PROV_FNV_OFF: i64 = 1469598103934665603
1432const MD_PROV_FNV_PRM: i64 = 1099511628211
1433const MD_PROV_TAB: i64 = 9
1434const MD_PROV_NL: i64 = 10
1585const MD_TC_MIN_ELF: i64 = 4096 // size floor: refuse a truncated upload or an HTML error page
1586const MD_TC_MODE_EXEC: i64 = 0x1ed // 0755 -- a compiler that is not executable is a dead ecosystem

functions

17func md_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
19func md_cat_slice(d: *u8, o: i64, src: *u8, off: i64, len: i64) -> i64
25func md_tok_eq(src: *u8, off: i64, len: i64, s: *u8) -> i64
33func md_slice_atoi(src: *u8, off: i64, len: i64) -> i64
45func md_eol(snap: *u8, n: i64, start: i64) -> i64
55func md_split(snap: *u8, ls: i64, le: i64, offs: *i64, lens: *i64, maxf: i64) -> i64
71func md_slice_eq(a: *u8, ao: i64, al: i64, b: *u8, bo: i64, bl: i64) -> i64
78func md_copy_slice_z(dst: *u8, src: *u8, off: i64, len: i64, cap: i64) -> i64
88func md_read_file(path: *u8, szbox: *i64) -> *u8
113func md_adnet_creative_store(b: *u8, n: i64, urlout: *u8, urlcap: i64) -> i64
135func md_adnet_invoice_report(out: *u8, cap: i64) -> i64
165func md_builtin_target(nm: *u8, off: i64, len: i64, kindb: *i64, srcbuf: *u8, subbuf: *u8, urlbuf: *u8, rbbuf: *u8) -> i64
190func md_resolve_target(cfgpath: *u8, nm: *u8, off: i64, len: i64, kindb: *i64, srcbuf: *u8, subbuf: *u8, urlbuf: *u8, rbbuf: *u8) -> i64
237func md_upload_target_ok(nm: *u8, off: i64, len: i64) -> i64
called by 1: ma_do_upload calls 1: md_slice_eq
296func md_unpack_resolve(nm: *u8, off: i64, len: i64, packbuf: *u8, destbuf: *u8) -> i64
312func md_exec_treepack(packpath: *u8, destpath: *u8, outpath: *u8) -> i64
328func md_content_ext_ok(nm: *u8, off: i64, len: i64) -> i64
389func md_content_pfx(nm: *u8, off: i64, len: i64) -> i64
499func md_content_target_ok(nm: *u8, off: i64, len: i64) -> i64
549func md_cmp_domain_of(src: *u8, off: i64, len: i64, domb: *u8, cap: i64) -> i64
584func md_cmp_ws(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 }
called by 2: md_cmp_wnmd_cmp_upsert calls 1: sys_write
585func md_cmp_wn(fd: i64, v: i64) -> i64
602func md_cmp_upsert(line: *u8, ln: i64, domb: *u8, domn: i64, replacedb: *i64) -> i64
684func md_cmp_install(srcp: *u8, tmpp: *u8, prevp: *u8, livep: *u8, firstc: i64) -> i64
708func md_cmp_regen() -> i64
730func md_cmp_dom_ok(src: *u8, off: i64, len: i64, domb: *u8) -> i64
called by 1: ma_do_cmp_publish
753func md_cmp_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o + i] = s[i]; i = i + 1 } d[o + i] = 0 as u8; return o + i }
759func md_cmp_publish(domb: *u8, kind: i64) -> i64
797func md_restart_sub(svc: *u8, off: i64, len: i64, subbuf: *u8) -> i64
807func md_direct_restart_ok(svc: *u8, off: i64, len: i64, namebuf: *u8) -> i64
840func md_catn(d: *u8, o: i64, v: i64) -> i64
853func md_route_valid(host: *u8, prefix: *u8, port: i64, mode: *u8) -> i64
called by 2: ma_do_routemain calls 2: md_lenmd_cstr_eq
900func md_route_append(confp: *u8, host: *u8, prefix: *u8, port: i64, mode: *u8) -> i64
978func md_pk_contains(hay: *u8, hn: i64, needle: *u8, nl: i64) -> i64
990func md_pk_atoi(s: *u8) -> i64
called by 1: md_kill_by_name
1001func md_allow_has_name(nm: *u8) -> i64
1030func md_allow_get_args(nm: *u8, dst: *u8, cap: i64) -> i64
1083func md_allow_update_row(nm: *u8, elfp: *u8, argp: *u8, argn: i64) -> i64
1142func md_streq(a: *u8, b: *u8) -> i64
1158func md_contains(a: *u8, sub: *u8) -> i64
called by 2: mainmd_promote_deny
1202func md_organ_kind(nm: *u8) -> i64
1248func mdh_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8) { n=n+1 } return n }
1250func mdh_tail_eq(nm: *u8, n: i64, suf: *u8) -> i64
called by 1: md_name_is_oracle calls 1: mdh_len
1258func md_tok_at(nm: *u8, w: *u8) -> i64
called by 1: md_promote_deny_hard calls 1: mdh_len
1278func md_name_is_oracle(nm: *u8) -> i64
1313func md_promote_deny_hard(nm: *u8) -> i64
1323func md_promote_deny(nm: *u8) -> i64
1355func md_staged_elf_ok(nm: *u8) -> i64
1376func md_promote_organ_ok(nm: *u8) -> i64
1437func md_prov_hash(path: *u8) -> i64
1455func md_prov_probe(name: *u8, h: i64, out3: *i64) -> i64
called by 1: md_prov_ok calls 2: sys_mmapdp_read
1496func md_prov_record(name: *u8, h: i64) -> i64
1519func md_prov_ok(name: *u8, stagedpath: *u8) -> i64
1531func md_promote_staged(name: *u8) -> i64
1588func md_toolchain_target_ok(nm: *u8) -> i64
called by 1: ma_do_promote_toolchain calls 1: md_streq
1595func md_tc_live(nm: *u8, buf: *u8) -> i64
1600func md_tc_prev(nm: *u8, buf: *u8) -> i64
1605func md_tc_staged(nm: *u8, buf: *u8) -> i64
called by 1: md_tc_install calls 1: md_cmp_cat
1613func md_tc_elf_size(p: *u8) -> i64
1638func md_tc_install(nm: *u8) -> i64
1662func md_tc_rollback(nm: *u8) -> i64
1674func md_self_pid() -> i64 { return __syscall(172, 0, 0, 0, 0, 0, 0) } // rv64 getpid=172. Was raw x86 39, which IS an RV64 KEY (umount2) the backend translated to ioctl(16) -> -ENOTTY, so the mgmt API's own pid was -25 (debt idx 2277)
called by 1: md_kill_by_name
1678func md_delayed_kill(pid: i64, delay_ms: i64) -> i64
1688func md_kill_by_name(needle: *u8) -> i64
1756func md_validate_artifact(path: *u8, kind: i64) -> i64 { return dep_validate(path, kind) }
called by 1: ma_do_deploy calls 1: dep_validate
1759func md_exec_hostctl(sub: *u8) -> i64
1772func md_exec_hostctl_capture(sub: *u8, outpath: *u8) -> i64
1779func md_exec_hostctl_capture2(sub: *u8, arg: *u8, outpath: *u8) -> i64
1807func md_exec_build_admit() -> i64
1834func md_exec_gatedry(srcpath: *u8) -> i64
1847func md_name_is_gate(nm: *u8) -> i64
called by 1: ma_do_build
1878func md_gate_in_baseline(nm: *u8) -> i64
called by 1: ma_do_build calls 2: sys_mmapsys_read_file
1910func md_organ_deployed(nm: *u8) -> i64
1942func md_exec_deploy_ready() -> i64
1959func md_exec_capmint(allow: *u8, expstr: *u8, noncestr: *u8, outpath: *u8) -> i64
1985func md_lease_run(verb: *u8, name: *u8, owner: *u8, ttl: *u8, nargs: i64, outpath: *u8) -> i64
1995func md_lease_name(target: *u8, buf: *u8) -> i64
called by 1: ma_do_build
2008func md_lease_name_pfx(prefix: *u8, src: *u8, buf: *u8) -> i64
2026func md_gate_name_ok(nm: *u8) -> i64
called by 1: ma_do_gate_run
2046func md_exec_gate_capture(elfpath: *u8, out: *u8, cap: i64, outlen: *i64, deadline_ms: i64) -> i64
2052func md_exec_gate_capture_OLD(elfpath: *u8, outpath: *u8, deadline_ms: i64) -> i64
2058func md_str_contains(hay: *u8, pat: *u8) -> i64
called by 1: md_proc_kill_needle_ok calls 1: md_len
2073func md_proc_kill_needle_ok(nm: *u8) -> i64
2080func md_cstr_eq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8) { if a[i]!=b[i] { return 0 } i=i+1 } if b[i]!=(0 as u8) { return 0 } return 1 }
2084func md_hostctl_action_ok(nm: *u8) -> i64
called by 1: ma_do_hostctl calls 1: md_cstr_eq
2105func md_tcp_alive(port: i64) -> i64
2115func md_health_probe(url: *u8) -> i64