code wiki / (root) / nx_log_category.nx

nx_log_category.nx

buildroot/runtime/nx_log_category.nx

9016 B236 linesdepth 0pulls 0 transitivereach 1 importersview sourcekind librarytopic log
docsdependenciesstructsconstsfunctions

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

nx_log_category.nx nx_log_category_test.nx

imports: none

imported by: nx_log_category_test.nx

structs

none

consts

52const NXLC_SYSTEM_STATE: i64 = 0
53const NXLC_SYSTEM_PERF: i64 = 1
54const NXLC_SYSTEM_ERROR: i64 = 2
55const NXLC_SYSTEM_CONFIG: i64 = 3
56const NXLC_SYSTEM_SECURITY: i64 = 4
57const NXLC_PEOPLE_PII: i64 = 5
58const NXLC_PEOPLE_BEHAVIOR: i64 = 6
59const NXLC_PEOPLE_LOCATION: i64 = 7
60const NXLC_CATEGORY_N: i64 = 8
114const NXLC_OK: i64 = 0
115const NXLC_REFUSED_NO_OVERRIDE: i64 = 1
116const NXLC_BAD_CATEGORY: i64 = 2
117const NXLC_BAD_OVERRIDE: i64 = 3
118const NXLC_BAD_ARG: i64 = 4
119const NXLC_VERDICT_N: i64 = 5

functions

62func nxlc_category_is_valid(c: i64) -> i64
68func nxlc_category_name(c: i64) -> *u8
called by 1: main
80func nxlc_category_name_len(c: i64) -> i64
95func nxlc_is_system(c: i64) -> i64
105func nxlc_is_people(c: i64) -> i64
121func nxlc_verdict_is_valid(v: i64) -> i64
called by 1: main
127func nxlc_verdict_name(v: i64) -> *u8
called by 1: main
149func nxlc_override_is_valid(token: *u8, token_n: i64,
173func nx_log_category_gate(
217func nx_log_count_people_overrides_in_buf(buf: *u8, n: i64) -> i64
called by 1: main