code wiki / _hdl_build / nx_pm_choose.nx

nx_pm_choose.nx source

↩ module page · 68 lines · 5737 B

1// nx_pm_choose.nx -- the PM CHOOSES the next priority (operator: "let them choose whats the priorities and work 2// with you"). Composes nx_pm_decision_matrix over the CURRENT open backlog: WSJF = Cost-of-Delay/effort, 3// confidence-adjusted, win-win-win (no stakeholder regression), READY-gated (blocked items can't be picked). 4// The PM ranks + auto-picks the top READY item and routes it (TEAM-OWNED vs needs-Claude-TUTOR); Claude then 5// partners on whatever it chose. The choice is the team's, not Claude's. license_tier: ORIGINAL 6import "nx_pm_decision_matrix.nx" 7import "nx_pm_review_log.nx" 8import "nx_syscalls.nx" 9 10func pc_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 11func pc_fn(fd: i64, v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; 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{b[i]=t[k-1-i];i=i+1}; sys_write(fd,b,k); return 0 } 12func pc_n(v: i64) -> i64 { return pc_fn(1, v) } 13 14const W_HW: i64 = 2 15const W_SW: i64 = 3 16const W_USER: i64 = 4 17const W_TIME: i64 = 3 18const NI: i64 = 10 19 20func main() -> i64 { 21 let id:*i64=sys_mmap(8*NI) as *i64; let hw:*i64=sys_mmap(8*NI) as *i64; let sw:*i64=sys_mmap(8*NI) as *i64 22 let usr:*i64=sys_mmap(8*NI) as *i64; let tc:*i64=sys_mmap(8*NI) as *i64; let eff:*i64=sys_mmap(8*NI) as *i64 23 let rdy:*i64=sys_mmap(8*NI) as *i64; let tut:*i64=sys_mmap(8*NI) as *i64; let route:*i64=sys_mmap(8*NI) as *i64 24 25 id[0]="resource-loop-deploy (team autonomously works the backlog, paused when busy)" as *u8 as i64; hw[0]=3;sw[0]=5;usr[0]=3;tc[0]=4;eff[0]=2;rdy[0]=1;tut[0]=0; route[0]="TEAM (deploy the polite loop detached + re-tick)" as *u8 as i64 26 id[1]="compliance-organ (standards registry + conformance + S-class gate)" as *u8 as i64; hw[1]=1;sw[1]=6;usr[1]=4;tc[1]=5;eff[1]=3;rdy[1]=1;tut[1]=1; route[1]="TUTOR (novel module -> Auditor/Compliance)" as *u8 as i64 27 id[2]="andelin a11y audit B4 (WCAG 2.2 AA per-component)" as *u8 as i64; hw[2]=1;sw[2]=4;usr[2]=6;tc[2]=4;eff[2]=3;rdy[2]=1;tut[2]=0; route[2]="TEAM (Auditor+Compliance measure)" as *u8 as i64 28 id[3]="A1 sovereign supervisor at boot (retire .sh -> footprint shrinks)" as *u8 as i64; hw[3]=2;sw[3]=8;usr[3]=3;tc[3]=6;eff[3]=4;rdy[3]=1;tut[3]=0; route[3]="TEAM (Engineer; rc.d root-at-boot)" as *u8 as i64 29 id[4]="CMS Argon2id+BLAKE2b (raised hand -> Engineer)" as *u8 as i64; hw[4]=2;sw[4]=8;usr[4]=5;tc[4]=6;eff[4]=5;rdy[4]=1;tut[4]=1; route[4]="TUTOR -> Engineer crypto; then password-hash composes" as *u8 as i64 30 id[5]="CMS HTML allowlist sanitizer (keystone XSS, raised hand -> Builder)" as *u8 as i64; hw[5]=1;sw[5]=9;usr[5]=6;tc[5]=6;eff[5]=6;rdy[5]=1;tut[5]=1; route[5]="TUTOR -> Builder; sanitize-LAST" as *u8 as i64 31 id[6]="per-site search isolation (no cross-site bleed)" as *u8 as i64; hw[6]=1;sw[6]=6;usr[6]=6;tc[6]=5;eff[6]=5;rdy[6]=1;tut[6]=1; route[6]="TUTOR/TEAM (reuse nx_bm25, key by host)" as *u8 as i64 32 id[7]="W2 compiler keystone (regalloc O(n^2)->linear + fix the captured miscompile)" as *u8 as i64; hw[7]=4;sw[7]=10;usr[7]=4;tc[7]=8;eff[7]=7;rdy[7]=1;tut[7]=1; route[7]="TUTOR -> Builder/Engineer; repro=nx_backlog_loop" as *u8 as i64 33 id[8]="W1 SSH S-class + OpenSSH benchmark" as *u8 as i64; hw[8]=2;sw[8]=6;usr[8]=2;tc[8]=3;eff[8]=5;rdy[8]=1;tut[8]=0; route[8]="TEAM (Engineer+Referee, bench=verdict)" as *u8 as i64 34 id[9]="andelin real content B5 (attorneys/phone/reviews)" as *u8 as i64; hw[9]=1;sw[9]=2;usr[9]=9;tc[9]=7;eff[9]=2;rdy[9]=0;tut[9]=0; route[9]="BLOCKED on operator input -- cannot pick" as *u8 as i64 35 36 let score:*i64=sys_mmap(8*NI) as *i64; let ready:*i64=sys_mmap(8*NI) as *i64; let picked:*i64=sys_mmap(8*NI) as *i64 37 var i: i64 = 0 38 while i < NI { 39 let cod: i64 = dm_cost_of_delay(hw[i],sw[i],usr[i],tc[i],W_HW,W_SW,W_USER,W_TIME) 40 var s: i64 = dm_wsjf(cod, eff[i]) 41 if dm_no_regression(hw[i],sw[i],usr[i]) == 0 { s = 0 } 42 score[i]=s; ready[i]=dm_ready(rdy[i]); picked[i]=0 43 i = i + 1 44 } 45 46 pc_puts("=== PM CHOOSES the next priority (WSJF over the open backlog; READY-gated) ===\n\n" as *u8) 47 let top: i64 = dm_next_pick(score, picked, ready, NI) 48 var rank: i64 = 1; var done: i64 = 0 49 while done < NI { 50 let b: i64 = dm_next_pick(score, picked, ready, NI) 51 if b < 0 { done = NI } else { 52 picked[b]=1 53 pc_puts("#" as *u8); pc_n(rank); pc_puts(" [WSJF " as *u8); pc_n(score[b]); pc_puts("] " as *u8); pc_puts(id[b] as *u8); pc_puts("\n" as *u8) 54 rank = rank + 1; done = done + 1 55 } 56 } 57 // surface blocked items (ready=0) honestly, not silently dropped 58 pc_puts("\nBLOCKED (not eligible until unblocked):\n" as *u8) 59 i = 0; while i < NI { if rdy[i] == 0 { pc_puts(" - " as *u8); pc_puts(id[i] as *u8); pc_puts(" :: " as *u8); pc_puts(route[i] as *u8); pc_puts("\n" as *u8) } i = i + 1 } 60 61 let pm: i64 = pm_open("/tmp/nishi_pm_review.log" as *u8) 62 pm_flag(pm, "PM-CHOICE" as *u8, id[top] as *u8, "TOP-PICK" as *u8, route[top] as *u8, "PM auto-picked highest-WSJF READY item; Claude partners" as *u8) 63 sys_close(pm) 64 65 pc_puts("\n>>> PM's CHOICE: " as *u8); pc_puts(id[top] as *u8); pc_puts("\n>>> ROUTE: " as *u8); pc_puts(route[top] as *u8) 66 if tut[top]==1 { pc_puts("\n>>> Claude PARTNERS by tutoring this into the right teammate.\n" as *u8) } else { pc_puts("\n>>> TEAM-OWNED; Claude monitors + partners on blockers.\n" as *u8) } 67 sys_exit(0); return 0 68}