code wiki / (root) / nx_ident.nx

nx_ident.nx

buildroot/runtime/nx_ident.nx

9646 B223 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_ident.nx -- ARTIFACT IDENTITY ORACLE: "which binary is ACTUALLY running, and does it match anything I built?" WHY THIS EXISTS (four self-corrections in one session, 2026-07-30): 1. I debugged a "commit SEGV" in nx_mvault_walk for a long arc. There was no bug. A promote that returned FETCH-FAIL had SUCCEEDED, a rollback that died on a closed socket had ALSO applied, and the live elf ended up at 156,572 B -- matching NEITHER my build (229,700) NOR .prev (193,788) NOR .prev-vw02b (164,804). The symptom was a STALE ARTIFACT, not code. 2. I declared a freshly-built mgmt binary "wedged on startup". An A/B on throwaway ports cleared it; the real defect was elsewhere. Both collapse to ONE missing capability: no cheap way to ask WHAT IS LIVE. ★★★★★LAW: BEFORE DEBUGGING A BEHAVIOUR, PROVE WHICH ARTIFACT IS EXECUTING. A symptom is only evidence about the bytes that actually ran. THE VERDICT THAT MATTERS MOST is LIVE-MATCHES-NOTHING: the live binary is byte-sized like no build, no .prev, and no banked variant. That is the signature of a half-applied deploy/rollback -- exactly case (1) -- and it is the state in which every downstream conclusion is worthless. It is reported LOUDLY rather than folded into "stale", because its remedy is different: stale means "promote"; matches-nothing means "STOP, establish provenance". nx_ident <organ-name> e.g. nx_ident nx_mvault_walk Reports live / staged / prev / every banked <name>.* variant with BYTES, and a verdict. Read-only. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_ident.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_write sys_mmap id_cat id_size sys_openat_rd sys_lseek sys_close sys_openat_rd ↻ sys_getdents64 dirent_reclen dirent_name id_starts id_eq sys_close ↻ id_dec id_cat ↻ sys_mmap ↻ sys_munmap id_ch

structs

none

consts

31const ID_DIRBUF: i64 = 1048576
32const ID_MAXV: i64 = 64 // variants reported; overflow is DECLARED
33const ID_NAME: i64 = 256
34const ID_OUT: i64 = 65536
35const ID_SEEK_END: i64 = 2

functions

37func id_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
39func id_cat(d: *u8, o: i64, s: *u8) -> i64
called by 2: id_decmain
46func id_ch(d: *u8, o: i64, c: i64) -> i64 { d[o] = c as u8; return o + 1 }
called by 1: main
48func id_dec(d: *u8, o: i64, v: i64) -> i64
called by 1: main calls 3: id_catsys_mmapsys_munmap
63func id_size(path: *u8) -> i64
72func id_starts(name: *u8, pfx: *u8) -> i64
called by 1: main
81func id_eq(a: *u8, b: *u8) -> i64
called by 1: main
91func main(argc: i64, argv: *i64) -> i64