nx_log_gate.nx
buildroot/runtime/nx_log_gate.nx
about
nx_log_gate.nx -- the gate for the structured logger 32 modules import.
WHY: nx_gensota gen-3 worklist. The module's header makes a STRONG, testable promise --
"deterministic by default: monotonic sequence counter, not wall-clock. Tests can snapshot
logs BYTE-FOR-BYTE" -- and a byte-for-byte snapshot claim is only true if the format is
fixed-width and the counter has no holes.
★THE TOOTH THAT MATTERS (T4): A FILTERED EVENT MUST NOT ADVANCE THE SEQUENCE. If a dropped
event consumed a sequence number, every snapshot would depend on the CURRENT LOG LEVEL --
two runs at different verbosity could never be diffed, which is the whole point of the design.
Nothing else in the system would notice; the lines still look perfectly well-formed.
The context takes an out_fd directly, so this gate writes to a real file and READS THE BYTES
BACK -- a writer is only tested by a read-back.
⚠DELIBERATELY NOT TESTED: nx_log_fatal, which exits the process by contract (NX_LOG_EXIT=200).
A gate that called it would kill its own harness; its exit path is proven by inspection here
and would need a fork to test honestly -- declared, not silently skipped.
license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_log.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
| 20 | const NLG_MODE: i64 = 0x1a4 |
| 21 | const NLG_CAP: i64 = 4096 |
functions
| 23 | func nlg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 24 | func nlg_eqn(a: *u8, b: *u8, n: i64) -> i64 called by 1: main |
| 30 | func nlg_slurp(path: *u8, buf: *u8) -> i64 |
| 43 | func main() -> i64 |