code wiki / _hdl_build / nx_gated_edit.nx
nx_gated_edit.nx
buildroot/runtime/_hdl_build/nx_gated_edit.nx
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
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
structs
| none |
consts
| 19 | const GE_CAP: i64 = 1048576 |
| 20 | const GE_ECAP: i64 = 2097152 |
functions
| 24 | func main(argc: i64, argv: *i64) -> i64 |