code wiki / (root) / nx_http_health_emit.nx

nx_http_health_emit.nx

buildroot/runtime/nx_http_health_emit.nx

9686 B258 linesdepth 0pulls 0 transitivereach 7 importersview sourcekind librarytopic http
docsdependenciesstructsconstsfunctions

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

nx_http_health_emit.nx nx_audit_server_routed.nx nx_http_health_test.nx nx_wiki_routes.nx

imports: none

imported by: nx_audit_server_routed.nxnx_http_health_test.nxnx_wiki_routes.nx

structs

none

consts

43const NXHL_OK: i64 = 0
44const NXHL_OOM_BUFFER: i64 = 1
45const NXHL_BAD_ARG: i64 = 2
46const NXHL_VERDICT_N: i64 = 3
67const NXHL_STATUS_PASS: i64 = 0
68const NXHL_STATUS_WARN: i64 = 1
69const NXHL_STATUS_FAIL: i64 = 2
70const NXHL_STATUS_N: i64 = 3

functions

48func nxhl_verdict_is_valid(v: i64) -> i64
called by 1: main
54func nxhl_verdict_name(v: i64) -> *u8
72func nxhl_status_is_valid(s: i64) -> i64
78func nxhl_status_name(s: i64) -> *u8
89func nxhl_status_http_code(s: i64) -> i64
98func nxhl_put(out: *u8, off: *i64, cap: i64, b: i64) -> i64
105func nxhl_put_cstr(out: *u8, off: *i64, cap: i64, s: *u8) -> i64
called by 1: nx_http_emit_health calls 1: nxhl_put
115func nxhl_put_bytes(out: *u8, off: *i64, cap: i64, src: *u8, n: i64) -> i64
calls 1: nxhl_put
131func nxhl_put_dec(out: *u8, off: *i64, cap: i64,
called by 1: nx_http_emit_health calls 1: nxhl_put
179func nx_http_emit_health(
252func nx_http_emit_ready(
called by 1: main calls 1: nx_http_emit_health