code wiki / (root) / nx_external_reach_probe.nx

nx_external_reach_probe.nx

buildroot/runtime/nx_external_reach_probe.nx

14674 B302 linesdepth 21pulls 130 transitivereach 4 importersview sourcekind probetopic external
docsdependenciesstructsconstsfunctions

about

nx_external_reach_probe.nx -- continuously probe an external endpoint for per-stage reachability + latency; alert on degradation. module: nishi-core.perception.external_reach_probe depends: nishi-core.perception.profile + nishi-core.perception.perceptual_dataset + nishi-core.perception.provenance_curve_store + nishi-core.perception.instrument_diagnostician + nishi-core.net.socket + nishi-core.io.syscalls disk_kb: 6 capability: PERCEPTION wired_status: PARTIAL_WIRED (nx_reach_probe_now GRADUATED to basic-glue 2026-05-20: composes nx_https_get + nx_clock_monotonic_ns for total-time + overall verdict; per-stage breakdown still queued) MISSING_CAPABILITIES (still queued): - PER_STAGE_CLOCK_TAPS (separate DNS / TCP / TLS / HTTP timings; requires calling nx_https_url_for_fetch + nx_https_url_connect + nx_tls13_client_session_run + nx_http_get directly with clock taps between each phase instead of single nx_https_get black box) - SCHEDULED_PROBE_LOOP (composes with nx_race_timing CONTINUOUS or SCHEDULED modes already FULLY_WIRED) - DEGRADATION_ALERT_DISPATCH (composes with nx_instrument_diagnostician for named-fix output when reachability drops below threshold) - PEER_HOST_DISPATCH (probe runs from one or more peer hosts so a single monitoring vantage point doesn't masquerade as "the whole world reaches us") - CALLER_PROVIDED_TRUST_STORE_AND_RNG (v1 uses fixed seed + empty trust store; v2 accepts caller-provided per user-owns-every-bit cardinal) - DATASET_PERSIST (write result to nx_perceptual_dataset as DRIFT_OBSERVATION entry; queued behind nx_pds_write_trial wire-up) license_tier: PUBLIC_NISHI_SUBSTRATE genealogy_id: feedback-substrate-does-heavy-lifting-user-is-partner-not-gate_2026 + feedback-substrate-primitives-meta-not-one-off_2026 + feedback-real-playtest-loop-not-just-logs_2026 + feedback-no-false-ok-substrate-honesty-audit + nx_realism_score + NISHIFAMILY_VIDEO_HARDENING_2026-05-20 + feedback-self-surfacing-intelligence-staged-autonomy

dependencies 8 imports · 3 importers

nx_syscalls.nx nx_perceptual_profile.nx nx_perceptual_dataset.nx nx_provenance_curve_store.nx nx_instrument_diagnostician.nx nx_https_get.nx nx_clock.nx nx_x509_trust_store.nx nx_external_reach_probe.nx nx_external_reach_probe_test.nx nx_load_test_harness.nx nx_reach_probe_cli.nx

imports: nx_syscalls.nxnx_perceptual_profile.nxnx_perceptual_dataset.nxnx_provenance_curve_store.nxnx_instrument_diagnostician.nxnx_https_get.nxnx_clock.nxnx_x509_trust_store.nx

imported by: nx_external_reach_probe_test.nxnx_load_test_harness.nxnx_reach_probe_cli.nx

structs

123struct NxReachProbeResult

consts

71const NX_MAGIC_65536: i64 = 65536
72const NX_MAGIC_1718452800: i64 = 1718452800
73const NX_MAGIC_1000000: i64 = 1000000
77const NX_REACH_STAGE_DNS_RESOLVE: i64 = 1
78const NX_REACH_STAGE_TCP_CONNECT: i64 = 2
79const NX_REACH_STAGE_TLS_HANDSHAKE: i64 = 3
80const NX_REACH_STAGE_HTTP_TTFB: i64 = 4
81const NX_REACH_STAGE_PAYLOAD_DOWNLOAD: i64 = 5
82const NX_REACH_STAGE_TOTAL_END_TO_END: i64 = 6
96const NX_REACH_OK: i64 = 0
97const NX_REACH_DEGRADED_SLOW: i64 = 1 // completes but exceeds threshold
98const NX_REACH_FAIL_DNS: i64 = 2
99const NX_REACH_FAIL_TCP_TIMEOUT: i64 = 3 // 2026-05-20 nishifamily.com:443 mode
100const NX_REACH_FAIL_TLS_HANDSHAKE: i64 = 4
101const NX_REACH_FAIL_HTTP_ERROR: i64 = 5 // 4xx / 5xx
102const NX_REACH_FAIL_PAYLOAD_INCOMPLETE: i64 = 6 // received < Content-Length
103const NX_REACH_FAIL_DEPENDENCY_MISSING: i64 = 7 // PARTIAL_WIRED default

functions

84func nx_reach_stage_name(s: i64) -> *u8
105func nx_reach_verdict_name(v: i64) -> *u8
168func nx_reach_probe_now(endpoint_url_ptr: *u8, endpoint_url_len: i64,
254func nx_reach_probe_register_endpoint(endpoint_url_ptr: *u8, endpoint_url_len: i64,
267func nx_reach_probe_get_last_result(endpoint_url_ptr: *u8, endpoint_url_len: i64,
278func nx_reach_probe_count_failures_in_window(endpoint_url_ptr: *u8, endpoint_url_len: i64,
291func nx_reach_probe_diagnose_failure(result_ptr: *NxReachProbeResult,
300func nx_reach_probe_get_last_verdict() -> i64