nx_health_check.nx
buildroot/runtime/nx_health_check.nx
about
nx_health_check.nx -- overall substrate health verdict.
Per [[feedback-self-surfacing-intelligence-staged-autonomy]]:
substrate emits a coarse GREEN / YELLOW / RED verdict aggregating
all known indicators. Operator sees one color first; can drill
into the dashboard for details.
Verdict rules (Q10 alert_score from nx_audit_dashboard):
GREEN : alert_score < 200 AND colony_status == HEALTHY
YELLOW : alert_score 200-768 OR colony_status == ALERTED
RED : alert_score > 768 OR colony_status >= RESPONDING
Composes:
nx_audit_dashboard -- the snapshot consumed for verdict
nx_recovery -- RED verdict triggers recovery procedure
nx_book -- RED entry written when transitioning into RED
dependencies 3 imports · 2 importers
imports: nx_syscalls.nxnx_tier.nxnx_audit_dashboard.nx
imported by: nx_audit_compose_test.nxnx_health_check_test.nx
structs
| 42 | struct NxHealthState |
consts
| 24 | const NX_HC_GREEN: nx_int = 0 |
| 25 | const NX_HC_YELLOW: nx_int = 1 |
| 26 | const NX_HC_RED: nx_int = 2 |
| 27 | const NX_HC_N_VERDICTS: nx_int = 3 |
functions
| 29 | func nx_hc_verdict_is_valid(v: nx_int) -> nx_int called by 1: main |
| 49 | func nx_health_state_new() -> *NxHealthState |
| 63 | func nx_health_check(state: *NxHealthState, |
| 95 | func nx_health_just_transitioned_to(state: *NxHealthState, |
| 103 | func nx_health_last_verdict(state: *NxHealthState) -> nx_int called by 1: main |
| 107 | func nx_health_consecutive_red(state: *NxHealthState) -> nx_int called by 1: main |
| 118 | func nx_health_should_trigger_recovery(state: *NxHealthState) -> nx_int |