code wiki / (root) / nx_teacher_merge.nx

nx_teacher_merge.nx

buildroot/runtime/nx_teacher_merge.nx

7265 B142 linesdepth 9pulls 10 transitivereach 9 importersview sourcekind tooltopic teacher
docsdependenciesstructsconstsfunctions

about

nx_teacher_merge.nx -- MULTI-SOURCE synthesis into ONE unified Nishi Teacher capability store (Teacher arc, rung R2b). Extends nx_teacher_synthesize (DRY -- reuses tsyn_field/streq/store_has_rule/ recall) so the team can "consume ALL our information" from a single native store, not many raw TSVs. Operator doctrine [[feedback-synthesize-before-retire]]: synthesize each information-bearing ledger's insight into the team's living capability store; once absorbed the raw is redundant. This rung makes the store MULTI-SOURCE + heterogeneous-schema + de-duplicated: tsyn_merge_cols(src, source_tag, prefix, id_col, rule_col) -> rows ADDED (-1 read, -2 commit) appends the ledger's insights at the store's CURRENT count offset (so a 2nd source never clobbers the 1st -- seg_store append-segment + last-wins count), reading the id + the insight from the caller-specified columns (so build_learnings 0/2, landmines 0/2, nishi_cardinals 0/1 all map in), and SKIPS any rule already in the store (cross-source dedup -> idempotent re-merge). tsyn_redundant_col(src, prefix, rule_col) -> 1 iff every insight of src is recoverable from the store. Faithful extraction only -- no fabricated insight (Rule 4). No hardware writes / network (Rule 26). license_tier: ORIGINAL

dependencies 2 imports · 4 importers

nx_teacher_synthesize.nx nx_syscalls.nx nx_teacher_merge.nx nx_teacher_consult.nx nx_teacher_learn.nx nx_teacher_merge_gate.nx nx_teacher_trainer.nx

imports: nx_teacher_synthesize.nxnx_syscalls.nx

imported by: nx_teacher_consult.nxnx_teacher_learn.nxnx_teacher_merge_gate.nxnx_teacher_trainer.nx

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

main tsyn_puts sys_write tsyn_merge_report tsyn_merge_cols sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ncfg_open ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat sys_fstatat ssc_streq ss_open ss_open2 ssc_retire_handle ncfg_count sys_mmap ↻ ncfg_count_key ss_hget sys_mmap ↻ ss_idx_find ss_r32 ss_len ss_kcmp ncfg_atoi ncfg_begin ss_begin ss_begin_cap sys_mmap ↻ tsyn_field sys_mmap ↻ tsyn_store_has_rule

structs

none

consts

18const K_MAGIC_4096: i64 = 4096

functions

21func tsyn_row3(w: *i64, idx: i64, src: *u8, id: *u8, rule: *u8) -> i64
30func tsyn_merge_cols(src_path: *u8, source_tag: *u8, store_prefix: *u8, id_col: i64, rule_col: i64) -> i64
69func tsyn_redundant_col(src_path: *u8, store_prefix: *u8, rule_col: i64) -> i64
97func tsyn_add_insight(store_prefix: *u8, source_tag: *u8, id: *u8, rule: *u8) -> i64
111func tsyn_merge_report(src: *u8, tag: *u8, store: *u8, idc: i64, rc: i64) -> i64
120func main() -> i64