code wiki / _hdl_build / nx_live_reach.nx

nx_live_reach.nx

buildroot/runtime/_hdl_build/nx_live_reach.nx

2731 B48 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic live
docsdependenciesstructsconstsfunctions

about

nx_live_reach.nx -- the team's LIVE-WEB policy with graceful fallback (rule #14). It attempts the live external source over the sovereign HTTPS stack (nx_https_get: DNS -> TCP -> TLS1.3 -> GET) and, whatever the outcome stage, decides honestly what to do: if REACHABLE, use the live bytes AND mirror them into the Nishi Library (so next time is sovereign); if blocked at any stage (DNS/TCP/TLS/HTTP), fall back to the LOCAL mirror; only if there is no mirror either is the research UNANSWERABLE. This is the policy LAYER the team owns; the byte-fetch + cert validation belong to nx_https_get and are ENV-GATED (a populated CA trust store + open network). So a successful cert-validated live fetch is not asserted here -- the guarantee proven is that a blocked live web never starves us when we have mirrored. license_tier: ORIGINAL Pairs with nx_library_cache (the mirror) + nx_external_reach_probe.

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_live_reach.nx nx_live_reach_test.nx

imports: nx_syscalls.nx

imported by: nx_live_reach_test.nx

structs

none

consts

14const LR_REACHABLE: i64 = 2 // live fetch succeeded (bytes in hand)
15const LR_DNS_FAIL: i64 = 3 // name did not resolve
16const LR_TCP_FAIL: i64 = 4 // could not connect (refused/timeout) -- the classic bot-block
17const LR_TLS_FAIL: i64 = 5 // TLS handshake/cert validation failed (e.g. empty trust store)
18const LR_HTTP_FAIL: i64 = 6 // connected+handshook but HTTP errored
21const LR_USE_LIVE: i64 = 1 // serve from the live fetch (and mirror it)
22const LR_USE_MIRROR: i64 = 2 // live blocked -> serve from the Nishi Library mirror
23const LR_NO_DATA: i64 = 3 // live blocked AND no mirror -> honestly unanswerable

functions

25func lr_is_reachable(outcome: i64) -> i64 { if outcome == LR_REACHABLE { return 1 } return 0 }
28func lr_policy(outcome: i64, have_mirror: i64) -> i64
called by 1: main
35func lr_answerable(outcome: i64, have_mirror: i64) -> i64
called by 1: main
42func lr_mirror_after_live(outcome: i64) -> i64 { if outcome == LR_REACHABLE { return 1 } return 0 }
called by 1: main
45func lr_blocked_but_covered(outcome: i64, have_mirror: i64) -> i64
called by 1: main