code wiki / (root) / nx_audit_server_routed.nx

nx_audit_server_routed.nx

buildroot/runtime/nx_audit_server_routed.nx

24935 B692 linesdepth 4pulls 13 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_emit.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_emit.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 sys_socket sys_mmap ↻ sys_setsockopt sys_bind sys_close sys_listen sys_now_ms sys_mmap ↻ sys_clock_gettime_mono 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 ↻ nxhl_put ↻ nxhl_status_http_code nxar_serve_metrics nx_http_metrics_emit_respo nx_http_metrics_emit_one nxm_validate_name nxm_is_name_start nxm_is_name_cont nxm_is_name_start ↻ nxm_type_is_valid nxm_put_cstr

structs

none

consts

41const NXAR_MAGIC_2048: i64 = 2048
42const NXAR_MAGIC_1024: i64 = 1024
43const NXAR_MAGIC_2047: i64 = 2047
45const NXAR_PORT: i64 = 51848
46const NXAR_REQ_CAP: i64 = 8192
47const NXAR_RESP_CAP: i64 = 524288 // 512 KB
48const NXAR_REQUEST_BUDGET: i64 = 1000000
52const NXAR_PER_CONN_BUDGET: i64 = 100
248const N_METRICS: i64 = 4

functions

60func nxar_path_starts_with(path: *u8, path_n: i64,
called by 1: main
74func nxar_path_eq(path: *u8, path_n: i64,
called by 1: main
87func nxar_emit_root(out: *u8, off: *i64, cap: i64) -> i64
called by 1: main
140func nxar_method_name(k: i64) -> *u8
called by 1: nxar_log_request
147func nxar_method_name_len(k: i64) -> i64
called by 1: nxar_log_request
161func nxar_log_request(
223func nxar_emit_404(out: *u8, off: *i64, cap: i64) -> i64
called by 1: main
250func nxar_serve_metrics(out: *u8, out_cap: i64, out_n: *i64,
called by 1: main calls 1: nx_http_metrics_emit_response
320func nxar_serve_health(out: *u8, out_cap: i64, out_n: *i64,
called by 1: main calls 1: nx_http_emit_health
347func nxar_serve_audit_cached(
553func main() -> i64