code wiki / _hdl_build / nx_connect_presence.nx

nx_connect_presence.nx

buildroot/runtime/_hdl_build/nx_connect_presence.nx

10035 B255 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic connect
docsdependenciesstructsconstsfunctions

about

nx_connect_presence.nx -- CONNECT: typing indicator + online presence + scheduled/silent send. Closes two MSG cells of nx_connect_func_census (typing+presence; scheduled/silent send). BY CONSTRUCTION properties: - the typing signal is a {conv,user,expiry} triple ONLY -- no draft-text field exists in the schema, and it EXPIRES (ephemeral): presence never becomes a stale lie. NEG-CONTROL: a sticky no-TTL incumbent model still claims "typing" an hour later; ours has expired. - last-seen privacy is the USER's setting: a coarse-mode profile renders only a "recently" bucket, never the exact timestamp (data minimization at render time). - scheduled send delivers exactly AT/after the due tick, never early; SILENT send delivers with ZERO notification events (Telegram-class silent send); the delivery tick is IDEMPOTENT (rule 10: a re-run tick cannot double-send). Times are passed in (deterministic, no clock). 100% sovereign. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_connect_presence.nx

imports: nx_syscalls.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 pr_set pr_idx cxp cxp ↻ pr_view pr_idx ↻ cxp ↻ tcheck sw ↻ pr_idx ↻ pr_last_seen pr_idx ↻ cxp ↻ ty_set cxp ↻ ty_active cxp ↻ ty_sticky_active sc_add cxp ↻ sc_tick cxp ↻ sn sys_mmap ↻ sys_write ↻ sys_exit

structs

none

consts

14const PR_MAGIC_4600: i64 = 4600
15const PR_MAGIC_2000: i64 = 2000
16const PR_MAGIC_1999: i64 = 1999
17const PR_MAGIC_2100: i64 = 2100
19const PR_MAX: i64 = 16
20const TY_MAX: i64 = 32
21const SC_MAX: i64 = 16
22const TY_TTL: i64 = 5
24const CX_PRU: i64 = 0
25const CX_PRST: i64 = 1
26const CX_PRLAST: i64 = 2
27const CX_PRCOARSE: i64 = 3
28const CX_NPR: i64 = 4
29const CX_TYC: i64 = 5
30const CX_TYU: i64 = 6
31const CX_TYX: i64 = 7
32const CX_NTY: i64 = 8
33const CX_SCDUE: i64 = 9
34const CX_SCSIL: i64 = 10
35const CX_SCSENT: i64 = 11
36const CX_NSC: i64 = 12
37const CX_DELIV: i64 = 13
38const CX_NOTIF: i64 = 14

functions

40func 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
41func 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
42func tcheck(pass: i64, label: *u8, fails: *i64) -> i64
called by 1: main calls 1: sw
47func cxp(ctx: *i64, i: i64) -> *i64 { return ctx[i] as *i64 }
49func pr_idx(ctx: *i64, user: i64) -> i64
called by 4: pr_setpr_viewpr_last_seenmain calls 1: cxp
56func pr_set(ctx: *i64, user: i64, state: i64, now: i64) -> i64
called by 1: main calls 2: pr_idxcxp
68func pr_view(ctx: *i64, target: i64, now: i64) -> i64
called by 1: main calls 2: pr_idxcxp
79func pr_last_seen(ctx: *i64, target: i64) -> i64
called by 1: main calls 2: pr_idxcxp
87func ty_set(ctx: *i64, conv: i64, user: i64, now: i64) -> i64
called by 1: main calls 1: cxp
103func ty_active(ctx: *i64, conv: i64, user: i64, now: i64) -> i64
called by 1: main calls 1: cxp
116func ty_sticky_active(set_at: i64, now: i64) -> i64
called by 1: main
121func sc_add(ctx: *i64, due: i64, silent: i64) -> i64
called by 1: main calls 1: cxp
132func sc_tick(ctx: *i64, now: i64) -> i64
called by 1: main calls 1: cxp
155func main() -> i64