code wiki / (root) / nx_teacher_rt.nx

nx_teacher_rt.nx

buildroot/runtime/nx_teacher_rt.nx

12565 B269 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind orphan librarytopic teacher
docsdependenciesstructsconstsfunctions

about

RETIRE CANDIDATE -- ORPHANED BYTE-IDENTICAL DUPLICATE (measured 2026-08-15). This file is a byte-for-byte copy of runtime/nx_teacher_lesson.nx: both were 11087 bytes at content-hash h0e2954e3cb38a146 immediately before this note was added (the note is the ONLY difference; re-derive by hashing both). nx_teacher_lesson.nx has THREE importers (nx_teacher_gate, nx_teacher_run, nx_teacher_serve). THIS file has ZERO references anywhere in buildroot -- nx_shelltool grep, 56,311 files, corpus_complete=1. So retiring it cannot cost a capability, and the live twin already carries every function it defines. WHY IT EXISTS: the three importers each carry the comment "the lesson organ the 2026-07-21 dedupe deleted" -- a previous dedupe removed the LIVE organ, broke those three importers, and it had to be restored. This is the leftover of that repair, not a second implementation. ONE FILE, ONE WRITER: both copies append to knowledge/registry/nishi_lessons.tsv, so leaving both buildable invites the two-writers-one-file race. ACTION: `nx_retire_path retire buildroot/runtime/nx_teacher_rt.nx` (rename-only, reversible). NOT done here -- that tool is capability-denied to this seat, and hand-rolling a rename would bypass the guard that refuses protected paths. The header below is INHERITED FROM THE COPY and names nx_teacher.nx, which is a DIFFERENT, REAL organ (3,969 B, the M0->M4 autonomy ladder). Do not trust it. 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.

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_teacher_rt.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

structs

none

consts

48const NX_TEACH_OK: i64 = 0
49const NX_TEACH_NO_FILE: i64 = 1
50const NX_TEACH_NO_TITLE: i64 = 2
51const NX_TEACH_MISSING: i64 = 3 // a required section is absent

functions

54func mem_eq(body: *u8, off: i64, n: i64, lit: *u8) -> i64
66func sec_bounds(body: *u8, n: i64, marker: *u8, out: *i64) -> i64
called by 1: nx_teacher_ingest calls 1: mem_eq
95func count_bullets(body: *u8, start: i64, end: i64) -> i64
called by 1: nx_teacher_ingest calls 1: mem_eq
109func 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
133func 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
134func tn(v: i64) -> i64
called by 1: nx_teacher_ingest calls 2: sys_mmapsys_write
147func nx_teacher_emit_index(out_path: *u8) -> i64
192func tn_fd(fd: i64, v: i64) -> i64
called by 1: nx_teacher_ingest calls 2: sys_mmapsys_write
205func nx_teacher_ingest(path_z: *u8, lesson_id: *u8, domain: *u8) -> i64