code wiki / _hdl_build / nx_teacher_test.nx

nx_teacher_test.nx source

↩ module page · 56 lines · 4061 B

1// nx_teacher_test.nx -- the Teacher sequences the handoff of Claude's work to the team. Roster maps 2// real capabilities to their autonomy rung + the team's grade: 3// fetch M4/90 extract M4/85 BM25 M4/80 corroborate M4/78 <- handed off, team fully owns 4// semantic-cooccurrence M3/70 <- team does it, Claude spot-checks; READY to reach M4 5// embeddings M0/30 prose M1/40 novel-module M1/35 <- Claude still owns (the LLM rung) 6// The Teacher must: count Claude's remaining load (= the 3 open LLM-gaps), advance the ready rung ONE 7// step (M3->M4), HOLD what's not ready (M0 embeddings stays with Claude), and guard regressions. 8// Exit 0 on 7/7. license_tier: ORIGINAL 9 10import "nx_teacher.nx" 11import "nx_syscalls.nx" 12 13func tt_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } 14func tt_num(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;k=1}; while m>0 {t[k]=48+(m%10); 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 } 15 16func main() -> i64 { 17 tt_puts("=== NISHI TEACHER: gracefully hand off Claude's work to the team (M0->M4) ===\n" as *u8) 18 let n: i64 = 8 19 let lv: *i64 = sys_mmap(8 * 16) as *i64 20 let gr: *i64 = sys_mmap(8 * 16) as *i64 21 lv[0]=TCH_M4; gr[0]=90 // fetch 22 lv[1]=TCH_M4; gr[1]=85 // structured extract 23 lv[2]=TCH_M4; gr[2]=80 // BM25 search 24 lv[3]=TCH_M4; gr[3]=78 // corroboration 25 lv[4]=TCH_M3; gr[4]=70 // semantic co-occurrence (ready to advance) 26 lv[5]=TCH_M0; gr[5]=30 // semantic embeddings (LLM rung -- Claude/external) 27 lv[6]=TCH_M1; gr[6]=40 // prose authoring (Claude) 28 lv[7]=TCH_M1; gr[7]=35 // novel-module authoring (Claude) 29 let thr: i64 = 60 30 31 let load: i64 = tch_claude_load(lv, n) 32 let done: i64 = tch_handed_off(lv, n) 33 let prog: i64 = tch_progress_permil(lv, n) 34 let nxt: i64 = tch_next_target(lv, gr, n) 35 let adv: i64 = tch_next_level(lv[4], gr[4], thr, 0) // semantic co-occ M3 -> ? 36 let hold: i64 = tch_next_level(lv[5], gr[5], thr, 0) // embeddings M0 -> ? 37 let guard: i64 = tch_next_level(lv[4], gr[4], thr, 1) // regressed -> ? 38 39 tt_puts(" Claude still owns " as *u8); tt_num(load); tt_puts(" caps (M0/M1 = the open LLM-gaps) handed-off=" as *u8); tt_num(done); tt_puts(" progress=" as *u8); tt_num(prog); tt_puts("/1000\n" as *u8) 40 tt_puts(" next to tutor toward handoff = cap#" as *u8); tt_num(nxt); tt_puts(" (semantic co-occurrence, grade " as *u8); tt_num(gr[nxt]); tt_puts(")\n" as *u8) 41 tt_puts(" advance ready M3->" as *u8); tt_num(adv); tt_puts(" hold not-ready M0->" as *u8); tt_num(hold); tt_puts(" regression-guard M3->" as *u8); tt_num(guard); tt_puts(" (no skip)\n" as *u8) 42 43 let r: *i64 = sys_mmap(8 * 8) as *i64 44 r[0] = 0; if tch_claude_owns(TCH_M0) == 1 { if tch_claude_owns(TCH_M4) == 0 { r[0] = 1 } } 45 r[1] = 0; if load == 3 { r[1] = 1 } // Claude's load = the 3 LLM-gaps 46 r[2] = 0; if done == 4 { r[2] = 1 } // 4 fully handed off 47 r[3] = 0; if prog == 500 { r[3] = 1 } // 50% handoff progress 48 r[4] = 0; if nxt == 4 { r[4] = 1 } // next target = the closest-to-ready cap 49 r[5] = 0; if adv == TCH_M4 { r[5] = 1 } // ready rung advances M3->M4 50 r[6] = 0; if hold == TCH_M0 { if guard == TCH_M3 { r[6] = 1 } } // not-ready holds + regression blocks advance 51 var pass: i64 = 0; var i: i64 = 0 52 while i < 7 { pass = pass + r[i]; i = i + 1 } 53 tt_puts("----\n passed " as *u8); tt_num(pass); tt_puts("/7\n" as *u8) 54 if pass == 7 { tt_puts(" HANDOFF SEQUENCED: 4 caps fully on the team, the ready one advances one rung, the LLM-rung stays with Claude until proven -- the team needs Claude less, gracefully.\n" as *u8); sys_exit(0); return 0 } 55 tt_puts(" FAIL\n" as *u8); sys_exit(1); return 1 56}