nx_teacher_lesson.nx
buildroot/runtime/nx_teacher_lesson.nx
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
imports: nx_syscalls.nx
imported by: nx_teacher_gate.nxnx_teacher_run.nxnx_teacher_serve.nx
structs
| none |
consts
| 28 | const NX_TEACH_OK: i64 = 0 |
| 29 | const NX_TEACH_NO_FILE: i64 = 1 |
| 30 | const NX_TEACH_NO_TITLE: i64 = 2 |
| 31 | const NX_TEACH_MISSING: i64 = 3 // a required section is absent |
functions
| 34 | func mem_eq(body: *u8, off: i64, n: i64, lit: *u8) -> i64 |
| 46 | func sec_bounds(body: *u8, n: i64, marker: *u8, out: *i64) -> i64 |
| 75 | func count_bullets(body: *u8, start: i64, end: i64) -> i64 |
| 89 | func emit_bullets(fd: i64, lesson_id: *u8, body: *u8, start: i64, end: i64) -> i64 |
| 113 | func tp(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 114 | func tn(v: i64) -> i64 |
| 127 | func nx_teacher_emit_index(out_path: *u8) -> i64 |
| 172 | func tn_fd(fd: i64, v: i64) -> i64 |
| 185 | func nx_teacher_ingest(path_z: *u8, lesson_id: *u8, domain: *u8) -> i64 |