code wiki / (root) / nx_sites_telemetry.nx

nx_sites_telemetry.nx

buildroot/runtime/nx_sites_telemetry.nx

5097 B125 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind tooltopic sites
docsdependenciesstructsconstsfunctions

about

nx_sites_telemetry.nx -- the SENSE layer of the self-improving sites system. Per-connection, append-only telemetry + access-path classification (LAN vs internet). Design cardinals honored: - ADDITIVE-ONLY (Cardinal 13): records are appended to a persistent log and never rewritten/deleted. History is the training data for the DECIDE + IMPROVE layers. - GRACEFUL DEGRADATION (Cardinal 14): telemetry is fire-and-forget; a logging failure must never crash a served request. All emit paths no-op on a bad fd. - SAME EXPERIENCE LAN+INTERNET: access class is OBSERVATIONAL here. The serving path dispatches by Host/path only -- never by source IP -- so both access paths receive byte-identical content. This module only LABELS the connection; it does not branch content. - CONSTANT MEMORY: the caller hoists the line buffer + holds one append fd open for the daemon's lifetime (no per-connection mmap / open-close in the hot path). Record line (text, greppable; the IMPROVE layer parses these): ts=<us> acc=<L|N> vh=<id> hs=<us> by=<n> rc=<n>\n acc: L=LAN (RFC1918/loopback), N=internet. vh: vhost id (0=family/default, 1=andelinwest, 2=wiki). hs: TLS handshake duration in microseconds. by: response bytes served. rc: 0 = handshake OK; negative = the failing -(NX_TLS13_SRUN_*). license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_sites_telemetry.nx nx_sites_daemon.nx nx_sites_daemon_v2.nx

imports: nx_syscalls.nx

imported by: nx_sites_daemon.nxnx_sites_daemon_v2.nx

structs

none

consts

none

functions

42func nx_access_is_lan(addr: *u8) -> i64
called by 2: mainmain
72func _tel_dec(buf: *u8, off: i64, v: i64) -> i64
called by 1: nx_telemetry_emit
91func _tel_lit(buf: *u8, off: i64, s: *u8, n: i64) -> i64
called by 1: nx_telemetry_emit
101func nx_telemetry_emit(
called by 2: mainmain calls 3: _tel_lit_tel_decsys_write
123func main() -> i64