nx_http_health_emit.nx
buildroot/runtime/nx_http_health_emit.nx
about
nx_http_health_emit.nx -- /health and /ready endpoint emitter.
RESTORED 2026-07-31. This code was NOT unwritten -- it was OVERWRITTEN. A dedupe/reconcile on
2026-07-21 found two files named nx_http_health.nx and treated a NAME COLLISION as a COPY. They are
different organs on OPPOSITE sides of HTTP health: one PROBES a remote URL (a CLI with main()), this
one EMITS a /health response (a library). The reconcile kept the prober and renamed this to
nx_http_health.nx.dupe-reconciled, silently deleting the emit capability and darkening every consumer:
nx_http_health_test.nx, nx_audit_server_routed.nx, and wiki/nx_wiki_routes.nx (2 call sites).
THE LAW IT PROVES, already in the corpus and violated anyway: a duplicate-basename detector cannot tell
a COPY from a COLLISION, and the remedies are OPPOSITE -- retire vs RENAME. Canonical must be chosen by
WHO IMPORTS IT, not by directory convention: this file had 3 importers, the prober had zero.
Restored under a DISTINCT name rather than by taking the old one back, so the running prober binary is
untouched and the collision can never be load-bearing again. Probe and emit are different jobs and now
have different names (rule 9).
Standard S-class hosting observability:
- /health => liveness probe (process is alive + responding)
- /ready => readiness probe (process is ready to serve)
Per cardinal feedback-no-third-party-trust-native-or-nothing:
substrate's own probe handlers; no Prometheus SDK, no /healthz
framework, no liveness-probe-via-CRD.
Per cardinal feedback-defensive-at-boundaries-trusting-internally:
these emitters never read external input; they emit a fixed
shape with caller-provided stats (uptime, request count, etc.).
nx_capability_claims:
needs: [sealed_enum, bounded_buffer]
provides: [http_health_emit, http_ready_emit]
safety: [no_unchecked_deref, no_floating_point, no_syscall,
bounded_iteration, bit_equal_reproducible,
target_agnostic]
verdict: [sealed_enum_4_state]
license: ORIGINAL
kind: racing_crew_specialist
layer: L3 (algorithm: response shape emitter)
dependencies 0 imports · 3 importers
imports: none
imported by: nx_audit_server_routed.nxnx_http_health_test.nxnx_wiki_routes.nx
structs
| none |
consts
| 43 | const NXHL_OK: i64 = 0 |
| 44 | const NXHL_OOM_BUFFER: i64 = 1 |
| 45 | const NXHL_BAD_ARG: i64 = 2 |
| 46 | const NXHL_VERDICT_N: i64 = 3 |
| 67 | const NXHL_STATUS_PASS: i64 = 0 |
| 68 | const NXHL_STATUS_WARN: i64 = 1 |
| 69 | const NXHL_STATUS_FAIL: i64 = 2 |
| 70 | const NXHL_STATUS_N: i64 = 3 |
functions
| 48 | func nxhl_verdict_is_valid(v: i64) -> i64 called by 1: main |
| 54 | func nxhl_verdict_name(v: i64) -> *u8 |
| 72 | func nxhl_status_is_valid(s: i64) -> i64 |
| 78 | func nxhl_status_name(s: i64) -> *u8 |
| 89 | func nxhl_status_http_code(s: i64) -> i64 |
| 98 | func nxhl_put(out: *u8, off: *i64, cap: i64, b: i64) -> i64 |
| 105 | func nxhl_put_cstr(out: *u8, off: *i64, cap: i64, s: *u8) -> i64 |
| 115 | func nxhl_put_bytes(out: *u8, off: *i64, cap: i64, src: *u8, n: i64) -> i64 calls 1: nxhl_put |
| 131 | func nxhl_put_dec(out: *u8, off: *i64, cap: i64, |
| 179 | func nx_http_emit_health( |
| 252 | func nx_http_emit_ready( |