code wiki / (root) / nx_link_sentinel.nx

nx_link_sentinel.nx

buildroot/runtime/nx_link_sentinel.nx

23989 B379 linesdepth 21pulls 146 transitivereach 0 importersview sourcekind orphan librarytopic link
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_connect.nx nx_csprng.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_https_fetch_follow.nx nx_link_sentinel.nx

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

15const ARCHIVE_MAGIC_65535: i64 = 65535
16const ARCHIVE_MAGIC_4194304: i64 = 4194304
17const ARCHIVE_MAGIC_65536: i64 = 65536
18const ARCHIVE_MAGIC_1048576: i64 = 1048576
19const ARCHIVE_MAGIC_8388608: i64 = 8388608
20const ARCHIVE_MAGIC_1024: i64 = 1024
22const HOST: *u8 = "https://nishifamily.com" as *u8
23const ARCHIVE_THRESHOLD: i64 = 6 // consecutive fails before a dead link becomes an archive candidate

functions

25func 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 }
26func wc(fd: i64, code: i64) -> i64 { let t: *u8 = sys_mmap(2); t[0] = code as u8; sys_write(fd, t, 1); return 0 }
27func wn(fd: i64, v: i64) -> i64
33func 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 }
34func c_read(path: *u8, buf: *u8, cap: i64) -> i64
40func 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 }
42func enc_int(buf: *u8, off: i64, v: i64) -> i64
51func 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 }
53func field(buf: *u8, ls: i64, le: i64, idx: i64, out: *u8) -> i64
69func classify(st: i64) -> i64
80func class_name(c: i64) -> *u8
87func is_healthy(cls: i64, scope_gated: i64) -> i64
94func 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 }
96func tfield(buf: *u8, ls: i64, le: i64, idx: i64, out: *u8) -> i64
105func sent_parse_ipport(s: *u8, ip_out: *i64, port_out: *i64) -> i64
131func sent_fetch_via(url: *u8, ovip: i64, ovport: i64, store: *TrustStore, out: *u8, out_cap: i64, stbox: *i64) -> i64
169func ledger_lookup(led: *u8, ln: i64, route: *u8, llbox: *i64, fsbox: *i64) -> i64
188func main(argc: i64, argv: *i64) -> i64