code wiki / _hdl_build / nx_consol_apply_mc.nx
nx_consol_apply_mc.nx
buildroot/runtime/_hdl_build/nx_consol_apply_mc.nx
about
nx_consol_apply_mc.nx -- MULTI-CONSUMER consolidation applier (extends nx_consol_apply past the
zero-importer soundness limit). To retire a shadow of a LIB that N organs import, rebuild EVERY
importer + byte-compare each artifact before/after: CONSOLIDATED only if ALL importers are byte-
identical (the retired copy was dead for all of them), else REFUSE + restore (never-brick). This is
the COMPLETE behaviour-preservation proof for a multi-consumer shadow -- no consumer can silently
change. Importers come from the atlas/funcmine importer histogram (a file, one target per line).
argv: <shadow> <retire> <buildonly-elf> <importers-file>
Artifact convention: buildonly writes /tmp/<importer>.sov.elf (BEFORE saved to /tmp/<importer>.mcbefore).
exit: 0 CONSOLIDATED | 1 REFUSED (restored) | 2 usage/shadow-absent | 3 no buildable importer / move err
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 4 imports · 0 importers
imports: nx_seat_drive_lib.nxnx_seg_store.nxnx_deploy_lib.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 15 | const MC_MAGIC_1048576: i64 = 1048576 |
| 17 | const MC_CAP: i64 = 4194304 |
| 18 | const MC_MAXI: i64 = 512 |
functions
| 20 | func mc_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd >= 0 { sys_close(fd); return 1 } return 0 } |
| 21 | func mc_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 30 | func mc_eq(a: *u8, an: i64, b: *u8, bn: i64) -> i64 { if an != bn { return 0 } var i: i64 = 0; while i < an { if a[i] != b[i] { return 0 } i = i + 1 } return 1 } called by 1: main |
| 32 | func mc_build_snap(buildelf: *u8, tname: *u8, artpath: *u8, snappath: *u8, buf: *u8) -> i64 |
| 44 | func main(argc: i64, argv: *i64) -> i64 |