code wiki / _hdl_build / nx_connect_lds_reconnect_lib.nx

nx_connect_lds_reconnect_lib.nx

buildroot/runtime/_hdl_build/nx_connect_lds_reconnect_lib.nx

5205 B110 linesdepth 0pulls 0 transitivereach 13 importersview sourcekind librarytopic connect
docsdependenciesstructsconstsfunctions

about

nx_connect_lds_reconnect_lib.nx -- the MEMBER <-> MISSIONARY RECONNECTION model, extracted as a shared library so the verifying gate (nx_connect_lds_reconnect) and the LIVE app (nx_connect_serve) bind ONE implementation of the law instead of two that can drift. This is the split the gate's own DRY note named: "the small primitives are re-stated to keep the gate self-contained; production extracts them to a shared library organ". No main, no syscalls, no allocation -- records are caller-supplied buffers -- so any consumer can import it, including one that never pulls in the syscall layer. THE LAW (unchanged, integer-only, no floats): two people could have KNOWN each other only if they were in the SAME MISSION, share an AREA, and their time windows OVERLAP. All three are NECESSARY, so a later missionary in the same area does not surface (time is load-bearing) and a same-mission person in a different area does not surface (area is load-bearing). A mutually-confirmed "I remember you" edge outranks inferred overlap. Discovery is CONSENT-GATED both ways (GDPR Art.9-style): a member who has not opted in is never surfaced, however real the overlap. The DATE lane is UNREACHABLE when a minor is involved, in both directions -- a returned missionary and a youth they taught are community, never romance. RECORD LAYOUT (8 slots): p[0]=age_band p[1]=mission p[2]=areas-bitmask p[3]=start_month p[4]=end_month p[5]=reconnect_optin p[6]=self_token p[7]=confirmed_tokens license_tier: ORIGINAL

dependencies 0 imports · 3 importers

nx_connect_lds_reconnect_lib.n nx_connect_api_lib.nx nx_connect_lds_reconnect.nx nx_connect_serve.nx

imports: none

imported by: nx_connect_api_lib.nxnx_connect_lds_reconnect.nxnx_connect_serve.nx

structs

none

consts

20const RC_LANE_FRIEND: i64 = 1
21const RC_LANE_COMMUNITY: i64 = 2
22const RC_LANE_DATE: i64 = 3
23const RC_BAND_MINOR: i64 = 0
24const RC_BAND_ADULT: i64 = 1
25const RC_EXCLUDED: i64 = 0-1
26const RC_REC_SLOTS: i64 = 8

functions

29func rc_inter_popc(a: i64, b: i64) -> i64
called by 2: rc_has_bitrc_raw
42func rc_clamp100(v: i64) -> i64 { if v > 100 { return 100 } return v }
called by 1: rc_raw
43func rc_imax(a: i64, b: i64) -> i64 { if a > b { return a } return b }
called by 1: rc_time_overlap
44func rc_imin(a: i64, b: i64) -> i64 { if a < b { return a } return b }
called by 1: rc_time_overlap
45func rc_has_bit(mask: i64, bit: i64) -> i64 { if rc_inter_popc(mask, bit) > 0 { return 1 } return 0 }
called by 1: rc_mutually_confirmed calls 1: rc_inter_popc
48func rc_time_overlap(a_s: i64, a_e: i64, b_s: i64, b_e: i64) -> i64
called by 1: rc_raw calls 2: rc_imaxrc_imin
56func rc_mk(p: *i64, band: i64, mission: i64, areas: i64, s: i64, e: i64, optin: i64, token: i64, conf: i64) -> i64
69func rc_mutually_confirmed(a: *i64, b: *i64) -> i64
called by 1: rc_raw calls 1: rc_has_bit
75func rc_raw(a: *i64, b: *i64) -> i64
90func rc_score(a: *i64, b: *i64) -> i64
called by 2: mainrc_lane calls 1: rc_raw
98func rc_lane(a: *i64, b: *i64, lane: i64) -> i64
106func rc_mission_only(a: *i64, b: *i64) -> i64
called by 1: main