code wiki / _hdl_build / nx_mgmt_data.nx

nx_mgmt_data.nx

buildroot/runtime/_hdl_build/nx_mgmt_data.nx

156437 B2860 linesdepth 9pulls 27 transitivereach 26 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 10 imports · 9 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_staging_guard.nx nx_file_install.nx nx_cap_mint.nx nx_mgmt_data.nx nx_deploy_listen_gate.nx nx_fio_region_gate.nx nx_mgmt_api.nx nx_mgmt_api.pre-toolchain-20260910 nx_mgmt_api_search_candidate_t330. nx_promote_deny_gate.nx nx_restart_routes_gate.nx nx_route_ctl_gate.nx nx_undopath_gate.nx

imports: nx_syscalls.nxnx_connect.nxnx_adnet_invoice.nxnx_adnet_creative.nxnx_deploy_lib.nxnx_http_health_lib.nxnx_tool_run.nxnx_staging_guard.nxnx_file_install.nxnx_cap_mint.nx

imported by: nx_deploy_listen_gate.nxnx_fio_region_gate.nxnx_mgmt_api.nxnx_mgmt_api.pre-toolchain-20260910.nxnx_mgmt_api_search_candidate_t330.nxnx_promote_deny_gate.nxnx_restart_routes_gate.nxnx_route_ctl_gate.nxnx_undopath_gate.nx

structs

23struct NxDeployTargetRecord
156struct NxRegisteredInstallResult
2799struct NxToolchainSessionResult

consts

22const MD_TARGET_COLUMNS: i64=8
193const MD_CH_DIGIT_TWO: i64 = 50
306const MD_ADNET_INV: *u8 = "/volume1/homes/elderwesto/nishihost/sites/nishifamily/synth/adnet_inventory.txt" as *u8
307const MD_ADNET_RATES: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/status/adnet_rates.conf" as *u8
308const MD_ADNET_SERVED: *u8 = "/volume1/homes/elderwesto/nishihost/adnet_impressions.log" as *u8
309const MD_ADNET_CLICKS: *u8 = "/volume1/homes/elderwesto/nishihost/adnet_clicks.log" as *u8
310const MD_ADNET_VIEW: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/status/adnet_viewable.log" as *u8
317const MD_ADNET_SYNTH: *u8 = "/volume1/homes/elderwesto/nishihost/sites/nishifamily/synth/" as *u8
1024const MD_TBL_FIELD: i64 = 124 // '|' -- field separator, and the message's own display separator
1025const MD_TBL_ROW: i64 = 59 // ';' -- row terminator
1028const MD_RESTART_BUFCAP: i64 = 64
1031const MD_RESTART_SUB_TBL: *u8 = "reader|kickreader;torrent|kicktorrent;torrentgw|kicktorrentgw;docportal|kickdocportal;"
1077const MD_RESTART_DIRECT_TBL: *u8 = "siteedit|nx_siteedit_daemon.elf;sites|sites.elf;survey|nx_survey_daemon.elf;office|nx_office_daemon.elf;officejs|office_app.js;toolsapi|nx_tools_api_serve.elf;seed|nx_torrent_seed.elf;clock|nx_clock_tickless.elf;wiki|nx_wiki_gw.elf;email|nx_email_portal_daemon.elf;"
1768const MD_PROV_HIST: *u8 = "knowledge/promote_history.tsv" as *u8
1769const MD_PROV_CAP: i64 = 1048576
1770const MD_PROV_RDCH: i64 = 262144
1771const MD_PROV_FNV_OFF: i64 = 1469598103934665603
1772const MD_PROV_FNV_PRM: i64 = 1099511628211
1773const MD_PROV_TAB: i64 = 9
1774const MD_PROV_NL: i64 = 10
1982const MD_TC_MIN_ELF: i64 = 4096 // size floor: refuse a truncated upload or an HTML error page
1983const MD_TC_MODE_EXEC: i64 = 0x1ed // 0755 -- a compiler that is not executable is a dead ecosystem
2035const MD_TC_ERR_BACKUP: i64 = 0 - 3
2599const MD_HP_NEVER_UP: i64 = 0 // the port never accepted inside the up budget -> the incoming process never listened -> ROLL BACK
2600const MD_HP_VERIFIED: i64 = 1 // REFUSED observed, then ACCEPTED -> the socket demonstrably changed hands
2601const MD_HP_UNVERIFIED: i64 = 2 // never observed REFUSED, but the port accepts -> healthy-looking, provenance UNPROVEN
2604const MD_PC_UP_TRIES: i64 = 0
2605const MD_PC_UP_TICK_MS: i64 = 1
2606const MD_PC_DOWN_TICK_MS: i64 = 2
2607const MD_PC_SLOTS: i64 = 3

functions

39func md_target_init(out: *NxDeployTargetRecord) -> i64
44func md_target_close(out: *NxDeployTargetRecord) -> i64
49func md_target_space(c: u8) -> i64
called by 1: md_target_decode
52func md_target_field(out: *NxDeployTargetRecord,index: i64,value: *u8) -> i64
called by 1: md_target_decode
67func md_target_decode(snapshot: *u8,n: i64,name: *u8,name_length: i64,out: *NxDeployTargetRecord) -> i64
126func md_target_read(path: *u8,snapshot_allowance: i64,name: *u8,name_length: i64,out: *NxDeployTargetRecord) -> i64
162func md_registered_install_init(out: *NxRegisteredInstallResult) -> i64
170func md_registered_install_close(out: *NxRegisteredInstallResult) -> i64
177func md_install_registered(registry: *u8,snapshot_allowance: i64,target: *u8,target_length: i64,intent: *u8,intent_allowance: i64,approved_intent_digest: *u8,scratch: *u8,scratch_bytes: i64,out: *NxRegisteredInstallResult) -> i64
190func md_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
212func md_rotate_prev(prevp: *u8) -> i64
225func md_cat_slice(d: *u8, o: i64, src: *u8, off: i64, len: i64) -> i64
231func md_tok_eq(src: *u8, off: i64, len: i64, s: *u8) -> i64
239func md_slice_atoi(src: *u8, off: i64, len: i64) -> i64
251func md_eol(snap: *u8, n: i64, start: i64) -> i64
261func md_split(snap: *u8, ls: i64, le: i64, offs: *i64, lens: *i64, maxf: i64) -> i64
277func md_slice_eq(a: *u8, ao: i64, al: i64, b: *u8, bo: i64, bl: i64) -> i64
284func md_copy_slice_z(dst: *u8, src: *u8, off: i64, len: i64, cap: i64) -> i64
294func md_read_file(path: *u8, szbox: *i64) -> *u8
319func md_adnet_creative_store(b: *u8, n: i64, urlout: *u8, urlcap: i64) -> i64
341func md_adnet_invoice_report(out: *u8, cap: i64) -> i64
371func md_builtin_target(nm: *u8, off: i64, len: i64, kindb: *i64, srcbuf: *u8, subbuf: *u8, urlbuf: *u8, rbbuf: *u8) -> i64
396func md_resolve_target(cfgpath: *u8, nm: *u8, off: i64, len: i64, kindb: *i64, srcbuf: *u8, subbuf: *u8, urlbuf: *u8, rbbuf: *u8) -> i64
445func md_upload_target_ok(nm: *u8, off: i64, len: i64) -> i64
504func md_unpack_resolve(nm: *u8, off: i64, len: i64, packbuf: *u8, destbuf: *u8) -> i64
520func md_exec_treepack(packpath: *u8, destpath: *u8, outpath: *u8) -> i64
536func md_content_ext_ok(nm: *u8, off: i64, len: i64) -> i64
597func md_content_pfx(nm: *u8, off: i64, len: i64) -> i64
707func md_content_target_ok(nm: *u8, off: i64, len: i64) -> i64
757func md_cmp_domain_of(src: *u8, off: i64, len: i64, domb: *u8, cap: i64) -> i64
called by 1: md_cmp_upsert
792func 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
793func md_cmp_wn(fd: i64, v: i64) -> i64
810func md_cmp_upsert(line: *u8, ln: i64, domb: *u8, domn: i64, replacedb: *i64) -> i64
892func md_cmp_install(srcp: *u8, tmpp: *u8, prevp: *u8, livep: *u8, firstc: i64) -> i64
916func md_cmp_regen() -> i64
938func md_cmp_dom_ok(src: *u8, off: i64, len: i64, domb: *u8) -> i64
961func 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 }
967func md_cmp_publish(domb: *u8, kind: i64) -> i64
1083func md_tbl_row(tbl: *u8, i: i64, barbox: *i64, endbox: *i64) -> i64
1104func md_tbl_row_ok(i: i64, bar: i64, end: i64) -> i64
1113func md_tbl_lookup(tbl: *u8, svc: *u8, off: i64, len: i64, outbuf: *u8, cap: i64) -> i64
1140func md_tbl_names(tbl: *u8, dst: *u8, o: i64) -> i64
1164func md_restart_sub(svc: *u8, off: i64, len: i64, subbuf: *u8) -> i64
1176func md_direct_restart_ok(svc: *u8, off: i64, len: i64, namebuf: *u8) -> i64
1180func md_catn(d: *u8, o: i64, v: i64) -> i64
1193func md_route_valid(host: *u8, prefix: *u8, port: i64, mode: *u8) -> i64
called by 1: main calls 2: md_lenmd_cstr_eq
1240func md_route_append(confp: *u8, host: *u8, prefix: *u8, port: i64, mode: *u8) -> i64
1318func md_pk_contains(hay: *u8, hn: i64, needle: *u8, nl: i64) -> i64
1330func md_pk_atoi(s: *u8) -> i64
called by 1: md_kill_by_name
1341func md_allow_has_name(nm: *u8) -> i64
1370func md_allow_get_args(nm: *u8, dst: *u8, cap: i64) -> i64
1423func md_allow_update_row(nm: *u8, elfp: *u8, argp: *u8, argn: i64) -> i64
1482func md_streq(a: *u8, b: *u8) -> i64
1498func md_contains(a: *u8, sub: *u8) -> i64
called by 1: md_promote_deny
1542func md_organ_kind(nm: *u8) -> i64
1588func mdh_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8) { n=n+1 } return n }
1590func mdh_tail_eq(nm: *u8, n: i64, suf: *u8) -> i64
called by 1: md_name_is_oracle calls 1: mdh_len
1598func md_tok_at(nm: *u8, w: *u8) -> i64
called by 1: md_promote_deny_hard calls 1: mdh_len
1618func md_name_is_oracle(nm: *u8) -> i64
1653func md_promote_deny_hard(nm: *u8) -> i64
1663func md_promote_deny(nm: *u8) -> i64
1695func md_staged_elf_ok(nm: *u8) -> i64
1716func md_promote_organ_ok(nm: *u8) -> i64
1777func md_prov_hash(path: *u8) -> i64
1795func md_prov_probe(name: *u8, h: i64, out3: *i64) -> i64
called by 1: md_prov_ok calls 2: sys_mmapdp_read
1836func md_prov_record(name: *u8, h: i64) -> i64
1859func md_prov_ok(name: *u8, stagedpath: *u8) -> i64
1883func md_exec_offc_refresh(bare: *u8) -> i64
1891func md_promote_staged_ex(name: *u8, allow_loss: i64) -> i64
1958func md_promote_staged(name: *u8) -> i64 { return md_promote_staged_ex(name, 0) }
1985func md_toolchain_target_ok(nm: *u8) -> i64
called by 1: md_tc_session_run calls 1: md_streq
1992func md_tc_live(nm: *u8, buf: *u8) -> i64
1997func md_tc_prev(nm: *u8, buf: *u8) -> i64
2002func md_tc_staged(nm: *u8, buf: *u8) -> i64
called by 1: md_tc_install calls 1: md_cmp_cat
2010func md_tc_elf_size(p: *u8) -> i64
2036func md_tc_install(nm: *u8) -> i64
2068func md_tc_rollback(nm: *u8) -> i64
2080func 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
2084func md_delayed_kill(pid: i64, delay_ms: i64) -> i64
2094func md_kill_by_name(needle: *u8) -> i64
2162func md_validate_artifact(path: *u8, kind: i64) -> i64 { return dep_validate(path, kind) }
2165func md_exec_hostctl(sub: *u8) -> i64
2178func md_exec_hostctl_capture(sub: *u8, outpath: *u8) -> i64
2185func md_exec_hostctl_capture2(sub: *u8, arg: *u8, outpath: *u8) -> i64
2218func md_exec_build_admit() -> i64
2243func md_exec_gatedry(srcpath: *u8) -> i64
2277func md_exec_magicratchet(nm: *u8) -> i64
2291func md_name_is_gate(nm: *u8) -> i64
2322func md_gate_in_baseline(nm: *u8) -> i64
2354func md_organ_deployed(nm: *u8) -> i64
2386func md_exec_deploy_ready(target: *u8) -> i64
2413func md_exec_capmint(allow: *u8, expstr: *u8, noncestr: *u8, outpath: *u8) -> i64
2439func md_lease_run(verb: *u8, name: *u8, owner: *u8, ttl: *u8, nargs: i64, outpath: *u8) -> i64
2449func md_lease_name(target: *u8, buf: *u8) -> i64
2462func md_lease_name_pfx(prefix: *u8, src: *u8, buf: *u8) -> i64
2480func md_gate_name_ok(nm: *u8) -> i64
2500func md_exec_gate_capture(elfpath: *u8, out: *u8, cap: i64, outlen: *i64, deadline_ms: i64) -> i64
2516func md_str_contains(hay: *u8, pat: *u8) -> i64
called by 1: md_proc_kill_needle_ok calls 1: md_len
2531func md_proc_kill_needle_ok(nm: *u8) -> i64
2538func 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 }
2542func md_hostctl_action_ok(nm: *u8) -> i64
2563func md_tcp_alive(port: i64) -> i64
2620func md_probe_conf(out: *i64) -> i64
2667func md_probe_down_tries(cfg: *i64) -> i64
2677func md_url_is_port(url: *u8) -> i64
2685func md_url_port(url: *u8) -> i64
2700func md_probe_listen_edge_cfg(port: i64, cfg: *i64) -> i64
2739func md_probe_listen_edge(port: i64) -> i64
2749func md_deploy_health(url: *u8) -> i64
2758func md_hp_suffix(code: i64) -> *u8
2764func md_health_probe(url: *u8) -> i64
2813func md_tc_session_init(out:*NxToolchainSessionResult)->i64
2819func md_tc_session_close(out:*NxToolchainSessionResult)->i64
2824func md_tc_session_run(registry:*u8,snapshot_budget:i64,target:*u8,forward:*u8,forward_hash:*u8,reverse:*u8,reverse_hash:*u8,intent_budget:i64,canary:*u8,args:*i64,deadline_ms:i64,scratch:*u8,scratch_bytes:i64,capture:*u8,capture_bytes:i64,out:*NxToolchainSessionResult)->i64
2858func md_issue_cap_at(keyfile:*u8,allow:*u8,allen:i64,exp:i64,nonce:i64,out:*u8,capacity:i64)->i64
calls 1: cm_mint_file