code wiki / (root) / nx_teacher_synthesize.nx

nx_teacher_synthesize.nx

buildroot/runtime/nx_teacher_synthesize.nx

9134 B196 linesdepth 8pulls 9 transitivereach 11 importersview sourcekind tooltopic teacher
docsdependenciesstructsconstsfunctions

about

nx_teacher_synthesize.nx -- the SYNTHESIS bridge of the Nishi Teacher/Trainer (Teacher arc, rung R2). Operator doctrine (2026-06-20): "we want to CONSUME all our information FROM the nishi teacher and trainer so we get the insights to improve the nishi team's capabilities -- and once the information is SYNTHESIZED it is REDUNDANT and we can move away from [the raw source]." So a raw insight-bearing artifact (e.g. a quarantined ledger like build_learnings.tsv) is not discarded as junk: its insights are first INGESTED into the team's living capability store, where the team consumes them; the raw source is then PROVABLY redundant (every insight recoverable from the store) -> safe to retire. This organ ingests an insight LEDGER (tab-delimited `id<TAB>class<TAB>learning<TAB>reinforces`, with `#` comment lines) and synthesizes each row into the NATIVE content-addressed seg_store (ncfg / nx_native_config -- NOT a borrowed TSV, the operator's "native ecosystem only" mandate) under tag "insight", at a fixed team-capability prefix. Three verbs: tsyn_ingest_ledger(src,source_tag,prefix) -> count synthesized (-1 read fail, -2 commit fail) tsyn_recall(prefix,id,out) -> 1 if the team can CONSUME that insight by id from the store tsyn_redundant(src,prefix) -> 1 iff EVERY learning in src is recoverable from the store (the source is fully absorbed = redundant = retirable) Parameterized so the gate targets /tmp fixtures; main() runs the real quarantined ledger. No hardware writes, no network (Rule 26). Faithful extraction only -- no fabricated insight (Rule 4). license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_native_config.nx nx_teacher_synthesize.nx nx_teacher_merge.nx nx_teacher_synthesize_gate.nx

imports: nx_syscalls.nxnx_native_config.nx

imported by: nx_teacher_merge.nxnx_teacher_synthesize_gate.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main tsyn_puts sys_write tsyn_ingest_ledger sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ncfg_begin ss_begin ss_begin_cap sys_mmap ↻ tsyn_field sys_mmap ↻ tsyn_row sys_mmap ↻ ncfg_add_row sys_mmap ↻ canon_encode sys_mmap ↻ cc_cmp cc_w32 cc_len sys_munmap ncfg_key ss_add ss_add2 ss_w32 ss_len ncfg_set_count sys_mmap ↻ ncfg_count_key ncfg_itoa sys_mmap ↻ ss_add ↻ ncfg_commit ss_commit

structs

none

consts

23const K_MAGIC_4096: i64 = 4096
24const K_MAGIC_4095: i64 = 4095

functions

26func tsyn_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: tsyn_merge_reportmainmain calls 1: sys_write
27func tsyn_putn(v: i64) -> i64
36func tsyn_streq(a: *u8, b: *u8) -> i64
43func tsyn_field(b: *u8, ls: i64, le: i64, f: i64) -> *u8
59func tsyn_row(w: *i64, idx: i64, src: *u8, id: *u8, cls: *u8, rule: *u8, reinf: *u8) -> i64
70func tsyn_ingest_ledger(src_path: *u8, source_tag: *u8, store_prefix: *u8) -> i64
103func tsyn_recall(store_prefix: *u8, want_id: *u8, out: *u8) -> i64
128func tsyn_store_has_rule(h: *i64, want: *u8) -> i64
144func tsyn_redundant(src_path: *u8, store_prefix: *u8) -> i64
170func main() -> i64