code wiki / (root) / nx_antibot.nx

nx_antibot.nx

buildroot/runtime/nx_antibot.nx

10595 B232 linesdepth 4pulls 5 transitivereach 6 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_antibot.nx -- BOT-WALL CLASSIFICATION AS DATA: the /compare/webscraping R4 contract (symbol abt_classify). Recognises a challenge / block / rate-limit response FROM CAPTURED SPECIMENS and reports a VERDICT. It never solves, retries, rotates or escalates -- the plan row says so and so does the estate's ethics: a wall is a host's answer, and the crawler's job is to record it honestly (outcome row) and move on, not to defeat it. Concept source: crawl4ai antibot_detector.py (three tiers: structural vendor markers on any page size, generic phrases only on short or error pages, structural integrity of the body). Sovereign form: the markers are ROWS in knowledge/antibot_markers.conf (tier|vendor|reason|marker, literal bytes, no regex), the two scalars are rows in knowledge/antibot.conf, and the classifier is a pure function over (status, body) plus those rows. Codes: ABT_CLEAN 0 nothing matched ABT_RATE_LIMIT 1 HTTP 429 (always a rate limit; the pacer, not this organ, decides how long to wait) ABT_STATUS_BLOCK 2 HTTP 403 / 503 carrying an HTML body (a refusal page, vendor unknown unless a marker names it) ABT_VENDOR_WALL 3 a tier-1 marker matched (abt_last_vendor_g / abt_last_reason_g name it) ABT_GENERIC_WALL 4 a tier-2 marker matched on a short or error body ABT_EMPTY_SHELL 5 a 200 whose text is under shell_max_text: a JS-only page or a silent block -- its OWN class, because an empty page is not evidence of a wall and must not be laundered into one FALSE POSITIVES ARE NOT CHEAP HERE (the source says they are, because its fallback rescues them; ours has no fallback by design): a wall verdict drops a page from the index and feeds the host-health streak, so the gate carries a long-prose control that MENTIONS captcha, Cloudflare and Access Denied and must read CLEAN. license_tier: ORIGINAL module: nishi-core.search.antibot No hw writes (Rule 26).

dependencies 3 imports · 3 importers

nx_syscalls.nx nx_lane_conf.nx nx_html_to_text.nx nx_antibot.nx nx_antibot_gate.nx nx_source_health_probe.nx nx_web_crawl_step.nx

imports: nx_syscalls.nxnx_lane_conf.nxnx_html_to_text.nx

imported by: nx_antibot_gate.nxnx_source_health_probe.nxnx_web_crawl_step.nx

structs

none

consts

25const ABT_MARKERS: *u8 = "knowledge/antibot_markers.conf"
26const ABT_CONF: *u8 = "knowledge/antibot.conf"
27const ABT_DEF_SMALL_PAGE_BYTES: i64 = 10240 // crawl4ai is_blocked: tier-2 terms only on pages < 10KB
28const ABT_DEF_SHELL_MAX_TEXT: i64 = 500 // == WC_MININDEX, the crawler's measured thin-page bar; one number for "empty"
29const ABT_CLEAN: i64 = 0
30const ABT_RATE_LIMIT: i64 = 1
31const ABT_STATUS_BLOCK: i64 = 2
32const ABT_VENDOR_WALL: i64 = 3
33const ABT_GENERIC_WALL: i64 = 4
34const ABT_EMPTY_SHELL: i64 = 5
35const ABT_HTTP_429: i64 = 429
36const ABT_HTTP_403: i64 = 403
37const ABT_HTTP_503: i64 = 503
38const ABT_HTTP_200: i64 = 200
39const ABT_HTTP_ERR_FLOOR: i64 = 400
40const ABT_PIPE: i64 = 124
41const ABT_NL: i64 = 10
42const ABT_CR: i64 = 13
43const ABT_HASH: i64 = 35
45const ABT_ROW: i64 = 7
46const ABT_R_TIER: i64 = 0
47const ABT_R_VOFF: i64 = 1
48const ABT_R_VLEN: i64 = 2
49const ABT_R_ROFF: i64 = 3
50const ABT_R_RLEN: i64 = 4
51const ABT_R_MOFF: i64 = 5
52const ABT_R_MLEN: i64 = 6

functions

72func abt_count_nl(b: *u8, n: i64) -> i64
called by 1: abt_load
79func abt_parse_row(b: *u8, s: i64, e: i64, rows: *i64, r: i64) -> i64
called by 1: abt_load
111func abt_load() -> i64
152func abt_reload() -> i64 { abt_loaded_g = 0; return abt_load() }
called by 1: main calls 1: abt_load
155func abt_find(hay: *u8, n: i64, needle: *u8, nl: i64) -> i64
called by 1: abt_scan_tier
167func abt_set_last(r: i64) -> i64
called by 1: abt_classify
182func abt_scan_tier(html: *u8, n: i64, tier: i64) -> i64
called by 1: abt_classify calls 1: abt_find
195func abt_classify(status: i64, html: *u8, n: i64) -> i64
225func abt_code_name(code: i64) -> *u8
called by 1: main