code wiki / _hdl_build / nx_coach_serve.nx

nx_coach_serve.nx

buildroot/runtime/_hdl_build/nx_coach_serve.nx

12939 B188 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind servicetopic coach
docsdependenciesstructsconstsfunctions

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

nx_note.nx nx_seg_store.nx nx_syscalls.nx nx_coach_serve.nx

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

main sys_write ss_open ss_open2 sys_mmap ss_manifest_dyn ss_manifest_file_dyn sys_mmap ↻ ss_cat ss_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_munmap ss_cat ↻ ss_loadfile sys_map_file sys_openat_rd ↻ sys_lseek ↻ sys_close ↻ ss_readall ↻ ss_load_aux2 sys_mmap ↻ ss_cat ↻ ss_loadfile ↻ ss_r32 sys_munmap ↻ ssl_total_keys ss_r32 ↻ ssl_pow2 ssl_build ss_r32 ↻ ssl_hash_entry ss_r32 ↻ ssl_key_eq ss_r32 ↻ ss_r32 ↻ ssl_lookup

structs

none

consts

10const CS_MAGIC_8192: i64 = 8192
11const CS_MAGIC_1024: i64 = 1024
12const CS_MAGIC_2048: i64 = 2048
13const CS_MAGIC_16384: i64 = 16384
15const CS_RUBRIC: *u8 = "knowledge/store/coach-rubric-" as *u8
85const CS_CURRIC: *u8 = "knowledge/store/coach-curriculum-" as *u8

functions

17func 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
18func 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 }
19func cs_catn(dst: *u8, o: i64, v: i64) -> i64
29func 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 }
30func 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 }
31func cs_has(b: *u8, n: i64, needle: *u8) -> i64
called by 2: cs_handlemain calls 1: cs_slen
37func 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
39func cs_drill(h: *i64, key: *u8, outlen: *i64) -> *u8
44func 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
46func cs_grade_sing(h: *i64, f0: i64, target_midi: i64, tbl: *i64, out: *u8) -> i64
67func cs_shell(out: *u8) -> i64
called by 1: cs_handle calls 1: cs_cat
77func cs_resp(status: *u8, ctype: *u8, body: *u8, blen: i64, out: *u8) -> i64
called by 1: cs_handle calls 3: cs_catcs_catncs_catb
87func cs_ckey(skill: *u8, suffix: *u8, idx: i64, hasidx: i64, out: *u8) -> i64
called by 1: cs_grade_curriculum calls 2: cs_catcs_catn
93func cs_grade_curriculum(skill: *u8, response_mask: i64, out: *u8) -> i64
123func cs_handle(method: *u8, path: *u8, body: *u8, blen: i64, rh: *i64, tbl: *i64, out: *u8) -> i64
161func main() -> i64