code wiki / _hdl_build / nx_connect_translate.nx
nx_connect_translate.nx
buildroot/runtime/_hdl_build/nx_connect_translate.nx
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
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
structs
| none |
consts
| 14 | const CT_MAGIC_4096: i64 = 4096 |
| 15 | const CT_MAGIC_4095: i64 = 4095 |
| 16 | const CT_MAGIC_8192: i64 = 8192 |
| 17 | const CT_MAGIC_8191: i64 = 8191 |
| 19 | const CT_MAXMSG: i64 = 64 |
| 20 | const CT_MAXCORR: i64 = 32 |
functions
| 22 | func sw(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 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 } |
| 24 | func tcheck(pass: i64, label: *u8, fails: *i64) -> i64 |
| 29 | func ct_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 30 | func ct_app(dst: *u8, pos: *i64, cap: i64, s: *u8) -> i64 |
| 36 | func ct_find(buf: *u8, n: i64, needle: *u8) -> i64 |
| 52 | func ct_render_inline(text: *u8, srcLang: i64, viewerLang: i64, out: *u8, cap: i64) -> i64 |
| 69 | func ct_rationed_translate(used: *i64, daily_cap: i64, text: *u8, srcLang: i64, viewerLang: i64, out: *u8) -> i64 |
| 77 | func main() -> i64 |