code wiki / _hdl_build / nx_hr_bot_behavior.nx
nx_hr_bot_behavior.nx
buildroot/runtime/_hdl_build/nx_hr_bot_behavior.nx
about
nx_hr_bot_behavior.nx -- NISHI HR, visitor module REDESIGNED for PRIVACY + sophistication (operator 2026-06-20:
"we are NOT going to log visitors / we don't want IP / we don't want anything; evaluate bots by BEHAVIOR even
if they are sophisticated"). SUPERSEDES the UA/IP approach (nx_hr_visitor list-match + nx_hr_visitor_log IP-log),
which sophisticated bots defeat (UA spoof + residential-IP rotation) AND which logs PII. This evaluates a visitor
purely from EPHEMERAL per-session BEHAVIOR signals -- ZERO IP / UA / identity inputs by construction (privacy by
design: nothing about the visitor is stored). Researcher-grounded (sovereign fetch, cited):
knowledge/fetched/botbehavior_scraping.raw -- web-scraping countermeasures: CAPTCHA/challenge, fingerprinting,
bot-detection, HONEYPOTS (invisible traps humans never touch). [en.wikipedia.org/wiki/Web_scraping]
knowledge/fetched/botbehavior_fingerprint.raw -- passive/behavioral fingerprinting signals. [.../Device_fingerprint]
knowledge/fetched/botbehavior_bot.raw -- bot taxonomy/threat. [.../Internet_bot]
DESIGN: no single signal (a sophisticated bot fakes any one); LAYER them + impose a cost (proof-of-work/JS
challenge) -- a bot can spoof a UA but cannot cheaply manufacture real human interaction entropy AND solve a
per-session challenge AND stay consistent. Signals are 0..100 (or 0/1), computed live by the front-end and
DISCARDED after the verdict. license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_hr_bot_behavior_gate.nx
structs
| none |
consts
| 17 | const HB_ALLOW: i64 = 0 |
| 18 | const HB_CHALLENGE: i64 = 1 // ambiguous -> raise a cost (proof-of-work / interactive challenge), don't block a human |
| 19 | const HB_BLOCK: i64 = 2 |
| 22 | const HB_BLOCK_THRESH: i64 = 60 |
| 23 | const HB_CHALLENGE_THRESH: i64 = 30 |
functions
| 32 | func hb_bot_score(interaction_entropy: i64, timing_regularity: i64, challenge_solved: i64, sequence_anomaly: i64, honeypot_hit: i64, env_consistent: i64) -> i64 |
| 46 | func hb_verdict(score: i64) -> i64 |
| 52 | func hb_evaluate(interaction_entropy: i64, timing_regularity: i64, challenge_solved: i64, sequence_anomaly: i64, honeypot_hit: i64, env_consistent: i64) -> i64 |
| 55 | func hb_verdict_name(v: i64) -> *u8 { if v == HB_BLOCK { return "BLOCK" as *u8 } if v == HB_CHALLENGE { return "CHALLENGE" as *u8 } return "ALLOW" as *u8 } |