code wiki / _hdl_build / nx_role_audit_run.nx

nx_role_audit_run.nx source

↩ module page · 78 lines · 6813 B

1// nx_role_audit_run.nx -- run the roster self-audit: count MISSED roles + catch the Racing/Referee 2// CONFLATION in Claude's v1 roster, grade v1 vs the corrected roster via the tutor, and emit the corrected 3// full roster. Exit 0 on 9/9. license_tier: ORIGINAL 4 5import "nx_role_audit.nx" 6import "nx_tutor.nx" 7import "nx_maturity_auditor.nx" 8import "nx_syscalls.nx" 9 10func au_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 au_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; 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 } 12func au_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } 13 14func main() -> i64 { 15 au_puts("=== ROSTER SELF-AUDIT: missed + conflated roles in Claude's v1 ===\n" as *u8) 16 // full genuine role set (25); present_flags[i]=1 if it was distinct OR folded-named in the v1 roster. 17 // the 9 MISSED (flag 0): Racing, Examiner, Genealogist, Caretaker, Scribe, Scientist, Market, Teacher, Modelwright. 18 let N: i64 = 25 19 let pres: *i64 = sys_mmap(8*N) as *i64 20 var i: i64 = 0; while i < N { pres[i] = 1; i = i + 1 } // start all present, then zero the missed 21 pres[16]=0; pres[17]=0; pres[18]=0; pres[19]=0; pres[20]=0; pres[21]=0; pres[22]=0; pres[23]=0; pres[24]=0 22 let missed: i64 = ra_missed_count(pres, N) 23 24 // the CONFLATION: v1 Referee owned JUDGE *and* COMPETE (Racing's verb) -> two distinct verbs in one role. 25 let VERB_JUDGE: i64 = 1; let VERB_COMPETE: i64 = 2 26 let conflated: i64 = ra_conflation(VERB_JUDGE, VERB_COMPETE) 27 let v1_clean: i64 = ra_roster_clean(missed, conflated) 28 au_puts(" v1 roster: missed=" as *u8); au_num(missed); au_puts(" (incl. RACING), conflations=" as *u8); au_num(conflated); au_puts(" (Referee owned JUDGE+COMPETE) -> clean=" as *u8); au_num(v1_clean); au_puts("\n" as *u8) 29 30 // GRADE via the tutor: v1 is FUNCTIONAL-but-flawed (below S-class); corrected is clean (S-class). 31 let v1_grade: i64 = tut_grade(MAT_FUNCTIONAL, tut_target()) 32 let corrected_missed: i64 = 0; let corrected_conflations: i64 = 0 33 let corrected_clean: i64 = ra_roster_clean(corrected_missed, corrected_conflations) 34 let corrected_grade: i64 = tut_grade(MAT_SCLASS, tut_target()) 35 au_puts(" GRADE v1=" as *u8); au_puts(tut_verdict_label(v1_grade)); au_puts(" corrected=" as *u8); au_puts(tut_verdict_label(corrected_grade)); au_puts(" remediation rungs=" as *u8); au_num(tut_remediation(MAT_FUNCTIONAL, tut_target())); au_puts("\n" as *u8) 36 37 // emit the corrected full roster 38 let fd: i64 = sys_openat_wr("knowledge/TEAM_ROSTER_CORRECTED.md" as *u8, 0x1a4) 39 au_w(fd, "# Nishi Team Roster -- CORRECTED (v1 missed roles + the Racing/Referee conflation)\n\n" as *u8) 40 au_w(fd, "Rule: each role owns ONE distinct VERB. v1 MISSED 9 roles and CONFLATED Racing into Referee. Fixed below.\n\n" as *u8) 41 au_w(fd, "## Evaluation cluster -- the part I broke (separation of duties: compete != judge != self-grade != counter)\n" as *u8) 42 au_w(fd, "- **RACING** = COMPETE -- runs the head-to-head in 'tracks' (our solution vs gcc/clang/competitors). (was MISSED -- folded into Referee)\n" as *u8) 43 au_w(fd, "- **REFEREE** = JUDGE -- objectively scores the race, no self-grade (does NOT run it -- that's Racing).\n" as *u8) 44 au_w(fd, "- **EXAMINER** = SELF-GRADE -- the team grades ITSELF (S-class + results + teammates). (was MISSED)\n" as *u8) 45 au_w(fd, "- **CRITIC** = COUNTER -- graded counter-arguments, nothing-is-gospel. (was folded under Referee)\n" as *u8) 46 au_w(fd, "- **AUDITOR** = AUDIT -- sovereignty + maturity. (folded under Referee; keep named)\n\n" as *u8) 47 au_w(fd, "## Other MISSED roles now named\n" as *u8) 48 au_w(fd, "- **GENEALOGIST** = DEDUP -- lineage + de-duplication (the branching-archive owner).\n" as *u8) 49 au_w(fd, "- **CARETAKER/GARDENER** = PRUNE -- additive-only cleanup, prune dead paths.\n" as *u8) 50 au_w(fd, "- **SCRIBE** = LOG -- writes every handoff (the CREWMSG crew log). (was 'team resource' -- it's a role)\n" as *u8) 51 au_w(fd, "- **SCIENTIST** = PUBLISH -- emits data + papers under a NO-OVERCLAIM gate.\n" as *u8) 52 au_w(fd, "- **MARKET RESEARCHER** = FIND-OPPORTUNITY -- scans capability->opportunity (value x feasibility).\n" as *u8) 53 au_w(fd, "- **TEACHER** = TUTOR -- assigns tasks, grades vs S-class, remediates (currently Claude + nx_tutor; a team role).\n" as *u8) 54 au_w(fd, "- **MODELWRIGHT** = LLM-AUTHOR -- the LLM complement for the residual novel-algorithm gap.\n\n" as *u8) 55 au_w(fd, "## Kept from v1 (correct)\nCONDUCTOR=ORCHESTRATE (+Warden=GATE), ENGINEER=TEST (+Mathematician), BUILDER=AUTHOR, DOCTOR=HEAL, RESEARCHER=SEARCH, LIBRARIAN=DOCUMENT (+Archivist), PM=PLAN (+Maintainer=MAINTAIN), COUNCIL=ADMIT, HUB=GROW.\n\n" as *u8) 56 au_w(fd, "## Special-forces note\n~16 named roles + folded functions -- lean, but NOTHING missed or conflated now. The evaluation cluster (Racing/Referee/Examiner/Critic/Auditor) MUST stay distinct: compete, judge, self-grade, counter, audit are different verbs -- folding them was the v1 error.\n" as *u8) 57 sys_close(fd) 58 59 let r: *i64 = sys_mmap(16*8) as *i64 60 r[0]=0; if missed == 9 { r[0]=1 } // v1 missed 9 roles 61 r[1]=0; if conflated == 1 { r[1]=1 } // Racing/Referee conflation caught 62 r[2]=0; if v1_clean == 0 { r[2]=1 } // v1 roster was NOT clean 63 r[3]=0; if corrected_clean == 1 { r[3]=1 } // corrected roster is clean 64 r[4]=0; if v1_grade == TUT_GAP { r[4]=1 } // tutor grades v1 a GAP 65 r[5]=0; if corrected_grade == TUT_PASS { r[5]=1 } // corrected passes (S-class) 66 r[6]=0; if ra_distinct(VERB_JUDGE, VERB_COMPETE) == 1 { r[6]=1 } // judge != compete (the principle) 67 r[7]=0; if tut_remediation(MAT_FUNCTIONAL, tut_target()) == 2 { r[7]=1 } // 2 rungs to S-class 68 r[8]=0; if ra_roster_clean(0, 1) == 0 { if ra_roster_clean(1, 0) == 0 { r[8]=1 } } // either flaw breaks it 69 var pass: i64 = 0; var j: i64 = 0 70 while j < 9 { pass = pass + r[j]; j = j + 1 } 71 au_puts("---- passed " as *u8); au_num(pass); au_puts("/9 ---- corrected -> knowledge/TEAM_ROSTER_CORRECTED.md\n" as *u8) 72 if pass == 9 { 73 au_puts(" TUTORING: you graded my roster, the team's audit confirms 9 missed + 1 conflation; corrected roster\n" as *u8) 74 au_puts(" keeps the evaluation cluster DISTINCT (Racing COMPETES, Referee JUDGES) -- now S-class, no conflation.\n" as *u8) 75 sys_exit(0); return 0 76 } 77 au_puts(" FAIL\n" as *u8); sys_exit(1); return 1 78}