code wiki / (root) / nx_anti_slop.nx

nx_anti_slop.nx

buildroot/runtime/nx_anti_slop.nx

3626 B61 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_anti_slop.nx nx_anti_slop_gate.nx

imports: nx_syscalls.nx

imported by: nx_anti_slop_gate.nx

structs

none

consts

10const AS_MAGIC_1469598103934665603: i64 = 1469598103934665603
11const AS_MAGIC_1099511628211: i64 = 1099511628211
12const AS_MAGIC_8192: i64 = 8192
14const AS_MIN: i64 = 5 // min tokens for "adequate length"
15const AS_FLOOR: i64 = 50 // quality floor (>0): slop is DOWN-ranked, never removed (neutrality)
16const AS_THRESH: i64 = 500 // >= this = KEEP (real content); below = down-ranked slop

functions

18func as_lc(c: i64) -> i64 { if c >= 0x41 { if c <= 0x5a { return c + 0x20 } } return c }
called by 1: as_tok_hash
19func 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
20func 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 }
called by 1: as_quality calls 1: as_lc
23func as_quality(text: *u8, len: i64) -> i64
called by 1: main calls 3: sys_mmapas_is_tokas_tok_hash
59func as_apply(base: i64, quality: i64) -> i64 { return base * quality / 1000 }
called by 1: main
61func as_keep(quality: i64) -> i64 { if quality >= AS_THRESH { return 1 } return 0 }
called by 1: main