nx_anti_slop.nx
buildroot/runtime/nx_anti_slop.nx
about
nx_anti_slop.nx -- LIB: anti-slop QUALITY FILTER = the 2026 relevance edge (AI content farms lost 50-90% traffic;
the web drowns in AI slop). Scores a document's "real human content" likelihood from measurable text signals and
returns a rank MULTIPLIER (0..1000 permille) that DOWN-RANKS slop -- it NEVER deletes (composes the content-neutrality
charter: no dead-internet walls, freedom of expression; even the worst slop keeps a positive FLOOR so it still
appears, just lower). Signals: lexical diversity (unique/total -- real content is diverse; AI-slop + keyword-stuffing
are not), keyword-stuffing repetition (max-token-freq/total), thin-content length. Data-driven thresholds. Built +
gated NOW; runs over the ingested corpus at NAS scale later, fused as a quality prior into nx_rank_fused. No float.
license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_anti_slop_gate.nx
structs
| none |
consts
| 10 | const AS_MAGIC_1469598103934665603: i64 = 1469598103934665603 |
| 11 | const AS_MAGIC_1099511628211: i64 = 1099511628211 |
| 12 | const AS_MAGIC_8192: i64 = 8192 |
| 14 | const AS_MIN: i64 = 5 // min tokens for "adequate length" |
| 15 | const AS_FLOOR: i64 = 50 // quality floor (>0): slop is DOWN-ranked, never removed (neutrality) |
| 16 | const AS_THRESH: i64 = 500 // >= this = KEEP (real content); below = down-ranked slop |
functions
| 18 | func as_lc(c: i64) -> i64 { if c >= 0x41 { if c <= 0x5a { return c + 0x20 } } return c } called by 1: as_tok_hash |
| 19 | func as_is_tok(c: i64) -> i64 { if c >= 0x30 { if c <= 0x39 { return 1 } } if c >= 0x41 { if c <= 0x5a { return 1 } } if c >= 0x61 { if c <= 0x7a { return 1 } } return 0 } called by 1: as_quality |
| 20 | func as_tok_hash(text: *u8, s: i64, e: i64) -> i64 { var h: i64 = AS_MAGIC_1469598103934665603; var i: i64 = s; while i < e { h = h ^ as_lc(text[i] as i64); h = h * AS_MAGIC_1099511628211; i = i + 1 } return h } |
| 23 | func as_quality(text: *u8, len: i64) -> i64 |
| 59 | func as_apply(base: i64, quality: i64) -> i64 { return base * quality / 1000 } called by 1: main |
| 61 | func as_keep(quality: i64) -> i64 { if quality >= AS_THRESH { return 1 } return 0 } called by 1: main |