nx_scam_detector.nx
buildroot/runtime/nx_scam_detector.nx
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
imports: nx_syscalls.nxnx_tier.nxnx_intent.nx
imported by: nx_captain_moroni_compose_test.nxnx_scam_detector_test.nx
structs
| 60 | struct NxScamScanResult |
consts
| 37 | const NX_SP_URGENCY_PRESSURE: nx_int = 0 |
| 38 | const NX_SP_AUTHORITY_IMPERSONATION: nx_int = 1 |
| 39 | const NX_SP_PAYMENT_DIVERSION: nx_int = 2 |
| 40 | const NX_SP_GIFT_CARD_REQUEST: nx_int = 3 |
| 41 | const NX_SP_CRYPTO_INVESTMENT: nx_int = 4 |
| 42 | const NX_SP_ROMANCE_PROGRESSION: nx_int = 5 |
| 43 | const NX_SP_GRANDPARENT_HELP: nx_int = 6 |
| 44 | const NX_SP_TECH_SUPPORT_INTRUSION: nx_int = 7 |
| 45 | const NX_SP_N_PATTERNS: nx_int = 8 |
| 49 | const NX_SC_CLEAN: nx_int = 0 |
| 50 | const NX_SC_SUSPICIOUS: nx_int = 1 // 1-2 patterns detected |
| 51 | const NX_SC_LIKELY_SCAM: nx_int = 2 // 3+ patterns detected |
| 52 | const NX_SC_CONFIRMED_PATTERN: nx_int = 3 // canonical scam shape |
| 53 | const NX_SC_ERR_BAD_INTENT: nx_int = 4 |
functions
| 67 | func nx_sp_is_valid(p: nx_int) -> nx_int |
| 79 | func _scam_match_substring(buf: *u8, n: nx_size, kw: *u8, kw_n: nx_size) -> nx_int |
| 106 | func _scam_check_urgency(buf: *u8, n: nx_size) -> nx_int |
| 119 | func _scam_check_authority(buf: *u8, n: nx_size) -> nx_int |
| 129 | func _scam_check_gift_card(buf: *u8, n: nx_size) -> nx_int |
| 138 | func _scam_check_crypto(buf: *u8, n: nx_size) -> nx_int |
| 152 | func nx_scam_scan(buf: *u8, n: nx_size, |
| 199 | func nx_scam_pattern_flagged(r: *NxScamScanResult, pattern: nx_int) -> nx_int |