code wiki / _hdl_build / nx_mgmt_data_toolchain_session_20260910.nx

nx_mgmt_data_toolchain_session_20260910.nx

buildroot/runtime/_hdl_build/nx_mgmt_data_toolchain_session_20260910.nx

155834 B2851 linesdepth 7pulls 21 transitivereach 2 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 9 imports · 1 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_session_20260910.n nx_mgmt_data_toolchain_session nx_mgmt_api_toolchain_session_2026

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_session_20260910.nx

imported by: nx_mgmt_api_toolchain_session_20260910.nx

structs

22struct NxDeployTargetRecord
155struct NxRegisteredInstallResult
2794struct NxToolchainSessionResult

consts

21const MD_TARGET_COLUMNS: i64=8
192const MD_CH_DIGIT_TWO: i64 = 50
305const MD_ADNET_INV: *u8 = "/volume1/homes/elderwesto/nishihost/sites/nishifamily/synth/adnet_inventory.txt" as *u8
306const MD_ADNET_RATES: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/status/adnet_rates.conf" as *u8
307const MD_ADNET_SERVED: *u8 = "/volume1/homes/elderwesto/nishihost/adnet_impressions.log" as *u8
308const MD_ADNET_CLICKS: *u8 = "/volume1/homes/elderwesto/nishihost/adnet_clicks.log" as *u8
309const MD_ADNET_VIEW: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/status/adnet_viewable.log" as *u8
316const MD_ADNET_SYNTH: *u8 = "/volume1/homes/elderwesto/nishihost/sites/nishifamily/synth/" as *u8
1023const MD_TBL_FIELD: i64 = 124 // '|' -- field separator, and the message's own display separator
1024const MD_TBL_ROW: i64 = 59 // ';' -- row terminator
1027const MD_RESTART_BUFCAP: i64 = 64
1030const MD_RESTART_SUB_TBL: *u8 = "reader|kickreader;torrent|kicktorrent;torrentgw|kicktorrentgw;docportal|kickdocportal;"
1076const 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;"
1767const MD_PROV_HIST: *u8 = "knowledge/promote_history.tsv" as *u8
1768const MD_PROV_CAP: i64 = 1048576
1769const MD_PROV_RDCH: i64 = 262144
1770const MD_PROV_FNV_OFF: i64 = 1469598103934665603
1771const MD_PROV_FNV_PRM: i64 = 1099511628211
1772const MD_PROV_TAB: i64 = 9
1773const MD_PROV_NL: i64 = 10
1977const MD_TC_MIN_ELF: i64 = 4096 // size floor: refuse a truncated upload or an HTML error page
1978const MD_TC_MODE_EXEC: i64 = 0x1ed // 0755 -- a compiler that is not executable is a dead ecosystem
2030const MD_TC_ERR_BACKUP: i64 = 0 - 3
2594const MD_HP_NEVER_UP: i64 = 0 // the port never accepted inside the up budget -> the incoming process never listened -> ROLL BACK
2595const MD_HP_VERIFIED: i64 = 1 // REFUSED observed, then ACCEPTED -> the socket demonstrably changed hands
2596const MD_HP_UNVERIFIED: i64 = 2 // never observed REFUSED, but the port accepts -> healthy-looking, provenance UNPROVEN
2599const MD_PC_UP_TRIES: i64 = 0
2600const MD_PC_UP_TICK_MS: i64 = 1
2601const MD_PC_DOWN_TICK_MS: i64 = 2
2602const MD_PC_SLOTS: i64 = 3

functions

38func md_target_init(out: *NxDeployTargetRecord) -> i64
43func md_target_close(out: *NxDeployTargetRecord) -> i64
48func md_target_space(c: u8) -> i64
called by 1: md_target_decode
51func md_target_field(out: *NxDeployTargetRecord,index: i64,value: *u8) -> i64
called by 1: md_target_decode
66func md_target_decode(snapshot: *u8,n: i64,name: *u8,name_length: i64,out: *NxDeployTargetRecord) -> i64
125func md_target_read(path: *u8,snapshot_allowance: i64,name: *u8,name_length: i64,out: *NxDeployTargetRecord) -> i64
161func md_registered_install_init(out: *NxRegisteredInstallResult) -> i64
169func md_registered_install_close(out: *NxRegisteredInstallResult) -> i64
176func 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
189func md_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
211func md_rotate_prev(prevp: *u8) -> i64
224func md_cat_slice(d: *u8, o: i64, src: *u8, off: i64, len: i64) -> i64
230func md_tok_eq(src: *u8, off: i64, len: i64, s: *u8) -> i64
238func md_slice_atoi(src: *u8, off: i64, len: i64) -> i64
250func md_eol(snap: *u8, n: i64, start: i64) -> i64
260func md_split(snap: *u8, ls: i64, le: i64, offs: *i64, lens: *i64, maxf: i64) -> i64
276func md_slice_eq(a: *u8, ao: i64, al: i64, b: *u8, bo: i64, bl: i64) -> i64
283func md_copy_slice_z(dst: *u8, src: *u8, off: i64, len: i64, cap: i64) -> i64
293func md_read_file(path: *u8, szbox: *i64) -> *u8
318func md_adnet_creative_store(b: *u8, n: i64, urlout: *u8, urlcap: i64) -> i64
340func md_adnet_invoice_report(out: *u8, cap: i64) -> i64
370func md_builtin_target(nm: *u8, off: i64, len: i64, kindb: *i64, srcbuf: *u8, subbuf: *u8, urlbuf: *u8, rbbuf: *u8) -> i64
395func md_resolve_target(cfgpath: *u8, nm: *u8, off: i64, len: i64, kindb: *i64, srcbuf: *u8, subbuf: *u8, urlbuf: *u8, rbbuf: *u8) -> i64
444func md_upload_target_ok(nm: *u8, off: i64, len: i64) -> i64
called by 1: ma_do_upload calls 1: md_slice_eq
503func md_unpack_resolve(nm: *u8, off: i64, len: i64, packbuf: *u8, destbuf: *u8) -> i64
519func md_exec_treepack(packpath: *u8, destpath: *u8, outpath: *u8) -> i64
535func md_content_ext_ok(nm: *u8, off: i64, len: i64) -> i64
596func md_content_pfx(nm: *u8, off: i64, len: i64) -> i64
706func md_content_target_ok(nm: *u8, off: i64, len: i64) -> i64
756func md_cmp_domain_of(src: *u8, off: i64, len: i64, domb: *u8, cap: i64) -> i64
called by 1: md_cmp_upsert
791func 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
792func md_cmp_wn(fd: i64, v: i64) -> i64
809func md_cmp_upsert(line: *u8, ln: i64, domb: *u8, domn: i64, replacedb: *i64) -> i64
891func md_cmp_install(srcp: *u8, tmpp: *u8, prevp: *u8, livep: *u8, firstc: i64) -> i64
915func md_cmp_regen() -> i64
937func md_cmp_dom_ok(src: *u8, off: i64, len: i64, domb: *u8) -> i64
960func 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 }
966func md_cmp_publish(domb: *u8, kind: i64) -> i64
1082func md_tbl_row(tbl: *u8, i: i64, barbox: *i64, endbox: *i64) -> i64
1103func md_tbl_row_ok(i: i64, bar: i64, end: i64) -> i64
1112func md_tbl_lookup(tbl: *u8, svc: *u8, off: i64, len: i64, outbuf: *u8, cap: i64) -> i64
1139func md_tbl_names(tbl: *u8, dst: *u8, o: i64) -> i64
1163func md_restart_sub(svc: *u8, off: i64, len: i64, subbuf: *u8) -> i64
calls 1: md_tbl_lookup
1175func md_direct_restart_ok(svc: *u8, off: i64, len: i64, namebuf: *u8) -> i64
calls 1: md_tbl_lookup
1179func md_catn(d: *u8, o: i64, v: i64) -> i64
called by 1: md_route_append
1192func md_route_valid(host: *u8, prefix: *u8, port: i64, mode: *u8) -> i64
1239func md_route_append(confp: *u8, host: *u8, prefix: *u8, port: i64, mode: *u8) -> i64
1317func md_pk_contains(hay: *u8, hn: i64, needle: *u8, nl: i64) -> i64
called by 1: md_kill_by_name
1329func md_pk_atoi(s: *u8) -> i64
called by 1: md_kill_by_name
1340func md_allow_has_name(nm: *u8) -> i64
1369func md_allow_get_args(nm: *u8, dst: *u8, cap: i64) -> i64
1422func md_allow_update_row(nm: *u8, elfp: *u8, argp: *u8, argn: i64) -> i64
1481func md_streq(a: *u8, b: *u8) -> i64
1497func md_contains(a: *u8, sub: *u8) -> i64
called by 1: md_promote_deny
1541func md_organ_kind(nm: *u8) -> i64
1587func mdh_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8) { n=n+1 } return n }
1589func mdh_tail_eq(nm: *u8, n: i64, suf: *u8) -> i64
called by 1: md_name_is_oracle calls 1: mdh_len
1597func md_tok_at(nm: *u8, w: *u8) -> i64
called by 1: md_promote_deny_hard calls 1: mdh_len
1617func md_name_is_oracle(nm: *u8) -> i64
1652func md_promote_deny_hard(nm: *u8) -> i64
1662func md_promote_deny(nm: *u8) -> i64
1694func md_staged_elf_ok(nm: *u8) -> i64
1715func md_promote_organ_ok(nm: *u8) -> i64
1776func md_prov_hash(path: *u8) -> i64
1794func md_prov_probe(name: *u8, h: i64, out3: *i64) -> i64
called by 1: md_prov_ok calls 2: sys_mmapdp_read
1835func md_prov_record(name: *u8, h: i64) -> i64
1858func md_prov_ok(name: *u8, stagedpath: *u8) -> i64
1882func md_exec_offc_refresh(bare: *u8) -> i64
1890func md_promote_staged_ex(name: *u8, allow_loss: i64) -> i64
1953func md_promote_staged(name: *u8) -> i64 { return md_promote_staged_ex(name, 0) }
1980func md_toolchain_target_ok(nm: *u8) -> i64
called by 1: md_tc_session_run calls 1: md_streq
1987func md_tc_live(nm: *u8, buf: *u8) -> i64
1992func md_tc_prev(nm: *u8, buf: *u8) -> i64
1997func md_tc_staged(nm: *u8, buf: *u8) -> i64
called by 1: md_tc_install calls 1: md_cmp_cat
2005func md_tc_elf_size(p: *u8) -> i64
2031func md_tc_install(nm: *u8) -> i64
2063func md_tc_rollback(nm: *u8) -> i64
2075func 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
2079func md_delayed_kill(pid: i64, delay_ms: i64) -> i64
2089func md_kill_by_name(needle: *u8) -> i64
2157func md_validate_artifact(path: *u8, kind: i64) -> i64 { return dep_validate(path, kind) }
called by 1: ma_do_deploy calls 1: dep_validate
2160func md_exec_hostctl(sub: *u8) -> i64
called by 1: ma_do_deploy calls 2: sys_mmapdep_run
2173func md_exec_hostctl_capture(sub: *u8, outpath: *u8) -> i64
2180func md_exec_hostctl_capture2(sub: *u8, arg: *u8, outpath: *u8) -> i64
called by 1: ma_do_build calls 2: sys_mmapdep_run_capture
2213func md_exec_build_admit() -> i64
2238func md_exec_gatedry(srcpath: *u8) -> i64
2272func md_exec_magicratchet(nm: *u8) -> i64
2286func md_name_is_gate(nm: *u8) -> i64
called by 1: ma_do_build
2317func md_gate_in_baseline(nm: *u8) -> i64
called by 1: ma_do_build calls 2: sys_mmapsys_read_file
2349func md_organ_deployed(nm: *u8) -> i64
2381func md_exec_deploy_ready(target: *u8) -> i64
2408func md_exec_capmint(allow: *u8, expstr: *u8, noncestr: *u8, outpath: *u8) -> i64
2434func md_lease_run(verb: *u8, name: *u8, owner: *u8, ttl: *u8, nargs: i64, outpath: *u8) -> i64
2444func md_lease_name(target: *u8, buf: *u8) -> i64
called by 1: ma_do_build
2457func md_lease_name_pfx(prefix: *u8, src: *u8, buf: *u8) -> i64
2475func md_gate_name_ok(nm: *u8) -> i64
called by 1: ma_do_gate_run
2495func md_exec_gate_capture(elfpath: *u8, out: *u8, cap: i64, outlen: *i64, deadline_ms: i64) -> i64
2511func md_str_contains(hay: *u8, pat: *u8) -> i64
called by 1: md_proc_kill_needle_ok calls 1: md_len
2526func md_proc_kill_needle_ok(nm: *u8) -> i64
2533func 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 }
2537func md_hostctl_action_ok(nm: *u8) -> i64
called by 1: ma_do_hostctl calls 1: md_cstr_eq
2558func md_tcp_alive(port: i64) -> i64
2615func md_probe_conf(out: *i64) -> i64
2662func md_probe_down_tries(cfg: *i64) -> i64
2672func md_url_is_port(url: *u8) -> i64
called by 1: md_deploy_health
2680func md_url_port(url: *u8) -> i64
called by 1: md_deploy_health
2695func md_probe_listen_edge_cfg(port: i64, cfg: *i64) -> i64
2734func md_probe_listen_edge(port: i64) -> i64
2744func md_deploy_health(url: *u8) -> i64
2753func md_hp_suffix(code: i64) -> *u8
called by 1: ma_do_deploy
2759func md_health_probe(url: *u8) -> i64
2808func md_tc_session_init(out:*NxToolchainSessionResult)->i64
2814func md_tc_session_close(out:*NxToolchainSessionResult)->i64
2819func 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