code wiki / _hdl_build / nx_apistack_audit.nx

nx_apistack_audit.nx

buildroot/runtime/_hdl_build/nx_apistack_audit.nx

4456 B104 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind librarytopic apistack
docsdependenciesstructsconstsfunctions

about

nx_apistack_audit.nx -- CAP-API-AUDIT: the control-plane must-have -- a who/what/when trail for every privileged /api action (deploy/rollback/reconcile/restart/upload). Append-only AND HASH-CHAINED: each record's chain hash folds the PREVIOUS record's hash + this record's payload, so altering or deleting any past record breaks the chain and au_verify detects it. Tamper-EVIDENT by construction (the sovereign exceed over a mutable log file). Pure integer FNV-1a -> deterministic, reproducible. Record: "<hex16 chain>\t<action>\t<actor>\t<result>\n". license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_site_lock_lib.nx nx_apistack_audit.nx nx_apistack_audit_gate.nx

imports: nx_syscalls.nxnx_site_lock_lib.nx

imported by: nx_apistack_audit_gate.nx

structs

none

consts

9const AU_MAGIC_1048576: i64 = 1048576
11const AU_FNV_OFF: i64 = 0 - 3750763034362895579 // 0xcbf29ce484222325
12const AU_FNV_PRIME: i64 = 1099511628211

functions

15func au_fnv_chain(prev: i64, payload: *u8, n: i64) -> i64
called by 2: au_appendau_verify
23func au_hex16(h: i64, out: *u8) -> i64
called by 1: au_append
29func au_hexparse(s: *u8) -> i64
41func au_read_file(path: *u8, out: *u8, cap: i64) -> i64
54func au_last_chain(logpath: *u8) -> i64
70func au_append(logpath: *u8, payload: *u8, payload_n: i64) -> i64
82func au_verify(logpath: *u8) -> i64