code wiki / _hdl_build / nx_pub_recover_pulse.nx
nx_pub_recover_pulse.nx
buildroot/runtime/_hdl_build/nx_pub_recover_pulse.nx
about
nx_pub_recover_pulse.nx -- THE PUBLISHER'S SELF-HEALING PULSE (composes the gated decide + execute rungs).
One pass = decide (scan the monitor's metrics -> recovery requests, via a DATA-DRIVEN map url-substring->
daemon, rule #11 not hardcoded) then execute (kill the wedged daemon; the existing nx_hostctl keeper
respawns a fresh one). Run on a cadence by a scheduler (one pass per invocation; the daemon-loop wrapper is
the next rung). This is the Publisher OWNING ops/restarts end-to-end -- NO direct/ad-hoc workstream action,
every step a gated Publisher rung.
pulse_pass(metricspath, queuepath, ledgerpath, mappath, wedge_ms) -> recoveries executed
license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_pub_recover_exec.nx
imported by: nx_pub_recover_pulse_gate.nxnx_pub_recover_pulsed.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 12 | const PP_MAGIC_100000: i64 = 100000 |
| 13 | const PP_MAGIC_5000: i64 = 5000 |
| 15 | const PP_METRICS: *u8 = "knowledge/status/apm_metrics.tsv" |
| 16 | const PP_QUEUE: *u8 = "knowledge/publish/recovery_queue.tsv" |
| 17 | const PP_LEDGER: *u8 = "knowledge/publish/recovery_ledger.tsv" |
| 18 | const PP_MAP: *u8 = "knowledge/publish/recover_map.tsv" // url-substring<TAB>daemon (data-driven, no hardcode) |
| 19 | const PP_LOCK: *u8 = "publish_recover" |
| 20 | const PP_REC_CAP: i64 = 1024 |
| 21 | const PP_COOLDOWN_SEC: i64 = 300 // never kill-storm: at most PP_MAX_RECOVERIES of a daemon per this window |
| 22 | const PP_MAX_RECOVERIES: i64 = 2 // (#26 never-brick: a daemon that keeps wedging -> BACK OFF, don't re-kill) |
functions
| 24 | func pp_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: pp_decide |
| 27 | func pp_recent_recoveries(ledgerpath: *u8, daemon: *u8, now: i64, window: i64) -> i64 |
| 49 | func pp_map_lookup(url: *u8, urllen: i64, mappath: *u8, out: *u8) -> i64 |
| 72 | func pp_decide(metricspath: *u8, queuepath: *u8, ledgerpath: *u8, mappath: *u8, wedge_ms: i64, now: i64) -> i64 called by 1: pulse_pass calls 11: sys_mmapsys_read_filepr_fieldpp_strlenpp_map_lookuppp_recent_recoveries+5 |
| 112 | func pulse_pass(metricspath: *u8, queuepath: *u8, ledgerpath: *u8, mappath: *u8, wedge_ms: i64) -> i64 |
| 117 | func pp_uw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 118 | func main(argc: i64, argv: *i64) -> i64 |