nx_book.nx
buildroot/runtime/nx_book.nx
about
nx_book.nx -- family ledger / operator-visible log.
Per [[feedback-captain-moroni-doctrine]]: "All bypass events logged
in books. Audit trail accessible to family." THE canonical
operator-visible append-only ledger. Distinct from internal-detail
logs (nx_evict_journal / nx_provenance_chain) which are forensic;
nx_book is the human-readable, family-facing audit trail.
Per [[feedback-self-surfacing-intelligence-staged-autonomy]]: when
the substrate takes any significant action (twin-key authorized,
drone deployed, sanctuary opened, reclaim applied, failover
executed), the BOOK records it loud + structured so the family
reviewer can read what happened without grep'ing 47 JSONL files.
Composes:
nx_twin_key -- every twin-key authorization writes a book row
nx_drone_doctrine -- every drone session deployment writes a row
nx_transponder_quiescence -- every emergency_override writes a row
nx_reclaim -- every reclamation safety envelope writes a row
nx_promote -- every failover writes a row
nx_xenocell -- xenocell intrusion events write a row
nx_ai_audit -- every BLOCKED AI proposal writes a row
nx_scam_detector -- every CONFIRMED_PATTERN scam writes a row
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_tier.nx
imported by: nx_audit_compose_test.nxnx_book_test.nx
structs
| 58 | struct NxBookEntry |
| 68 | struct NxBook |
consts
| 30 | const NX_BK_TWIN_KEY_AUTHORIZED: nx_int = 0 |
| 31 | const NX_BK_DRONE_DEPLOYED: nx_int = 1 |
| 32 | const NX_BK_SANCTUARY_OPENED: nx_int = 2 |
| 33 | const NX_BK_RECLAIM_APPLIED: nx_int = 3 |
| 34 | const NX_BK_FAILOVER_EXECUTED: nx_int = 4 |
| 35 | const NX_BK_XENO_ALERT: nx_int = 5 |
| 36 | const NX_BK_SCAM_FLAGGED: nx_int = 6 |
| 37 | const NX_BK_AI_PROPOSAL_BLOCKED: nx_int = 7 |
| 38 | const NX_BK_TREATY_BREACHED: nx_int = 8 |
| 39 | const NX_BK_TRACE_SHARED: nx_int = 9 |
| 40 | const NX_BK_OPERATOR_OVERRIDE: nx_int = 10 |
| 41 | const NX_BK_HEALTH_RED_TRIGGERED: nx_int = 11 |
| 42 | const NX_BK_N_KINDS: nx_int = 12 |
| 46 | const NX_BS_INFO: nx_int = 0 |
| 47 | const NX_BS_NOTICE: nx_int = 1 |
| 48 | const NX_BS_WARNING: nx_int = 2 |
| 49 | const NX_BS_ALERT: nx_int = 3 |
| 50 | const NX_BS_N_SEVS: nx_int = 4 |
| 52 | const NX_BK_OK: nx_int = 0 |
| 53 | const NX_BK_ERR_FULL: nx_int = 1 |
| 54 | const NX_BK_ERR_BAD_KIND: nx_int = 2 |
| 74 | const NX_BK_ENTRY_BYTES: nx_size = 56 |
functions
| 76 | func nx_bk_kind_is_valid(k: nx_int) -> nx_int |
| 82 | func nx_bk_severity_is_valid(s: nx_int) -> nx_int |
| 88 | func nx_book_new(capacity: nx_size) -> *NxBook |
| 97 | func _bk_at(b: *NxBook, idx: nx_size) -> *NxBookEntry |
| 107 | func nx_book_record(b: *NxBook, |
| 129 | func _bk_find(b: *NxBook, entry_id: nx_int) -> nx_int |
| 144 | func nx_book_mark_seen(b: *NxBook, entry_id: nx_int) -> nx_int |
| 154 | func nx_book_count_unseen(b: *NxBook) -> nx_int |
| 165 | func nx_book_count(b: *NxBook) -> nx_size called by 1: main |
| 169 | func nx_book_count_by_kind(b: *NxBook, kind: nx_int) -> nx_int |
| 180 | func nx_book_count_by_severity(b: *NxBook, severity: nx_int) -> nx_int |
| 197 | func nx_book_count_alerts_unseen(b: *NxBook) -> nx_int |