code wiki / _hdl_build / nx_clobber_guard.nx
nx_clobber_guard.nx
buildroot/runtime/_hdl_build/nx_clobber_guard.nx
about
nx_clobber_guard.nx -- SOTA anti-clobber guard for dual-copy artifacts (acl lane, F744).
Content-reconciliation with OPTIMISTIC-CONCURRENCY / git-non-fast-forward semantics: compare two
SURFACE copies of one logical artifact (e.g. laptop SSOT vs NAS buildroot, or a store's two segments'
exports). A would-be push that OVERWRITES a DIVERGED target is REFUSED (exit 3) so the writer must
reconcile first -- never silent last-writer-wins. Byte-exact compare (same idiom as nx_drift_watch /
nx_stale_check byte compare), no crypto dependency, no hardware writes (Rule 26).
nx_clobber_guard cmp <pathA> <pathB>
Machine contract (exit code): 0 CONVERGED (safe to push) | 3 DIVERGED (would-clobber, refuse) |
4 ABSENT (a surface is missing) | 2 usage. The stdout line carries the verdict + sizes for logs.
license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_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
| 13 | const K_MAGIC_8388608: i64 = 8388608 |
functions
| 15 | func cg_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 20 | func cg_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 21 | func cg_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 34 | func main(argc: i64, argv: *i64) -> i64 |