nx_antibot.nx
buildroot/runtime/nx_antibot.nx
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
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
| 25 | const ABT_MARKERS: *u8 = "knowledge/antibot_markers.conf" |
| 26 | const ABT_CONF: *u8 = "knowledge/antibot.conf" |
| 27 | const ABT_DEF_SMALL_PAGE_BYTES: i64 = 10240 // crawl4ai is_blocked: tier-2 terms only on pages < 10KB |
| 28 | const ABT_DEF_SHELL_MAX_TEXT: i64 = 500 // == WC_MININDEX, the crawler's measured thin-page bar; one number for "empty" |
| 29 | const ABT_CLEAN: i64 = 0 |
| 30 | const ABT_RATE_LIMIT: i64 = 1 |
| 31 | const ABT_STATUS_BLOCK: i64 = 2 |
| 32 | const ABT_VENDOR_WALL: i64 = 3 |
| 33 | const ABT_GENERIC_WALL: i64 = 4 |
| 34 | const ABT_EMPTY_SHELL: i64 = 5 |
| 35 | const ABT_HTTP_429: i64 = 429 |
| 36 | const ABT_HTTP_403: i64 = 403 |
| 37 | const ABT_HTTP_503: i64 = 503 |
| 38 | const ABT_HTTP_200: i64 = 200 |
| 39 | const ABT_HTTP_ERR_FLOOR: i64 = 400 |
| 40 | const ABT_PIPE: i64 = 124 |
| 41 | const ABT_NL: i64 = 10 |
| 42 | const ABT_CR: i64 = 13 |
| 43 | const ABT_HASH: i64 = 35 |
| 45 | const ABT_ROW: i64 = 7 |
| 46 | const ABT_R_TIER: i64 = 0 |
| 47 | const ABT_R_VOFF: i64 = 1 |
| 48 | const ABT_R_VLEN: i64 = 2 |
| 49 | const ABT_R_ROFF: i64 = 3 |
| 50 | const ABT_R_RLEN: i64 = 4 |
| 51 | const ABT_R_MOFF: i64 = 5 |
| 52 | const ABT_R_MLEN: i64 = 6 |
functions
| 72 | func abt_count_nl(b: *u8, n: i64) -> i64 called by 1: abt_load |
| 79 | func abt_parse_row(b: *u8, s: i64, e: i64, rows: *i64, r: i64) -> i64 called by 1: abt_load |
| 111 | func abt_load() -> i64 called by 2: abt_reloadabt_classify calls 6: lc_getisys_mmapsys_read_filesys_free_fileabt_count_nlabt_parse_row |
| 152 | func abt_reload() -> i64 { abt_loaded_g = 0; return abt_load() } |
| 155 | func abt_find(hay: *u8, n: i64, needle: *u8, nl: i64) -> i64 called by 1: abt_scan_tier |
| 167 | func abt_set_last(r: i64) -> i64 called by 1: abt_classify |
| 182 | func abt_scan_tier(html: *u8, n: i64, tier: i64) -> i64 |
| 195 | func abt_classify(status: i64, html: *u8, n: i64) -> i64 called by 3: ag_clsmainmain calls 6: abt_loadabt_set_lastabt_scan_tiersys_munmapsys_mmapnx_html_to_text |
| 225 | func abt_code_name(code: i64) -> *u8 called by 1: main |