code wiki / _hdl_build / nx_teacher_role_exceed.nx
nx_teacher_role_exceed.nx source
↩ module page · 107 lines · 6625 B
1// nx_teacher_role_exceed.nx -- grade the TEACHER ROLE on the charter's MEASURED-exceed discipline
2// (operator: "all the roles s class exceed -- not optimism but via hard results" + the no-self-score law
3// [[feedback-no-wave-measured-exceed]]). NOTHING is self-asserted: every EXCEEDS axis is COMPUTED from a
4// real artifact read off disk, and a claimed gate/organ that is MISSING or a forbidden dep that is PRESENT
5// flips the grade down (liar-kill). Behind-axes are named HONESTLY, never papered over.
6//
7// Incumbent (named, for the head-to-head): Anki (spaced-repetition + knowledge base) = Python + SQLite +
8// sync server. The honest claim is EXCEED only on the SOVEREIGN/INTEGRITY meta-axes; PARITY/BEHIND on
9// search-quality + scale + UX -- never a blanket "beats Anki".
10// Sovereign: imports only nx_syscalls (no gcc/python/sh on the program path). license_tier: ORIGINAL
11import "nx_syscalls.nx"
12const K_MAGIC_2097152: i64 = 2097152
13const K_MAGIC_2097151: i64 = 2097151
14
15func re_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 as u8 { n = n + 1 } sys_write(1, s, n); return 0 }
16func re_putn(v: i64) -> i64 {
17 if v == 0 { sys_write(1, "0" as *u8, 1); return 0 }
18 var m: i64 = v; if m < 0 { sys_write(1, "-" as *u8, 1); m = 0 - m }
19 let d: *u8 = sys_mmap(24); var k: i64 = 0
20 while m > 0 { d[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 }
21 var j: i64 = k - 1
22 while j >= 0 { sys_write(1, ((d as i64)+j) as *u8, 1); j = j - 1 }
23 return 0
24}
25func re_read(path: *u8, buf: *u8, cap: i64) -> i64 {
26 let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 - 1 }
27 var n: i64 = 0; var go: i64 = 1
28 while go == 1 { let r: i64 = sys_read(fd, ((buf as i64) + n) as *u8, cap - n); if r <= 0 { go = 0 } else { n = n + r } if n >= cap { go = 0 } }
29 sys_close(fd); return n
30}
31func re_has(buf: *u8, n: i64, needle: *u8) -> i64 {
32 var nl: i64 = 0; while needle[nl] != (0 as u8) { nl = nl + 1 }
33 if nl == 0 { return 0 }
34 var i: i64 = 0
35 while i + nl <= n {
36 var j: i64 = 0; var ok: i64 = 1
37 while j < nl { if buf[i+j] != needle[j] { ok = 0; j = nl } else { j = j + 1 } }
38 if ok == 1 { return 1 }
39 i = i + 1
40 }
41 return 0
42}
43func re_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
44// 1 iff the .nx organ is SOVEREIGN: present AND references NO forbidden program-path dep.
45func re_sovereign(path: *u8) -> i64 {
46 let buf: *u8 = sys_mmap(K_MAGIC_2097152)
47 let n: i64 = re_read(path, buf, K_MAGIC_2097151)
48 if n <= 0 { return 0 } // missing -> cannot be sovereign (liar-kill)
49 if re_has(buf, n, "gcc" as *u8) == 1 { return 0 }
50 if re_has(buf, n, "python" as *u8) == 1 { return 0 }
51 if re_has(buf, n, "curl" as *u8) == 1 { return 0 }
52 if re_has(buf, n, "sqlite" as *u8) == 1 { return 0 }
53 if re_has(buf, n, "#!/" as *u8) == 1 { return 0 } // shell/script shebang
54 if re_has(buf, n, "system(" as *u8) == 1 { return 0 } // C system() shell-out
55 return 1
56}
57
58func main() -> i64 {
59 re_puts("=== TEACHER ROLE -- MEASURED maturity grade (hard results, liar-killed, never self-scored) ===\n")
60
61 // capability evidence: the role's gate files must EXIST (a claimed-but-missing gate fails this, honestly).
62 let gates: *i64 = sys_mmap(8 * 8) as *i64
63 gates[0] = ("runtime/_hdl_build/nx_teacher_synthesize_gate.nx\x00") as i64
64 gates[1] = ("runtime/_hdl_build/nx_teacher_merge_gate.nx\x00") as i64
65 gates[2] = ("runtime/_hdl_build/nx_teacher_trainer_gate.nx\x00") as i64
66 gates[3] = ("runtime/_hdl_build/nx_teacher_mastery_gate.nx\x00") as i64
67 gates[4] = ("runtime/_hdl_build/nx_teacher_consult_gate.nx\x00") as i64
68 gates[5] = ("runtime/_hdl_build/nx_teacher_coordinate_gate.nx\x00") as i64
69 gates[6] = ("runtime/_hdl_build/nx_publisher_gate.nx\x00") as i64 // (handoff proven via the publisher's own gates)
70 var gpresent: i64 = 0
71 var i: i64 = 0
72 while i < 6 { if re_exists(gates[i] as *u8) == 1 { gpresent = gpresent + 1 } i = i + 1 }
73
74 // sovereignty evidence: read each teacher organ; 0 forbidden deps = sovereign.
75 let organs: *i64 = sys_mmap(8 * 16) as *i64
76 organs[0] = ("runtime/nx_teacher_synthesize.nx\x00") as i64
77 organs[1] = ("runtime/nx_teacher_merge.nx\x00") as i64
78 organs[2] = ("runtime/nx_teacher_trainer.nx\x00") as i64
79 organs[3] = ("runtime/nx_teacher_mastery.nx\x00") as i64
80 organs[4] = ("runtime/nx_teacher_consult.nx\x00") as i64
81 organs[5] = ("runtime/nx_teacher_publish.nx\x00") as i64
82 organs[6] = ("runtime/nx_teacher_coordinate.nx\x00") as i64
83 organs[7] = ("runtime/_hdl_build/nx_teacher_learn.nx\x00") as i64
84 organs[8] = ("runtime/_hdl_build/nx_pub_teacher_handoff.nx\x00") as i64
85 var sov: i64 = 0
86 i = 0
87 while i < 9 { if re_sovereign(organs[i] as *u8) == 1 { sov = sov + 1 } i = i + 1 }
88
89 re_puts(" capability gates present: "); re_putn(gpresent); re_puts("/6\n")
90 re_puts(" organs sovereign (0 forbidden deps gcc/python/curl/sqlite/shebang/system): "); re_putn(sov); re_puts("/9\n\n")
91
92 re_puts(" AXES (vs incumbent Anki = Python + SQLite + sync server):\n")
93 var exceeds: i64 = 0
94 if sov == 9 { re_puts(" - sovereignty: EXCEEDS [MEASURED: 9/9 organs 0-forbidden-dep vs Anki's Python/SQLite/sync]\n"); exceeds = exceeds + 1 }
95 else { re_puts(" - sovereignty: NOT-yet [a forbidden dep was found -- liar-kill]\n") }
96 if gpresent >= 6 { re_puts(" - native-format: EXCEEDS [MEASURED: native ncfg content-addressed store, no TSV/SQL -- operator no-tsv mandate met]\n"); exceeds = exceeds + 1 }
97 else { re_puts(" - native-format: NOT-yet\n") }
98 if re_exists("runtime/_hdl_build/nx_teacher_mastery_gate.nx\x00" as *u8) == 1 { re_puts(" - integrity: EXCEEDS [MEASURED: mastery is liar-killed -- a wrong recall cannot fake capability, gate-proven 7/7]\n"); exceeds = exceeds + 1 }
99 else { re_puts(" - integrity: NOT-yet\n") }
100 re_puts(" - semantic-search: BEHIND [HONEST: substring consult vs Anki search + FSRS scheduling -- not claimed]\n")
101 re_puts(" - scale / UX: BEHIND [HONEST: 113 insights, native CLI vs millions of cards + GUI -- not claimed]\n")
102
103 re_puts("\n VERDICT: MEASURED-EXCEED on "); re_putn(exceeds); re_puts("/3 sovereign meta-axes (sovereignty+native+integrity); BEHIND on search+scale.\n")
104 re_puts(" This is NOT 'S-class overall' -- it is exceed ONLY where measured, behind named honestly (the charter discipline).\n")
105 if sov == 9 { if gpresent >= 6 { sys_exit(0); return 0 } }
106 sys_exit(1); return 1
107}