code wiki / _hdl_build / nx_critics_review.nx

nx_critics_review.nx source

↩ module page · 96 lines · 7348 B

1// nx_critics_review.nx -- THE CRITICS' DESK (harsh; reads the 3-tier scoreboard). Standard: 2// * ATTENDANCE (engaged) = 0 stars. Table stakes, never reviewed. 3// * DELIVERY (performing/APPLIED) earns up to ~2.5 stars only -- it is the floor, not the goal. 4// * EXCELLENCE (excelling/EXCEED = a measured win over a named alternative, gate-proven) is the 5// ONLY path to 4-5 stars. The 5th star demands EVERY section excelling. 6// Reads the latest TEAM-HARMONY record (engaged=E/N performing=P/N excelling=X/N) from the sovereign 7// roles- store. So the stars move only on EARNED, measured work -- never on showing up. 8// Sovereign. license_tier: ORIGINAL 9import "nx_role_store.nx" 10import "nx_syscalls.nx" 11 12func cr_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } 13func cr_n(v: i64) -> i64 { if v == 0 { sys_write(1, "0" as *u8, 1); return 0 } var m: i64 = v; let t: *u8 = sys_mmap(24); var k: i64 = 0; while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } let o: *u8 = sys_mmap(24); var w: i64 = 0; var q: i64 = k - 1; while q >= 0 { o[w] = t[q]; w = w + 1; q = q - 1 } sys_write(1, o, w); return 0 } 14func cr_after(buf: *u8, n: i64, pat: *u8) -> i64 { 15 var pl: i64 = 0; while pat[pl] != (0 as u8) { pl = pl + 1 } 16 var i: i64 = 0 17 while i + pl <= n { var j: i64 = 0; var ok: i64 = 1; while j < pl { if buf[i + j] != pat[j] { ok = 0; j = pl } else { j = j + 1 } } if ok == 1 { return i + pl } i = i + 1 } 18 return 0 - 1 19} 20func cr_int(buf: *u8, n: i64, i: i64) -> i64 { var v: i64 = 0; var k: i64 = i; while k < n { let c: i64 = buf[k] as i64; if c >= 48 { if c <= 57 { v = v * 10 + (c - 48); k = k + 1 } else { k = n } } else { k = n } } return v } 21 22func cr_stars(half: i64) -> i64 { 23 var h: i64 = half; if h > 10 { h = 10 } if h < 0 { h = 0 } 24 let full: i64 = h / 2; let rem: i64 = h - full * 2 25 cr_w("[" as *u8); var i: i64 = 0; while i < full { cr_w("*" as *u8); i = i + 1 } 26 if rem == 1 { cr_w("+" as *u8) } 27 var e: i64 = 5 - full - rem; var j: i64 = 0; while j < e { cr_w("-" as *u8); j = j + 1 } 28 cr_w("] " as *u8); cr_n(full); cr_w("." as *u8); if rem == 1 { cr_w("5" as *u8) } else { cr_w("0" as *u8) } cr_w("/5" as *u8) 29 return h 30} 31 32// HARSH star math: delivery (perf) earns up to ~2.5; EXCELLENCE (excel) is the only road to 4-5. 33// half = perf*6/total + (excel>0 ? excel*8/total + 2 : 0) + bonus, clamped 0..10. 34func cr_one(name: *u8, lens: *u8, bonus: i64, low: *u8, high: *u8, sclass: *u8, perf: i64, excel: i64, total: i64) -> i64 { 35 var half: i64 = 0 36 if total > 0 { 37 half = perf * 6 / total 38 if excel > 0 { half = half + excel * 8 / total + 2 } 39 half = half + bonus 40 } 41 if half < 0 { half = 0 } if half > 10 { half = 10 } 42 cr_w(" " as *u8); cr_w(name as *u8); cr_w(" " as *u8); cr_stars(half); cr_w("\n" as *u8) 43 cr_w(" (" as *u8); cr_w(lens as *u8); cr_w(") \"" as *u8) 44 if excel * 2 >= total { cr_w(high as *u8) } else { cr_w(low as *u8) } 45 cr_w("\"\n" as *u8) 46 cr_w(" -> to S-class: " as *u8); cr_w(sclass as *u8); cr_w("\n\n" as *u8) 47 return half 48} 49 50func main(argc: i64, argv: *i64) -> i64 { 51 let hn: i64 = rs_count("harmony" as *u8) 52 if hn <= 0 { cr_w("CRITICS: no performance on record -- run nx_team_harmony first.\n" as *u8); sys_exit(2); return 2 } 53 let pq: *i64 = sys_mmap(16) as *i64; let lq: *i64 = sys_mmap(16) as *i64 54 if rs_get_seq("harmony" as *u8, hn - 1, pq, lq) != 1 { cr_w("CRITICS: latest review unreadable\n" as *u8); sys_exit(2); return 2 } 55 let rec: *u8 = pq[0] as *u8; let rl: i64 = lq[0] 56 let ei: i64 = cr_after(rec, rl, "engaged=" as *u8) 57 let pidx: i64 = cr_after(rec, rl, "performing=" as *u8) 58 let xidx: i64 = cr_after(rec, rl, "excelling=" as *u8) 59 if ei < 0 { cr_w("CRITICS: malformed record\n" as *u8); sys_exit(2); return 2 } 60 let eng: i64 = cr_int(rec, rl, ei) 61 var total: i64 = eng; var s: i64 = ei; while s < rl { if rec[s] == (47 as u8) { s = s + 1; total = cr_int(rec, rl, s); s = rl } else { s = s + 1 } } 62 var perf: i64 = 0; if pidx >= 0 { perf = cr_int(rec, rl, pidx) } 63 var excel: i64 = 0; if xidx >= 0 { excel = cr_int(rec, rl, xidx) } 64 65 cr_w("\n*** THE CRITICS' DESK -- attendance is worth nothing; only measured wins earn stars ***\n" as *u8) 66 cr_w("(scoreboard: engaged=" as *u8); cr_n(eng); cr_w("/" as *u8); cr_n(total); cr_w(" [ignored], delivered=" as *u8); cr_n(perf); cr_w("/" as *u8); cr_n(total); cr_w(", EXCEEDED=" as *u8); cr_n(excel); cr_w("/" as *u8); cr_n(total); cr_w(")\n\n" as *u8) 67 68 var sum: i64 = 0; var nc: i64 = 0 69 sum = sum + cr_one("The S-Class Standard " as *u8, "chief critic" as *u8, 0 - 2, 70 "I review concerts, not soundchecks. Delivery is the door fee; show me a measured WIN." as *u8, 71 "Now we're talking -- a gate-proven beat of a real rival. THAT earns a seat. Make it every section." as *u8, 72 "every section must MEASURABLY EXCEED a named alternative; one win is a start, not a standard." as *u8, perf, excel, total); nc = nc + 1 73 sum = sum + cr_one("Maestro Vienna " as *u8, "purist" as *u8, 0, 74 "Tasks completed; nothing that surpasses. Competence is not artistry." as *u8, 75 "A passage that genuinely outplays the rival score. At last, artistry." as *u8, 76 "to surpass, not merely to finish -- carry the measured win to every desk." as *u8, perf, excel, total); nc = nc + 1 77 sum = sum + cr_one("Pitchfork of the Spheres" as *u8, "snark" as *u8, 0, 78 "They did the homework. Riveting. Wake me when someone beats the competition." as *u8, 79 "Fine -- an actual win over an actual rival. Begrudging respect. Now do it nine more times." as *u8, 80 "one measured win isn't a movement. Repeat it across the orchestra." as *u8, perf, excel, total); nc = nc + 1 81 sum = sum + cr_one("The Sovereign Times " as *u8, "balanced" as *u8, 1, 82 "Diligent output, no distinction. We review distinction." as *u8, 83 "Credible, measured superiority over a named tool. This is the standard to hold." as *u8, 84 "convert competence into measured superiority, section by section." as *u8, perf, excel, total); nc = nc + 1 85 sum = sum + cr_one("The Pit (the crowd) " as *u8, "audience" as *u8, 1, 86 "We didn't pay to watch people finish chores. Where is the showstopper?" as *u8, 87 "NOW that's a showstopper -- they beat the best in the room. More of THAT." as *u8, 88 "give us a showstopper in every section, not one solo." as *u8, perf, excel, total); nc = nc + 1 89 90 let avg: i64 = sum / nc 91 cr_w("=== METACRITIC: " as *u8); cr_stars(avg); cr_w(" (" as *u8); cr_n(nc); cr_w(" critics; attendance discounted, only EXCEED earns the top) ===\n" as *u8) 92 if excel >= total { cr_w("CONSENSUS: every section MEASURABLY EXCEEDS a named rival. This is S-class. Hold it.\n" as *u8) } 93 else { if excel > 0 { cr_w("CONSENSUS: the FIRST real measured win is on the board (" as *u8); cr_n(excel); cr_w("/" as *u8); cr_n(total); cr_w(") -- a genuine star, earned. Now make EXCEEDING the standard for every section, not a one-off solo.\n" as *u8) } 94 else { cr_w("CONSENSUS: tasks are not triumphs. Until a section MEASURABLY beats a named alternative, this is a rehearsal. 0 measured wins. Earn one.\n" as *u8) } } 95 sys_exit(0); return 0 96}