nx_link_sentinel.nx
buildroot/runtime/nx_link_sentinel.nx
about
nx_link_sentinel.nx -- LINK LIVENESS MONITOR for the nav. Probes every surface in knowledge/site/surfaces.reg
over the sovereign TLS stack (nx_https_fetch_follow + Mozilla trust store -- the public-edge path a real browser
takes), classifies each LIVE/GATED/REDIRECT/DEAD, and keeps a HEALTH LEDGER over time (last-live epoch + fail
streak) so no nav link is ever a SILENT orphan. A link stays ACTIVE while reachable; a dead public link becomes
DEGRADED (flagged, still shown) then an ARCHIVE candidate after N consecutive fails -- removal stays deliberate
(surfaces.reg status=archived). Modes: gate (console+update ledger) | json | html (dashboard). Ledger file:
knowledge/site/link_health.tsv (route \t last_status \t class \t last_live_unix \t fail_streak \t checked_unix).
nx_cc traps honored (no '#'/'!' in literals; classes not ids; w2 ' -> "). license_tier: ORIGINAL expect_exit:0
dependencies 6 imports · 0 importers
imports: nx_syscalls.nxnx_connect.nxnx_csprng.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 15 | const ARCHIVE_MAGIC_65535: i64 = 65535 |
| 16 | const ARCHIVE_MAGIC_4194304: i64 = 4194304 |
| 17 | const ARCHIVE_MAGIC_65536: i64 = 65536 |
| 18 | const ARCHIVE_MAGIC_1048576: i64 = 1048576 |
| 19 | const ARCHIVE_MAGIC_8388608: i64 = 8388608 |
| 20 | const ARCHIVE_MAGIC_1024: i64 = 1024 |
| 22 | const HOST: *u8 = "https://nishifamily.com" as *u8 |
| 23 | const ARCHIVE_THRESHOLD: i64 = 6 // consecutive fails before a dead link becomes an archive candidate |
functions
| 25 | func w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 26 | func wc(fd: i64, code: i64) -> i64 { let t: *u8 = sys_mmap(2); t[0] = code as u8; sys_write(fd, t, 1); return 0 } |
| 27 | func wn(fd: i64, v: i64) -> i64 |
| 33 | func lsent_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 } |
| 34 | func c_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 40 | func scopy(dst: *u8, doff: i64, src: *u8) -> i64 { var i: i64 = 0; while src[i] != (0 as u8) { dst[doff+i] = src[i]; i = i + 1 } return doff + i } |
| 42 | func enc_int(buf: *u8, off: i64, v: i64) -> i64 |
| 51 | func w2(fd: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { if (s[i] as i64) == 39 { wc(fd, 34) } else { wc(fd, s[i] as i64) } i = i + 1 } return 0 } |
| 53 | func field(buf: *u8, ls: i64, le: i64, idx: i64, out: *u8) -> i64 |
| 69 | func classify(st: i64) -> i64 |
| 80 | func class_name(c: i64) -> *u8 |
| 87 | func is_healthy(cls: i64, scope_gated: i64) -> i64 |
| 94 | func lsent_atoi(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; while s[i] != (0 as u8) { let c: i64 = s[i] as i64; if c >= 48 { if c <= 57 { v = v * 10 + (c - 48) } } i = i + 1 } return v } |
| 96 | func tfield(buf: *u8, ls: i64, le: i64, idx: i64, out: *u8) -> i64 |
| 105 | func sent_parse_ipport(s: *u8, ip_out: *i64, port_out: *i64) -> i64 |
| 131 | func sent_fetch_via(url: *u8, ovip: i64, ovport: i64, store: *TrustStore, out: *u8, out_cap: i64, stbox: *i64) -> i64 |
| 169 | func ledger_lookup(led: *u8, ln: i64, route: *u8, llbox: *i64, fsbox: *i64) -> i64 |
| 188 | func main(argc: i64, argv: *i64) -> i64 |