nx_log_category.nx
buildroot/runtime/nx_log_category.nx
about
nx_log_category.nx -- sealed-enum log-field classification with
structural people-data refusal.
User directive 2026-05-17: "yes we want logs for systems not
people and s class".
The sealed enum makes the system/people distinction LOAD-BEARING:
every log call declares its category; the emitter refuses to
transmit PEOPLE_* categories without an explicit caller-supplied
override token. This is structural prevention, not policy hope.
Sealed-enum NxLogCategory (8 states):
SYSTEM categories (default-allowed):
SYSTEM_STATE daemon uptime, state transitions, version
SYSTEM_PERF latency p50/p95, throughput, queue depths
SYSTEM_ERROR errno, crash dumps, aggregate error counts
SYSTEM_CONFIG config loaded, env var set, capability flag
SYSTEM_SECURITY auth failure AGGREGATE COUNT (not per-user)
PEOPLE categories (refused by default; require override):
PEOPLE_PII IP, UA, cookie, fingerprint, email, name
PEOPLE_BEHAVIOR per-user click path, dwell time, navigation
PEOPLE_LOCATION geo-IP, coarse city, precise GPS
Per cardinal feedback-privacy-by-default-no-tracking:
- SYSTEM categories serve operations: capacity planning, alert
thresholds, crash diagnosis, performance regressions
- PEOPLE categories enable surveillance: subpoena targets,
advertising profiles, behavioral manipulation
Substrate's structural enforcement:
Default emit accepts ONLY SYSTEM categories.
PEOPLE category emit requires an explicit override token whose
value carries a citation (legal requirement / regulated industry
carve-out / user-explicit-consent flow). The grader scans for
override tokens + ensures each has a justification annotation.
nx_capability_claims:
needs: [sealed_enum, byte_ops]
dependencies 0 imports · 1 importers
imports: none
imported by: nx_log_category_test.nx
structs
| none |
consts
| 52 | const NXLC_SYSTEM_STATE: i64 = 0 |
| 53 | const NXLC_SYSTEM_PERF: i64 = 1 |
| 54 | const NXLC_SYSTEM_ERROR: i64 = 2 |
| 55 | const NXLC_SYSTEM_CONFIG: i64 = 3 |
| 56 | const NXLC_SYSTEM_SECURITY: i64 = 4 |
| 57 | const NXLC_PEOPLE_PII: i64 = 5 |
| 58 | const NXLC_PEOPLE_BEHAVIOR: i64 = 6 |
| 59 | const NXLC_PEOPLE_LOCATION: i64 = 7 |
| 60 | const NXLC_CATEGORY_N: i64 = 8 |
| 114 | const NXLC_OK: i64 = 0 |
| 115 | const NXLC_REFUSED_NO_OVERRIDE: i64 = 1 |
| 116 | const NXLC_BAD_CATEGORY: i64 = 2 |
| 117 | const NXLC_BAD_OVERRIDE: i64 = 3 |
| 118 | const NXLC_BAD_ARG: i64 = 4 |
| 119 | const NXLC_VERDICT_N: i64 = 5 |
functions
| 62 | func nxlc_category_is_valid(c: i64) -> i64 |
| 68 | func nxlc_category_name(c: i64) -> *u8 called by 1: main |
| 80 | func nxlc_category_name_len(c: i64) -> i64 |
| 95 | func nxlc_is_system(c: i64) -> i64 |
| 105 | func nxlc_is_people(c: i64) -> i64 |
| 121 | func nxlc_verdict_is_valid(v: i64) -> i64 called by 1: main |
| 127 | func nxlc_verdict_name(v: i64) -> *u8 called by 1: main |
| 149 | func nxlc_override_is_valid(token: *u8, token_n: i64, called by 1: nx_log_category_gate |
| 173 | func nx_log_category_gate( |
| 217 | func nx_log_count_people_overrides_in_buf(buf: *u8, n: i64) -> i64 called by 1: main |