code wiki / _hdl_build / nx_connect_translate.nx

nx_connect_translate.nx

buildroot/runtime/_hdl_build/nx_connect_translate.nx

8802 B184 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic connect
docsdependenciesstructsconstsfunctions

about

nx_connect_translate.nx -- CONNECT in-chat TRANSLATION + CORRECTION flow (the Tandem-wedge DIF cell). Composes the sovereign MT substrate (nx_mt_multi: EN-pivot, 5 langs, integer, deterministic) into the actual CHAT functionality: a message renders INLINE with its translation for the viewer's language, a partner can bind a CORRECTION annotation to the original message (additive -- the original is never destroyed), and translation is UNLIMITED BY CONSTRUCTION: there is NO quota counter anywhere in the render path, so rationing (Tandem free tier / HelloTalk 'unlimited translations' behind Paid -- both cited in knowledge/library/conncomp_*.txt) is structurally impossible, not a policy promise. NEG-CONTROL: an incumbent-model rationed translator (daily cap table) denies message cap+1 -- proving the unlimited check discriminates. HONEST SCOPE: lexicon is method-level (R1 edit-here); translation QUALITY is not claimed anywhere near DeepL-class -- the claim is the FLOW + the pricing architecture. 100% sovereign (nx_cc->nxasm_x86). license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_mt_multi.nx nx_connect_translate.nx

imports: nx_syscalls.nxnx_mt_multi.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sw sys_write ct_render_inline sys_mmap ↻ ct_app nx_multi_translate sys_mmap ↻ mm_is_tok mm_extract mm_lc mm_appb mm_xlate_token mm_en_to mm_streq mm_to_en mm_streq ↻ mm_app ct_slen ct_find ct_slen ↻ tcheck sw ↻ ct_rationed_translate nx_multi_translate ↻ ct_slen ↻ ct_app ↻ sn sys_mmap ↻ sys_write ↻ sys_exit

structs

none

consts

14const CT_MAGIC_4096: i64 = 4096
15const CT_MAGIC_4095: i64 = 4095
16const CT_MAGIC_8192: i64 = 8192
17const CT_MAGIC_8191: i64 = 8191
19const CT_MAXMSG: i64 = 64
20const CT_MAXCORR: i64 = 32

functions

22func sw(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 2: tcheckmain calls 1: sys_write
23func sn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
24func tcheck(pass: i64, label: *u8, fails: *i64) -> i64
called by 1: main calls 1: sw
29func ct_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
30func ct_app(dst: *u8, pos: *i64, cap: i64, s: *u8) -> i64
36func ct_find(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: ct_slen
52func ct_render_inline(text: *u8, srcLang: i64, viewerLang: i64, out: *u8, cap: i64) -> i64
69func ct_rationed_translate(used: *i64, daily_cap: i64, text: *u8, srcLang: i64, viewerLang: i64, out: *u8) -> i64
called by 1: main calls 2: nx_multi_translatect_slen
77func main() -> i64