nx_erotica_loop.nx source
↩ module page · 60 lines · 4788 B
1// nx_erotica_loop.nx -- R5: the AUTONOMOUS erotica keep/discard loop. Scores candidate prose via
2// nx_erotica_craft_lib.ec_eval (7 sovereign-store axes) -> KEEP (>= threshold) or REVISE with a TARGETED
3// DIRECTIVE (the weakest axis's craft advice). This is the immune loop that lets the erotica lane improve on its
4// own: wrap the LOCAL generation seat's drafts with this and it self-selects toward gorgeous. Gates weak->REVISE,
5// strong->KEEP on fixtures (the seat is down this session; the loop LOGIC is proven + ready to wrap real drafts).
6// The directive thresholds/advice are DATA-derived from the same rubric; NO 3rd-party, no loose files, no seat.
7// expect_exit: 0 license_tier: ORIGINAL module: nishi-core.erotica.loop
8import "nx_syscalls.nx"
9import "nx_seg_store.nx"
10import "nx_erotica_craft_lib.nx"
11
12func el_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
13func el_num(v: i64) -> i64 {
14 if v==0 { sys_write(1,"0" as *u8,1); return 0 }
15 var m: i64=v; if m<0 { sys_write(1,"-" as *u8,1); m=0-m }
16 let d: *u8=sys_mmap(24); var k: i64=0
17 while m>0 { d[k]=(48+(m%10)) as u8; m=m/10; k=k+1 }
18 let o: *u8=sys_mmap(24); var i: i64=0; while i<k { o[i]=d[k-1-i]; i=i+1 } sys_write(1,o,k); return 0
19}
20// emit the revise-directive for the weakest axis (slop penalty first, then the lowest positive axis)
21func el_directive(out: *i64) -> i64 {
22 if out[7] >= 500 { el_puts("cut the tired euphemisms / purple prose (the slop lexicon flags them) -- let plain, precise language carry it" as *u8); return 0 }
23 var worst: i64 = 0; var wv: i64 = out[0]
24 var i: i64 = 1
25 while i<=6 { if out[i]<wv { wv=out[i]; worst=i } i=i+1 }
26 if out[8]<wv { wv=out[8]; worst=8 }
27 if worst==0 { el_puts("raise emotion>physical (4:1) -- add interiority: what it MEANS to them, not just what happens" as *u8) }
28 if worst==1 { el_puts("tune the sensory density toward the sweet spot (too sparse reads flat, too dense tips into purple)" as *u8) }
29 if worst==2 { el_puts("ground a beat in an UNEXPECTED sensory detail (the room, an object) -- displacement separates masterful from competent" as *u8) }
30 if worst==3 { el_puts("build anticipation -- slow the burn, delay before the action, let the charge rise" as *u8) }
31 if worst==4 { el_puts("modulate sentence length -- longer to build anticipation, short and clipped at the peak" as *u8) }
32 if worst==5 { el_puts("add the afterglow beat -- the emotional aftermath is the most resonant moment" as *u8) }
33 if worst==6 { el_puts("make consent legible -- enthusiastic, clear, freely given" as *u8) }
34 if worst==8 { el_puts("hit the full ARC -- build anticipation, then the action, THEN an afterglow beat (not just the act)" as *u8) }
35 return 0
36}
37func el_judge(text: *u8, label: *u8, h: *i64) -> i64 {
38 let out: *i64 = sys_mmap(8*8) as *i64
39 let c: i64 = ec_eval(text, h, out)
40 el_puts(" " as *u8); el_puts(label); el_puts(": CRAFT=" as *u8); el_num(c)
41 if c>=600 { el_puts(" -> KEEP\n" as *u8); return 1 }
42 el_puts(" -> REVISE: " as *u8); el_directive(out); el_puts("\n" as *u8)
43 return 0
44}
45func main() -> i64 {
46 el_puts("=== NISHI EROTICA AUTONOMY LOOP (score -> KEEP / REVISE-with-directive; sovereign, seat-free scoring) ===\n" as *u8)
47 let h: *i64 = ss_open("knowledge/erotica_craft-" as *u8)
48 if h[0]==0 { el_puts("no store -- run nx_erotica_store first\n" as *u8); sys_exit(1); return 1 }
49 let weak: *u8 = "His throbbing member pressed against her core. She could feel the heat building. Suddenly he gripped her hips and pulled her close. His manhood was engorged and pulsating. She felt herself getting wet as the waves of pleasure began to build. He pushed harder. The exquisite friction was electric." as *u8
50 let strong: *u8 = "Are you sure, he whispered, and she nodded, breathless, trusting him completely. His hand found hers in the candlelight. She had wanted this for so long, not the heat of it but the way he looked at her like she mattered, like she was safe. She pressed closer, needing him near. Later, tangled together, he traced slow circles on her shoulder while their heartbeats settled, and for the first time in months she felt at home." as *u8
51 let kw: i64 = el_judge(weak, "WEAK (cliche draft) " as *u8, h)
52 let ks: i64 = el_judge(strong, "STRONG(gorgeous draft)" as *u8, h)
53 el_puts(" discriminator: weak must REVISE (0), strong must KEEP (1)\n" as *u8)
54 if kw==0 { if ks==1 {
55 el_puts("EROTICA-LOOP GREEN (auto keep/discard discriminates + emits the targeted revise-directive; wrap the LOCAL seat's drafts to self-improve -- gorgeous smut, on its own)\n" as *u8)
56 sys_exit(0); return 0
57 } }
58 el_puts("EROTICA-LOOP RED\n" as *u8)
59 sys_exit(1); return 1
60}