code wiki / _hdl_build / nx_skill_coach.nx
nx_skill_coach.nx
buildroot/runtime/_hdl_build/nx_skill_coach.nx
about
nx_skill_coach.nx -- THE UNIFIED SKILL-COACH ENGINE (the "engine + audio first" capstone). ONE coached-attempt
API that composes the four proven rungs: perception-grade (R1 sing via nx_note / R3 chord via the nx_polypitch
note-list contract) -> DRILL from the data-driven rubric store (R2, knowledge/store/coach-rubric-) -> gamified
SCORE (R4, joy-first). The /coach page + the team call coach_sing()/coach_chord() with one call. Thresholds are
read FROM the store (rule #11, no magic numbers). Self-gate: a mixed practice session through the single API ->
every attempt yields a store-drill + advances the gamified state. NO floats. license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_note.nxnx_itoa_lib.nxnx_seg_store.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 12 | const SK_RUBRIC: *u8 = "knowledge/store/coach-rubric-" as *u8 |
| 13 | const SK_LEVEL_XP: i64 = 500 |
| 14 | const SK_MASTERY: i64 = 5 |
functions
| 16 | func sk_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 21 | func sk_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 22 | func sk_atoi(s: *u8, n: i64) -> i64 { var v: i64 = 0; var i: i64 = 0; while i < n { let c: i64 = s[i]; if c >= 48 { if c <= 57 { v = v * 10 + (c - 48) } } i = i + 1 } return v } called by 1: main |
| 24 | func sk_get(h: *i64, key: *u8, outlen: *i64) -> *u8 |
| 31 | func sk_key(disc: *u8, verdict: *u8, out: *u8) -> i64 |
| 35 | func sk_record(st: *i64, points: i64, is_clean: i64) -> i64 |
| 43 | func sk_score_sing(verdict: i64, cents: i64) -> i64 called by 1: coach_sing |
| 48 | func sk_sing_verdict_name(v: i64) -> *u8 called by 1: coach_sing |
| 55 | func sk_chord_verdict_name(v: i64) -> *u8 called by 1: coach_chord |
| 62 | func coach_sing(rh: *i64, gam: *i64, tol: i64, sung_f0: i64, target_midi: i64, tbl: *i64) -> i64 |
| 81 | func coach_chord(rh: *i64, gam: *i64, notes: *i64, n: i64, target_mask: i64) -> i64 |
| 99 | func main() -> i64 |