code wiki / (root) / nx_audit_server_routed.nx

nx_audit_server_routed.nx

buildroot/runtime/nx_audit_server_routed.nx

24467 B687 linesdepth 5pulls 15 transitivereach 0 importersview sourcekind tooltopic audit
docsdependenciesstructsconstsfunctions

about

nx_audit_server_routed.nx -- multi-endpoint dispatcher daemon. Phase-A route-table integration of the audit-dashboard arc. Composes shipped primitives: nx_http_server bind/listen/accept nx_pages_static static-file serve for /audit/* nx_http_health /health + /ready endpoints nx_http_metrics /metrics endpoint (Prometheus text) Per cardinal NISHI_PRIVACY_BY_DEFAULT (S14): all counters are SYSTEM_PERF (request count, error count, uptime) -- no per-IP, no per-UA, no per-user fields. Per cardinal feedback-bounded-loop-discipline-jpl-rule-2: 1M- request budget per process; supervisor restarts. Route table: GET /health -> nx_http_emit_health (200 or 503) GET /ready -> nx_http_emit_ready GET /metrics -> nx_http_metrics_emit_response (counters) GET /audit/* -> nx_pages_serve_file (base=docs) GET / -> 200 with link list (no implicit index) * -> 404 Non-GET methods on any route -> 405 (handled by nx_pages_static for the file paths; this file handles others).

dependencies 10 imports · 0 importers

nx_syscalls_x86_64.nx nx_http_server.nx nx_pages_static.nx nx_http_health.nx nx_http_metrics.nx nx_log_jsonl.nx nx_http_header_find.nx nx_http_cache.nx nx_http_security_headers.nx nx_path_canonicalize.nx nx_audit_server_routed.nx

imports: nx_syscalls_x86_64.nxnx_http_server.nxnx_pages_static.nxnx_http_health.nxnx_http_metrics.nxnx_log_jsonl.nxnx_http_header_find.nxnx_http_cache.nxnx_http_security_headers.nxnx_path_canonicalize.nx

imported by: nobody (leaf or entry point)

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

main nx_http_server_addr_loopba nx_http_server_make_sockad nx_http_server_listen sys_ignore_sigpipe sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_socket sys_mmap ↻ sys_setsockopt sys_bind sys_close sys_listen nx_http_server_accept_one sys_accept nx_http_server_read_reques sys_read nx_http_parse_request nxar_path_eq nxar_serve_health nx_http_emit_health nxhl_status_is_valid nxhl_put_cstr nxhl_put nxhl_status_name nxhl_put_dec nxhl_put ↻

structs

none

consts

40const NXAR_PORT: i64 = 51848
41const NXAR_REQ_CAP: i64 = 8192
42const NXAR_RESP_CAP: i64 = 524288 // 512 KB
43const NXAR_REQUEST_BUDGET: i64 = 1000000
47const NXAR_PER_CONN_BUDGET: i64 = 100
243const N_METRICS: i64 = 4

functions

55func nxar_path_starts_with(path: *u8, path_n: i64,
called by 1: main
69func nxar_path_eq(path: *u8, path_n: i64,
called by 1: main
82func nxar_emit_root(out: *u8, off: *i64, cap: i64) -> i64
called by 1: main
135func nxar_method_name(k: i64) -> *u8
called by 1: nxar_log_request
142func nxar_method_name_len(k: i64) -> i64
called by 1: nxar_log_request
156func nxar_log_request(
218func nxar_emit_404(out: *u8, off: *i64, cap: i64) -> i64
called by 1: main
245func nxar_serve_metrics(out: *u8, out_cap: i64, out_n: *i64,
called by 1: main calls 1: nx_http_metrics_emit_response
315func nxar_serve_health(out: *u8, out_cap: i64, out_n: *i64,
called by 1: main calls 1: nx_http_emit_health
342func nxar_serve_audit_cached(
548func main() -> i64