code wiki / _hdl_build / nx_mgmt_cap_data_candidate_t186.nx
nx_mgmt_cap_data_candidate_t186.nx
buildroot/runtime/_hdl_build/nx_mgmt_cap_data_candidate_t186.nx
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 · 1 importers
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_candidate_t186.nx
imported by: nx_mgmt_cap_candidate_t186.nx
structs
| 23 | struct NxDeployTargetRecord |
| 156 | struct NxRegisteredInstallResult |
| 2795 | struct NxToolchainSessionResult |
consts
| 22 | const MD_TARGET_COLUMNS: i64=8 |
| 193 | const MD_CH_DIGIT_TWO: i64 = 50 |
| 306 | const MD_ADNET_INV: *u8 = "/volume1/homes/elderwesto/nishihost/sites/nishifamily/synth/adnet_inventory.txt" as *u8 |
| 307 | const MD_ADNET_RATES: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/status/adnet_rates.conf" as *u8 |
| 308 | const MD_ADNET_SERVED: *u8 = "/volume1/homes/elderwesto/nishihost/adnet_impressions.log" as *u8 |
| 309 | const MD_ADNET_CLICKS: *u8 = "/volume1/homes/elderwesto/nishihost/adnet_clicks.log" as *u8 |
| 310 | const MD_ADNET_VIEW: *u8 = "/volume1/homes/elderwesto/nishihost/knowledge/status/adnet_viewable.log" as *u8 |
| 317 | const MD_ADNET_SYNTH: *u8 = "/volume1/homes/elderwesto/nishihost/sites/nishifamily/synth/" as *u8 |
| 1024 | const MD_TBL_FIELD: i64 = 124 // '|' -- field separator, and the message's own display separator |
| 1025 | const MD_TBL_ROW: i64 = 59 // ';' -- row terminator |
| 1028 | const MD_RESTART_BUFCAP: i64 = 64 |
| 1031 | const MD_RESTART_SUB_TBL: *u8 = "reader|kickreader;torrent|kicktorrent;torrentgw|kicktorrentgw;docportal|kickdocportal;" |
| 1077 | const 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;" |
| 1768 | const MD_PROV_HIST: *u8 = "knowledge/promote_history.tsv" as *u8 |
| 1769 | const MD_PROV_CAP: i64 = 1048576 |
| 1770 | const MD_PROV_RDCH: i64 = 262144 |
| 1771 | const MD_PROV_FNV_OFF: i64 = 1469598103934665603 |
| 1772 | const MD_PROV_FNV_PRM: i64 = 1099511628211 |
| 1773 | const MD_PROV_TAB: i64 = 9 |
| 1774 | const MD_PROV_NL: i64 = 10 |
| 1978 | const MD_TC_MIN_ELF: i64 = 4096 // size floor: refuse a truncated upload or an HTML error page |
| 1979 | const MD_TC_MODE_EXEC: i64 = 0x1ed // 0755 -- a compiler that is not executable is a dead ecosystem |
| 2031 | const MD_TC_ERR_BACKUP: i64 = 0 - 3 |
| 2595 | const MD_HP_NEVER_UP: i64 = 0 // the port never accepted inside the up budget -> the incoming process never listened -> ROLL BACK |
| 2596 | const MD_HP_VERIFIED: i64 = 1 // REFUSED observed, then ACCEPTED -> the socket demonstrably changed hands |
| 2597 | const MD_HP_UNVERIFIED: i64 = 2 // never observed REFUSED, but the port accepts -> healthy-looking, provenance UNPROVEN |
| 2600 | const MD_PC_UP_TRIES: i64 = 0 |
| 2601 | const MD_PC_UP_TICK_MS: i64 = 1 |
| 2602 | const MD_PC_DOWN_TICK_MS: i64 = 2 |
| 2603 | const MD_PC_SLOTS: i64 = 3 |
functions
| 39 | func md_target_init(out: *NxDeployTargetRecord) -> i64 |
| 44 | func md_target_close(out: *NxDeployTargetRecord) -> i64 |
| 49 | func md_target_space(c: u8) -> i64 called by 1: md_target_decode |
| 52 | func md_target_field(out: *NxDeployTargetRecord,index: i64,value: *u8) -> i64 called by 1: md_target_decode |
| 67 | func md_target_decode(snapshot: *u8,n: i64,name: *u8,name_length: i64,out: *NxDeployTargetRecord) -> i64 called by 1: md_target_read calls 10: md_target_initmd_eolmd_target_spacemd_slice_eqsys_mmapfi_copy+4 |
| 126 | func md_target_read(path: *u8,snapshot_allowance: i64,name: *u8,name_length: i64,out: *NxDeployTargetRecord) -> i64 called by 2: md_install_registeredmd_tc_session_run calls 4: md_target_initsys_mmapmd_target_decodesys_munmap |
| 162 | func md_registered_install_init(out: *NxRegisteredInstallResult) -> i64 called by 3: ma_install_dispatchmd_registered_install_closemd_install_registered calls 1: md_target_init |
| 170 | func md_registered_install_close(out: *NxRegisteredInstallResult) -> i64 |
| 177 | func 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 called by 1: ma_install_dispatch calls 4: md_registered_install_initfi_path_validmd_target_readfi_install_bound |
| 190 | func md_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 212 | func md_rotate_prev(prevp: *u8) -> i64 |
| 225 | func md_cat_slice(d: *u8, o: i64, src: *u8, off: i64, len: i64) -> i64 |
| 231 | func md_tok_eq(src: *u8, off: i64, len: i64, s: *u8) -> i64 |
| 239 | func md_slice_atoi(src: *u8, off: i64, len: i64) -> i64 |
| 251 | func md_eol(snap: *u8, n: i64, start: i64) -> i64 |
| 261 | func md_split(snap: *u8, ls: i64, le: i64, offs: *i64, lens: *i64, maxf: i64) -> i64 |
| 277 | func md_slice_eq(a: *u8, ao: i64, al: i64, b: *u8, bo: i64, bl: i64) -> i64 |
| 284 | func md_copy_slice_z(dst: *u8, src: *u8, off: i64, len: i64, cap: i64) -> i64 |
| 294 | func md_read_file(path: *u8, szbox: *i64) -> *u8 called by 15: ma_emit_services_filema_emit_health_filema_do_buildma_do_unpackma_do_deployma_do_hostctl+9 calls 1: sys_read_file |
| 319 | func md_adnet_creative_store(b: *u8, n: i64, urlout: *u8, urlcap: i64) -> i64 called by 1: ma_do_adnet_creative calls 7: acr_validatesys_mmapacr_namesys_openat_wrsys_writesys_close+1 |
| 341 | func md_adnet_invoice_report(out: *u8, cap: i64) -> i64 |
| 371 | func md_builtin_target(nm: *u8, off: i64, len: i64, kindb: *i64, srcbuf: *u8, subbuf: *u8, urlbuf: *u8, rbbuf: *u8) -> i64 |
| 396 | func md_resolve_target(cfgpath: *u8, nm: *u8, off: i64, len: i64, kindb: *i64, srcbuf: *u8, subbuf: *u8, urlbuf: *u8, rbbuf: *u8) -> i64 |
| 445 | func md_upload_target_ok(nm: *u8, off: i64, len: i64) -> i64 |
| 504 | func md_unpack_resolve(nm: *u8, off: i64, len: i64, packbuf: *u8, destbuf: *u8) -> i64 |
| 520 | func md_exec_treepack(packpath: *u8, destpath: *u8, outpath: *u8) -> i64 |
| 536 | func md_content_ext_ok(nm: *u8, off: i64, len: i64) -> i64 called by 1: md_content_target_ok |
| 597 | func md_content_pfx(nm: *u8, off: i64, len: i64) -> i64 called by 1: md_content_target_ok |
| 707 | func md_content_target_ok(nm: *u8, off: i64, len: i64) -> i64 |
| 757 | func md_cmp_domain_of(src: *u8, off: i64, len: i64, domb: *u8, cap: i64) -> i64 called by 1: md_cmp_upsert |
| 792 | func 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 } |
| 793 | func md_cmp_wn(fd: i64, v: i64) -> i64 |
| 810 | func md_cmp_upsert(line: *u8, ln: i64, domb: *u8, domn: i64, replacedb: *i64) -> i64 |
| 892 | func md_cmp_install(srcp: *u8, tmpp: *u8, prevp: *u8, livep: *u8, firstc: i64) -> i64 called by 2: md_cmp_regenmd_cmp_publish calls 8: sys_mmapmd_read_filesys_openat_wrsys_writesys_closesys_openat_rd+2 |
| 916 | func md_cmp_regen() -> i64 |
| 938 | func md_cmp_dom_ok(src: *u8, off: i64, len: i64, domb: *u8) -> i64 |
| 961 | func 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 } |
| 967 | func md_cmp_publish(domb: *u8, kind: i64) -> i64 |
| 1083 | func md_tbl_row(tbl: *u8, i: i64, barbox: *i64, endbox: *i64) -> i64 |
| 1104 | func md_tbl_row_ok(i: i64, bar: i64, end: i64) -> i64 |
| 1113 | func md_tbl_lookup(tbl: *u8, svc: *u8, off: i64, len: i64, outbuf: *u8, cap: i64) -> i64 called by 2: md_restart_submd_direct_restart_ok calls 5: sys_mmapmd_tbl_rowmd_tbl_row_okmd_slice_eqmd_copy_slice_z |
| 1140 | func md_tbl_names(tbl: *u8, dst: *u8, o: i64) -> i64 |
| 1164 | func md_restart_sub(svc: *u8, off: i64, len: i64, subbuf: *u8) -> i64 calls 1: md_tbl_lookup |
| 1176 | func md_direct_restart_ok(svc: *u8, off: i64, len: i64, namebuf: *u8) -> i64 calls 1: md_tbl_lookup |
| 1180 | func md_catn(d: *u8, o: i64, v: i64) -> i64 called by 1: md_route_append |
| 1193 | func md_route_valid(host: *u8, prefix: *u8, port: i64, mode: *u8) -> i64 |
| 1240 | func md_route_append(confp: *u8, host: *u8, prefix: *u8, port: i64, mode: *u8) -> i64 |
| 1318 | func md_pk_contains(hay: *u8, hn: i64, needle: *u8, nl: i64) -> i64 called by 1: md_kill_by_name |
| 1330 | func md_pk_atoi(s: *u8) -> i64 called by 1: md_kill_by_name |
| 1341 | func md_allow_has_name(nm: *u8) -> i64 |
| 1370 | func md_allow_get_args(nm: *u8, dst: *u8, cap: i64) -> i64 |
| 1423 | func md_allow_update_row(nm: *u8, elfp: *u8, argp: *u8, argn: i64) -> i64 |
| 1482 | func md_streq(a: *u8, b: *u8) -> i64 |
| 1498 | func md_contains(a: *u8, sub: *u8) -> i64 called by 1: md_promote_deny |
| 1542 | func md_organ_kind(nm: *u8) -> i64 |
| 1588 | func mdh_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8) { n=n+1 } return n } |
| 1590 | func mdh_tail_eq(nm: *u8, n: i64, suf: *u8) -> i64 |
| 1598 | func md_tok_at(nm: *u8, w: *u8) -> i64 |
| 1618 | func md_name_is_oracle(nm: *u8) -> i64 |
| 1653 | func md_promote_deny_hard(nm: *u8) -> i64 |
| 1663 | func md_promote_deny(nm: *u8) -> i64 |
| 1695 | func md_staged_elf_ok(nm: *u8) -> i64 |
| 1716 | func md_promote_organ_ok(nm: *u8) -> i64 |
| 1777 | func md_prov_hash(path: *u8) -> i64 |
| 1795 | func md_prov_probe(name: *u8, h: i64, out3: *i64) -> i64 |
| 1836 | func md_prov_record(name: *u8, h: i64) -> i64 |
| 1859 | func md_prov_ok(name: *u8, stagedpath: *u8) -> i64 called by 2: md_promote_staged_exmd_tc_install calls 4: md_prov_hashsys_mmapmd_prov_probemd_prov_record |
| 1883 | func md_exec_offc_refresh(bare: *u8) -> i64 |
| 1891 | func md_promote_staged_ex(name: *u8, allow_loss: i64) -> i64 called by 1: md_promote_staged calls 13: sys_mmapmd_copy_slice_zsys_openat_rdsys_closemd_prov_oksg_conf_load+7 |
| 1954 | func md_promote_staged(name: *u8) -> i64 { return md_promote_staged_ex(name, 0) } calls 1: md_promote_staged_ex |
| 1981 | func md_toolchain_target_ok(nm: *u8) -> i64 |
| 1988 | func md_tc_live(nm: *u8, buf: *u8) -> i64 |
| 1993 | func md_tc_prev(nm: *u8, buf: *u8) -> i64 |
| 1998 | func md_tc_staged(nm: *u8, buf: *u8) -> i64 |
| 2006 | func md_tc_elf_size(p: *u8) -> i64 |
| 2032 | func md_tc_install(nm: *u8) -> i64 |
| 2064 | func md_tc_rollback(nm: *u8) -> i64 |
| 2076 | func 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 |
| 2080 | func md_delayed_kill(pid: i64, delay_ms: i64) -> i64 |
| 2090 | func md_kill_by_name(needle: *u8) -> i64 called by 1: ma_do_proc_kill calls 13: md_lensys_openat_rdsys_mmapsys_getdents64dirent_reclendirent_name+7 |
| 2158 | func md_validate_artifact(path: *u8, kind: i64) -> i64 { return dep_validate(path, kind) } |
| 2161 | func md_exec_hostctl(sub: *u8) -> i64 |
| 2174 | func md_exec_hostctl_capture(sub: *u8, outpath: *u8) -> i64 |
| 2181 | func md_exec_hostctl_capture2(sub: *u8, arg: *u8, outpath: *u8) -> i64 |
| 2214 | func md_exec_build_admit() -> i64 |
| 2239 | func md_exec_gatedry(srcpath: *u8) -> i64 |
| 2273 | func md_exec_magicratchet(nm: *u8) -> i64 |
| 2287 | func md_name_is_gate(nm: *u8) -> i64 called by 1: ma_do_build |
| 2318 | func md_gate_in_baseline(nm: *u8) -> i64 |
| 2350 | func md_organ_deployed(nm: *u8) -> i64 |
| 2382 | func md_exec_deploy_ready(target: *u8) -> i64 |
| 2409 | func md_exec_capmint(allow: *u8, expstr: *u8, noncestr: *u8, outpath: *u8) -> i64 |
| 2435 | func md_lease_run(verb: *u8, name: *u8, owner: *u8, ttl: *u8, nargs: i64, outpath: *u8) -> i64 |
| 2445 | func md_lease_name(target: *u8, buf: *u8) -> i64 called by 1: ma_do_build |
| 2458 | func md_lease_name_pfx(prefix: *u8, src: *u8, buf: *u8) -> i64 |
| 2476 | func md_gate_name_ok(nm: *u8) -> i64 called by 1: ma_do_gate_run |
| 2496 | func md_exec_gate_capture(elfpath: *u8, out: *u8, cap: i64, outlen: *i64, deadline_ms: i64) -> i64 |
| 2512 | func md_str_contains(hay: *u8, pat: *u8) -> i64 |
| 2527 | func md_proc_kill_needle_ok(nm: *u8) -> i64 |
| 2534 | func 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 } |
| 2538 | func md_hostctl_action_ok(nm: *u8) -> i64 |
| 2559 | func md_tcp_alive(port: i64) -> i64 |
| 2616 | func md_probe_conf(out: *i64) -> i64 |
| 2663 | func md_probe_down_tries(cfg: *i64) -> i64 called by 1: md_probe_listen_edge_cfg |
| 2673 | func md_url_is_port(url: *u8) -> i64 called by 1: md_deploy_health |
| 2681 | func md_url_port(url: *u8) -> i64 called by 1: md_deploy_health |
| 2696 | func md_probe_listen_edge_cfg(port: i64, cfg: *i64) -> i64 |
| 2735 | func md_probe_listen_edge(port: i64) -> i64 |
| 2745 | func md_deploy_health(url: *u8) -> i64 |
| 2754 | func md_hp_suffix(code: i64) -> *u8 called by 1: ma_do_deploy |
| 2760 | func md_health_probe(url: *u8) -> i64 called by 1: md_deploy_health calls 6: md_probe_listen_edgesys_mmapdep_run_capturedp_readhh_aftersys_sleep_ms |
| 2809 | func md_tc_session_init(out:*NxToolchainSessionResult)->i64 |
| 2815 | func md_tc_session_close(out:*NxToolchainSessionResult)->i64 |
| 2820 | func 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 |
| 2855 | func md_issue_cap_at(keyfile:*u8,allow:*u8,allen:i64,exp:i64,nonce:i64,out:*u8,capacity:i64)->i64 calls 1: cm_mint_file |