code wiki / _hdl_build / nx_meet_trust.nx
nx_meet_trust.nx source
↩ module page · 88 lines · 4331 B
1// nx_meet_trust.nx -- R6 of the NISHI MEET PLATFORM: the ANTI-FAKE engine (LIBRARY, no main). The headline
2// capability + the MEASURED exceed: rule-based detection of AI-generated / slop resumes and fake "ghost" job
3// postings -- the screening that lets "quality meet quality." Sovereign (nx_cc->nxasm, no ML runtime, no JS):
4// lowercase + weighted keyword signals (slop buzzword density vs concrete specifics: numbers, contacts, links,
5// salary, real URLs). Returns 0..100 (higher = more authentic); below TRUST_THRESHOLD => flagged. Thresholds are
6// named consts (rule 11). license_tier: ORIGINAL
7import "nx_syscalls.nx"
8import "nx_meet_lib.nx"
9
10const TRUST_THRESHOLD: i64 = 50
11
12// lowercase-copy src[0..n) into out (nul-term).
13func trust_lc(src: *u8, n: i64, out: *u8) -> i64 {
14 var i: i64 = 0
15 while i < n {
16 var c: i64 = src[i] as i64
17 if c >= 65 { if c <= 90 { c = c + 32 } }
18 out[i] = c as u8
19 i = i + 1
20 }
21 out[n] = 0 as u8
22 return n
23}
24// 1 if needle occurs in hay[0..n).
25func trust_has(hay: *u8, n: i64, needle: *u8) -> i64 {
26 let nl: i64 = mlen(needle); if nl == 0 { return 0 }
27 var i: i64 = 0
28 while i + nl <= n { var k: i64 = 0; var hit: i64 = 1; while k < nl { if hay[i+k] != needle[k] { hit = 0; k = nl } else { k = k + 1 } } if hit == 1 { return 1 } i = i + 1 }
29 return 0
30}
31func trust_has_digit(hay: *u8, n: i64) -> i64 {
32 var i: i64 = 0
33 while i < n { let c: i64 = hay[i] as i64; if c >= 48 { if c <= 57 { return 1 } } i = i + 1 }
34 return 0
35}
36
37// resume authenticity 0..100. Slop buzzword density subtracts; concrete specifics (numbers/contact/links) add.
38func trust_resume_score(text: *u8) -> i64 {
39 let n: i64 = mlen(text)
40 let lc: *u8 = sys_mmap(n + 16)
41 trust_lc(text, n, lc)
42 var s: i64 = 50
43 if trust_has(lc, n, "as an ai" as *u8) == 1 { s = s - 18 }
44 if trust_has(lc, n, "language model" as *u8) == 1 { s = s - 18 }
45 if trust_has(lc, n, "results-driven professional" as *u8) == 1 { s = s - 14 }
46 if trust_has(lc, n, "passionate team player" as *u8) == 1 { s = s - 14 }
47 if trust_has(lc, n, "detail-oriented" as *u8) == 1 { s = s - 10 }
48 if trust_has(lc, n, "synergy" as *u8) == 1 { s = s - 12 }
49 if trust_has(lc, n, "hit the ground running" as *u8) == 1 { s = s - 12 }
50 if trust_has(lc, n, "think outside the box" as *u8) == 1 { s = s - 12 }
51 if trust_has(lc, n, "go-getter" as *u8) == 1 { s = s - 10 }
52 if trust_has(lc, n, "proven track record" as *u8) == 1 { s = s - 10 }
53 if trust_has_digit(lc, n) == 1 { s = s + 14 }
54 if trust_has(lc, n, "@" as *u8) == 1 { s = s + 12 }
55 if trust_has(lc, n, "http" as *u8) == 1 { s = s + 12 }
56 if trust_has(lc, n, "%" as *u8) == 1 { s = s + 10 }
57 if trust_has(lc, n, "github" as *u8) == 1 { s = s + 8 }
58 if s < 0 { s = 0 }
59 if s > 100 { s = 100 }
60 return s
61}
62func trust_is_fake_resume(text: *u8) -> i64 { if trust_resume_score(text) < TRUST_THRESHOLD { return 1 } return 0 }
63
64// posting legitimacy 0..100. Ghost/MLM markers subtract; concrete company/salary/URL specifics add.
65func trust_posting_score(text: *u8) -> i64 {
66 let n: i64 = mlen(text)
67 let lc: *u8 = sys_mmap(n + 16)
68 trust_lc(text, n, lc)
69 var s: i64 = 50
70 if trust_has(lc, n, "competitive salary" as *u8) == 1 { s = s - 12 }
71 if trust_has(lc, n, "fast-paced environment" as *u8) == 1 { s = s - 12 }
72 if trust_has(lc, n, "be your own boss" as *u8) == 1 { s = s - 18 }
73 if trust_has(lc, n, "unlimited earning" as *u8) == 1 { s = s - 18 }
74 if trust_has(lc, n, "rockstar" as *u8) == 1 { s = s - 10 }
75 if trust_has(lc, n, "ninja" as *u8) == 1 { s = s - 10 }
76 if trust_has(lc, n, "wear many hats" as *u8) == 1 { s = s - 10 }
77 if trust_has(lc, n, "always hiring" as *u8) == 1 { s = s - 12 }
78 if trust_has(lc, n, "work hard play hard" as *u8) == 1 { s = s - 10 }
79 if trust_has(lc, n, "like a family" as *u8) == 1 { s = s - 10 }
80 if trust_has_digit(lc, n) == 1 { s = s + 12 }
81 if trust_has(lc, n, "http" as *u8) == 1 { s = s + 12 }
82 if trust_has(lc, n, "$" as *u8) == 1 { s = s + 12 }
83 if trust_has(lc, n, "remote" as *u8) == 1 { s = s + 6 }
84 if s < 0 { s = 0 }
85 if s > 100 { s = 100 }
86 return s
87}
88func trust_is_ghost_posting(text: *u8) -> i64 { if trust_posting_score(text) < TRUST_THRESHOLD { return 1 } return 0 }