code wiki / _hdl_build / nx_meet_curate_gate.nx

nx_meet_curate_gate.nx source

↩ module page · 49 lines · 4210 B

1// nx_meet_curate_gate.nx -- liar-kill gate for R7 (curation/membership). Proves the club gate composes R6 2// (a clean applicant is SCREENED through; an AI-slop resume, a ghost posting, or a honeypot-tripping bot is 3// auto-FLAGGED) AND that the vetting state machine cannot be skipped (PENDING->MEMBER, SCREENED->MEMBER, 4// MEMBER->* are all refused). expect_exit: 0 5import "nx_syscalls.nx" 6import "nx_meet_lib.nx" 7import "nx_meet_trust.nx" 8import "nx_meet_curate.nx" 9import "nx_gate_verdict.nx" 10 11func main() -> i64 { 12 mputs("=== nx_meet_curate_gate: R7 curation/membership -- screen (composes R6) + unskippable vetting flow ===\n" as *u8) 13 14 let realres: *u8 = "Built payment service handling 12000 req/s at Acme; cut latency 38 percent. jane@example.com github.com/jane" as *u8 15 let fakeres: *u8 = "As an AI language model, results-driven professional with synergy, proven track record, detail-oriented go-getter." as *u8 16 let realpost: *u8 = "Senior Engineer at Acme https://acme.com McKinney TX. Salary 140000 to 170000. careers@acme.com" as *u8 17 let ghostpost: *u8 = "Be your own boss, unlimited earning! Competitive salary, fast-paced environment, always hiring rockstars." as *u8 18 19 let mt: *u8 = sys_mmap(8); mt[0] = 0 as u8 // a real empty honeypot (the "" literal is unsafe for mlen) 20 var pass: i64 = 0; var fail: i64 = 0 21 // screening (composes the R6 trust engine) 22 if curate_screen_resume(realres, mt) == ST_SCREENED { pass=pass+1 } else { fail=fail+1; mputs(" FAIL real-resume-not-screened\n" as *u8) } 23 if curate_screen_resume(fakeres, mt) == ST_FLAGGED { pass=pass+1 } else { fail=fail+1; mputs(" FAIL slop-resume-not-flagged\n" as *u8) } 24 if curate_screen_resume(realres, "http://spam.example" as *u8) == ST_FLAGGED { pass=pass+1 } else { fail=fail+1; mputs(" FAIL honeypot-bot-not-flagged\n" as *u8) } 25 if curate_screen_posting(realpost, mt) == ST_SCREENED { pass=pass+1 } else { fail=fail+1; mputs(" FAIL real-posting-not-screened\n" as *u8) } 26 if curate_screen_posting(ghostpost, mt) == ST_FLAGGED { pass=pass+1 } else { fail=fail+1; mputs(" FAIL ghost-posting-not-flagged\n" as *u8) } 27 // valid vetting transitions 28 if curate_valid_transition(ST_PENDING, ST_SCREENED) == 1 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL pending->screened-blocked\n" as *u8) } 29 if curate_valid_transition(ST_SCREENED, ST_VERIFIED) == 1 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL screened->verified-blocked\n" as *u8) } 30 if curate_valid_transition(ST_VERIFIED, ST_MEMBER) == 1 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL verified->member-blocked\n" as *u8) } 31 if curate_valid_transition(ST_SCREENED, ST_FLAGGED) == 1 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL screened->flagged-blocked\n" as *u8) } 32 if curate_valid_transition(ST_FLAGGED, ST_REJECTED) == 1 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL flagged->rejected-blocked\n" as *u8) } 33 // TEETH: the club cannot be skipped 34 if curate_valid_transition(ST_PENDING, ST_MEMBER) == 0 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL pending->member-allowed\n" as *u8) } 35 if curate_valid_transition(ST_SCREENED, ST_MEMBER) == 0 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL screened->member-allowed\n" as *u8) } 36 if curate_valid_transition(ST_MEMBER, ST_PENDING) == 0 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL member-not-terminal\n" as *u8) } 37 if curate_valid_transition(ST_PENDING, ST_VERIFIED) == 0 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL pending->verified-allowed\n" as *u8) } 38 39 mputs("MEET-CURATE-GATE pass=" as *u8); mnum(pass); mputs(" fail=" as *u8); mnum(fail) 40 // MIGRATED onto nx_gate_verdict by nx_gate_dry_apply (D001, minimal form): every check 41 // row above is untouched, so the PASS/FAIL vector cannot change; only the hand-rolled 42 // verdict emission is replaced by the ONE shared base class. Proven by nx_gate_migrate verify. 43 let ctr__dry: *i64 = gv_ctr() 44 ctr__dry[0] = pass 45 ctr__dry[1] = pass + fail 46 let rc__dry: i64 = gv_verdict("MEET-CURATE-GATE" as *u8, ctr__dry, "club gate: composes R6 auto-screen + unskippable vetting flow)" as *u8) 47 sys_exit(rc__dry) 48 return rc__dry 49}