nx_net_polite.nx
buildroot/runtime/nx_net_polite.nx
about
nx_net_polite.nx -- INTERNET CITIZENSHIP decisions (pure, deterministic, gate-able): how the harvester
paces itself + backs off so it is NOT flagged/blocked/rate-banned (which would dry up our sources). This is
the DECISION layer -- the caller (nx_search_extern) composes these around the TLS fetch. Keeps the logic
pure so it gates without touching the network. Named thresholds (rule 11, no magic numbers). license_tier: ORIGINAL
dependencies 1 imports · 3 importers
imports: nx_syscalls.nx
imported by: nx_frontier_watch.nxnx_net_polite_gate.nxnx_search_extern.nx
structs
| none |
consts
| 7 | const POL_MAX_RETRY: i64 = 3 // give up after this many retries (then honor the block, don't hammer) |
| 8 | const POL_BACKOFF_BASE_SEC: i64 = 2 // exponential backoff base |
| 9 | const POL_BACKOFF_CAP_SEC: i64 = 60 // never sleep longer than this per retry |
| 11 | const POL_ARXIV_MIN_SEC: i64 = 3 |
| 12 | const POL_GITHUB_MIN_SEC: i64 = 6 |
functions
| 16 | func pol_wait_sec(now: i64, last: i64, min_interval: i64) -> i64 |
| 23 | func pol_backoff_sec(attempt: i64, base: i64, cap: i64) -> i64 |
| 30 | func pol_should_retry(status: i64) -> i64 { if status==429 { return 1 } if status==503 { return 1 } return 0 } |
| 32 | func pol_digit(c: i64) -> i64 { if c>=48 { if c<=57 { return 1 } } return 0 } called by 1: pol_retry_after |
| 33 | func pol_find_after(buf: *u8, n: i64, needle: *u8) -> i64 called by 1: pol_retry_after |
| 41 | func pol_retry_after(resp: *u8, n: i64) -> i64 |
| 52 | func pol_pace(last: i64, min_interval: i64) -> i64 |
| 59 | func pol_backoff_sleep(resp: *u8, n: i64, attempt: i64) -> i64 |