code wiki / _hdl_build / nx_doctor_apply_gate.nx
nx_doctor_apply_gate.nx
buildroot/runtime/_hdl_build/nx_doctor_apply_gate.nx
about
nx_doctor_apply_gate.nx -- SOVEREIGN gate for the Doctor's graceful-apply core.
T1 APPLY -- region present exactly once -> applied, file rewritten correctly.
T2 CONFLICT -- region absent (already-applied / changed by another) -> REFUSED, file UNCHANGED (no clobber).
T3 AMBIGUOUS -- region matches >1 -> REFUSED, file UNCHANGED (won't guess).
T4 WITHOUT-COMPETITION (the point) -- a concurrent edit ELSEWHERE in the file is PRESERVED while my
non-overlapping change still applies against the CURRENT file = a clean merge, no clobber, no race-loss.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_doctor_apply.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
| 11 | const GT_TGT: *u8 = "/tmp/da_gate_target" |
functions
| 13 | func gt_uw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 14 | func gt_wn(v: i64) -> i64 { let b: *u8 = sys_mmap(24); var m: i64 = v; var k: i64 = 0; if m==0 {b[0]=48 as u8;k=1} let t: *u8=sys_mmap(24); while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var o: *u8=sys_mmap(24); var w: i64=0; var q: i64=k-1; while q>=0{o[w]=t[q];w=w+1;q=q-1} sys_write(1,o,w); return 0 } |
| 15 | func gt_write(path: *u8, s: *u8, len: i64) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd < 0 { return 0-1 } sys_write(fd, s, len); sys_close(fd); return 0 } |
| 17 | func gt_file_eq(path: *u8, expected: *u8, elen: i64) -> i64 |
| 24 | func main(argc: i64, argv: *i64) -> i64 |