code wiki / _hdl_build / nx_connect_lds_room.nx
nx_connect_lds_room.nx
buildroot/runtime/_hdl_build/nx_connect_lds_room.nx
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
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
structs
| none |
consts
| 21 | const BAND_MAGIC_8000: i64 = 8000 |
| 23 | const BAND_MINOR: i64 = 0 |
| 24 | const BAND_ADULT: i64 = 1 |
| 25 | const TWO_DEEP: i64 = 2 |
functions
| 27 | func yw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 28 | func 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 } |
| 29 | func 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 |
| 32 | func room_safe(y: i64, a: i64) -> i64 |
| 39 | func room_admit(y: i64, a: i64, band: i64) -> i64 |
| 44 | func room_may_leave(y: i64, a: i64, band: i64) -> i64 |
| 49 | func room_admit_incumbent(y: i64, a: i64, band: i64) -> i64 { return 1 } called by 1: main |
| 51 | func ad_allowed(band: i64) -> i64 { if band==BAND_MINOR { return 0 } return 1 } called by 1: main |
| 53 | func may_private_dm(a_band: i64, b_band: i64) -> i64 called by 1: main |
| 59 | func ycheck(pass: i64, label: *u8, fails: *i64) -> i64 |
| 65 | func main() -> i64 |