nx_netscope_heal.nx
buildroot/runtime/nx_netscope_heal.nx
about
nx_netscope_heal.nx -- NX-NETSCOPE rung 3: goal-directed SELF-HEALING
connectivity agent (DECISION CORE). The north-star payload: a device
given a goal ("reach nishifamily.com") auto-selects the BEST reachable
resolver/path, switches/fails over, and re-verifies -- without flapping.
This is the PURE, DETERMINISTIC decision core (no I/O), isolated so it
is KAT-able offline (fault-inject a synthetic probe matrix -> assert the
chosen resolver + heal action). The live MAPE-K loop (monitor tick,
EXECUTE set-resolver, backoff+jitter sleep, circuit breaker) wraps this
next increment. Design grounded (research workflow wf_ca778575) in:
- Happy Eyeballs v2/v3 (RFC 8305/8306): RACE candidates, pick best --
but "best" = lowest RTT among CORRECT answers (a fast WRONG answer,
NXDOMAIN/SERVFAIL/timeout, never wins over a slower correct one).
- MAPE-K autonomic loop (monitor->analyze->plan->execute->verify).
- Hysteresis / RTT-banding (RFC 2439 RFD spirit): don't switch for a
marginal gain -> no flapping.
Reuses nxv_cell + ProbeCell + NXNS_* from the shipped probe/verdict
layers; composes nx_dns_probe_matrix_parallel results (no new deps).
license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_netscope_verdict.nx
imported by: nx_netscope_heal_loop.nxnx_netscope_heal_test.nx
structs
| 40 | struct HealDecision |
consts
| 26 | const HEAL_KEEP: i64 = 0 |
| 27 | const HEAL_SWITCH: i64 = 1 |
| 28 | const HEAL_GIVEUP: i64 = 2 |
| 30 | const HEAL_R_HEALTHY: i64 = 0 // incumbent still best -> no change |
| 31 | const HEAL_R_INCUMBENT_FAILED: i64 = 1 // incumbent no longer correct -> fail over |
| 32 | const HEAL_R_BETTER_FOUND: i64 = 2 // a meaningfully faster correct resolver |
| 33 | const HEAL_R_NO_CANDIDATE: i64 = 3 // nothing correct reachable -> give up safely |
| 37 | const HEAL_BAND_MS: i64 = 20 |
| 47 | const HEAL_DECISION_BYTES: i64 = 40 |
functions
| 52 | func heal_cell_eligible(cell: *ProbeCell, require_private: i64) -> i64 |
| 61 | func heal_select_best(cells: *ProbeCell, ns: i64, nh: i64, col: i64, require_private: i64) -> i64 |
| 83 | func heal_decide(cells: *ProbeCell, ns: i64, nh: i64, col: i64, |
| 136 | func heal_render(out: *HealDecision, servers: *i64, host_name: *u8, host_len: i64) -> i64 |