code wiki / (root) / nx_teacher_lesson.nx

nx_teacher_lesson.nx

buildroot/runtime/nx_teacher_lesson.nx

11087 B249 linesdepth 2pulls 2 transitivereach 3 importersview sourcekind librarytopic teacher
docsdependenciesstructsconstsfunctions

about

nx_teacher.nx -- the NISHI TEACHER: turn a work-session into a structured, machine-AND-human-educatable LESSON, validate it is S-class, and organize+log it. WHY (operator 2026-06-17): "take our data from [what] we did meaningful for the nishi team and my growth to learn -- machine and human educatable... build a nishi teacher role... organize and log what we need to practice, takeaways, etc." GROUNDED IN LEARNING SCIENCE (Bjork "desirable difficulties", cited evidence in knowledge/registry/teaching_evidence.tsv): a lesson only TRANSFERS if it has - CONTEXT concrete situation (concrete-before-abstract) - TAKEAWAYS the S-class abstractions - CARDINALS durable reusable rules (the MACHINE-applicable principles) -> cardinal log - DRILLS retrieval-practice prompts (the testing effect) -> drill log - EVIDENCE cited provenance ("we do things with evidence & science, ALWAYS") A lesson missing any of these is NOT S-class -> RED (the teacher's liar-kill / publish-gate). The lesson is a markdown file (so the EXISTING wiki ingestor auto-discovers it as /wiki/<slug>); the teacher additionally EXTRACTS the machine-readable structure (cardinals + drills) into registries the Nishi team / spore can ingest. Two audiences, one source. DRY: reuses nx_syscalls only; no new primitives. genealogy_id: nishi_teacher_lesson_capture lineage_id: markdown_section_parse + cardinal_drill_extract + sclass_publish_gate license_tier: ORIGINAL

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_teacher_lesson.nx nx_teacher_gate.nx nx_teacher_run.nx nx_teacher_serve.nx

imports: nx_syscalls.nx

imported by: nx_teacher_gate.nxnx_teacher_run.nxnx_teacher_serve.nx

structs

none

consts

28const NX_TEACH_OK: i64 = 0
29const NX_TEACH_NO_FILE: i64 = 1
30const NX_TEACH_NO_TITLE: i64 = 2
31const NX_TEACH_MISSING: i64 = 3 // a required section is absent

functions

34func mem_eq(body: *u8, off: i64, n: i64, lit: *u8) -> i64
46func sec_bounds(body: *u8, n: i64, marker: *u8, out: *i64) -> i64
called by 2: nx_teacher_ingesttsv_valid calls 1: mem_eq
75func count_bullets(body: *u8, start: i64, end: i64) -> i64
called by 1: nx_teacher_ingest calls 1: mem_eq
89func emit_bullets(fd: i64, lesson_id: *u8, body: *u8, start: i64, end: i64) -> i64
called by 1: nx_teacher_ingest calls 2: mem_eqsys_write
113func tp(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 1: nx_teacher_ingest calls 1: sys_write
114func tn(v: i64) -> i64
called by 1: nx_teacher_ingest calls 2: sys_mmapsys_write
127func nx_teacher_emit_index(out_path: *u8) -> i64
172func tn_fd(fd: i64, v: i64) -> i64
called by 1: nx_teacher_ingest calls 2: sys_mmapsys_write
185func nx_teacher_ingest(path_z: *u8, lesson_id: *u8, domain: *u8) -> i64