nx_audit_server_routed.nx
buildroot/runtime/nx_audit_server_routed.nx
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
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
structs
| none |
consts
| 41 | const NXAR_MAGIC_2048: i64 = 2048 |
| 42 | const NXAR_MAGIC_1024: i64 = 1024 |
| 43 | const NXAR_MAGIC_2047: i64 = 2047 |
| 45 | const NXAR_PORT: i64 = 51848 |
| 46 | const NXAR_REQ_CAP: i64 = 8192 |
| 47 | const NXAR_RESP_CAP: i64 = 524288 // 512 KB |
| 48 | const NXAR_REQUEST_BUDGET: i64 = 1000000 |
| 52 | const NXAR_PER_CONN_BUDGET: i64 = 100 |
| 248 | const N_METRICS: i64 = 4 |
functions
| 60 | func nxar_path_starts_with(path: *u8, path_n: i64, called by 1: main |
| 74 | func nxar_path_eq(path: *u8, path_n: i64, called by 1: main |
| 87 | func nxar_emit_root(out: *u8, off: *i64, cap: i64) -> i64 called by 1: main |
| 140 | func nxar_method_name(k: i64) -> *u8 called by 1: nxar_log_request |
| 147 | func nxar_method_name_len(k: i64) -> i64 called by 1: nxar_log_request |
| 161 | func nxar_log_request( |
| 223 | func nxar_emit_404(out: *u8, off: *i64, cap: i64) -> i64 called by 1: main |
| 250 | func nxar_serve_metrics(out: *u8, out_cap: i64, out_n: *i64, |
| 320 | func nxar_serve_health(out: *u8, out_cap: i64, out_n: *i64, |
| 347 | func nxar_serve_audit_cached( |
| 553 | func main() -> i64 |