code wiki / _hdl_build / nx_gated_edit.nx

nx_gated_edit.nx

buildroot/runtime/_hdl_build/nx_gated_edit.nx

4288 B96 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tooltopic gated
docsdependenciesstructsconstsfunctions

about

nx_gated_edit.nx -- GATED SOURCE-EDIT APPLIER (2026-07-21, closes the D001 mechanization gap: nx_consol_apply retires dead FILE shadows byte-identical; THIS applies a function-body -> shared-lib DELEGATION (or any exact-string source edit) and keeps it ONLY IF a verify command's output is byte-identical BEFORE vs AFTER. Behaviour-preserving BY CONSTRUCTION: run verify (BEFORE) -> apply the unique old->new edit -> run verify (AFTER). If AFTER == BEFORE the edit changed no observable behaviour -> CONSOLIDATED. Else the edit IS live -> RESTORE source + re-run verify (rebuild good) + REFUSE. Uniqueness contract (exactly one match, else untouched) = nx_fs_write-edit's; before/after diff = nx_consol_apply's proof, generalised from file-rename to string-edit. A seat/PM points verify at a build+gate driver so "output preserved" == "the organ still builds and its gate stays GREEN". argv: <srcfile> <oldfile> <newfile> <verifyelf> <verifyarg> (old/new from FILES: no argv escaping) exit: 0 CONSOLIDATED | 1 REFUSED (source restored) | 2 usage/NOMATCH/AMBIGUOUS (untouched) | 3 verify-before-empty (untouched) license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 4 imports · 0 importers

nx_seat_drive_lib.nx nx_deploy_lib.nx nx_syscalls.nx nx_ge_str_lib.nx nx_gated_edit.nx

imports: nx_seat_drive_lib.nxnx_deploy_lib.nxnx_syscalls.nxnx_ge_str_lib.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 sys_mmap dp_read sys_openat_rd sys_read sys_close ge_count ge_find sd_num sys_mmap ↻ ge_find ↻ dep_run_capture sys_fork sys_openat_wr sys_dup3 sys_mmap ↻ sys_execve_clean sys_close ↻ sys_execve sys_exit ↻ sys_wait4 dp_writefile sys_openat_wr ↻ sys_write ↻ sys_close ↻ ge_eq

structs

none

consts

19const GE_CAP: i64 = 1048576
20const GE_ECAP: i64 = 2097152

functions

24func main(argc: i64, argv: *i64) -> i64