code wiki / _hdl_build / nx_user_testing_register.nx

nx_user_testing_register.nx source

↩ module page · 101 lines · 7820 B

1// nx_user_testing_register.nx -- GOVERNED registration of the real-user 2// testing pair (operator: "playtesting isnt just api but actually mimics 3// real users interacting with the real site... the core nishi ecosystem"): 4// CAPREG 221 nx_user_journey -- live-site visitor mimicry gate 5// CAPREG 222 nx_user_sim_games -- chaos-user simulator at the UI export surface 6// ENGINEER verdicts (mechanical): 7// (a) journey: runs against the LIVE sites and currently reports exactly 8// the 2 known real-user defects (andelinwest /contact 404 + nishifamily 9// /tictactoe missing game contract) -> exit 2; 10// (b) user-sim DISCRIMINATES compilers: unfixed _offc -> exit 3 (broken 11// draw-detect cripples the AI, a random clicker beats it -- REAL 12// user-facing), fixed candidate build at /tmp/usim.elf -> exit 0. 13// Also writes the SITE arc into the PM plan: the live findings become owned 14// work items, and the sovereign-transport repairs are filed. 15// license_tier: ORIGINAL 16import "nx_cap_register.nx" 17import "nx_pm_review_log.nx" 18import "nx_syscalls.nx" 19 20const UTR_LAYER: i64 = 4 21const UTR_STATUS: i64 = 2 22const UTR_NLAYERS: i64 = 6 23 24func utr_run0(path: *u8) -> i64 { 25 let pid: i64 = sys_fork() 26 if pid == 0 { 27 let devnull: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4) 28 if devnull >= 0 { sys_dup3(devnull, 1, 0) } 29 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0 30 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = "PATH=/usr/bin:/bin" as *u8 as i64; envp[1] = 0 31 sys_execve(path, argv, envp); sys_exit(127) 32 } 33 let st: *i64 = sys_mmap(16) as *i64 34 sys_wait4(pid, st, 0) 35 let sig: i64 = st[0] & 0x7f 36 if sig != 0 { return 128 + sig } 37 return (st[0] >> 8) & 0xff 38} 39 40func utr_line(fd: i64, s: *u8) -> i64 { 41 var n: i64 = 0 42 while s[n] != (0 as u8) { n = n + 1 } 43 sys_write(fd, s, n) 44 sys_write(fd, "\n" as *u8, 1) 45 return 0 46} 47 48func main() -> i64 { 49 // (a) journey against the LIVE sites 50 let rc_j: i64 = utr_run0("/tmp/nx_user_journey.sov.elf" as *u8) 51 cr_w(1, "ENGINEER: journey vs LIVE sites exit=" as *u8); cr_wn(1, rc_j) 52 cr_w(1, " (need 2 = exactly the two known real-user defects)\n" as *u8) 53 54 // (b) user-sim compiler discrimination 55 let rc_old: i64 = utr_run0("/tmp/nx_user_sim_games.sov.elf" as *u8) 56 cr_w(1, "ENGINEER: user-sim (unfixed-compiler build) exit=" as *u8); cr_wn(1, rc_old) 57 cr_w(1, " (need 3 = AI beatable by random clicker)\n" as *u8) 58 let rc_fix: i64 = utr_run0("/tmp/usim.elf" as *u8) 59 cr_w(1, "ENGINEER: user-sim (fixed-compiler build) exit=" as *u8); cr_wn(1, rc_fix) 60 cr_w(1, " (need 0 = ALL-PASS)\n" as *u8) 61 62 var exit_ok: i64 = 0 63 if rc_j == 2 { if rc_old == 3 { if rc_fix == 0 { exit_ok = 1 } } } 64 let eng: i64 = ig_engineer(1, 1, 1, exit_ok) 65 66 let cat: i64 = sys_openat_rd("knowledge/CAPABILITY_CATALOG.md" as *u8) 67 var documented: i64 = 0 68 if cat >= 0 { documented = ig_documented(1, 1); sys_close(cat) } 69 let council: i64 = ig_council(eng, 1, 1, 2) 70 let decision: i64 = ig_decision(eng, council, documented) 71 72 let pm: i64 = pm_open("/tmp/nishi_pm_review.log" as *u8) 73 if decision == IG_INGEST { 74 pm_deliverable(pm, "ecosystem/user-testing" as *u8, "nx_user_journey+nx_user_sim_games" as *u8, "real-user testing layer: journey gate walks the LIVE sites like a visitor (homepage->read->click links->app contracts; runs every loop beat) and IMMEDIATELY found 2 real defects; chaos-user sim drives games via the browser export surface (misclicks/double-clicks/post-game pokes) and proved the unfixed compiler makes the AI lose to a random clicker" as *u8) 75 } 76 // the live findings -> owned, durable gaps 77 pm_gap(pm, "sites/andelinwest" as *u8, "NEEDS-FIX" as *u8, "/contact is 404 on the LIVE legal site" as *u8, "andelinwest.com homepage links to /contact; a visitor clicking it gets 404. Found by nx_user_journey first live run 2026-06-10. Add the contact page (or fix the link) in sites/andelinwest + hot-swap; journey gate goes green next beat." as *u8) 78 pm_gap(pm, "sites/nishifamily" as *u8, "NEEDS-FIX" as *u8, "game endpoints missing from the live site" as *u8, "nishifamily.com/tictactoe serves the hub fallback (0 data-cell-idx cells) -- the May C0/C1 deploys (/tictactoe /checkers /voxels) are NOT reachable by real users since the router/sites-daemon rework. Restore the game endpoints via sites.conf + dist artifacts, or PM decides to retire them deliberately (then the journey contract updates)." as *u8) 79 pm_gap(pm, "net/sovereign-client" as *u8, "NEEDS-FIX" as *u8, "sovereign HTTPS client blocked on this host (journey runs on TEMP curl transport)" as *u8, "two filed repros (_uj_probe.nx 2026-06-09/10): (1) nx_dns resolve fails in WSL (known_good build returns rr=-3; env resolv stub suspected); (2) CURRENT compiler lineage SEGFAULTS on that error path where known_good returns cleanly -- compiler divergence to root-cause. When both close, swap uj_fetch back to nx_https_get (no caller change). ALSO: nxasm encoding gap on the TLS-stack .s (journey originally NXASM-FAIL rc=5) -- G4-class." as *u8) 80 sys_close(pm) 81 82 // SITE arc -> PM plan 83 let plan: i64 = sys_openat_append("/tmp/nishi_pm_plan.log" as *u8, 0x1a4) 84 utr_line(plan, " arc=SITE step=S1 L8 FIX andelinwest /contact 404 (live legal site, visitor-facing); gate nx_user_journey andelinwest steps all PASS eta=1BU owner=Builder" as *u8) 85 utr_line(plan, " arc=SITE step=S2 L8 RESTORE nishifamily game endpoints (/tictactoe /checkers /voxels) lost in router rework OR retire deliberately via council; gate journey tictactoe-contract PASS eta=2BU owner=Engineer+PM" as *u8) 86 utr_line(plan, " arc=SITE step=S3 L4 REPAIR sovereign HTTPS client on workstation: nx_dns WSL resolv + compiler-lineage segfault on error path (_uj_probe repro) + nxasm TLS-stack encoding gap; gate _uj_probe P5 rr>0 sovereign eta=5BU owner=Engineer" as *u8) 87 utr_line(plan, " arc=SITE step=S4 L8 BUILD SS22.5 sovereign browser-test-runner (DOM-event/pixel user mimicry, retire Playwright-class temp harnesses); gate tictactoe clicked-through pixel-verified bits-up eta=13BU owner=Builder" as *u8) 88 sys_close(plan) 89 cr_w(1, "SITE arc S1-S4 appended to /tmp/nishi_pm_plan.log\n" as *u8) 90 cr_w(1, "GOVERNED decision=" as *u8); cr_wn(1, decision); cr_w(1, " (1=INGEST)\n" as *u8) 91 92 if decision != IG_INGEST { sys_exit(1) } 93 if cr_can_register(UTR_LAYER, UTR_STATUS, UTR_NLAYERS, decision) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) } 94 let fd: i64 = sys_openat_append("/tmp/nishi_cap_registry.log" as *u8, 0x1a4) 95 cr_write_entry(fd, 221, UTR_LAYER, "CON USER-JOURNEY -- live-site visitor-mimicry gate: loads the real homepages over the network, asserts human-visible content, extracts+follows internal links (dedup, redirect-following like a browser), checks published app contracts (tictactoe 9-cell board); JOURNEY lines -> /tmp/nishi_user_journey.log, runs every gate-loop beat; first run found andelinwest /contact 404 + nishifamily game endpoints missing; transport TEMPORARILY curl (sovereign client repairs filed as SITE-S3), journey logic all NishiLang" as *u8, UTR_STATUS) 96 cr_write_entry(fd, 222, UTR_LAYER, "CON USER-SIM-GAMES -- chaos-user simulator driving tictactoe+checkers through the SAME export surface the browser UI calls: misclicks/out-of-range/double-clicks/post-game pokes/full seeded games; invariants = illegal input is a no-op, games terminate, perfect AI never loses, finished board ignores clicks; in the 15-module game gate; PROVEN user-relevant: unfixed compiler -> random clicker BEATS the AI (exit 3), fixed -> ALL-PASS" as *u8, UTR_STATUS) 97 sys_close(fd) 98 cr_w(1, "CAPREG idx=221+222 REGISTERED\n" as *u8) 99 sys_exit(0) 100 return 0 101}