nx_servedrift.nx
buildroot/runtime/nx_servedrift.nx
about
nx_artifactdrift.nx -- IS THE BINARY WE ARE SERVING THE ONE THE LAST BUILD PRODUCED?
⚠THIS ORGAN WAS NAMED WRONG TWICE, AND BOTH GUARDS WERE RIGHT. It shipped as `nx_promotestale` and
nx_job_run's launch guard refused it: that guard splits the name on '_' and denies any SEGMENT
STARTING WITH a control-plane stem, so "promotestale" reads as promote. Renamed to `nx_servedrift`,
/api/promote then refused it as a DAEMON and nx_job_run refused it again -- "servedrift" starts with
"serve", and that guard's header states it chose stem-prefix DELIBERATELY so `nx_server` could never
escape, calling an escaped server "the brick".
-- BOTH REFUSALS WERE CORRECT. A launch guard must be wrong in the direction of REFUSING, and a name
that starts with `serve` genuinely looks like a server. The tempting fix -- patch an allow-path into a
never-brick guard so it consults organ_kind.conf -- would trade a real safety property for a bad name.
-- SO THE NAME MOVED, NOT THE GUARD: this measures DRIFT BETWEEN THE BUILT AND SERVED ARTIFACT, which
`artifactdrift` says exactly and claims to be no kind of server.
★★AN ORGAN'S NAME IS PART OF ITS INTERFACE, BECAUSE THE ESTATE'S OWN SAFETY RULES READ IT -- and when a
guard and a name disagree, the guard is the thing with a proof behind it.
WHY IT EXISTS, MEASURED 2026-08-14: two organs were found SERVING STALE CODE purely because a human
happened to notice nx_catalog's BUILT and PROMOTED columns disagree -- nx_vizsla_digest (47,402 served
vs 47,596 built) and nx_vizsla_plan (176,882 served vs 217,561 built: ~40 KB, a FIFTH of the organ,
missing from the running binary). Both were invisible to every health check the estate runs.
-- A RUNNING BINARY THAT IS NOT WHAT ITS SOURCE BUILT IS A SILENT CORRECTNESS AND SECURITY DEFECT:
every fix, every audit and every gate verdict then describes code that is not the code being executed.
-- SPOTTING IT BY EYE DOES NOT SCALE. nx_catalog answers this one NAME at a time; this sweeps.
nx_servedrift [registry] [buildroot]
THE UNIT IS THE BINARY, NOT THE REGISTRY ROW. Several names legitimately share one elf (nx_status and
nx_torstat both point at nx_hostctl; nx_services/nx_health/nx_mgmt all at nx_mgmt_call.elf), so
counting rows would INFLATE the population and report one stale binary as three.
CLASSES -- a PARTITION whose parts are printed and MUST sum:
IDENTICAL served bytes == built bytes -> what we run is what we built
STALE both exist and DIFFER -> THE WORKLIST; the served code is not the build
NO-BUILD no build artifact to compare against -> CANNOT JUDGE, never folded into IDENTICAL
NO-SERVED the registry points at a missing elf -> a dangling row, a different defect entirely
-- "I COULD NOT LOOK" GETS ITS OWN BUCKET. Folding NO-BUILD into IDENTICAL would report the fleet
healthy in exactly the state this organ exists to catch -- the defect nx_offc_install already made
once when it read "no twin to judge" as "not stale".
CHEAP BY CONSTRUCTION: size comes from sys_fstatat (a stat, NOT a read), so the common case costs two
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
| 47 | const PS_MAXROW: i64 = 4096 |
| 48 | const PS_NAMEMAX: i64 = 256 |
| 49 | const PS_STAT_SIZE_OFF: i64 = 48 |
| 50 | const PS_DEFAULT_REG: *u8 = "tool_allowlist.conf" |
| 51 | const PS_DEFAULT_BROOT: *u8 = "buildroot/_build/" |
| 52 | const PS_TAB: i64 = 9 |
| 53 | const PS_NL: i64 = 10 |
functions
| 55 | func ps_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: ps_puts |
| 56 | func ps_puts(s: *u8) -> i64 { sys_write(1, s, ps_len(s)); return 0 } |
| 57 | func ps_pn(v: i64) -> i64 |
| 71 | func ps_size(path: *u8) -> i64 |
| 77 | func ps_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 89 | func ps_same(a: *u8, b: *u8) -> i64 |
| 108 | func main(argc: i64, argv: *i64) -> i64 |