nx_ident.nx
buildroot/runtime/nx_ident.nx
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
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
structs
| none |
consts
| 31 | const ID_DIRBUF: i64 = 1048576 |
| 32 | const ID_MAXV: i64 = 64 // variants reported; overflow is DECLARED |
| 33 | const ID_NAME: i64 = 256 |
| 34 | const ID_OUT: i64 = 65536 |
| 35 | const ID_SEEK_END: i64 = 2 |
functions
| 37 | func id_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 39 | func id_cat(d: *u8, o: i64, s: *u8) -> i64 |
| 46 | func id_ch(d: *u8, o: i64, c: i64) -> i64 { d[o] = c as u8; return o + 1 } called by 1: main |
| 48 | func id_dec(d: *u8, o: i64, v: i64) -> i64 |
| 63 | func id_size(path: *u8) -> i64 |
| 72 | func id_starts(name: *u8, pfx: *u8) -> i64 called by 1: main |
| 81 | func id_eq(a: *u8, b: *u8) -> i64 called by 1: main |
| 91 | func main(argc: i64, argv: *i64) -> i64 |