code wiki / _hdl_build / nx_consent_gate.nx
nx_consent_gate.nx source
↩ module page · 54 lines · 3957 B
1// nx_consent_gate.nx -- CONSENT enforced by construction, incl. the EXPLICIT/VR-SEXUAL "all legal" gate. Proves
2// the tier/scope matrix AND that interactive explicit play needs (1) a VERIFIED ADULT (absolute -- synthetic or
3// real) and (2) an EXPLICIT license with the VR-interactive scope. Minor / artistic-only / no-interactive-scope /
4// expired are all REFUSED, fail-closed. expect_exit:0 license_tier: ORIGINAL
5import "nx_syscalls.nx"
6import "nx_consent.nx"
7
8func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
9func yn(v: i64) -> i64 { if v==1 { hw("ALLOW" as *u8) } else { hw("REFUSE" as *u8) } return 0 }
10func chk(label: *u8, got: i64, want: i64, fp: *i64) -> i64 {
11 hw(" "); hw(label); hw(" -> "); yn(got)
12 if got == want { hw(" ok\n" as *u8) } else { hw(" MISMATCH\n" as *u8); fp[0]=fp[0]+1 }
13 return 0
14}
15
16func main() -> i64 {
17 hw("=== nx_consent_gate -- consent tiers + the explicit/VR 'all legal' gate ===\n" as *u8)
18 let rec: *i64 = sys_mmap(8 * 8) as *i64
19 let now: i64 = 1000000
20 let fp: *i64 = sys_mmap(8) as *i64; fp[0] = 0
21
22 // --- base tier/scope matrix (delivery of nude/clothed content) ---
23 consent_init(rec, PROV_SYNTH, 0, 0, 0, 0, 0, 0)
24 chk("synthetic, artistic-nude delivery " as *u8, consent_allows(rec, LIC_ARTISTIC, 0, now), 1, fp)
25 consent_init(rec, PROV_SCAN, 1, LIC_CLOTHED, USE_DISTRIBUTE, 2000000, 100, 1)
26 chk("clothed-license model, artistic delivery" as *u8, consent_allows(rec, LIC_ARTISTIC, USE_DISTRIBUTE, now), 0, fp)
27 consent_init(rec, PROV_SCAN, 0, LIC_EXPLICIT, USE_DISTRIBUTE, 2000000, 101, 1)
28 chk("model, NO signed release " as *u8, consent_allows(rec, LIC_ARTISTIC, USE_DISTRIBUTE, now), 0, fp)
29
30 // --- the EXPLICIT / VR-SEXUAL 'all legal' gate ---
31 hw(" -- explicit / VR sexual interaction (needs ADULT + explicit license + interactive scope) --\n" as *u8)
32 // synthetic ADULT, explicit + interactive: fictional adult play -> ALLOWED
33 consent_init(rec, PROV_SYNTH, 0, 0, 0, 0, 0, 0)
34 chk("synthetic ADULT, explicit VR play " as *u8, interaction_explicit_allowed(rec, 1, now), 1, fp)
35 // synthetic but adult NOT verified -> REFUSED (absolute CSAM line, even for a synthetic character)
36 chk("synthetic, adult NOT verified " as *u8, interaction_explicit_allowed(rec, 0, now), 0, fp)
37 // adult, but only ARTISTIC license (not explicit) -> REFUSED
38 consent_init(rec, PROV_SCAN, 1, LIC_ARTISTIC, USE_VR_INTERACTIVE, 2000000, 200, 5)
39 chk("adult performer, only ARTISTIC license " as *u8, interaction_explicit_allowed(rec, 1, now), 0, fp)
40 // adult, explicit license but scope lacks VR_INTERACTIVE -> REFUSED
41 consent_init(rec, PROV_SCAN, 1, LIC_EXPLICIT, USE_DISTRIBUTE, 2000000, 201, 5)
42 chk("adult, explicit but no interactive scope" as *u8, interaction_explicit_allowed(rec, 1, now), 0, fp)
43 // adult performer, explicit + interactive contract -> ALLOWED (a consenting adult performer, legal)
44 consent_init(rec, PROV_SCAN, 1, LIC_EXPLICIT, USE_VR_INTERACTIVE + USE_DISTRIBUTE, 2000000, 202, 5)
45 chk("adult performer, explicit+interactive " as *u8, interaction_explicit_allowed(rec, 1, now), 1, fp)
46 // same performer, but a MINOR (adult not verified) -> REFUSED absolutely, license notwithstanding
47 chk("same contract but adult NOT verified " as *u8, interaction_explicit_allowed(rec, 0, now), 0, fp)
48 // adult performer, explicit+interactive but EXPIRED -> REFUSED
49 consent_init(rec, PROV_SCAN, 1, LIC_EXPLICIT, USE_VR_INTERACTIVE, 500000, 203, 5)
50 chk("adult performer, license EXPIRED " as *u8, interaction_explicit_allowed(rec, 1, now), 0, fp)
51
52 if fp[0] == 0 { hw("CONSENT-GATE GREEN -- explicit/VR play ALLOWED only for verified adults within an explicit+interactive license; all else fail-closed\n" as *u8); sys_exit(0); return 0 }
53 hw("CONSENT-GATE RED\n" as *u8); sys_exit(1); return 1
54}