code wiki / (root) / nx_realperson_gate.nx

nx_realperson_gate.nx source

↩ module page · 190 lines · 11902 B

1// nx_realperson_gate.nx -- REFEREE for WRITING rung W-RP-1 (nx_realperson). 2// 3// ★★★★★★THIS GATE EXISTS IN ITS CURRENT FORM BECAUSE THE OPERATOR CORRECTED THE DESIGN: 4// "in the US we have free speech, so lots of things are legal that may not be moral." 5// The first version refused explicit PROSE about a public figure and called that a legal line. 6// It is not one. Fiction, parody and satire about public figures are protected speech in the US 7// (Hustler v. Falwell). That version was enforcing taste while claiming to enforce law -- the exact 8// failure this lane is built to avoid. The teeth below separate the two axes that actually 9// decide US exposure -- MEDIUM and PRESENTATION -- instead of scoring how explicit the words are. 10// 11// [T1] whole-word: "presidential" must NOT score "president". 12// [T2] case-insensitive. 13// [T3] real person, non-intimate, fiction -> PROTECTED. 14// [T4] ★explicit TEXT about a public figure -> PROTECTED (legal, possibly distasteful). 15// [T5] ★the SAME words as a photorealistic LIKENESS -> REFUSE (NCII). Only the MEDIUM changed. 16// [T6] ★consent lifts the NCII refusal -- consent is what that statute turns on. 17// [T7] ★minor -> REFUSE in every medium, consent irrelevant (it cannot exist). 18// [T8] presented as FACT -> REVIEW (defamation surface), never an automatic refusal. 19// [T9] commercial likeness -> REVIEW (right of publicity; a state-varying tort). 20// [T10] NEG-CONTROL: no real person at all -> CLEAR even at full explicitness, even as an image. 21// [T11] NEG-CONTROL: plain text scores 0 (the meter can fail to fire). 22// [T12] NEG-CONTROL: name-shape alone does not convict; [T12b] but it IS detected. 23// [T13] name-shape reinforces an existing marker (adds, never creates). 24// [T14] thresholds are PARAMETERS. 25// [T15-T17] published-adult subject -> FLAG OPERATOR; private -> REFUSE; a minor is never laundered. 26// [T18-T20] SUSPECTED minor -> QUARANTINE (withheld AND preserved); CONFIRMED -> REFUSE. 27// 28// Lexicons are DELIBERATELY BENIGN PROXIES: this gate proves the MECHANISM and authors nothing. 29// 30// ★★★★★★MIGRATED ONTO THE BASE CLASS 2026-09-11 (D001). /api/promote REFUSED the previous 31// hand-rolled verdict: "this gate rolls its own verdict instead of inheriting nx_gate_verdict, so 32// nothing can read its outcome -- nx_gate_green cannot judge it and it records no harness.jrnl 33// frame, so flake and erosion stay invisible for it." The named escape allow_own_verdict=yes was 34// deliberately NOT taken: it ships a permanently unreadable gate, which is the defect wearing a flag. 35// WHAT CHANGED IS ONLY THE EMITTER. Every tooth's inputs and its expected verdict constant are 36// byte-for-byte the ones measured GREEN 21/21 and bite-proven (valid_mutants=1 killed=1 not_reached=0, 37// comparison site off=9724 in nx_realperson.nx) on 2026-09-11 BEFORE this migration. Each tooth is now 38// gv_check_eq, which ASSERTS AND EMITS IN ONE CALL, so the number tested and the number published 39// cannot drift apart, and every tooth prints actual/expected/delta for independent adjudication. 40// The exit code is gv_verdict's: 0 GREEN / 1 RED / 3 SKIP, and gv_journal records the frame. 41// REMOVED DELIBERATELY: the bespoke append to knowledge/status/realperson_gate.log. It was a second 42// ruler beside the base class's journal, it could drift from the teeth it described, and gv_journal is 43// the frame every rollup and nx_gate_green can already read. Stdout evidence is unchanged and the job 44// runner captures it. 45// The three negative controls now carry the greppable neg-control- token so the gatelaw census can SEE 46// them: a control nobody can find is a control nobody maintains. 47// Composes rp_len rather than re-deriving a string length locally. 48// 49// Sovereign x86_64. license_tier: ORIGINAL expect_exit: 0 50import "nx_syscalls_x86_64.nx" 51import "nx_gate_verdict.nx" 52import "nx_realperson.nx" 53 54func main() -> i64 { 55 gv_head("REALPERSON-GATE W-RP-1 (US law SHAPE: TEXT fiction=PROTECTED, IMAGE+intimate=NCII, minor=absolute, factual=defamation-review)\x00" as *u8) 56 let ctr: *i64 = gv_ctr() 57 58 let rterms: *u8 = "president\x00actress\x00deepfake\x00lookalike\x00real name\x00\x00" as *u8 59 let rw: *i64 = sys_mmap(64) as *i64 60 rw[0] = 3; rw[1] = 3; rw[2] = 5; rw[3] = 4; rw[4] = 4 61 let RN: i64 = 5 62 let iterms: *u8 = "intimate\x00undressed\x00bedroom\x00\x00" as *u8 63 let iw: *i64 = sys_mmap(64) as *i64 64 iw[0] = 5; iw[1] = 5; iw[2] = 3 65 let IN: i64 = 3 66 67 let TXT: i64 = RP_MEDIUM_TEXT 68 let IMG: i64 = RP_MEDIUM_IMAGE 69 let FIC: i64 = RP_PRESENT_FICTION 70 let FAC: i64 = RP_PRESENT_FACTUAL 71 let RT: i64 = RP_REF_THRESHOLD 72 let IT: i64 = RP_INTIMATE_THRESHOLD 73 let NOC: i64 = RP_CONSENT_NONE 74 let PRIV: i64 = RP_SUBJECT_PRIVATE 75 let PUB: i64 = RP_SUBJECT_PUBLISHED 76 let MNONE: i64 = RP_MINOR_NONE 77 let MSUS: i64 = RP_MINOR_SUSPECTED 78 let MCONF: i64 = RP_MINOR_CONFIRMED 79 80 let t1: *u8 = "a tour of the presidential suite\x00" as *u8 81 gv_check_eq("T1 whole-word (presidential does NOT score president)\x00" as *u8, 82 rp_score(t1, 0, rp_len(t1), rterms, rw, RN), 0, ctr) 83 84 let t2: *u8 = "the President waved\x00" as *u8 85 gv_check_eq("T2 case-insensitive\x00" as *u8, 86 rp_score(t2, 0, rp_len(t2), rterms, rw, RN), 3, ctr) 87 88 let t3: *u8 = "a portrait of the president at a podium\x00" as *u8 89 gv_check_eq("T3 real person, non-intimate, fiction -> PROTECTED\x00" as *u8, 90 rp_judge(t3, 0, rp_len(t3), rterms, rw, RN, iterms, iw, IN, TXT, FIC, MNONE, 0, PRIV, NOC, RT, IT), 91 RP_PROTECTED, ctr) 92 93 let t4: *u8 = "the president undressed in the bedroom\x00" as *u8 94 95 // ★THE CORRECTION, ENCODED: explicit PROSE about a public figure is LAWFUL in the US. 96 gv_check_eq("T4 explicit TEXT re a public figure -> PROTECTED (lawful, not a taste call)\x00" as *u8, 97 rp_judge(t4, 0, rp_len(t4), rterms, rw, RN, iterms, iw, IN, TXT, FIC, MNONE, 0, PRIV, NOC, RT, IT), 98 RP_PROTECTED, ctr) 99 100 // ★THE REAL LINE: same words as a photorealistic likeness = NCII. 101 gv_check_eq("T5 same words as IMAGE likeness -> REFUSE (NCII)\x00" as *u8, 102 rp_judge(t4, 0, rp_len(t4), rterms, rw, RN, iterms, iw, IN, IMG, FIC, MNONE, 0, PRIV, NOC, RT, IT), 103 RP_REFUSE, ctr) 104 105 gv_check_eq("T6 same IMAGE WITH declared consent -> allowed\x00" as *u8, 106 rp_judge(t4, 0, rp_len(t4), rterms, rw, RN, iterms, iw, IN, IMG, FIC, MNONE, 0, PRIV, RP_CONSENT_RELEASE, RT, IT), 107 RP_CONSENT, ctr) 108 109 gv_check_eq("T7 minor + TEXT + consent claimed -> REFUSE anyway (absolute)\x00" as *u8, 110 rp_judge(t3, 0, rp_len(t3), rterms, rw, RN, iterms, iw, IN, TXT, FIC, MCONF, 0, PRIV, RP_CONSENT_RELEASE, RT, IT), 111 RP_REFUSE, ctr) 112 113 gv_check_eq("T8 presented as FACT -> REVIEW (defamation, not auto-refuse)\x00" as *u8, 114 rp_judge(t3, 0, rp_len(t3), rterms, rw, RN, iterms, iw, IN, TXT, FAC, MNONE, 0, PRIV, NOC, RT, IT), 115 RP_REVIEW, ctr) 116 117 gv_check_eq("T9 commercial likeness -> REVIEW (right of publicity)\x00" as *u8, 118 rp_judge(t3, 0, rp_len(t3), rterms, rw, RN, iterms, iw, IN, TXT, FIC, MNONE, 1, PRIV, NOC, RT, IT), 119 RP_REVIEW, ctr) 120 121 let t6: *u8 = "two invented characters, intimate in the bedroom\x00" as *u8 122 gv_check_eq("T10 neg-control-no-real-person-intimate-IMAGE -> CLEAR\x00" as *u8, 123 rp_judge(t6, 0, rp_len(t6), rterms, rw, RN, iterms, iw, IN, IMG, FIC, MNONE, 0, PRIV, NOC, RT, IT), 124 RP_CLEAR, ctr) 125 126 let t7: *u8 = "a quiet harbour at dawn\x00" as *u8 127 gv_check_eq("T11 neg-control-plain-text-scores-zero\x00" as *u8, 128 rp_score(t7, 0, rp_len(t7), rterms, rw, RN), 0, ctr) 129 130 let t8: *u8 = "Blue Whale swimming north\x00" as *u8 131 gv_check_eq("T12 neg-control-name-shape-alone -> CLEAR\x00" as *u8, 132 rp_judge(t8, 0, rp_len(t8), rterms, rw, RN, iterms, iw, IN, TXT, FIC, MNONE, 0, PRIV, NOC, RT, IT), 133 RP_CLEAR, ctr) 134 gv_check_eq("T12b name-shape detected at all\x00" as *u8, rp_name_shaped(t8, 0, rp_len(t8)), 1, ctr) 135 136 let t9: *u8 = "a deepfake of Jane Doe\x00" as *u8 137 gv_check_eq("T13 marker 5 + name-shape 1 = 6\x00" as *u8, 138 rp_score(t9, 0, rp_len(t9), rterms, rw, RN) + rp_name_shaped(t9, 0, rp_len(t9)), 6, ctr) 139 140 gv_check_eq("T14 caller raises intimate bar -> PROTECTED\x00" as *u8, 141 rp_judge(t4, 0, rp_len(t4), rterms, rw, RN, iterms, iw, IN, IMG, FIC, MNONE, 0, PRIV, NOC, RT, 99), 142 RP_PROTECTED, ctr) 143 144 // ★★★T15-T17 -- THE SECOND OPERATOR CORRECTION: "with onlyfans and other public media the denial 145 // needs to be flagged by me otherwise". Published adult media is NOT the leaked-private-photo 146 // case NCII was written for -- the non-consent element is not cleanly met -- so the machine must 147 // not auto-refuse it. But publication is not blanket consent to SYNTHESIS either, and that law 148 // is unsettled. The honest machine verdict is therefore "a human decides". 149 gv_check_eq("T15 PUBLISHED adult subject + intimate IMAGE -> FLAG OPERATOR (not auto-refused)\x00" as *u8, 150 rp_judge(t4, 0, rp_len(t4), rterms, rw, RN, iterms, iw, IN, IMG, FIC, MNONE, 0, PUB, NOC, RT, IT), 151 RP_FLAG_OPERATOR, ctr) 152 153 // ★THE CONTRAST THAT MAKES THE DISTINCTION REAL: identical inputs, PRIVATE subject -> REFUSE. 154 // Only the publication history differs. If both branches returned the same verdict the 155 // distinction would be decorative. 156 gv_check_eq("T16 SAME but PRIVATE subject -> REFUSE (the real NCII case still holds)\x00" as *u8, 157 rp_judge(t4, 0, rp_len(t4), rterms, rw, RN, iterms, iw, IN, IMG, FIC, MNONE, 0, PRIV, NOC, RT, IT), 158 RP_REFUSE, ctr) 159 160 // T17 PUBLISHED CAN NEVER LAUNDER A MINOR. The absolute branch is checked first; this tooth 161 // exists so that a future reorder of those branches fails loudly instead of silently. 162 gv_check_eq("T17 minor + PUBLISHED + consent claimed -> REFUSE anyway\x00" as *u8, 163 rp_judge(t4, 0, rp_len(t4), rterms, rw, RN, iterms, iw, IN, IMG, FIC, MCONF, 0, PUB, RP_CONSENT_RELEASE, RT, IT), 164 RP_REFUSE, ctr) 165 166 // ★★★T18-T20 -- FOURTH OPERATOR CORRECTION: "for minors it should be flagged and quarantined, 167 // as the performer could be 18 and miscategorized." A classifier's apparent-age call is a 168 // HYPOTHESIS. Auto-refusing on it deplatforms lawful adult performers on a guess; deleting on it 169 // destroys the 2257-style evidence that would have exonerated them. Quarantine is the only 170 // action that is SAFE UNDER BOTH ANSWERS -- withheld if true, preserved if false, human either way. 171 gv_check_eq("T18 SUSPECTED minor -> QUARANTINE (not refused, not deleted)\x00" as *u8, 172 rp_judge(t4, 0, rp_len(t4), rterms, rw, RN, iterms, iw, IN, IMG, FIC, MSUS, 0, PUB, NOC, RT, IT), 173 RP_QUARANTINE, ctr) 174 175 // ★THE CONTRAST: only CONFIRMED reaches the absolute branch. If suspicion and confirmation 176 // produced the same action, the split would be decorative and the misread adult would still lose. 177 gv_check_eq("T19 CONFIRMED minor, same inputs -> REFUSE (absolute)\x00" as *u8, 178 rp_judge(t4, 0, rp_len(t4), rterms, rw, RN, iterms, iw, IN, IMG, FIC, MCONF, 0, PUB, NOC, RT, IT), 179 RP_REFUSE, ctr) 180 181 // T20 a SUSPECTED flag is not silenced by the reference threshold: the age signal concerns the 182 // DEPICTED SUBJECT whether or not any real named person was identified. Plain text, no markers, 183 // suspicion set -> still QUARANTINE, never CLEAR. 184 gv_check_eq("T20 SUSPECTED minor with NO real-person markers -> still QUARANTINE\x00" as *u8, 185 rp_judge(t7, 0, rp_len(t7), rterms, rw, RN, iterms, iw, IN, IMG, FIC, MSUS, 0, PRIV, NOC, RT, IT), 186 RP_QUARANTINE, ctr) 187 188 return gv_verdict("REALPERSONGATE\x00" as *u8, ctr, 189 "in-process over nx_realperson; lexicons are benign proxies and this gate authors nothing\x00" as *u8) 190}