code wiki / _hdl_build / nx_consol_apply.nx

nx_consol_apply.nx

buildroot/runtime/_hdl_build/nx_consol_apply.nx

4767 B99 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tooltopic consol
docsdependenciesstructsconstsfunctions

about

nx_consol_apply.nx -- GATED CONSOLIDATION APPLIER (2026-07-20, closes the atlas-consolidation loop: detect[nx_consolidate] -> classify[reachability] -> APPLY[here], behaviour-preserving BY CONSTRUCTION). The never-brick proof for retiring a dup shadow: build the affected target (BEFORE), retire the shadow, rebuild (AFTER). If AFTER == BEFORE byte-for-byte, the shadow was NEVER in the build -> retiring it is PROVEN behaviour-neutral -> CONSOLIDATED. If it differs (or the build changes/breaks), the shadow WAS live -> RESTORE it and REFUSE. Retire = MOVE (rule 13 additive: the shadow is relocated, never deleted; rollback = move it back). No source is edited; a seat/PM points this at one proposal from the consolq- plane. argv: <shadow-path> <retire-path> <buildelf> <buildarg> <artifact-path> exit: 0 CONSOLIDATED | 1 REFUSED-live-shadow (restored) | 2 usage/shadow-absent | 3 build/move error (restored) license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 4 imports · 0 importers

nx_seat_drive_lib.nx nx_seg_store.nx nx_deploy_lib.nx nx_syscalls.nx nx_consol_apply.nx

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

main sd_w sys_write sys_exit ca_exists sys_openat_rd sys_close sys_mmap dep_run_capture sys_fork sys_openat_wr sys_dup3 sys_mmap ↻ sys_execve_clean sys_close ↻ sys_execve sys_exit ↻ sys_wait4 ca_read sys_openat_rd ↻ sys_read sys_close ↻ sys_renameat ca_eq sd_num sys_mmap ↻

structs

none

consts

16const CA_CAP: i64 = 2097152

functions

18func ca_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
27func ca_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd >= 0 { sys_close(fd); return 1 } return 0 }
called by 1: main calls 2: sys_openat_rdsys_close
28func ca_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
30func main(argc: i64, argv: *i64) -> i64