code wiki / _hdl_build / nx_coach_curriculum_lib.nx

nx_coach_curriculum_lib.nx

buildroot/runtime/_hdl_build/nx_coach_curriculum_lib.nx

7684 B137 linesdepth 3pulls 4 transitivereach 4 importersview sourcekind librarytopic coach
docsdependenciesstructsconstsfunctions

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

nx_seg_store.nx nx_itoa_lib.nx nx_syscalls.nx nx_coach_curriculum_lib.nx nx_coach_curriculum.nx nx_cook_coach.nx nx_meal_skills_page.nx

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

22const CC_PFX: *u8 = "knowledge/store/coach-curriculum-" as *u8

functions

24func 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 }
called by 3: maincc_attemptmain calls 1: sys_write
25func cc_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
26func 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 }
27func 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
28func cc_add(w: *i64, key: *u8, val: *u8) -> i64 { return ss_add(w, 1, key, val, cc_slen(val)) }
called by 2: cc_seedcook_seed calls 2: ss_addcc_slen
31func cc_key(skill: *u8, suffix: *u8, idx: i64, hasidx: i64, out: *u8) -> i64
43func cc_get(h: *i64, key: *u8, outlen: *i64) -> *u8
49func cc_seed(prefix: *u8) -> i64
75func cc_attempt(h: *i64, skill: *u8, response_mask: i64) -> i64
103func cc_element_count(h: *i64, skill: *u8) -> i64
115func cc_missing_mask(h: *i64, skill: *u8, response_mask: i64) -> i64
called by 1: main calls 1: cc_element_count
123func cc_element(h: *i64, skill: *u8, idx: i64, outlen: *i64) -> *u8
128func cc_drill(h: *i64, skill: *u8, idx: i64, outlen: *i64) -> *u8
133func cc_prompt(h: *i64, skill: *u8, outlen: *i64) -> *u8
called by 1: msp_checklist calls 3: sys_mmapcc_keycc_get