code wiki / _hdl_build / nx_meet_curate_gate.nx

nx_meet_curate_gate.nx source

↩ module page · 41 lines · 3826 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" 9 10func main() -> i64 { 11 mputs("=== nx_meet_curate_gate: R7 curation/membership -- screen (composes R6) + unskippable vetting flow ===\n" as *u8) 12 13 let realres: *u8 = "Built payment service handling 12000 req/s at Acme; cut latency 38 percent. jane@example.com github.com/jane" as *u8 14 let fakeres: *u8 = "As an AI language model, results-driven professional with synergy, proven track record, detail-oriented go-getter." as *u8 15 let realpost: *u8 = "Senior Engineer at Acme https://acme.com McKinney TX. Salary 140000 to 170000. careers@acme.com" as *u8 16 let ghostpost: *u8 = "Be your own boss, unlimited earning! Competitive salary, fast-paced environment, always hiring rockstars." as *u8 17 18 let mt: *u8 = sys_mmap(8); mt[0] = 0 as u8 // a real empty honeypot (the "" literal is unsafe for mlen) 19 var pass: i64 = 0; var fail: i64 = 0 20 // screening (composes the R6 trust engine) 21 if curate_screen_resume(realres, mt) == ST_SCREENED { pass=pass+1 } else { fail=fail+1; mputs(" FAIL real-resume-not-screened\n" as *u8) } 22 if curate_screen_resume(fakeres, mt) == ST_FLAGGED { pass=pass+1 } else { fail=fail+1; mputs(" FAIL slop-resume-not-flagged\n" as *u8) } 23 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) } 24 if curate_screen_posting(realpost, mt) == ST_SCREENED { pass=pass+1 } else { fail=fail+1; mputs(" FAIL real-posting-not-screened\n" as *u8) } 25 if curate_screen_posting(ghostpost, mt) == ST_FLAGGED { pass=pass+1 } else { fail=fail+1; mputs(" FAIL ghost-posting-not-flagged\n" as *u8) } 26 // valid vetting transitions 27 if curate_valid_transition(ST_PENDING, ST_SCREENED) == 1 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL pending->screened-blocked\n" as *u8) } 28 if curate_valid_transition(ST_SCREENED, ST_VERIFIED) == 1 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL screened->verified-blocked\n" as *u8) } 29 if curate_valid_transition(ST_VERIFIED, ST_MEMBER) == 1 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL verified->member-blocked\n" as *u8) } 30 if curate_valid_transition(ST_SCREENED, ST_FLAGGED) == 1 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL screened->flagged-blocked\n" as *u8) } 31 if curate_valid_transition(ST_FLAGGED, ST_REJECTED) == 1 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL flagged->rejected-blocked\n" as *u8) } 32 // TEETH: the club cannot be skipped 33 if curate_valid_transition(ST_PENDING, ST_MEMBER) == 0 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL pending->member-allowed\n" as *u8) } 34 if curate_valid_transition(ST_SCREENED, ST_MEMBER) == 0 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL screened->member-allowed\n" as *u8) } 35 if curate_valid_transition(ST_MEMBER, ST_PENDING) == 0 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL member-not-terminal\n" as *u8) } 36 if curate_valid_transition(ST_PENDING, ST_VERIFIED) == 0 { pass=pass+1 } else { fail=fail+1; mputs(" FAIL pending->verified-allowed\n" as *u8) } 37 38 mputs("MEET-CURATE-GATE pass=" as *u8); mnum(pass); mputs(" fail=" as *u8); mnum(fail) 39 if fail == 0 { mputs(" verdict=GREEN (club gate: composes R6 auto-screen + unskippable vetting flow)\n" as *u8); sys_exit(0); return 0 } 40 mputs(" verdict=RED\n" as *u8); sys_exit(1); return 1 41}