nx_http_probe.nx
buildroot/runtime/nx_http_probe.nx
about
nx_http_probe.nx -- CLI over nx_http_probe_lib. Sovereign bounded loopback HTTP probe and dead-man
heartbeat stamper; retires the `curl | grep -q && date > log` cron one-liner that was the estate's
only compensating control over a fail-open authentication path and whose own failure was unobservable.
THIS FILE IS DELIBERATELY THIN. All logic lives in nx_http_probe_lib.nx so the gate can drive the SAME
code the CLI drives -- a gate that re-implements its subject proves nothing about the subject.
USAGE
nx_http_probe <path> [expect-substring] [port]
legacy positional form, byte-compatible with the pre-2026-08-20 organ (exit 0 ok / 1 usage /
2 connect-failed / 3 pattern-absent are unchanged). No heartbeat, no explicit budget.
nx_http_probe watch <port> <path> <expect-substring> <budget-sec> <stamp-path>
the supervised form: asserts a 2xx status AND the substring, and ONLY THEN writes
`ts=<epoch>` to <stamp-path> for nx_cron_watch to read. Every failure is NAMED on stdout and
on stderr and leaves the stamp untouched, so the watch goes STALE instead of reading healthy.
Pass "" as <expect-substring> to assert liveness and status only.
A path beginning with '/' can never be the literal verb `watch`, so the two grammars cannot collide.
EXIT CODES (each is a diagnosis; hp_reason() names them in the output)
0 ok 1 usage 2 connect-failed 3 pattern-absent 4 status-not-2xx 5 stamp-write-failed
6 recv-timeout 7 send-failed 8 body-truncated-pattern-unproven 9 path-too-long
10 socket-failed 11 empty-response 12 not-http
expect_exit: 0 license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 1 imports · 0 importers
imports: nx_http_probe_lib.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
| 28 | const HPC_LEGACY_ARGC_PATH: i64 = 2 |
| 29 | const HPC_LEGACY_ARGC_EXPECT: i64 = 3 |
| 30 | const HPC_LEGACY_ARGC_PORT: i64 = 4 |
| 31 | const HPC_WATCH_ARGC: i64 = 7 |
| 32 | const HPC_PORT_DIGITS: i64 = 12 |
| 33 | const HPC_VERBOSE: i64 = 1 |
functions
| 35 | func hpc_usage() -> i64 called by 1: main |
| 50 | func hpc_bad_port(s: *u8) -> i64 called by 1: main |
| 60 | func main(argc: i64, argv: *i64) -> i64 |