code wiki / (root) / nx_consent.nx

nx_consent.nx source

↩ module page · 74 lines · 5334 B

1// nx_consent.nx -- CONSENT, PROVENANCE & LICENSE-TIER gate for character assets. Consent is the dividing line, so 2// make it MECHANICAL (like never-brick #26: proven by construction, fail-closed, not asserted). A hired model 3// licenses a GRADED TIER per their contract -- clothed-only -> standard artistic/figure nude (life drawing & 4// painting reference) -> explicit -- across specific USE-CASES (art-modeling coaching / game / commercial / 5// distribute). The DELIVERED nudity tier is set by what LAYERS cover the base (nx_outfit/makeup): a licensed nude 6// base can be dressed DOWN to clothed, or delivered bare only within its tier. The pipeline calls consent_allows() 7// before any delivery and is FAIL-CLOSED. Synthetic/fictional characters carry no real person -> ungated. 8// license_tier: ORIGINAL 9import "nx_syscalls.nx" 10 11// provenance 12const PROV_SYNTH: i64 = 0 // generated character (no real person) -> ungated 13const PROV_SCAN: i64 = 1 // photogrammetry/3D scan of a REAL hired model -> needs release + tier + scope 14const PROV_LIKENESS: i64 = 2 // authored from a real model's likeness -> needs release + tier + scope 15// LICENSE TIER (graded, "standard to explicit per their contract"). A delivery needs the model's tier >= its own. 16const LIC_CLOTHED: i64 = 0 // clothed depiction only 17const LIC_ARTISTIC: i64 = 1 // standard artistic / figure nude (life drawing & painting reference); non-explicit 18const LIC_EXPLICIT: i64 = 2 // explicit, per contract 19// USE-CASE scope bits (what the content is FOR; a delivery may require several) 20const USE_ART_COACH: i64 = 1 // nude-art-modeling reference / drawing & painting coaching 21const USE_GAME: i64 = 2 // game / interactive asset 22const USE_COMMERCIAL: i64 = 4 // commercial use 23const USE_DISTRIBUTE: i64 = 8 // publish / redistribute 24const USE_VR_INTERACTIVE: i64 = 16 // interactive / VR play (incl. explicit, at the explicit tier) 25// refusal reasons 26const CR_OK: i64 = 0 27const CR_NO_RELEASE: i64 = 1 28const CR_TIER: i64 = 2 // licensed tier below what the delivery needs 29const CR_OUT_OF_SCOPE: i64 = 3 // a required use-case not in the license 30const CR_EXPIRED: i64 = 4 31 32// record layout (i64[8]): [0]=provenance [1]=release_signed(0/1) [2]=licensed_tier [3]=use_scope_bits 33// [4]=expiry_epoch(0=none) [5]=consent_id [6]=model_ref [7]=capture_epoch 34func consent_init(rec: *i64, prov: i64, release: i64, tier: i64, use_scope: i64, expiry: i64, consent_id: i64, model_ref: i64) -> i64 { 35 rec[0]=prov; rec[1]=release; rec[2]=tier; rec[3]=use_scope; rec[4]=expiry; rec[5]=consent_id; rec[6]=model_ref; rec[7]=0 36 return 0 37} 38// the GATE: may this asset be delivered at req_tier for req_uses at time `now`? returns a CR_* reason (0=allowed). 39func consent_reason(rec: *i64, req_tier: i64, req_uses: i64, now: i64) -> i64 { 40 if rec[0] == PROV_SYNTH { return CR_OK } // fictional/generated: no real person, no gate 41 if rec[1] == 0 { return CR_NO_RELEASE } // real model, NO signed release -> fail-closed 42 if rec[2] < req_tier { return CR_TIER } // delivery more revealing than the licensed tier 43 if (rec[3] & req_uses) != req_uses { return CR_OUT_OF_SCOPE } 44 if rec[4] != 0 { if now > rec[4] { return CR_EXPIRED } } 45 return CR_OK 46} 47func consent_allows(rec: *i64, req_tier: i64, req_uses: i64, now: i64) -> i64 { if consent_reason(rec, req_tier, req_uses, now) == CR_OK { return 1 } return 0 } 48 49// EXPLICIT / VR SEXUAL INTERACTION gate ("all legal"). TWO absolute prerequisites, fail-closed: 50// (1) adult_verified == 1 -- the CSAM line, ABSOLUTE, applies to SYNTHETIC and REAL alike, never assumed 51// (synthetic char = adult BY CONSTRUCTION; real performer = ID-verified adult on the release). No explicit 52// content of any unverified subject, ever. 53// (2) an EXPLICIT license carrying the VR_INTERACTIVE scope -- i.e. a synthetic adult, or a consenting adult 54// performer whose contract explicitly covers interactive/explicit play. Anything less is refused. 55// This is how legal adult VR is produced: fictional adults, or consenting adult performers within a signed 56// explicit+interactive contract. Everything short of it (minor, artistic-only tier, no interactive scope, 57// expired) is REFUSED by construction -- like never-brick #26, proven mechanically not promised. 58func interaction_explicit_allowed(rec: *i64, adult_verified: i64, now: i64) -> i64 { 59 if adult_verified != 1 { return 0 } // (1) absolute adult line 60 return consent_allows(rec, LIC_EXPLICIT, USE_VR_INTERACTIVE, now) // (2) explicit tier + interactive scope 61} 62func consent_reason_str(r: i64) -> *u8 { 63 if r == CR_OK { return "ALLOWED" as *u8 } 64 if r == CR_NO_RELEASE { return "REFUSED: real model, no signed release (fail-closed)" as *u8 } 65 if r == CR_TIER { return "REFUSED: delivery exceeds the licensed tier (standard/explicit per contract)" as *u8 } 66 if r == CR_OUT_OF_SCOPE { return "REFUSED: use-case not in the model's license" as *u8 } 67 if r == CR_EXPIRED { return "REFUSED: license expired" as *u8 } 68 return "REFUSED" as *u8 69} 70func lic_tier_name(t: i64) -> *u8 { 71 if t == 0 { return "clothed" as *u8 } 72 if t == 1 { return "artistic-nude" as *u8 } 73 return "explicit" as *u8 74}