code wiki / _hdl_build / nx_live_reach.nx
nx_live_reach.nx
buildroot/runtime/_hdl_build/nx_live_reach.nx
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
imports: nx_syscalls.nx
imported by: nx_live_reach_test.nx
structs
| none |
consts
| 14 | const LR_REACHABLE: i64 = 2 // live fetch succeeded (bytes in hand) |
| 15 | const LR_DNS_FAIL: i64 = 3 // name did not resolve |
| 16 | const LR_TCP_FAIL: i64 = 4 // could not connect (refused/timeout) -- the classic bot-block |
| 17 | const LR_TLS_FAIL: i64 = 5 // TLS handshake/cert validation failed (e.g. empty trust store) |
| 18 | const LR_HTTP_FAIL: i64 = 6 // connected+handshook but HTTP errored |
| 21 | const LR_USE_LIVE: i64 = 1 // serve from the live fetch (and mirror it) |
| 22 | const LR_USE_MIRROR: i64 = 2 // live blocked -> serve from the Nishi Library mirror |
| 23 | const LR_NO_DATA: i64 = 3 // live blocked AND no mirror -> honestly unanswerable |
functions
| 25 | func lr_is_reachable(outcome: i64) -> i64 { if outcome == LR_REACHABLE { return 1 } return 0 } |
| 28 | func lr_policy(outcome: i64, have_mirror: i64) -> i64 called by 1: main |
| 35 | func lr_answerable(outcome: i64, have_mirror: i64) -> i64 called by 1: main |
| 42 | func lr_mirror_after_live(outcome: i64) -> i64 { if outcome == LR_REACHABLE { return 1 } return 0 } called by 1: main |
| 45 | func lr_blocked_but_covered(outcome: i64, have_mirror: i64) -> i64 called by 1: main |