code wiki / _hdl_build / nx_connect_lds_room.nx

nx_connect_lds_room.nx

buildroot/runtime/_hdl_build/nx_connect_lds_room.nx

9244 B145 linesdepth 2pulls 3 transitivereach 0 importersview sourcekind tooltopic connect
docsdependenciesstructsconstsfunctions

about

nx_connect_lds_room.nx -- CONNECT / LDS vertical: YOUTH GAME + HANGOUT ROOM (safety admission layer). Ask #6: LDS youth worldwide meet, play games and hang out -- SAFELY. This is the safety ADMISSION layer that governs WHO may occupy a youth room together; it COMPOSES the existing substrate rather than duplicating it: * nx_room_relay -> the actual unified room: independent game-state/chat/audio/video channels on one room hash, server-relay (no WebRTC). (proven by nx_game_room_gate) * nx_connect_group -> membership/roles (OWNER/ADMIN/MEMBER), lane safety. * nx_connect_lds_youth-> the two-deep visible-context wall this layer enforces on room occupancy. * the games portal (nx_game_*) -> the peer game played in the room (e.g. tic-tac-toe/connect-four). THE NEW INVARIANT (what neither the relay nor the group had): a youth room is SAFE iff youth and adults coexist ONLY at two-deep (>=2 adults). So a lone adult can never be alone with youth in a game room -- enforced on JOIN and on LEAVE. Peers (youth-youth, adult-adult) are free; no room ever spawns an adult<->youth private DM; no ads to minors. The final check drives a REAL nx_room_relay room: admission-gated posting -> two youth land in the live roster of the game AND chat channels, while the denied lone adult never appears. 8 checks incl. negative controls. 100% sovereign. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_room_relay.nx nx_connect_lds_room.nx

imports: nx_syscalls.nxnx_room_relay.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap room_admit room_safe room_may_leave room_safe ↻ rr_init rr_post rr_find rr_alloc rr_roster yw sys_write yn sys_mmap ↻ sys_write ↻ ycheck yw ↻ may_private_dm ad_allowed room_admit_incumbent yinlist sys_exit

structs

none

consts

21const BAND_MAGIC_8000: i64 = 8000
23const BAND_MINOR: i64 = 0
24const BAND_ADULT: i64 = 1
25const TWO_DEEP: i64 = 2

functions

27func yw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: ycheckmain calls 1: sys_write
28func yn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
29func yinlist(out: *i64, c: i64, id: i64) -> i64 { var i: i64=0; while i<c { if out[i]==id { return 1 } i=i+1 } return 0 }
called by 1: main
32func room_safe(y: i64, a: i64) -> i64
39func room_admit(y: i64, a: i64, band: i64) -> i64
called by 1: main calls 1: room_safe
44func room_may_leave(y: i64, a: i64, band: i64) -> i64
called by 1: main calls 1: room_safe
49func room_admit_incumbent(y: i64, a: i64, band: i64) -> i64 { return 1 }
called by 1: main
51func ad_allowed(band: i64) -> i64 { if band==BAND_MINOR { return 0 } return 1 }
called by 1: main
53func may_private_dm(a_band: i64, b_band: i64) -> i64
called by 1: main
59func ycheck(pass: i64, label: *u8, fails: *i64) -> i64
called by 1: main calls 1: yw
65func main() -> i64