code wiki / (root) / nx_scam_detector.nx

nx_scam_detector.nx

buildroot/runtime/nx_scam_detector.nx

8011 B204 linesdepth 3pulls 3 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_scam_detector.nx -- inbound-communication pattern detection. Per [[feedback-captain-moroni-doctrine]] Phase M4: "Phishing, vishing, romance-scam, BEC patterns. Defends family, never attacks scammers — just refuses to be a victim." THE FAMILY-DEFENSE PRIMITIVE. Inbound message (SMS, email, call transcript, DM) is scanned for known scam patterns; substrate surfaces verdict to operator. Captain Moroni discipline: we don't attack the scammer, we just don't fall for it. Composes: nx_intent -- detector itself runs under Defensive intent nx_pamp -- composes with pattern recognition layer nx_xenocell -- a confirmed scammer can be tagged as foreign nx_evict_journal -- all scam-flagged messages logged nx_aposematism -- our cell may advertise "fraud-detection active" so scammer ML backs off (similar judo to vendor-scanner mimicry) V1 patterns shipped (the 8 highest-frequency scam classes): - URGENCY_PRESSURE -- "act now" / "limited time" - AUTHORITY_IMPERSONATION -- claims-to-be-IRS / police / bank - PAYMENT_DIVERSION -- "new banking details for invoice" - GIFT_CARD_REQUEST -- "pay with gift cards" - CRYPTO_INVESTMENT -- "guaranteed returns" + "send crypto" - ROMANCE_PROGRESSION -- relationship-building + money-ask - GRANDPARENT_HELP -- relative-in-trouble + money + secrecy - TECH_SUPPORT_INTRUSION -- "your computer has a virus, call us"

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_tier.nx nx_intent.nx nx_scam_detector.nx nx_captain_moroni_compose_test.nx nx_scam_detector_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_intent.nx

imported by: nx_captain_moroni_compose_test.nxnx_scam_detector_test.nx

structs

60struct NxScamScanResult

consts

37const NX_SP_URGENCY_PRESSURE: nx_int = 0
38const NX_SP_AUTHORITY_IMPERSONATION: nx_int = 1
39const NX_SP_PAYMENT_DIVERSION: nx_int = 2
40const NX_SP_GIFT_CARD_REQUEST: nx_int = 3
41const NX_SP_CRYPTO_INVESTMENT: nx_int = 4
42const NX_SP_ROMANCE_PROGRESSION: nx_int = 5
43const NX_SP_GRANDPARENT_HELP: nx_int = 6
44const NX_SP_TECH_SUPPORT_INTRUSION: nx_int = 7
45const NX_SP_N_PATTERNS: nx_int = 8
49const NX_SC_CLEAN: nx_int = 0
50const NX_SC_SUSPICIOUS: nx_int = 1 // 1-2 patterns detected
51const NX_SC_LIKELY_SCAM: nx_int = 2 // 3+ patterns detected
52const NX_SC_CONFIRMED_PATTERN: nx_int = 3 // canonical scam shape
53const NX_SC_ERR_BAD_INTENT: nx_int = 4

functions

67func nx_sp_is_valid(p: nx_int) -> nx_int
79func _scam_match_substring(buf: *u8, n: nx_size, kw: *u8, kw_n: nx_size) -> nx_int
106func _scam_check_urgency(buf: *u8, n: nx_size) -> nx_int
119func _scam_check_authority(buf: *u8, n: nx_size) -> nx_int
129func _scam_check_gift_card(buf: *u8, n: nx_size) -> nx_int
138func _scam_check_crypto(buf: *u8, n: nx_size) -> nx_int
152func nx_scam_scan(buf: *u8, n: nx_size,
199func nx_scam_pattern_flagged(r: *NxScamScanResult, pattern: nx_int) -> nx_int
called by 1: main calls 1: nx_sp_is_valid