code wiki / _hdl_build / nx_teacher_merge_gate.nx
nx_teacher_merge_gate.nx
buildroot/runtime/_hdl_build/nx_teacher_merge_gate.nx
about
nx_teacher_merge_gate.nx -- proves MULTI-SOURCE synthesis into one unified teacher capability store:
heterogeneous-schema ledgers (different rule columns) unify, cross-source DEDUP works, re-merge is
idempotent, and redundancy is per-source. Hermetic /tmp store. Discriminating + liar-killed.
T1 merge ledger A (rule@col2, 3 rows) -> count 3
T2 merge ledger B (rule@col1, DIFFERENT schema, 3 rows) -> count 6 (2nd source did not clobber 1st)
T3 recall A2 from the unified store == faithful (consume across sources)
T4 recall B2 from the unified store == faithful
T5 redundancy: ledger A fully recoverable (rule_col=2)
T6 redundancy: ledger B fully recoverable (rule_col=1)
T7[neg] ledger C (shares A2's rule + 1 new) is NOT redundant BEFORE merge (the new rule is absent)
T8 re-merge A -> 0 added (cross-source dedup => idempotent)
T9 count still 6 after the idempotent re-merge
T10 merge C -> exactly 1 added (only the genuinely-new rule; the shared one deduped)
T11 count == 7
T12 ledger C now redundant (both its rules recoverable)
T13[neg] no-fabrication: a rule never merged is ABSENT from the store
GREEN iff all. Sovereign: imports nx_teacher_merge + nx_syscalls. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_teacher_merge.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 22 | func mg_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 as u8 { n = n + 1 } sys_write(1, s, n); return 0 } |
| 23 | func mg_putn(v: i64) -> i64 |
| 32 | func mg_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != 0 as u8 { dst[off + i] = s[i]; i = i + 1 } return off + i } |
| 33 | func mg_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 41 | func mg_join(out: *u8, a: *u8, b: *u8) -> i64 { var o: i64 = mg_cat(out, 0, a); o = mg_cat(out, o, b); out[o] = 0 as u8; return o } |
| 42 | func mg_mkdir(path: *u8) -> i64 { return sys_mkdir(path, 0x1ed) } |
| 43 | func mg_write(path: *u8, content: *u8) -> i64 |
| 49 | func mg_count(store: *u8) -> i64 |
| 54 | func mg_assert(label: *u8, cond: i64) -> i64 |
| 59 | func main() -> i64 |