code wiki / _hdl_build / nx_coach_serve.nx
nx_coach_serve.nx
buildroot/runtime/_hdl_build/nx_coach_serve.nx
about
nx_coach_serve.nx -- SKILL-COACH rung R5 (publish scaffold): the /coach HTTP request HANDLER wrapping the
unified engine. Browser (phone) getUserMedia -> POST the detected pitch/notes -> coach grade -> feedback JSON.
Gateable per feedback-sovereign-gates-not-bash-harnesses: cs_handle(method,path,body)->response bytes, asserted
by CALLING it (no socket/curl). The DAEMON wrapper (accept-fork loop + nx_pitch on the POSTed PCM + OPAQUE auth +
/coach sites-route) is the thin OPERATOR-COORDINATED deploy layer (the /gen pattern). HTML emitted by THIS organ
(nishi-ecosystem: no hand-JS except the emitted last-mile). Composes nx_note + the R2 rubric store. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_note.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
| 10 | const CS_MAGIC_8192: i64 = 8192 |
| 11 | const CS_MAGIC_1024: i64 = 1024 |
| 12 | const CS_MAGIC_2048: i64 = 2048 |
| 13 | const CS_MAGIC_16384: i64 = 16384 |
| 15 | const CS_RUBRIC: *u8 = "knowledge/store/coach-rubric-" as *u8 |
| 85 | const CS_CURRIC: *u8 = "knowledge/store/coach-curriculum-" as *u8 |
functions
| 17 | func cs_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: cs_has |
| 18 | func cs_cat(dst: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[o + i] = s[i]; i = i + 1 } return o + i } |
| 19 | func cs_catn(dst: *u8, o: i64, v: i64) -> i64 |
| 29 | func cs_catb(dst: *u8, o: i64, src: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { dst[o + i] = src[i]; i = i + 1 } return o + i } |
| 30 | func cs_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 } |
| 31 | func cs_has(b: *u8, n: i64, needle: *u8) -> i64 |
| 37 | func cs_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while 1 == 1 { if a[i] != b[i] { return 0 } if a[i] == (0 as u8) { return 1 } i = i + 1 } return 1 } called by 1: cs_handle |
| 39 | func cs_drill(h: *i64, key: *u8, outlen: *i64) -> *u8 |
| 44 | func cs_sing_vname(v: i64) -> *u8 { if v == 0 { return "in_tune" as *u8 } if v == 1 { return "sharp" as *u8 } if v == 2 { return "flat" as *u8 } if v == 3 { return "too_high" as *u8 } return "too_low" as *u8 } called by 1: cs_grade_sing |
| 46 | func cs_grade_sing(h: *i64, f0: i64, target_midi: i64, tbl: *i64, out: *u8) -> i64 |
| 67 | func cs_shell(out: *u8) -> i64 |
| 77 | func cs_resp(status: *u8, ctype: *u8, body: *u8, blen: i64, out: *u8) -> i64 |
| 87 | func cs_ckey(skill: *u8, suffix: *u8, idx: i64, hasidx: i64, out: *u8) -> i64 |
| 93 | func cs_grade_curriculum(skill: *u8, response_mask: i64, out: *u8) -> i64 |
| 123 | func cs_handle(method: *u8, path: *u8, body: *u8, blen: i64, rh: *i64, tbl: *i64, out: *u8) -> i64 |
| 161 | func main() -> i64 |