code wiki / _hdl_build / nx_coach_curriculum_lib.nx
nx_coach_curriculum_lib.nx
buildroot/runtime/_hdl_build/nx_coach_curriculum_lib.nx
about
nx_coach_curriculum_lib.nx -- the CURRICULUM-COACH engine as a PURE CORE (no main), extracted verbatim from
nx_coach_curriculum.nx so a second discipline can ADOPT the engine instead of forking it.
WHY THE EXTRACTION. nx_coach_curriculum.nx was a lib wearing an organ's clothes: the whole engine plus a
main(). Nothing can import a file that defines main(), so the only way to reuse it was to copy it -- which is
exactly the duplication the estate is already RED on (179 cross-tree dup basenames). The estate already has
the split convention (nx_gate_verdict / nx_gate_verdict_lib); this applies it here. The organ keeps its main()
and imports this; behaviour is unchanged and proven by re-running it.
THE ENGINE, unchanged: assess -> serve the FRAMEWORK from the store -> the person practises -> grade the
SELF-REPORT (a bitmask of which framework elements they used) against the checklist -> name the MISSING
element -> hand back its drill. "Coaching is coaching": the framework's required elements are the target
chord, the reported elements are the played notes, missing is the gap. Works for any discipline whose
technique decomposes into nameable elements -- interpersonal frameworks, or a knife on a board.
Frameworks are DATA in knowledge/store/coach-curriculum- (rule 11), so a new discipline is rows, not code.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 3 imports · 3 importers
imports: nx_seg_store.nxnx_itoa_lib.nxnx_syscalls.nx
imported by: nx_coach_curriculum.nxnx_cook_coach.nxnx_meal_skills_page.nx
structs
| none |
consts
| 22 | const CC_PFX: *u8 = "knowledge/store/coach-curriculum-" as *u8 |
functions
| 24 | func cc_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 25 | func cc_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 26 | func cc_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 } |
| 27 | func cc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: cc_add |
| 28 | func cc_add(w: *i64, key: *u8, val: *u8) -> i64 { return ss_add(w, 1, key, val, cc_slen(val)) } |
| 31 | func cc_key(skill: *u8, suffix: *u8, idx: i64, hasidx: i64, out: *u8) -> i64 |
| 43 | func cc_get(h: *i64, key: *u8, outlen: *i64) -> *u8 |
| 49 | func cc_seed(prefix: *u8) -> i64 |
| 75 | func cc_attempt(h: *i64, skill: *u8, response_mask: i64) -> i64 |
| 103 | func cc_element_count(h: *i64, skill: *u8) -> i64 |
| 115 | func cc_missing_mask(h: *i64, skill: *u8, response_mask: i64) -> i64 |
| 123 | func cc_element(h: *i64, skill: *u8, idx: i64, outlen: *i64) -> *u8 |
| 128 | func cc_drill(h: *i64, skill: *u8, idx: i64, outlen: *i64) -> *u8 |
| 133 | func cc_prompt(h: *i64, skill: *u8, outlen: *i64) -> *u8 |