code wiki / _hdl_build / nx_team_scorecard.nx
nx_team_scorecard.nx source
↩ module page · 60 lines · 2997 B
1// nx_team_scorecard.nx -- the TEAMMATE growth loop (operator: consistently grade the TEAMMATES, not
2// the capabilities, as we work, so the team improves WITHOUT REGRESSION and each teammate becomes
3// MORE capable -- a loop Claude is tied into so the operator isn't manually suggesting growth work,
4// run until the team beats the AI benchmarks). Each ORGAN (Engineer, Doctor, Builder, ... Critic,
5// Caretaker) is scored on capability dimensions; the loop:
6// 1. GRADES every teammate (0-100) -> score per round.
7// 2. REGRESSION GUARD: any teammate whose score DROPPED vs last round is an alarm -- the team must
8// only get stronger; a build that weakens another organ is caught.
9// 3. GROWTH TARGET: the below-benchmark teammate with the largest (gap * leverage) -> the NEXT
10// thing Claude builds. Deterministic, not hand-picked.
11// 4. BENCHMARK: when every teammate >= the benchmark, the team has beaten the bar.
12// So Claude is the builder INSIDE the loop: grade -> pick weakest-highest-leverage -> build it ->
13// re-grade (no regression) -> repeat until all pass. license_tier: ORIGINAL Refs: M0-M4 autonomy ladder.
14
15import "nx_syscalls.nx"
16
17const TSC_BENCHMARK: i64 = 60 // a teammate "beats the bar" at >= 60 (the AI-benchmark gate)
18
19// capability score 0-100 from dimensions: proven(0/1)*20 + autonomy(0..4 M-level)*10 +
20// breadth(0..5)*4 + robustness(0..5)*4. max = 20+40+20+20 = 100.
21func tsc_score(proven: i64, autonomy: i64, breadth: i64, robustness: i64) -> i64 {
22 return proven * 20 + autonomy * 10 + breadth * 4 + robustness * 4
23}
24
25func tsc_passes(score: i64, benchmark: i64) -> i64 { if score >= benchmark { return 1 } return 0 }
26
27func tsc_all_pass(n: i64, scores: *i64, benchmark: i64) -> i64 {
28 var i: i64 = 0
29 while i < n { if scores[i] < benchmark { return 0 } i = i + 1 }
30 return 1
31}
32
33// REGRESSION GUARD: did any teammate get worse than last round? (the team must monotonically improve.)
34func tsc_any_regression(n: i64, prev: *i64, cur: *i64) -> i64 {
35 var i: i64 = 0
36 while i < n { if cur[i] < prev[i] { return 1 } i = i + 1 }
37 return 0
38}
39
40// GROWTH TARGET: the below-benchmark teammate maximizing (benchmark - score) * leverage. This is the
41// deterministic next build -- the weakest, highest-leverage organ. Returns its index, or -1 if all pass.
42func tsc_growth_target(n: i64, scores: *i64, leverage: *i64, benchmark: i64) -> i64 {
43 var best: i64 = 0 - 1; var bestpri: i64 = 0
44 var i: i64 = 0
45 while i < n {
46 if scores[i] < benchmark {
47 let pri: i64 = (benchmark - scores[i]) * leverage[i]
48 if pri > bestpri { bestpri = pri; best = i }
49 }
50 i = i + 1
51 }
52 return best
53}
54
55// how far below the bar the WHOLE team is (sum of gaps) -- the loop drives this to 0.
56func tsc_total_gap(n: i64, scores: *i64, benchmark: i64) -> i64 {
57 var g: i64 = 0; var i: i64 = 0
58 while i < n { if scores[i] < benchmark { g = g + (benchmark - scores[i]) } i = i + 1 }
59 return g
60}